diff --git a/README.md b/README.md index d7b6fe8..14e361b 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,14 @@ Start by adding the `@paytmScripts` tag into the `
` tag of your page. For @paytmScripts ``` -Next, to initiate the Checkout Payment Page, you need to callout `openJsCheckoutPopup(orderId, txnToken, amount)` and pass it the `orderId`, `txntoken` and the `amount` received in **Step # 1**. + +Next, to initiate the Checkout Payment Page, you have 2 available methods - + +##### Method # 1 + +This method will invoke the payment gateway and upon completion, will redirect the user to the callback url set earlier (or in the config file). + +To achieve that, you need to call the `openJsCheckoutPopup(orderId, txnToken, amount)` function and pass it the `orderId`, `txntoken` and the `amount` received in **Step # 1**. ```php // Somewhere in your page @@ -122,8 +129,36 @@ Next, to initiate the Checkout Payment Page, you need to callout `openJsCheckout ``` Upon clicking the `Pay Now` button, a pop-up for the Paytm PG will open with all the options to make the payment. Once the payment is complete, you will be redirected to the `callback_url` set in the .env file as `PAYTM_CALLBACK_URL`. -### Step # 3 - Receiving Callback -The **callback** from the Paytm PG will provide an array containing the following (for a successful transaction) - +##### Method # 2 + +This method will allow you to handle the response on the same page (and ignore any callback urls set for this transaction). Useful when you want to process transaction without a redirect. + +```php +// Somewhere in your page + + +// Before the closing