Processing an Apple Pay Authorization with Merchant Decryption

This section uses a code example to show how to process an authorization request with the merchant decryption implementation of Apple Pay.
IMPORTANT
In the example, a
Visa card
transaction is processed with
Visa Platform Connect
. If you want to replicate this example for a
different card or processor
, you will need to change some of the API fields in the request message.
For general information about basic authorizations, see the "Standard Payments Processing" section of the
Payments Developer Guide
.

Fields Specific to This Use Case

These
REST API
request fields and values are specific to this use case:
  • orderInformation.currency
  • orderInformation.totalAmount
  • paymentInformation.tokenizedCard.cryptogram
  • paymentInformation.tokenizedCard.expirationMonth
  • paymentInformation.tokenizedCard.expirationYear
  • paymentInformation.tokenizedCard.number
  • paymentInformation.tokenizedCard.transactionType
  • processingInformation.paymentSolution

Basic Steps

Follow these steps to request the authorization service for an Apple Pay transaction:
  1. Create the message with the required API fields.
  2. Send the message to one of these endpoints:
    • Production:
      POST
      https://api.cybersource.com
      /pts/v2/payments
    • Test:
      POST
      https://apitest.cybersource.com
      /pts/v2/payments
  3. Verify the response messages to make sure that the request was successful. A 200-level HTTP response code indicates success.

Required Fields for Processing an Authorization with Merchant Decryption

As a best practice, include these
REST API
fields in your request for an authorization transaction with the
Cybersource
decryption implementation of Apple Pay.
Depending on your processor, your geographic location, and whether the relaxed address verification system (RAVS) is enabled for your account, some of these fields might not be required. It is your responsibility to determine whether an API field can be omitted from the transaction you are requesting.
Token authentication verification value cryptogram.
The value for this field must be a 28-character, Base64-encoded string (the encoding method for Apple Pay transactions).
Set the value to month in which the token expires. Format:
MM
Possible values:
01
through
12
.
Set the value to the year in which the token expires. Format:
yyyy
.
Set the value to customer's payment network token value that contains the customer's credit card number.
For
Visa Platform Connect
, set this field to the value that indicates the type of transaction that provided the payment network token data. Possible values:
  • 1
    : In-app transaction.
  • 2
    : Near-field communication (NFC) transaction. The customer’s mobile device provided the token data for a contactless EMV transaction.
  • 3
    : A transaction using stored customer credentials on
    Visa Platform Connect
    , whether for merchant-initiated transactions (MITs) or customer-initiated transactions (CITs).
IMPORTANT
This value does not specify the token service provider. It specifies the entity that provided you with information about the token.
Set the value to
001
to identify Apple Pay as the digital payment solution.

REST Example: Processing an Authorization with Merchant Decryption

Example Request
{ "clientReferenceInformation": { "code": "TC_1231223" }, "processingInformation": { "paymentSolution": "001" }, "paymentInformation": { "tokenizedCard": { "number": "4111111111111111", "expirationMonth": "12", "expirationYear": "2031", "cryptogram": "AceY+igABPs3jdwNaDg3MAACAAA=", "transactionType": "1" } }, "orderInformation": { "amountDetails": { "totalAmount": "10", "currency": "USD" "billTo": { "firstName": "John", "lastName": "Doeo", "address1": "901 Metro Center Blvd", "locality": "Foster City", "administrativeArea": "CA", "postalCode": "94404", "country": "US", "email": "test@cybs.com" } } }
Response to a Successful Request
{ "_links": { "authReversal": { "method": "POST", "href": "/pts/v2/payments/7321424891916305803955/reversals" }, "self": { "method": "GET", "href": "/pts/v2/payments/7321424891916305803955" }, "capture": { "method": "POST", "href": "/pts/v2/payments/7321424891916305803955/captures" } }, "clientReferenceInformation": { "code": "TC_1231223" }, "consumerAuthenticationInformation": { "token": "Axj/7wSTjOUuXKBWG6qzABsZQiN2tBnQpWJzJsnvxnvVvoCnvxnvVvukCvoQ5YZNJMvRiuIkVgTk4zlLlygVhuqswAAAQAM8" }, "id": "7321424891916305803955", "issuerInformation": { "responseRaw": "0110322000000E10000200000000000000100011202241291458025044373550335052584E32363833313030303030000159008000223134573031363135303730333830323039344730363400103232415050524F56414C00065649435243200034544B54523031313132313231323132313231544C3030323636504E30303431313131" }, "orderInformation": { "amountDetails": { "authorizedAmount": "10.00", "currency": "USD" } }, "paymentAccountInformation": { "card": { "type": "001" } }, "paymentInformation": { "tokenizedCard": { "expirationYear": "2031", "requestorId": "12121212121", "prefix": "411111", "assuranceLevel": "66", "expirationMonth": "12", "suffix": "1111", "type": "001" }, "card": { "suffix": "1111", "type": "001" } }, "pointOfSaleInformation": { "terminalId": "02495701" }, "processingInformation": { "paymentSolution": "001" }, "processorInformation": { "merchantNumber": "000372839590885", "approvalCode": "831000", "networkTransactionId": "016150703802094", "transactionId": "016150703802094", "responseCode": "00", "avs": { "code": "Y", "codeRaw": "Y" } }, "reconciliationId": "PD75P3PRXN26", "riskInformation": { "earlyVelocity": { "counts": [ { "count": "1", "informationCode": "MVEL-R1" } ] } }, "status": "AUTHORIZED", "submitTimeUtc": "2024-11-20T22:41:29Z" }