To ensure integration with the Juspay Payments SDK from the server side (Merchant end), the following three items/operations are required:
- Availability of all payload parameters to trigger Payments SDK (Refer Step 2 & 4 in Integration Architecture )
- Handling SDK responses (Refer Step 6 in Integration Architecture )
- Implementation of Server-to-Server calls
I. Availability of all payload parameters to trigger Payments SDK
The Merchant App will need specific payload to Initiate and Process the SDK. Please ensure that all the payload parameters are made available by your server.
Initiate PayloadAs a part of Initiate SDK call, signed payload has to be passed to the SDK. This will help Juspay in prefetching the enabled payment methods, refreshing wallet balances of the customer in advance. Please refer the Payload for Initiation for required parameters.
It is highly recommended to call initiate SDK from the order summary page (atleast 5 seconds before starting the payment page) for a seamless user experience. This is to optimize background API calls to fetch/ create customer, refresh wallet balances and fetch enabled payment methods.
Process PayloadSince the SDK is an enhanced Payments Orchestrator, the payload to Process SDK is typically a bunch of basic Payments payload parameters. Please refer the Payload for Process for required parameters.
II. Handling SDK responses
Please refer to SDK Response Handling. Code snippets are shown for Java, kotlin, Swift, Objective-C, and React. These code snippets basically add more detail to the event handling routines which were outlined in the response handling callbacks (listener for React) sent with the Initiate API.
III. Server to Server Calls
The Merchant will have to initiate server-to-server calls for the below use cases (unless webhooks are used in place of status calls- see below):
- Get Order Status API (post transaction):
- Refund Order API:
- Update Order API:
If mandates are used, The Merchant will have to initiate these additional server-to-server calls for mandates (unless webhooks are used in place of status calls- see below):
- Mandate Order Status API:
- Get Mandate Execution Status API:
- List Mandates API (list mandates of customer):
- Revoke Mandate API:
Handling S2S responses from Juspay Server (webhooks)
A URL must be set up in the merchant server configured as a 'Webhook'. Callbacks will be sent from the SDK to the webhook URL for various events resulting from API calls, such as: Payment Success/Failure, Order/Transaction Creation, etc. Using webhooks can eliminate the need to send status request APIs in many cases, which can simplify your transaction flow. Documentation for webhooks can be found here:
Updated 7 months ago