Skip to content

Instantly share code, notes, and snippets.

View bespalown's full-sized avatar

Viktor Bespalov bespalown

  • Alfa-Bank
  • Russia
View GitHub Profile
--- NEW REQUEST ---
POST https://wl.walletone.com/w1/invoicingapi/payments/54857384/process
--- HTTP HEADERS ---
[X-Wallet-UserId: 129213545437, Content-Type: application/json, X-Wallet-Signature: RnhA8+QWc4iLIi2jnX8Gjw==, X-Wallet-Timestamp: 2015-07-06T15:04:23, Accept: application/json]
--- BODY ---
//задаю все значения
let merchantId = 191238281216
let timestamp: String = "2015-06-22T16:10:08"
let merchantKeyForMD5 = "6d306b6375724d664e556b4774397070626752354434753955617c"
let sign = Signature(urlToSign: "https://wl.walletone.com/w1/invoicingapi/invoices/",
jsonString: "{\"MerchantUserId\":191238281216,\"Amount\":2.91,\"CurrencyId\":643,\"PaymentTypeId\":\"YandexMoneyRUB\",\"OrderId\":\"GQYOE-MJNPO-49623\"}",
merchantKey: "6d306b6375724d664e556b4774397070626752354434753955617c",
signatureAlgorithm: .MD5)
/*
var messageToSign = string.Format("{0}{1}{2}{3}", urlToSign,merchantId, timestamp, body);
public static string CreateMerchantSign(string message)
{
byte[] data = Encoding.UTF8.GetBytes(message);
byte[] binaryKey = Encoding.UTF8.GetBytes(MerchantSignatire);
return Convert.ToBase64String(MD5.Create().ComputeHash(Union(data, binaryKey)));
}
"Проверьте соединение с интернет" = "Check your internet connection";
"Неизвестная ошибка: %d" = "Unknown error: %d";
"Ошибка" = "Error";
"Дэшборд" = "Dashboard";
"Счета" = "Invoices";
"Выписка" = "Statement";
"Вывод" = "Withdrawal";
"Настройки" = "Settings";
"В разработке" = "Under development";
"Для магазинов"
enum NetworkManagerError: String {
case Unknown = "UNKNOWN"
case AgentExternalIdError = "AGENT_EXTERNAL_ID_ERROR"
case AgentIdNotFound = "AGENT_ID_NOT_FOUND"
case AgentIsNotActive = "AGENT_IS_NOT_ACTIVE"
case AgentKeyExpired = "AGENT_KEY_EXPIRED"
case AgentPaymentCodeError = "AGENT_PAYMENT_CODE_ERROR"
case AgentPaymentCodeTypeError = "AGENT_PAYMENT_CODE_TYPE_ERROR"
@bespalown
bespalown / gist:a2a1dd7f472a31ace039
Created February 18, 2015 12:57
/OpenApi/payments/templates
{
Items = (
{
Amount = 0;
CurrencyId = 643;
DenyManualExecution = 0;
HasSchedule = 0;
IsReadonly = 0;
IsVerified = 0;
MasterField = 4307119468;
@interface VBScheduleData : VBMasterModels
@property (nonatomic, strong) NSNumber *utcTimeOffset;
@property (nonatomic, strong) NSNumber *executedTimes;
@property (nonatomic, strong) NSString *nextExecution;
@property (nonatomic, strong) VBOnceData *Once; //однократный платеж
@property (nonatomic, strong) VBDailyData *Daily; //по дням
@property (nonatomic, strong) VBWeeklyData *Weekly; //по неделям и дням недели
@property (nonatomic, strong) VBMonthlyDayOfMonthData *MonthlyDayOfMonth; //в опеределенное число месяца
PCDMerchant *merchant = [PCDMerchant new];
merchant.ID = @100018; //Merchant's ID. Should be obtained after a registration (see Prerequisites). Mandatory field.
merchant.password = @"ChuWeIle"; //Merchant's password. Should be obtained after a registration (see Prerequisites). Mandatory field.
merchant.clientId = @"Merchant_W1"; //Client's ID in Merchant's system. Mandatory field.
merchant.email = @"[email protected]"; // Client's email. Can be empty.
merchant.phone = @"+79854619029"; //Client phone. Can be empty.
PCDCardScanViewController *scanDardVC = [PCDCardScanViewController new];
scanDardVC.merchant = merchant; //merchant property is necessary, otherwise error will occur
scanDardVC.delegate = self;
@bespalown
bespalown / gist:afb33434591fa2a51fe9
Last active August 29, 2015 14:10
pay.cards crash#2
SIGSEGV
libGPUSupportMercury.dylibgpusSubmitDataBuffers
Occurrences1
Users1
# Binary Image Name Address Symbol
0 Pay.Cards 0x1000e85d3 testflight_backtrace
1 Pay.Cards 0x1000e7bf3 TFSignalHandler
2 libsystem_platform.dylib 0x195cd095b _sigtramp
3 libGPUSupportMercury.dylib 0x18d753127 gpusSubmitDataBuffers
@bespalown
bespalown / gist:ac70d0a5d687b039436f
Created December 1, 2014 09:14
pay.cards crash #1
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
Pay.Cards-[TSSurface checkStatus]
in TSSurface.m on Line 245
Occurrences1
Users1
# Binary Image Name Address Symbol
0 CoreFoundation 0x18d62a950 __exceptionPreprocess
1 libobjc.A.dylib 0x199b301fc objc_exception_throw
2 Pay.Cards 0x1000c91d4 -[TSSurface checkStatus] in TSSurface.m on Line 245
3 Pay.Cards 0x1000c8910 -[TSSurface postInitialization] in TSSurface.m on Line 36