xpay-redirect 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -67
- package/dist/index.js +25 -23
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
## Installation:
|
|
2
|
-
|
|
3
|
-
**XPay Redirection** - _used to show the payment gateway at the another page._
|
|
4
|
-
|
|
5
|
-
Use this script tag to get access to the xpay redirection.
|
|
6
|
-
|
|
7
|
-
**_`<script src="https://cdn.jsdelivr.net/npm/xpay-redirect@1.5.
|
|
8
|
-
|
|
9
|
-
## Implementation:
|
|
10
|
-
|
|
11
|
-
**Steps:-**
|
|
12
|
-
|
|
13
|
-
1. Create two HTML files like **`index.html`** and **`xpay.html`**.
|
|
14
|
-
|
|
15
|
-
2. Add a button or anchor tag at **`index.html`** to redirect to the **`xpay.html`** page.
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<a href="./xpay.html">paynow</a>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
3. At **`xpay.html`**. Add a div tag with the id **`xpay-ftb-web-redirect`** at the body tag. It is used to display the xpay module with the help of this id.
|
|
22
|
-
|
|
23
|
-
```html
|
|
24
|
-
<div id="xpay-ftb-web-redirect"></div>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
4. Add a Script tag to the head tag or body tag. And use the latest version.
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<script src="https://cdn.jsdelivr.net/npm/xpay-redirect@1.5.
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
5. Next, add the script tag at a necessary place. But add below the source script.
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<script>
|
|
37
|
-
const config = {
|
|
38
|
-
baseurl: string,
|
|
39
|
-
sessionid: string,
|
|
40
|
-
paymenttokenid: string,
|
|
41
|
-
delayTime: number,
|
|
42
|
-
maximumFractionDigits: number,
|
|
43
|
-
merchantName: string,
|
|
44
|
-
merchantUrl: string,
|
|
45
|
-
onResponse: function (data) {},
|
|
46
|
-
onError: function (data) {},
|
|
47
|
-
onPopupClose: function (data) {}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
xpayftb.XpayRedirect(config);
|
|
51
|
-
</script>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
_Here, the config variable is used to pass the data as an object to the xpayftb.
|
|
55
|
-
**`xpayftb.XpayRedirect(config)`**_
|
|
56
|
-
|
|
57
|
-
**Note:-**
|
|
58
|
-
|
|
59
|
-
- _**`baseurl`** should pass as a string value. It is used as the base URL for API calls._
|
|
60
|
-
- _**`sessionid`** and **`paymenttokenid`** should pass as a string value. It is used all over the xpay._
|
|
61
|
-
- _**`delayTime`** should pass a number as seconds to close the popup._
|
|
62
|
-
- _**`maximumFractionDigits`** should pass a number for digits to display amount not compulsory._
|
|
63
|
-
- _**`merchantName`** is used to display the merchant name at xpay. And pass it as a string value._
|
|
64
|
-
- _**`merchantUrl`** should pass as a string value. It is used to return the merchant back to the checkout page or any URL or **`#`** ._
|
|
65
|
-
- _**`onResponse`** is a callback function. It is getting called when the API gives a successful response. Return data is an object with its API endpoint and result._
|
|
66
|
-
- _**`onError`** is a callback function. It is getting called when the API gives an error message. Return data is an object with its API endpoint and result._
|
|
67
|
-
- _**`onPopupClose`** is a callback function. It is getting called when the user cancels the transaction or on close of payment success or session gets expired. Return data is an object with its action and result._
|
|
1
|
+
## Installation:
|
|
2
|
+
|
|
3
|
+
**XPay Redirection** - _used to show the payment gateway at the another page._
|
|
4
|
+
|
|
5
|
+
Use this script tag to get access to the xpay redirection.
|
|
6
|
+
|
|
7
|
+
**_`<script src="https://cdn.jsdelivr.net/npm/xpay-redirect@1.5.5/dist/index.min.js"></script>`_**
|
|
8
|
+
|
|
9
|
+
## Implementation:
|
|
10
|
+
|
|
11
|
+
**Steps:-**
|
|
12
|
+
|
|
13
|
+
1. Create two HTML files like **`index.html`** and **`xpay.html`**.
|
|
14
|
+
|
|
15
|
+
2. Add a button or anchor tag at **`index.html`** to redirect to the **`xpay.html`** page.
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<a href="./xpay.html">paynow</a>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. At **`xpay.html`**. Add a div tag with the id **`xpay-ftb-web-redirect`** at the body tag. It is used to display the xpay module with the help of this id.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<div id="xpay-ftb-web-redirect"></div>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
4. Add a Script tag to the head tag or body tag. And use the latest version.
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/xpay-redirect@1.5.5/dist/index.min.js"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
5. Next, add the script tag at a necessary place. But add below the source script.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<script>
|
|
37
|
+
const config = {
|
|
38
|
+
baseurl: string,
|
|
39
|
+
sessionid: string,
|
|
40
|
+
paymenttokenid: string,
|
|
41
|
+
delayTime: number,
|
|
42
|
+
maximumFractionDigits: number,
|
|
43
|
+
merchantName: string,
|
|
44
|
+
merchantUrl: string,
|
|
45
|
+
onResponse: function (data) {},
|
|
46
|
+
onError: function (data) {},
|
|
47
|
+
onPopupClose: function (data) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
xpayftb.XpayRedirect(config);
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
_Here, the config variable is used to pass the data as an object to the xpayftb.
|
|
55
|
+
**`xpayftb.XpayRedirect(config)`**_
|
|
56
|
+
|
|
57
|
+
**Note:-**
|
|
58
|
+
|
|
59
|
+
- _**`baseurl`** should pass as a string value. It is used as the base URL for API calls._
|
|
60
|
+
- _**`sessionid`** and **`paymenttokenid`** should pass as a string value. It is used all over the xpay._
|
|
61
|
+
- _**`delayTime`** should pass a number as seconds to close the popup._
|
|
62
|
+
- _**`maximumFractionDigits`** should pass a number for digits to display amount not compulsory._
|
|
63
|
+
- _**`merchantName`** is used to display the merchant name at xpay. And pass it as a string value._
|
|
64
|
+
- _**`merchantUrl`** should pass as a string value. It is used to return the merchant back to the checkout page or any URL or **`#`** ._
|
|
65
|
+
- _**`onResponse`** is a callback function. It is getting called when the API gives a successful response. Return data is an object with its API endpoint and result._
|
|
66
|
+
- _**`onError`** is a callback function. It is getting called when the API gives an error message. Return data is an object with its API endpoint and result._
|
|
67
|
+
- _**`onPopupClose`** is a callback function. It is getting called when the user cancels the transaction or on close of payment success or session gets expired. Return data is an object with its action and result._
|