Table of Contents
Overview
This article documents how to initiate a transaction using a Apple Pay token with Direct Connect.
Supported Platforms
- WebMIS
Supported Solutions
- Direct Connect
Prerequisites
Before you get started, review the following prerequisites:
- The latest version of Direct Connect
- Test credentials for the NMI test platform
- A working test integration with Apple Pay:
Configuration
Apple Pay uses a Payment Processing Certificate which is associated with the Apple Merchant Identifier and used to encrypt all payment information. This certificate expires every 25 months and is platform unique (i.e. one for Production and one for Staging).
If a certificate is required, or the existing one is about to expire, a new certificate will need to be set up on the NMI Gateway. The time this takes should be taken into consideration before any go-live dates are set in stone. Please contact Integration Support (support@nmi.com) and raise a Certificate Signing Request (CSR) providing your Apple Pay Merchant Identifier and the NMI platform you are raising the request for (Production/Staging). When replacing an existing certificate, please ensure you raise any CSR requests well in advance of the certificate expiry (1-2 weeks at minimum).
Forming the Request Object
Once you have generated a valid Apple Pay token, you can begin the process of sending a transaction request to the NMI Gateway using the token. NMI recommends using a back-office process to handle the transaction request to to avoid instances where the transaction result may not be handled correctly due to communication issues on-device. If a back-office process is used, the token should be transferred from device to the system handling the request using a secure transport method.
A request object should be created, omitting any typical card details in favour of the Apple Pay token supplied as an ExtendedProperty
:
C# Example
Request request = new Request { Amount = "<Amount>", AmountType = AmountType.Actual, AmountUnit = AmountUnit.Major, ApplicationId = "<Your ApplicationId>", CurrencyCode = "<ISO CurrencyCode>", ExtendedProperties = new Collection<ExtendedProperty> { new ExtendedProperty("digital-wallet", "applepay"), new ExtendedProperty("applepay-token", <ApplePayToken.PaymentData>), new ExtendedProperty("applepay-merchantid", <Apple Pay Merchant Id>), }, RequestType = RequestType.Auth, SoftwareName = "<Your SoftwareName>", SoftwareVersion = "<Your SoftwareVersion>", TerminalID = "<Your TerminalId>", TransactionKey = "<Your TransactionKey>", UserReference = "<A Unique Sale Reference>", };
PHP Example
$request = new Request(); $request->setAmount("<Amount>"); $request->setAmountType(AmountType_Actual); $request->setAmountUnit(AmountUnit_Major); $request->setApplicationId("<Your ApplicationId>"); $request->setCurrencyCode("<ISO CurrencyCode>"); $request->addExtendedProperty(new ExtendedProperty("digital-wallet", "applepay")); $request->addExtendedProperty(new ExtendedProperty("applepay-token", <ApplePayToken.PaymentData>)); $request->addExtendedProperty(new ExtendedProperty("applepay-merchantid", <Apple Pay Merchant Id>)); $request->setRequestType(RequestType_Auth); $request->setSoftwareName("<Your SoftwareName>"); $request->setSoftwareVersion("<Your SoftwareVersion>"); $request->setTerminalID("<Your TerminalId>"); $request->setTransactionKey("<Your TransactionKey>"); $request->setUserReference("<A Unique Sale Reference>");
The integration should then proceed to send the request to the NMI Gateway for processing, and handle the response.