Инструменты страницы
Connecting Apple Pay on Web
To set up integration on Apple Pay on WEB on the Merchant side, you need to register anApple Merchant ID for the Mjerchant.
The registration of Apple Merchant ID
for the merchant is made through the payment gateway. To verify the domain from which the payment will be made, you need to contact the technical support service.
However, the partner must also place an Apple Pay button on their side.
Registering a payment and making an Apple Pay payment:
Register your order using a standard registration request such as register.do. Request merchant validation using the request https://3dsec.sberbank.ru/payment/applepay/validateMerchant.do
Request parameters:
{ "mdOrder":"c4408897-ae2e-7562-909e-bc880007acd8", "validationUrl":"https://apple-pay-gateway-cert.apple.com/paymentservices/startSession" }
Where:
mdOrder
is a unique order number that gets passed inregister.do
order registration request;validationUrl
is the URL received from the device https://developer.apple.com/documentation/apple_pay_on_the_web/applepayvalidatemerchantevent .
Upon successful validation, the response will be as follows:
{ "success": true, "data": { "epochTimestamp": ...., "expiresAt": ...., "merchantSessionIdentifier": "..........", "nonce": "......", "merchantIdentifier": ".......", "domainName": "....", "displayName": "....", "signature": "..." } }
If the response is unsuccessful, you must close the Apple Pay payment window.
In a test environment, you need to use https://apple-pay-gateway-cert.apple.com/paymentservices/startSession as validationUrl.
In the validateMerchant.do request, you must pass the «x-original-domain-name» header with the value of the domain from which the request is sent, otherwise the request will not be validated on the frontend, since the 3dsec.sberbank.ru domain will be returned.
3. Upon successful validation of the merchant, go to user identification session.completeMerchantValidation (validationResult.data) (https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778012-completepayment);
if completion is successful, the client is allowed to authorize using Touch Id or Face ID https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized;
4. Send the received data to paymentData to the gateway. The request used for this is https://3dsec.sberbank.ru/payment/applepay/paymentOrder.do
Request parameters:
mdOrder
– unique order number on the gatewaypaymentToken
parameter must contain a Base64 encoded value of thepaymentData
property that was received inPKPaymentToken Object
from the Apple Pay system
Thus, to make a request for payment to the payment gateway, you need to:
- Receive from the Apple Pay system the PKPaymentToken Object object containing the paymentData property;
- Extract the value of the paymentData property and encode it in Base64;
- include the encoded value of the
paymentData
property as the value of thepaymentToken
parameter in the payment request.
The response will return the sucess parameter with the value:
- true – request is processed successfully;
- false – request failed.