POST Authorize Wallet Payment
Authorizes a wallet session for a payment that has already been initialized.
Call this only when the Payment Initialization response contained an action of type auth, and call it at the url that action gave you — it carries the application and payment processor identifiers as query parameters.
Apple Pay is the case you will meet in practice. When the payment sheet asks you to validate the merchant, post the validation URL it hands you as auth_info.verification_url, together with the domain the sheet is running on as auth_info.initiative_context. The response carries a base64-encoded merchant session in additional_info.session_object, which you pass to completeMerchantValidation().
Headers
- Type: stringAcceptrequired
Type of content accepted by the API (application/json in most cases)
- Type: stringApplicationrequired
Application key for specific client app
- Type: stringContent
- Type requiredContent-Type header
- Type: stringA
P I - V E R S I O N requiredVersion of the API to be used
- Type: stringAuthorization
Authorization header
- Type: stringX
- Request - I D requiredUnique request identifier
Body
- Type: stringpayment
_init _hash requiredThe
payment_init_hashof the payment being authorized. It must still be pending. - Type: object{ initiative_context, verification_url }auth
_info Properties: 2Data the payment processor needs to authorize the wallet session.
Responses
- application/json
- 400
Bad Request - the payment initialization hash is unknown or no longer pending, or the payment processor rejected the authorization
- 401
Unauthorized
- 403
Forbidden
curl https://api-public-demo.menu.app/api/payment-processors/auth-payment \
--request POST \
--header 'Accept: application/json' \
--header 'Application: application-key' \
--header 'Content-Type: application/json' \
--header 'API-VERSION: ' \
--header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937' \
--data '{
"payment_init_hash": "032878b199f90e13e1bdce036e00f157",
"auth_info": {
"verification_url": "https://apple-pay-gateway.apple.com/paymentservices/startSession",
"initiative_context": "shop.example.com"
}
}'
{
"status": "OK",
"code": 200,
"data": {
"payment_processor_type_id": 32,
"payment_processor_id": "3c07ddd3-925e-4549-b6a3-ec5cec38a0dd",
"payment_init_hash": "032878b199f90e13e1bdce036e00f157",
"additional_info": {
"session_object": "eyJlcG9jaFRpbWVzdGFtcCI6MTcyMDAwMDAwMDAwMCwiZXhwaXJlc0F0IjoxNzIwMDAwMzAwMDAwfQ=="
}
}
}Wallet session authorized
