Skip to content

Yandex Pay payments with decrypted payment token data

The bePaid system can process payment, authorization and charge requests with the decrypted encryptedMessage object of a payment method token provided by Yandex.

Info

You must be Payment Card Industry Data Security Standard (PCI DSS) compliant to decrypt and store the payment tokens from Yandex Pay.

Request

To initiate a payment with the decrypted Yandex Pay token, send the payment, authorization or charge request, where you should submit the decrypted Yandex Pay token as the value of request.credit_card.token in the format described below.

For recurring payments and payments with the saved card data, get the bePaid payment token by sending the request.additional_data.contract parameter in the payment, authorization or charge requests.

The required format of the decrypted Yandex Pay token sent as the card token

Submit the decrypted Yandex Pay token in requests as the card token in the $begateway_yandex_pay_decrypted_1_0_0$<base64-decoded_encryptedMessage_here> format, where:

  • $begateway_yandex_pay_decrypted_1_0_0$ is the required prefix for the decrypted Yandex Pay token;
  • <base64-decoded_encryptedMessage_here> is the decrypted encryptedMessage property of the signedMessage serialized into JSON and then converted to the Base64 format.

The required format of the JSON-serialized decrypted encryptedMessage property

The following JSON format applies to encryptedMessage data for "paymentMethod":"CARD" and "authMethod":"CLOUD_TOKEN":

{
"paymentMethod":"CARD",
"paymentMethodDetails":{
    "authMethod":"CLOUD_TOKEN",
    "pan":"1111222233334444",
    "expirationMonth":10,
    "expirationYear":2020,
    "cryptogram":"AAAAAA...",
    "eci":"05"
},
"paymentAccountReference":"V1123..",
"transactionDetails":{
    "amount":100,
    "currency":"RUB"
},
"gatewayMerchantId":"Your shop ID",
"messageId":"Some message ID",
"messageExpiration":"1577862000000"
}

The following JSON format applies to encryptedMessage data for "paymentMethod":"CARD" and "authMethod":"PAN_ONLY":

{
   "paymentMethod":"CARD",
   "paymentMethodDetails":{
      "authMethod":"PAN_ONLY",
      "pan":"1111222233334444",
      "expirationMonth":10,
      "expirationYear":2020
   },
   "transactionDetails":{
      "amount":100,
      "currency":"RUB"
   },
   "gatewayMerchantId":"some-merchant-id",
   "messageId":"some-message-id",
   "messageExpiration":"1577862000000"
}
Example of the payment request with the decrypted Yandex Pay token
{
  "request":{
    "amount":1000,
    "currency":"RUB",
    "description":"Yandex Pay transaction",
    "tracking_id":"Your unique ID",
    "credit_card":{
      "token":"$begateway_yandex_pay_decrypted_1_0_0$eyAgInBheW1lbnRNZXRob2QiOiAiQ0FSRCIsICAicGF5bWVudE1ldGhvZERldGFpbHMiOiB7ICAgICJhdXRoTWV0aG9kIjogIlBBTl9PTkxZIiwgICAgInBhbiI6ICIxMTExMjIyMjMzMzM0NDQ0IiwgICAgImV4cGlyYXRpb25Nb250aCI6IDEwLCAgICAiZXhwaXJhdGlvblllYXIiOiAyMDIwLCAgfSwgICJ0cmFuc2FjdGlvbkRldGFpbHMiOiB7ICAgICJhbW91bnQiOiAxMDAsICAgICJjdXJyZW5jeSI6ICJSVUIiICB9LCAgImdhdGV3YXlNZXJjaGFudElkIjogInNvbWUtbWVyY2hhbnQtaWQiLCAgIm1lc3NhZ2VJZCI6ICJzb21lLW1lc3NhZ2UtaWQiLCAgIm1lc3NhZ2VFeHBpcmF0aW9uIjogIjE1Nzc4NjIwMDAwMDAifQ=="
    }
  }
}
Response

The response to the payment request with the decrypted encryptedMessage is returned with the final transaction processing status. It fully matches the response to payment or authorization requests.