Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SDK-Version 1.0.0
last update: 2020-07-24


Table of Contents
maxLevel6

...

If there comes an error like “ [!] Unable to find a specification for `Axepta` `Axepta` ” you should update your local CocoaPods repositories by

...

Configure the SDK by importing the Axepta class and inserting the configuration parameters you receive from Axepta or parameter merchantAppleID that you create yourself.

...

[[ Axepta sharedInstance ] paymentMethodsOnSuccess :^( NSArray < AxeptaPaymentMethod *>

* paymentMethods )

{

// set the methods as a data source

self . paymentMethods = paymentMethods;

for ( AxeptaPaymentMethod * method in self . paymentMethods)

{

// Mandatory params

[ method . paymentData setParamWithKey :@ "TransID" withValue :@ "YOUR_TRANS_ID" ];

[ method . paymentData setParamWithKey :@ "Amount" withValue :@ "YOUR_AMOUNT";

[ method . paymentData setParamWithKey :@ "Currency" withValue :@ "YOUR_CURRENCY" ];

[ method . paymentData setParamWithKey :@ "URLSuccess" withValue :@ "YOUR_URL_SUCCESS" ];

[ method . paymentData setParamWithKey :@ "URLNotify" withValue :@ "YOUR_URL_NOTIFY" ];

[ method . paymentData setParamWithKey :@ "URLFailure" withValue :@ "YOUR_URL_FAILURE" ];

if ([method. pmID isEqualToString : @ "pm_cc" ]) {

[method. paymentData setParamWithKey : @ "MsgVer" withValue :

@ "YOUR_MSGVER" ];

}

// Url sucess, failure of paypal may be different from other payments

if ([method. pmID isEqualToString : @ "pm_paypal" ]) {

[ method . paymentData setParamWithKey :@ "URLSuccess"

withValue :@ "YOUR_URL_SUCCESS_PAYPAL" ];

[ method . paymentData setParamWithKey :@ "URLFailure"

withValue :@ "YOUR_URL_FAILURE_PAYPAL" ];

} else {

[ method . paymentData setParamWithKey :@ "URLSuccess" withValue :@ "YOUR_URL_SUCCESS" ];

[ method . paymentData setParamWithKey :@ "URLFailure" withValue :@ "YOUR_URL_FAILURE" ];

}

// Optional params

[ method . paymentData setParamWithKey :@ "RefNr" withValue :@ "YOUR_REF_NR" ];

[ method . paymentData setParamWithKey :@ "OrderDesc" withValue :@ "YOUR_ORDER_DESC" ];

[ method . paymentData setParamWithKey :@ "AddrCity" withValue :@ "YOUR_ADDR_CITY" ];

[ method . paymentData setParamWithKey :@ "FirstName" withValue :@ "YOUR_FIRST_NAME" ];

[ method . paymentData setParamWithKey :@ "LastName" withValue :@ "YOUR_LAST_NAME" ];

[ method . paymentData setParamWithKey :@ "AddrZip" withValue :@ "YOUR_ADDR_ZIP" ];

[ method . paymentData setParamWithKey :@ "AddrStreet" withValue :@ "YOUR_ADDR_STREET" ];

[ method . paymentData setParamWithKey :@ "AddrState" withValue :@ "YOUR_ADDR_STATE" ];

[ method . paymentData setParamWithKey :@ "Phone" withValue :@ "YOUR_PHONE" ];

[ method . paymentData setParamWithKey :@ "eMail" withValue :@ "YOUR_EMAIL" ];

[ method . paymentData setParamWithKey :@ "ShopID" withValue :@ "YOUR_SHOP_ID" ];

[ method . paymentData setParamWithKey :@ "Subject" withValue :@ "YOUR_SUBJECT" ];

}

} onFailure :^( NSError * error ) {

// do something with the error

}];


The values of Amount and Currency will be validated during the checkout process. So you have to ensure that you are using valid data.

...

The amount is the lowest unit of the currency you are using. That means if you are using EUR as currency, the amount needs to be in cents, e.g. an amount of 100 is 1 EUR.


URLSuccess and URLFailure are the URL’s to which the SDK redirect the status of a payment process. These URL’s normally point to a HTML site on your merchant backend toshow the status to the user of your app.

...

Start the checkout by instantiating a AxeptaCheckout object. The AxeptaCheckout class is a top-level class that facilitates the payment procedure. It is responsible for validating payment data and instantiating a AxeptaCheckoutViewController object when a new payment is triggered by passing the respective paymentMethod including the paymentData .

...

  • To enable Apple Pay for your app in XCode, open the Capabilities pane. Select the switch in the Apple Pay row, and then select the merchant ID you want the app to use.

  • Insert “ Merchant ID ” in the AppDelegate.


#import "AppDelegate.h"

#import <Axepta.h>

@implementation AppDelegate

- ( BOOL ) application :( UIApplication *) application

didFinishLaunchingWithOptions :( NSDictionary *) launchOptions

{

AxeptaConfiguration . merchantAppleID = @ "YOUR_MERCHANT_ID";

return YES;

}

@end

...

4.4.1.3. Testing Apple Pay transactions


Use the Apple Pay Sandbox environment to test your transactions with test payment cards.

...


It is important to use the values return and cancel as path segments for success and failure.

...

Important note : Developer should add to main project -l"PPRiskComponent" under the Build settings → Other linker flags the Magnes library used by Axepta.

...

Since the Magnes library requires the location to send the payload risk to PayPal developer should activate it under info.plist by adding Privacy - Location When In Use Usage Description and some description text.

...