iOS Apple Pay

Follow the simple steps below to utilize Apple Pay.

The iOS SDK by Simplify Commerce allows you to easily and safely accept payments from your iOS app. Please follow the Installation Instructions if you have not done so already.

Sign up for Apple Pay

Get started accepting Apple Pay In-App Payments

Begin testing against the Apple Pay API today with our free, easy-to-use developer sandbox account.

Enable Apple Pay

Generate your certificate

After logging into your account, you can enable Apple Pay in: Account Settings -> Merchant Settings. In order to use Apple Pay, you will need your own certificate. Simplify can generate a certificate request for you from your Merchant Settings.

Your app's entitlement file as well as your project capabilities will have to include your merchant id and Apple Pay project capabilities.

Use Apple Pay

Now you are ready to accept payments with Simplify and Apple Pay by utilizing the SIMChargeViewController or using your own User Interface.

Create a single-use token

If you would like to use your own user interface for Apple Pay checkout and simply want to create a single-use card token with Simplify, you can.

When you receive the PKPayment from the "paymentAuthorizationViewController:didAuthorizePayment:completion:" method, you can create a single use token using the code shown below.

Please refer to Apple's documentation for information on constructing a PKPaymentRequest and presenting the Apple Pay Authorization Controller.

#import <Simplify/SIMSimplify.h>

//Put your Simplify Public Key in your instantiation
NSError *error;
SIMSimplify *simplify = [[SIMSimplify alloc] initWithPublicKey:@"YOUR_PUBLIC_API_KEY" error:nil];

[simplify createCardTokenWithPayment:payment completionHandler:^(SIMCreditCardToken *cardToken, NSError *error) {
    if (error) {
        NSLog(@"error:%@", error);
        //Handle the error
    } else {
        NSLog(@"token: %@", cardToken);
        //Use the card token
    }
}];

Collecting Card Information With SIMChargeCardViewController

You can use SIMChargeCardViewController in order to collect card information in your iOS app. There are validations on each of the fields, and the background of each field will turn green if valid or red if invalid (ex. an expiration date in the past will have a red field). The submit button will not be enabled unless the credit card number and the expiration date are both valid.

If you would like to support Apple Pay, simply pass a PKPaymentRequest to the SIMChargeCardViewController.

//1. SDKDemo.entitlements needs to be updated to use the new merchant id
PKPaymentRequest* paymentRequest = [[PKPaymentRequest alloc] init];
paymentRequest.merchantIdentifier = @"INSERT_YOUR_MERCHANT_ID_HERE";
paymentRequest.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;
paymentRequest.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
paymentRequest.countryCode = @"US";
paymentRequest.currencyCode = @"USD";

//2. Create a SIMChargeViewController with your public api key
SIMChargeCardViewController *chargeController = [[SIMChargeCardViewController alloc] initWithPublicKey:@"lvpb_INSERT_YOUR_PUBLIC_KEY_HERE" paymentRequest:paymentRequest primaryColor:self.primaryColor];

//3. Assign your class as the delegate to the SIMChargeViewController class which takes the user input and requests a token
chargeController.delegate = self;
chargeController.amount = mposButtons.amount;
chargeController.isCVCRequired = NO;
chargeController.isZipRequired = YES;

If the device is capable of conducting an Apple Pay payment, an ApplePay button will be present. Since Apple Pay necessitates a real card number, we enable specific charge amounts to allow you test various payment states. Please refer to the Testing documentation for more details.