PaymentSDK
Mobile payment SDK
Simple Example
  1. Initialize WDClient instance
    1 - (void)makeCardPayment
    2 {
    3  // it is better to keep client as property to keep reference
    4  WDClient *client = [[WDClient alloc] initWithEnvironment:WDEnvironmentTEST];
  2. Initialize WDCardPayment instance
    1 WDCardPayment *payment = [[WDCardPayment alloc] initWithAmount:[NSDecimalNumber decimalNumberWithMantissa:1275 exponent:-2 isNegative:NO]
    2  amountCurrency:WDCurrencyEUR
    3  transactionType:WDTransactionTypePurchase];
  3. Generate requestID, requestTimestamp and requestSignature on your server and assign them to WDCardPayment object
    1 payment.merchantAccountID = merchantAccountID; // provided by support
    2 payment.requestID = [[NSUUID UUID] UUIDString]; // generated on server unique to merchant
    3 payment.requestTimestamp = [NSDate date]; // generated on server
    4 payment.requestSignature = signature; // generated on server
  4. Create WDCompletionBlock to handle response
    1 WDCompletionBlock completionBlock = ^(WDPaymentResponse *_Nullable response, NSError *_Nullable error) {
    2  if (error) {
    3  IPLogError(@"error: %@", error);
    4  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
    5  message:error.localizedDescription
    6  delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    7  [alertView show];
    8  return;
    9  }
    10  // handle successful response
    11 };
  5. Trigger the payment
    1  [client makePayment:payment withCompletion:completionBlock];
    2 }