Apple Pay
 Specifics
 Integration scenarios
Ready-made solutions:
 Payment on the website or in the app
In this section, we will describe the process of accepting a payment for those who integrate Apple Pay independently. If you’re using the Yandex.Checkout’s mobile SDK, refer to the article on iOS SDK.
 Implementation
To implement this payment method, send the certificate that will be used by Apple to encode the bank card data to Yandex.Checkout. To get this certificate, you need to:
  1. Contact the manager and ask them to create a Certificate Signing Request (CSR) for you.
  2. Load the CSR in Apple Developer account.
  3. Download the generated certificate and send it to the manager.
Detailed instructions
(see Step 2 “Exchange certificates with Apple”)
 Processing payment
Step 1. Generate an Apple Pay cryptogram on the user’s device and get the contents of the
PKPaymentToken
object. More about generating cryptograms:
Step 2. Send a payment creation request to Yandex.Checkout with the
apple_pay
type and the Apple Pay cryptogram (
paymentData
) in the
payment_method_data
object.
Example of request
cURL
PHP
Python
curl https://payment.yandex.net/api/v3/payments \
  -X POST \
  -u <Shop ID>:<Secret Key> \
  -H 'Idempotence-Key: <Idempotence Key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "amount": {
          "value": "2.00",
          "currency": "RUB"
        },
        "payment_method_data": {
          "type": "apple_pay",
          "payment_data": "<paymentData>"
        },
        "description": "Order No. 72"
      }'
Example of a created payment object
JSON
{
  "id": "22e290a5-000f-5000-9000-13324c06cacb",
  "status": "waiting_for_capture",
  "paid": true,
  "amount": {
    "value": "2.00",
    "currency": "RUB"
  },
  "authorization_details": {
    "rrn": "1554373123411"
  },
  "created_at": "2018-07-19T11:58:29.196Z",
  "description": "Order No. 72",
  "expires_at": "2018-07-26T11:58:32.019Z",
  "metadata": {
    "ymapi": "true"
    },
  "payment_method": {
    "type": "apple_pay",
    "id": "22e290a5-000f-5000-9000-13324c06cacb",
    "saved": false
  },
  "recipient": {
    "account_id": "100001",
    "gateway_id": "1000001"
  },
  "refundable": false,
  "test": false
}
Step 3. Wait for the payment to be successfully completed: you will receive a notification from Yandex.Checkout, or you can send periodic requests for payment information .
 See also
iOS SDKPayment processDeclined paymentsPayment by 54-FZ