Skip to main content

Create a Redirect Session for existing Transaction Intent

The Merchant can also create a redirect session for redirecting the customer to Zastrpay website for viewing or cancelling an existing Transaction Intent / QR Code. For that purpose the following Merchant Backend -> Zastrpay Backend API call must be implemented:

PUT https://host.com/customer-authentication-service/v1/redirect-sessions/{redirectSessionId}
Content-Type: application/json
x-api-key: $apiKey
x-request-id: $requestId

{
"type": "ExistingTransactionIntent",
"customerId": "37257cd4-8ff1-46f7-bb20-0da4f954fede",
"transactionIntentId": "08a29f86-0dbc-4ceb-a4eb-f202561cb53e",
"redirectData": {
"successUrl": "https://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-success",
"failureUrl": "https://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-failure",
"abortUrl": "https://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-abort",
"qrCodeSuccessUrl": "http://merchant-host.com/zastrpay-create-new-transaction-intent-qr-code-success"
},
"locale": "de-DE",
}
note

customerId is optional, the Merchant may supply it if it is tracking customer registration at Zastrpay, and knows that the current customer is already registered at Zastrpay. The customerId submitted is the Zastrpay UUID/GUID of the customer, received and stored by the merchant previously. If not supplied Zastrpay automatically finds the customerId by the phoneNumber and corresponding authentication (PIN, SMS OTP).

Zastrpay Backend will answer with the following response:

200 OK

{
"id": "bf050093-fce3-4013-8090-524799de3f69",
"type": "ExistingTransactionIntent",
"merchantId": "e51bc4a8-4263-11ea-b317-b7ad13e2406e",
"customerId": "37257cd4-8ff1-46f7-bb20-0da4f954fede",
"transactionIntentId": "08a29f86-0dbc-4ceb-a4eb-f202561cb53e",
"redirectData": {
"successUrl": "http://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-success",
"failureUrl": "http://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-failure",
"abortUrl": "http://merchant-host.com/zastrpay-view-or-cancel-existing-transaction-intent-abort",
"qrCodeSuccessUrl": "http://merchant-host.com/zastrpay-create-new-transaction-intent-qr-code-success"
},
"locale": "de-DE",
"createdOn": "2023-01-26T13:04:59.5633378Z",
"lastCorrelationId": "55a5c33e-9003-4ea7-8e31-cfe5e9acc008",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjU2ODc4YmZlNzZiNDQyMTVhZmVkYzFkMzQzYTQ0NjU0In0.eyJzaWQiOiJiZjA1MDA5My1mY2UzLTQwMTMtODA5MC01MjQ3OTlkZTNmNjkiLCJtZXJjaElkIjoiZTUxYmM0YTgtNDI2My0xMWVhLWIzMTctYjdhZDEzZTI0MDZlIiwiYXV0aCI6Im90cCIsImN1c3RJZCI6IjM3MjU3Y2Q0LThmZjEtNDZmNy1iYjIwLTBkYTRmOTU0ZmVkZSIsImV4cCI6MTY3NDc0MDA5OSwiaXNzIjoiaHR0cHM6Ly9wYXkuZGV2LmMyZHBheW1lbnQuY29tIiwiYXVkIjoiaHR0cHM6Ly9wYXkuZGV2LmMyZHBheW1lbnQuY29tIn0.LKktJ4j2B-6UXrOrfmHQnqfeWSOvWQFPZJ_j1lJbacOAo-5IaIEMW0XB5kXyZc6qdOCJmIhuYM30SyiVu5TG7zii9zFuWRrdnIDu0tu_K-OJDU9rwn0Dtc-zreUq4VxzJs8utzZ6C7J3RVz3OVUIiDeMINKR0PFq-an4Ht81FSikZAnCreGbFpwsSn5HD9rBwLyDhlp7Dwl71yIn0fKIfAdtcUB6QEPycQi9-qGxYi0BDwy21rWJWI_kOsMi_kAnajtYD3ZB_8DInvAHZilWfV3pL_PuTAoA7OdKztkegt9wUCBQr_EPHU5rGxpBrUJLsYLBTvBqsJZEkp6gepyxtQ",
"redirectUrl": "https://pay.dev.zastrpay.com"
}

Here again the important response values to consider for the redirect are token and redirectUrl.

See Create Redirect Session API Reference for more information.

Next, let's see how to pNext, the same redirect to Zastrpay should take place as described in Redirect Customer.