Apple Pay
Apple Pay provides a secure payment method that can simplify your customer's checkout experience both in-app and on the web. Apple Pay stores payment information on the user's device and authenticates the user via Face ID or Touch ID.
Apple Pay is PSD2 SCA-compliant meaning you don't need to utilise 3-D Secure before authorising the payment. The user will be presented with a payment sheet, here they can choose which of their stored cards to use and provide contact, billing and shipping data without needing to fill out any forms.
Apple Pay works with many of the major credit and debit cards from the leading banks on specific devices and browsers. Refer to Apple's documentation for:
- Issuing banks that support Apple Pay
- Devices and browsers compatible with Apple Pay
- Countries and regions where Apple Pay is available
How it works
- You request the encrypted payload from your app or browser
- Apple returns a token value that contains an encrypted payload
- You send the token to your server and Base64 encode it
- You submit a request into Acquired’s Card API containing the token value
- Acquired processes the payment and returns a payment response
- You inform the customer of the transactions outcome
Setup
Before you get started you will need:
- A direct integration into the Acquired API
- For Apple Pay on the Web, you can use our certificate or you can use your own
- For in-App, you are required to create a payment processing certificate
Certificate Management
Use our certificate (Web Only)
When processing Apple Pay on the Web, you can use our certificates. This means you do not require an Apple Developer account and can avoid the complex process of certificate management.
Step 1. Login to the Hub
Step 2. Navigate to the Settings tab, select Payment Methods and then Apple Pay
Step 3. Under Web Domains, hit "+ Add Domain"
Step 4. Follow the instructions in the pop-up and select "Register Domains"
In the Apple Pay developer documentation, since you don't have a merchantIndentifier, Merchant Certificate or Payment Processing Certificate you will need to do the following:
Setting the merchantIdentifier
When we register your domains with Apple, we will set an internal merchantIdentifier for your account.
When setting the merchantIdentifier for canMakePaymentsWithActiveCard('') or any other request where it is required please use your assigned company_id
value.
Providing Merchant Validation
On your onvalidatemerchant event handler, as you do not have a merchant or payment processing certificate, we will perform Requesting an Apple Pay Payment Session. You will instead request the merchantSession from us via API:
Testing (https://qaapi.acquired.com/api.php/status)
Production (https://gateway.acquired.com/api.php/status)
Concatenate: timestamp + status_request_type + company_id + company_hashcode.
Parameter | Format | Length | Description |
---|---|---|---|
status_request_type Required |
enum |
Value should be set to APPLE_SESSION. | |
domain Required |
string |
1-254 | The domain you are completing the Apple Pay request from - it should already be registered with us. |
display_name | string |
1-64 | A string of 64 or fewer UTF-8 characters containing the canonical name for your store, suitable for display. |
validation_url Required |
string |
The URL from the event’s validationURL property |
Concatenate: timestamp + response_code + company_id + company_hashcode.
When you Base64 decode the "merchant_session" value you will find the merchantSession which you can pass in your completeMerchantValidation method. You can use the merchant session object a single time. It expires 5 minutes after it is created.
Create a payment processing certificate
If you are processing Apple Pay in-App, including through the Acquired SDK, before getting started you will require an Apple Developer account and to configure your environment.
Once you have created your Merchant Identifier, to create a payment processing certificate follow these steps:
Step 1. In your Apple Developer account navigate to here
Step 2. Under Services, select to create an Apple Pay Payment Processing Certificate and select a Merchant ID
Step 3. When it asks you to Upload a Certifiate Signing Request, login to the Hub and navigate to Setting > Payment Methods > Apple Pay
Step 4. under iOS Certificates select Add Certificate
Step 5. enter the Merchant ID selected in Step 2 and follow the instructions on the pop-up
Integrate with Apple Pay
Apple Pay > Web
Support Apple Pay on your website.
Get StartedApple Pay > in-App
Support Apple Pay on your iOS App.
Get StartedSet the supportedNetworks property
Acquired supports Apple Pay payments from Visa, MasterCard and Amex cards, you can define these accepted card networks in the ‘supportedNetworks’ property when integrating with Apple Pay.
Set the merchantCapabilities property
Acquired only supports the 3DS ‘merchantCapabilities’ option, you should define this within your Apple Pay integration.
Integrate with Acquired.com
Once you’ve successfully integrated your web application or app with Apple Pay and are able to send the returned payload to your server then you’re capable of submitting Apple Pay transactions to Acquired via our API.
Making a Payment
Step 1: at the end of the Apple Pay process an encrypted payload will be returned to your application, an example of this can be found below:
To simplify the integration process, base64 this entire payload which you can then pass through to us in the API in the payment.token field to be decrypted by us.
Step 2: using the Acquired API in the same way as a card payment, submit the base64 encoded string value through to us in the payment.token field of your request.
Parameter | Format | Length | Description |
---|---|---|---|
method Required |
enum |
Value should be set to apple_pay. | |
token Required |
string |
Base64 encoded payments as detailed in Step 1. | |
card_category | enum |
The "type" value passed back from Apple detailed here. | |
display_name | string |
0-50 | The "displayName" value passed back from Apple detailed here. |
network | string |
0-20 | The "network" value passed back from Apple detailed here. |
Step 3: we will respond in the normal way so if you have an existing card payments integration, nothing will change just handle the response_code value and display a response to your customer.
Testing Apple Pay
In simulate different responses from our API to test Apple Pay, you will need to update the "amount" value in your request as detailed below:
Amount | Response Code | Response Message |
---|---|---|
11.02 | 101 | Declined |
11.03 | 301 | Declined: Insufficent Funds |
11.04 | 402 | Declined: Lost or Stolen Card |