You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-3Lines changed: 38 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,14 @@ Start by adding the `@paytmScripts` tag into the `<head>` tag of your page. For
103
103
@paytmScripts
104
104
</head>
105
105
```
106
-
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**.
106
+
107
+
Next, to initiate the Checkout Payment Page, you have 2 available methods -
108
+
109
+
##### Method # 1
110
+
111
+
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).
112
+
113
+
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**.
107
114
108
115
```php
109
116
// Somewhere in your page
@@ -122,8 +129,36 @@ Next, to initiate the Checkout Payment Page, you need to callout `openJsCheckout
122
129
```
123
130
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`.
124
131
125
-
### Step # 3 - Receiving Callback
126
-
The **callback** from the Paytm PG will provide an array containing the following (for a successful transaction) -
132
+
##### Method # 2
133
+
134
+
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.
0 commit comments