Offer validation happens before payment
Bank offer integration on custom checkout flow uses promo APIs namely Fetch all Offers API, Fetch BIN API and Apply promo API to apply offers on any transaction. In this flow, the merchant does not need to modify the order as offer details are passed on to the merchant before the transaction is processed. Merchant can show the offer details (discount/cashback) against a payment instrument to its end users (as shown in demo below) before the users click the Pay button and transaction gets processed at our end.
Step 1: Configure an offer
You can configure a bank offer by providing the offer construct in an email to your Paytm’s account manager, client management team, or you may contact us. Paytm has introduced a solution for select merchants to configure and customize the bank offers campaigns in a DIY mode through Paytm Dashboard. To get more information on this, refer to documentation mentioned on Offer configuration via Paytm Dashboard page.
Step 2: Display Offers to Customer
Show the available offers which merchant will get in the response of Fetch All Offer API.
Step 3: Apply an Offer
Automatic Selection of an Offer : Paytm will apply best offer in case merchant will not pass any offer.Specific offer Validation : Merchant will pass specific offer in Apply Promo API as per user selection. Paytm will validate the offer and provide the response accordingly.
Step 4: Initiate transaction with Bank Offer
You will pass json string paymentoffer in the Initiate Transaction API under paymentoffersApplied parameter, this should be same as what you would have received in response of Apply Promo API. Paytm will provide transaction token in the response to this request.
Step 5: Process transaction.
Call the Process Transaction API API to process the transaction.
Step 6: Validating Checksum
Checksumhash received in response to process transaction needs to be verified on merchant server using Paytm library with all the parameters in key-value pairs.
Step 7: Validate the Transaction
You should always validate transaction response via server-side request using Transaction Status API. This API requires checksumhash in request and response. You must verify the Order Id and Amount with your DB entries. The status should be treated as the final status of the transaction in all cases.