paytabs_pt2 2.0.11 → 2.0.12
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/.github/workflows/npm-publish.yml +32 -0
- package/README.md +17 -13
- package/main.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 20
|
|
18
|
+
- run: npm i
|
|
19
|
+
|
|
20
|
+
publish-npm:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 20
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
- run: npm i
|
|
30
|
+
- run: npm publish
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/README.md
CHANGED
|
@@ -33,12 +33,12 @@ INSTALLATION
|
|
|
33
33
|
EXAMPLES
|
|
34
34
|
------------
|
|
35
35
|
|
|
36
|
-
*Init The Package:
|
|
36
|
+
* Init The Package:
|
|
37
37
|
|
|
38
38
|
const paytabs = require('paytabs_pt2');
|
|
39
39
|
paytabs.setConfig(<profile_id>,<server_key>,<region>);
|
|
40
40
|
|
|
41
|
-
*Create Pay Page:
|
|
41
|
+
* Create Pay Page:
|
|
42
42
|
|
|
43
43
|
paytabs.createPaymentPage([<payment_methods>],['sale','ecom'],[<cart_id>,<cart_currency>,<cart_amount>,<cart_description>],
|
|
44
44
|
[<customer_name>,<customer_email>,<customer_phone>,<customer_address>,<customer_city>,<customer_state>,<customer_country>,<customer_Zip>,<customer_ip>],
|
|
@@ -69,7 +69,7 @@ EXAMPLES
|
|
|
69
69
|
'en',createPayPage,True
|
|
70
70
|
)
|
|
71
71
|
|
|
72
|
-
*Validate Payment:
|
|
72
|
+
* Validate Payment:
|
|
73
73
|
|
|
74
74
|
paytabs.validatePayment(<transRef>,<callback>);
|
|
75
75
|
|
|
@@ -90,7 +90,7 @@ EXAMPLES
|
|
|
90
90
|
paytabs.validatePayment('TST2109000130191',verifyPayment);
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
*Refund:
|
|
93
|
+
* Refund:
|
|
94
94
|
|
|
95
95
|
paytabs.queryTransaction([<transRef>,'refund','ecom'],[<cart_id>,<cart_currency>,<cart_amount>,<cart_description>],callback);
|
|
96
96
|
|
|
@@ -112,12 +112,16 @@ EXAMPLES
|
|
|
112
112
|
|
|
113
113
|
* important notes:
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
* Make sure that your website currency is as same as your currency in payTabs profile.
|
|
116
|
+
* Make sure that you send the region as the syntax below:
|
|
117
|
+
* Send ARE if your region is United Arab Emirates.
|
|
118
|
+
* Send SAU if your region is Saudi Arabia.
|
|
119
|
+
* Send OMN if your region is Oman.
|
|
120
|
+
* Send JOR if your region is Jordan
|
|
121
|
+
* Send EGY if your region is Egypt
|
|
122
|
+
* Send KWT if your region is Kuwait
|
|
123
|
+
* Send MAR if your region is Marocco
|
|
124
|
+
* Send IRQ if your region is Iraq
|
|
125
|
+
* Send QAT if your region is Qatar
|
|
126
|
+
* Send GLOBAL if your region is Global
|
|
127
|
+
|
package/main.js
CHANGED
|
@@ -120,7 +120,9 @@ function _setEndPoint(region)
|
|
|
120
120
|
{
|
|
121
121
|
const regions_urls = {ARE:'https://secure.paytabs.com/',SAU:'https://secure.paytabs.sa/',
|
|
122
122
|
OMN:'https://secure-oman.paytabs.com/', JOR:'https://secure-jordan.paytabs.com/',
|
|
123
|
-
EGY:'https://secure-egypt.paytabs.com/',KWT:'https://secure-kuwait.paytabs.com/',
|
|
123
|
+
EGY:'https://secure-egypt.paytabs.com/',KWT:'https://secure-kuwait.paytabs.com/',
|
|
124
|
+
MAR: 'https://secure-morocco.paytabs.com/', IRQ: "https://secure-iraq.paytabs.com/",
|
|
125
|
+
QAT:'https://secure-doha.paytabs.com/', GLOBAL:'https://secure-global.paytabs.com/'};
|
|
124
126
|
|
|
125
127
|
for (const [key, value] of Object.entries(regions_urls))
|
|
126
128
|
{
|