Pay Request

Velocity Apple Pay API Integration Guide

This page provides information on sending a pay request using Apple Pay. The pay request will be different between mobile and web channels.

Sample Requests

Apple Pay Request for a Web Channel

When we process the Apple Pay web transaction, we need to send the session URL in the token. In this session URL and when user clicks the button, we receive this URL from the Apple Pay wallet.

<?xml version="1.0" encoding="UTF-8"?>
<root>
<pay client-id="10064" account="100640">
<transaction id="9953806" store-card="false">
<card type-id="15">
<amount country-id="200" currency-id= "840">100</amount>
<token>https://apple-pay-gateway-cert.apple.com/paymentservices/startSession</token>
</card>
</transaction>
<client-info language="us" version="1.00" platform="HTML5/1.00"/>
</pay>
</root>

In a web channel request, we need to send the additional header parameter and the host URL in the header as the key name reference. See the example below.

Referer:https://www.mywebsite.com

Apple Pay Request for a Mobile Channel

<?xml version="1.0" encoding="UTF-8"?>
<root>
<pay account="100691" client-id="10069">
<transaction store-card="false" id="10044528">
<card type-id="15">
<amount country-id="200" currency-id="840">22398</amount>
</card>
</transaction>
<client-info version="10.02" app-version="10.02" sdk-version="2.3.1" language="gb" platform="iOS/15.5">
<device-id>087E575D-92BD-483A-B1AA-C4F9CDCA5674</device-id>
</client-info>
</pay>
</root>

Request Parameters

The Authorize Request parameters are listed in the tables below.

Authorize-payment Parameters

ParameterTypeMandatoryDescription
accountIntegerNoThe number for a sub-account with which a payment transaction is associated. The account ID is an integer greater than 100000 and account number is an integer smaller than 1000.

The payment transaction is associated with the default sub-account if merchants do not provide this parameter.
client-idIntegerYesThe unique ID of a merchant.

Transaction Parameters

ParameterTypeMandatoryDescription
idIntegerYesThe ID of the transaction.
type-idIntegerYesA unique transaction identification number.
card networkEnumNoA list to identify the card network from which the token was obtained. It takes one of the following values:
• amex
• dankort
• dinersclub
• jcb
• maestro
• mastercard
• visa
• visaelectron
• discover

Card Parameters

ParameterTypeMandatoryDescription
currency-idIntegerYesThe country currency code of a currency.
country-idIntegerYesThe CellPoint Digital-specific country code, which is made available to merchants on request.
tokenStringNoThe base64 encoded cryptogram or session URL received from a third-party wallet such as Apple Pay.
hmacStringNoThe Message Authentication Code (MAC). It is calculated by creating a sha-512 hash comprising the input fields in the order listed in the Message Authentication Code table below.

Note: CELLPOINT DIGITAL provides the salt value to merchants.

Conditional Parameters are mandatory if parameters are provided in the request.

MAC calculation secures the information sent by the merchant to Velocity by applying the SHA-512 encryption algorithm on key parts of the information sent to protect against tampering. The “salt” is the merchant's shared secret string used to ensure that MAC is unique.

Message Authentication Code

The Message Authentication Code (MAC) found in hmac is calculated by creating a sha-512 hash comprising the following input fields in the listed order:

ParameterRequired
clientidYes
orderidYes
amountYes
countryYes
mobileConditional
mobile-countryConditional
emailConditional
deviceidConditional
saltYes

Address Parameters

ParameterTypeMandatoryDescription
country-idIntegerYesThe CellPoint Digital-specific country code, which is made available to merchants on request.
full-nameStringYesThe full name of a customer.
streetStringYesThe full address of a customer with street name and street number.
postal-codeStringYesThe postal code of a customer.
cityStringYesThe city in which a customer resides.
stateStringNoThe state in which a customer resides. Customers enter this parameter only if their country of residence is divided into states.
country-idIntegerYesThe CellPoint Digital-specific country code, which is made available to merchants on request.

Client Information Parameters

ParameterTypeMandatoryDescription
languageStringYesThe language that Velocity uses as default when translating the payment pages.

Note: Velocity language codes are based upon the ISO- 639-1 standard.

Refer to https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes for details.
versionStringYesThe version of an API or application that sends the request.
platformStringYesThe platform from which the request is sent. Examples: web, iOS, Android, B2B, and B2C.
mobile operator-idIntegerYesThe ID of a customer’s mobile network operator. CellPoint Digital recommends including this parameter in the request to ensure Velocity correctly interacts with the operator.
emailStringNoThe email address of a customer. If a customer provides this parameter, the Email input field on the Send Email Receipt page is automatically populated with this value.