Creating a transaction with Apple Pay at Gateway de Pagamento

Authorization with the Apple Pay token happens in the same way as standard credit card authorization. However, instead of providing card details openly, the token received by Apple Pay must be provided, as in the example below:

Request

{
   "MerchantOrderId": "2017051002",
   "Customer": {
     (…)
   },
   "Payment": {
      "Type": "CreditCard",
      "Amount": 1000,
      "Installments": 1,
      "Currency": "BRL",
      "Wallet": {
         "Type": "ApplePay",
         "WalletKey":"['paymentData.data']",
         "AdditionalData": {
            "EphemeralPublicKey": "['ephemeralPublicKey.header.EphemeralPublicKey']"
         }
      }
   }
}
Header ParametersDescriptionType and Size
MerchantIdStore ID in Gateway de PagamentoGUID (36)
MerchantKeyAPI key in Gateway de Pagamento.String (24)

Parameter

Description

Type and Size

MerchantOrderId

Order ID number.

String (50)

Customer

Node with customer's data.

Refer to API Reference.

Payment.Type

Payment method type. Possibilities: "CreditCard" / "DebitCard".

String (100)

Payment.Amount

Order amount in cents.

Number (15)

Payment.Installments

Number of installments.

Number (2)

Payment.Wallet.Type

Name of payment method provider. For Apple Pay transactions, use "ApplePay".

String (15)

Payment.Wallet.WalletKey

Fill with the paymentData.data parameter value returned by Apple Pay.

String

Payment.Wallet.AdditionalData.EphemeralPublicKey

Fill with the ephemeralPublicKey.header.EphemeralPublicKey parameter value returned by Apple Pay.

String

Response

{
    "MerchantOrderId": "2017051002",
    "Customer": {(…)
    },
    "Payment": {
        (…)
        "CreditCard": {
            (…)
        },
        (…)
        "Wallet": {
            "Type": "ApplePay",
            "WalletKey": "as01vRj+n9crY2vome7zc+u7Tz0+qg2La/8IUHpJIjFN6ThhUqLnSrskQHTrEbcYPiMksFK0+ddo9sZu70uJQJH1I+44N6PrVhilNDem97vOXq2VYDXiVJ27F/Q9wGQDgZBeGcZ6Pml9SIelHqUauBcQoOatrlnWPUL8kbdpT8WqgzXyaCh7oeTz=z6++rp/ofjvSjnGtOqAUsnrzvw4uzkcyKUSsfROdJ6B/Xzgu/T9fMIr5UxXD2DPF1SNh3ydEJABKz4HFjDW7ObvbQeua4GYxJdpQLpI3NgUbJy91E/LOyb/+PcCtO+0=a41tBrfnTTF9qsPuCIw8HWIEEKSRofn27NTofxev/i+nHEfqEtqNrN/epIvhzceD/gDiGetfiLKMzf94ARmpWUAMC==",
            "AdditionalData": {
                "EphemeralPublicKey": "MFkwEwZJKoZIzj0CAQYIKo12zj0DAQcDQgAEo+ReGClSmQ4hDJD1yh9nci3V4l7kPm2AQtKZMMvuNS0iK5sn/1A9l3kw1B1xCqOycZmnPSng7p5hpTvrei1BCA=="
            }
        },
        (…)
        "Links": [
            (…)
        ]
    }
}

The wallet authorization response will have the same fields presented in API Reference, however with the addition of the Payment.Wallet node repeating the same fields used in the authorization, as described above.