quickpos 1.0.910 → 1.0.912

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.
Files changed (131) hide show
  1. package/PROVIDERS-DETAILS.md +1544 -0
  2. package/examples/example-2checkout.js +78 -0
  3. package/examples/example-bitpay.js +83 -0
  4. package/examples/example-cardcom.js +80 -0
  5. package/examples/example-cashfree.js +109 -0
  6. package/examples/example-checkout.js +85 -0
  7. package/examples/example-coingate.js +101 -0
  8. package/examples/example-coinpayments.js +89 -0
  9. package/examples/example-doku.js +27 -0
  10. package/examples/example-epay.js +64 -0
  11. package/examples/example-epoint.js +91 -0
  12. package/examples/example-freekassa.js +26 -0
  13. package/examples/example-heleket.js +139 -0
  14. package/examples/example-konnect.js +227 -0
  15. package/examples/example-midtrans.js +80 -0
  16. package/examples/example-noonpayments.js +297 -0
  17. package/examples/example-nowpayments.js +289 -0
  18. package/examples/example-omise.js +27 -0
  19. package/examples/example-paycom.js +82 -0
  20. package/{example-paydisini.js → examples/example-paydisini.js} +1 -1
  21. package/examples/example-payid19.js +87 -0
  22. package/examples/example-paykun.js +29 -0
  23. package/examples/example-payme.js +202 -0
  24. package/examples/example-paymentwall.js +201 -0
  25. package/examples/example-paynet.js +104 -0
  26. package/examples/example-paynettr.js +18 -0
  27. package/examples/example-payoneer.js +74 -0
  28. package/examples/example-payop.js +351 -0
  29. package/examples/example-paypal.js +200 -0
  30. package/examples/example-payriff.js +89 -0
  31. package/examples/example-paysend.js +81 -0
  32. package/examples/example-payspace.js +103 -0
  33. package/examples/example-payssion.js +27 -0
  34. package/examples/example-paytabs.js +28 -0
  35. package/examples/example-paytm.js +78 -0
  36. package/examples/example-payuindia.js +108 -0
  37. package/examples/example-payulatam.js +75 -0
  38. package/examples/example-phonepe.js +27 -0
  39. package/examples/example-picpay.js +27 -0
  40. package/examples/example-plisio.js +84 -0
  41. package/examples/example-portwallet.js +90 -0
  42. package/examples/example-primepayments.js +250 -0
  43. package/examples/example-razorpay.js +30 -0
  44. package/examples/example-senangpay.js +28 -0
  45. package/examples/example-shurjopay.js +94 -0
  46. package/examples/example-toyyibpay.js +80 -0
  47. package/examples/example-tripay.js +89 -0
  48. package/examples/example-unitpay.js +26 -0
  49. package/examples/example-urway.js +28 -0
  50. package/examples/example-volet.js +80 -0
  51. package/examples/example-xendit.js +28 -0
  52. package/examples/example-yallapay.js +253 -0
  53. package/examples/example-yookassa.js +27 -0
  54. package/examples/example-youcanpay.js +28 -0
  55. package/examples/example-zarinpal.js +98 -0
  56. package/{example.js → examples/example.js} +1 -1
  57. package/lib/2checkout.js +165 -0
  58. package/lib/amazonpay.js +161 -0
  59. package/lib/bitpay.js +122 -0
  60. package/lib/cardcom.js +193 -0
  61. package/lib/cashfree.js +184 -0
  62. package/lib/checkout.js +248 -0
  63. package/lib/coinbase.js +150 -0
  64. package/lib/coingate.js +137 -0
  65. package/lib/coinpayments.js +245 -0
  66. package/lib/doku.js +173 -0
  67. package/lib/epay.js +175 -0
  68. package/lib/epoint.js +162 -0
  69. package/lib/freekassa.js +128 -0
  70. package/lib/heleket.js +67 -1
  71. package/lib/instamojo.js +158 -0
  72. package/lib/konnect.js +211 -0
  73. package/lib/midtrans.js +227 -0
  74. package/lib/noonpayments.js +650 -0
  75. package/lib/nowpayments.js +311 -0
  76. package/lib/omise.js +150 -0
  77. package/lib/paddle.js +180 -0
  78. package/lib/paycom.js +216 -0
  79. package/lib/payid19.js +211 -0
  80. package/lib/paykun.js +144 -0
  81. package/lib/payme.js +302 -0
  82. package/lib/paymentwall.js +205 -0
  83. package/lib/paynet.js +186 -0
  84. package/lib/paynettr.js +165 -0
  85. package/lib/payoneer.js +128 -0
  86. package/lib/payop.js +256 -0
  87. package/lib/paypal.js +542 -0
  88. package/lib/payriff.js +148 -0
  89. package/lib/paysend.js +189 -0
  90. package/lib/payspace.js +168 -0
  91. package/lib/payssion.js +177 -0
  92. package/lib/paytabs.js +145 -0
  93. package/lib/paytm.js +253 -0
  94. package/lib/payuindia.js +162 -0
  95. package/lib/payulatam.js +179 -0
  96. package/lib/perfectmoney.js +143 -0
  97. package/lib/phonepe.js +174 -0
  98. package/lib/picpay.js +119 -0
  99. package/lib/plisio.js +234 -0
  100. package/lib/portwallet.js +152 -0
  101. package/lib/primepayments.js +256 -0
  102. package/lib/razorpay.js +205 -0
  103. package/lib/senangpay.js +130 -0
  104. package/lib/shurjopay.js +159 -0
  105. package/lib/toyyibpay.js +151 -0
  106. package/lib/tripay.js +220 -0
  107. package/lib/unitpay.js +223 -0
  108. package/lib/urway.js +182 -0
  109. package/lib/volet.js +147 -0
  110. package/lib/xendit.js +206 -0
  111. package/lib/yallapay.js +279 -0
  112. package/lib/yookassa.js +193 -0
  113. package/lib/youcanpay.js +124 -0
  114. package/lib/zarinpal.js +157 -0
  115. package/package.json +138 -64
  116. package/readme.md +348 -105
  117. package/test.js +492 -0
  118. package/example-heleket.js +0 -83
  119. package/lib/vallet.js +0 -22
  120. /package/{example-anypay.js → examples/example-anypay.js} +0 -0
  121. /package/{example-bufpay.js → examples/example-bufpay.js} +0 -0
  122. /package/{example-cryptomus.js → examples/example-cryptomus.js} +0 -0
  123. /package/{example-esnekpos.js → examples/example-esnekpos.js} +0 -0
  124. /package/{example-fedapay.js → examples/example-fedapay.js} +0 -0
  125. /package/{example-iyzico.js → examples/example-iyzico.js} +0 -0
  126. /package/{example-papara.js → examples/example-papara.js} +0 -0
  127. /package/{example-payeer.js → examples/example-payeer.js} +0 -0
  128. /package/{example-paymaya.js → examples/example-paymaya.js} +0 -0
  129. /package/{example-shopier.js → examples/example-shopier.js} +0 -0
  130. /package/{ipaymu.js → examples/ipaymu.js} +0 -0
  131. /package/{oderopay.js → examples/oderopay.js} +0 -0
@@ -0,0 +1,124 @@
1
+ const axios = require('axios');
2
+ const crypto = require('crypto');
3
+
4
+ class YouCanPayClient {
5
+ constructor(config) {
6
+ const requiredFields = ['privateKey', 'publicKey'];
7
+ for (let field of requiredFields) {
8
+ if (!config[field]) throw new Error(`Missing required field: ${field}`);
9
+ }
10
+
11
+ this.privateKey = config.privateKey;
12
+ this.publicKey = config.publicKey;
13
+ this.baseURL = config.sandbox
14
+ ? 'https://youcanpay.com/sandbox/api'
15
+ : 'https://youcanpay.com/api';
16
+
17
+ this.client = axios.create({
18
+ baseURL: this.baseURL,
19
+ headers: {
20
+ 'Content-Type': 'application/json',
21
+ 'Authorization': `Bearer ${this.privateKey}`
22
+ }
23
+ });
24
+ }
25
+
26
+ async createPayment(options) {
27
+ try {
28
+ const orderId = options.orderId || `ORDER-${Date.now()}`;
29
+
30
+ const paymentData = {
31
+ order_id: orderId,
32
+ amount: Math.round(parseFloat(options.amount) * 100), // Amount in cents
33
+ currency: options.currency || 'MAD',
34
+ customer_name: options.name || options.customerName || '',
35
+ customer_email: options.email || '',
36
+ customer_phone: options.phone || '',
37
+ success_url: options.successUrl || options.callback_link,
38
+ error_url: options.failureUrl || options.callback_link,
39
+ metadata: {
40
+ description: options.description || 'Payment'
41
+ }
42
+ };
43
+
44
+ const response = await this.client.post('/tokenize', paymentData);
45
+
46
+ if (response.data.token) {
47
+ return {
48
+ status: 'success',
49
+ data: {
50
+ token: response.data.token,
51
+ url: `https://youcanpay.com/sandbox/payment/${response.data.token}`,
52
+ orderId: orderId,
53
+ amount: paymentData.amount / 100,
54
+ currency: paymentData.currency
55
+ }
56
+ };
57
+ } else {
58
+ throw new Error('Failed to create payment token');
59
+ }
60
+ } catch (error) {
61
+ throw new Error(`Payment creation error: ${error.response?.data?.message || error.message}`);
62
+ }
63
+ }
64
+
65
+ async handleCallback(callbackData) {
66
+ try {
67
+ const transactionId = callbackData.transaction_id || callbackData.id;
68
+
69
+ if (!transactionId) {
70
+ throw new Error('Transaction ID not found in callback data');
71
+ }
72
+
73
+ // Get transaction details
74
+ const transaction = await this.getTransactionDetails(transactionId);
75
+
76
+ // Status mapping
77
+ const statusMapping = {
78
+ 'paid': 'success',
79
+ 'pending': 'pending',
80
+ 'failed': 'failed',
81
+ 'refunded': 'refunded',
82
+ 'cancelled': 'failed'
83
+ };
84
+
85
+ return {
86
+ status: statusMapping[transaction.status] || 'unknown',
87
+ orderId: transaction.order_id,
88
+ transactionId: transaction.id,
89
+ amount: transaction.amount / 100,
90
+ currency: transaction.currency,
91
+ paymentStatus: transaction.status,
92
+ paymentMethod: transaction.payment_method
93
+ };
94
+ } catch (error) {
95
+ throw new Error(`Error in YouCanPay callback handling: ${error.message}`);
96
+ }
97
+ }
98
+
99
+ async getTransactionDetails(transactionId) {
100
+ try {
101
+ const response = await this.client.get(`/transactions/${transactionId}`);
102
+ return response.data;
103
+ } catch (error) {
104
+ throw new Error(`Error getting transaction details: ${error.response?.data?.message || error.message}`);
105
+ }
106
+ }
107
+
108
+ async refund(transactionId, options = {}) {
109
+ try {
110
+ const refundData = {
111
+ transaction_id: transactionId,
112
+ amount: options.amount ? Math.round(parseFloat(options.amount) * 100) : undefined,
113
+ reason: options.reason || 'Customer Request'
114
+ };
115
+
116
+ const response = await this.client.post('/refund', refundData);
117
+ return response.data;
118
+ } catch (error) {
119
+ throw new Error(`Error processing refund: ${error.response?.data?.message || error.message}`);
120
+ }
121
+ }
122
+ }
123
+
124
+ module.exports = YouCanPayClient;
@@ -0,0 +1,157 @@
1
+ const axios = require('axios');
2
+
3
+ class ZarinpalClient {
4
+ constructor(config) {
5
+ const requiredFields = ['merchantId'];
6
+ for (let field of requiredFields) {
7
+ if (!config[field]) throw new Error(`Missing required field: ${field}`);
8
+ }
9
+
10
+ this.merchantId = config.merchantId;
11
+ this.isSandbox = config.sandbox || false;
12
+
13
+ this.URL = this.isSandbox
14
+ ? 'https://sandbox.zarinpal.com/pg/v4/payment'
15
+ : 'https://api.zarinpal.com/pg/v4/payment';
16
+
17
+ this.paymentURL = this.isSandbox
18
+ ? 'https://sandbox.zarinpal.com/pg/StartPay'
19
+ : 'https://www.zarinpal.com/pg/StartPay';
20
+
21
+ this.client = axios.create({
22
+ baseURL: this.URL,
23
+ headers: {
24
+ 'Content-Type': 'application/json',
25
+ 'Accept': 'application/json'
26
+ }
27
+ });
28
+
29
+ this.client.interceptors.response.use(response => {
30
+ return response;
31
+ }, error => {
32
+ if (error.response) {
33
+ throw new Error(`Zarinpal API error: ${error.response.data.errors || error.message}`);
34
+ }
35
+ throw new Error(`Zarinpal API error: ${error.message}`);
36
+ });
37
+ }
38
+
39
+ async createPayment(options) {
40
+ try {
41
+ const requestData = {
42
+ merchant_id: this.merchantId,
43
+ amount: parseInt(options.amount) * 10, // Convert to Rials
44
+ currency: options.currency || 'IRT', // IRT or IRR
45
+ description: options.description || options.name || 'Payment',
46
+ callback_url: options.callbackUrl || options.callback_link,
47
+ metadata: {
48
+ email: options.email || '',
49
+ mobile: options.mobile || options.phone || '',
50
+ order_id: options.orderId || `ORDER-${Date.now()}`
51
+ }
52
+ };
53
+
54
+ const response = await this.client.post('/request.json', requestData);
55
+
56
+ if (response.data.data && response.data.data.code === 100) {
57
+ const authority = response.data.data.authority;
58
+
59
+ return {
60
+ status: 'success',
61
+ data: {
62
+ authority: authority,
63
+ url: `${this.paymentURL}/${authority}`,
64
+ orderId: requestData.metadata.order_id
65
+ }
66
+ };
67
+ } else {
68
+ throw new Error(response.data.errors || 'Payment creation failed');
69
+ }
70
+ } catch (error) {
71
+ throw new Error(`Payment creation error: ${error.message}`);
72
+ }
73
+ }
74
+
75
+ async verifyPayment(authority, amount) {
76
+ try {
77
+ const requestData = {
78
+ merchant_id: this.merchantId,
79
+ authority: authority,
80
+ amount: parseInt(amount) * 10 // Convert to Rials
81
+ };
82
+
83
+ const response = await this.client.post('/verify.json', requestData);
84
+
85
+ if (response.data.data && response.data.data.code === 100) {
86
+ return {
87
+ status: 'success',
88
+ data: {
89
+ refId: response.data.data.ref_id,
90
+ cardPan: response.data.data.card_pan,
91
+ cardHash: response.data.data.card_hash,
92
+ feeType: response.data.data.fee_type,
93
+ fee: response.data.data.fee
94
+ }
95
+ };
96
+ } else if (response.data.data && response.data.data.code === 101) {
97
+ return {
98
+ status: 'success',
99
+ data: {
100
+ message: 'Transaction already verified',
101
+ refId: response.data.data.ref_id
102
+ }
103
+ };
104
+ } else {
105
+ throw new Error(response.data.errors || 'Verification failed');
106
+ }
107
+ } catch (error) {
108
+ throw new Error(`Payment verification error: ${error.message}`);
109
+ }
110
+ }
111
+
112
+ async handleCallback(callbackData) {
113
+ try {
114
+ const authority = callbackData.Authority;
115
+ const status = callbackData.Status;
116
+
117
+ if (status !== 'OK') {
118
+ return {
119
+ status: 'failed',
120
+ authority: authority,
121
+ message: 'Payment cancelled or failed'
122
+ };
123
+ }
124
+
125
+ // You need to verify the payment with the amount
126
+ // The amount should be stored in your database with the authority
127
+ // For now, we return the authority for manual verification
128
+ return {
129
+ status: 'pending_verification',
130
+ authority: authority,
131
+ message: 'Payment needs verification'
132
+ };
133
+ } catch (error) {
134
+ throw new Error(`Error in Zarinpal callback handling: ${error.message}`);
135
+ }
136
+ }
137
+
138
+ async unverifiedTransactions() {
139
+ try {
140
+ const requestData = {
141
+ merchant_id: this.merchantId
142
+ };
143
+
144
+ const response = await this.client.post('/unVerified.json', requestData);
145
+
146
+ if (response.data.data && response.data.data.code === 100) {
147
+ return response.data.data.authorities;
148
+ } else {
149
+ throw new Error(response.data.errors || 'Failed to get unverified transactions');
150
+ }
151
+ } catch (error) {
152
+ throw new Error(`Unverified transactions error: ${error.message}`);
153
+ }
154
+ }
155
+ }
156
+
157
+ module.exports = ZarinpalClient;
package/package.json CHANGED
@@ -1,64 +1,138 @@
1
- {
2
- "name": "quickpos",
3
- "version": "1.0.910",
4
- "main": "app.js",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1"
7
- },
8
- "keywords": [
9
- "quickpos",
10
- "multi-gateway",
11
- "payment-gateway",
12
- "payment",
13
- "gateway",
14
- "pos",
15
- "paytr",
16
- "iyzico",
17
- "vallet",
18
- "shipy",
19
- "shopinext",
20
- "paywant",
21
- "payizone",
22
- "weepay",
23
- "paynet",
24
- "stripe",
25
- "paypal",
26
- "shopier",
27
- "cryptomus",
28
- "payeer",
29
- "papara",
30
- "paymaya",
31
- "anypay",
32
- "esnekpos",
33
- "fedapay"
34
- ],
35
- "repository": {
36
- "type": "git",
37
- "url": "https://github.com/fastuptime/QuickPos.git"
38
- },
39
- "bugs": {
40
- "url": "https://github.com/fastuptime/QuickPos/issues"
41
- },
42
- "homepage": "https://github.com/fastuptime/QuickPos",
43
- "author": "Can & SpeedSMM <fastuptime@gmail.com>",
44
- "license": "ISC",
45
- "description": "",
46
- "dependencies": {
47
- "@tokenpayeng/tokenpay": "^0.0.14",
48
- "anypay-node": "^1.0.0",
49
- "axios": "^1.7.2",
50
- "body-parser": "^1.20.3",
51
- "crypto": "^1.0.1",
52
- "dayjs": "^1.11.13",
53
- "esnekpos": "^1.0.0",
54
- "express": "^4.21.2",
55
- "fedapay": "^1.2.4",
56
- "iyzipay": "^2.0.48",
57
- "jssha": "^3.3.1",
58
- "multer": "^1.4.5-lts.1",
59
- "node-fetch": "^2.7.0",
60
- "paymaya-integration": "^1.0.4",
61
- "payu-websdk": "^1.2.0",
62
- "uuid": "^9.0.1"
63
- }
64
- }
1
+ {
2
+ "name": "quickpos",
3
+ "version": "1.0.912",
4
+ "main": "app.js",
5
+ "scripts": {
6
+ "test": "node test.js"
7
+ },
8
+ "keywords": [
9
+ "quickpos",
10
+ "multi-gateway",
11
+ "payment-gateway",
12
+ "payment",
13
+ "gateway",
14
+ "pos",
15
+ "paytr",
16
+ "iyzico",
17
+ "vallet",
18
+ "shipy",
19
+ "shopinext",
20
+ "paywant",
21
+ "payizone",
22
+ "weepay",
23
+ "paynet",
24
+ "stripe",
25
+ "paypal",
26
+ "shopier",
27
+ "cryptomus",
28
+ "payeer",
29
+ "papara",
30
+ "paymaya",
31
+ "anypay",
32
+ "esnekpos",
33
+ "fedapay",
34
+ "midtrans",
35
+ "plisio",
36
+ "tripay",
37
+ "toyyibpay",
38
+ "zarinpal",
39
+ "coinpayments",
40
+ "checkout",
41
+ "checkout.com",
42
+ "paytm",
43
+ "cardcom",
44
+ "paycom",
45
+ "payid19",
46
+ "paysend",
47
+ "volet",
48
+ "bitpay",
49
+ "payriff",
50
+ "epoint",
51
+ "payoneer",
52
+ "portwallet",
53
+ "2checkout",
54
+ "coingate",
55
+ "shurjopay",
56
+ "cashfree",
57
+ "payspace",
58
+ "payulatam",
59
+ "payuindia",
60
+ "epay",
61
+ "paynettr",
62
+ "doku",
63
+ "coinbase-commerce",
64
+ "amazonpay",
65
+ "perfect-money",
66
+ "paddle",
67
+ "instamojo",
68
+ "freekassa",
69
+ "picpay",
70
+ "paytabs",
71
+ "payssion",
72
+ "paykun",
73
+ "omise",
74
+ "phonepe",
75
+ "youcanpay",
76
+ "yookassa",
77
+ "urway",
78
+ "xendit",
79
+ "unitpay",
80
+ "senangpay",
81
+ "razorpay",
82
+ "cryptocurrency",
83
+ "crypto-payment",
84
+ "indonesia",
85
+ "malaysia",
86
+ "iran",
87
+ "india",
88
+ "israel",
89
+ "uzbekistan",
90
+ "azerbaijan",
91
+ "bangladesh",
92
+ "south-africa",
93
+ "bulgaria",
94
+ "moldova",
95
+ "turkey",
96
+ "brazil",
97
+ "middle-east",
98
+ "morocco",
99
+ "russia",
100
+ "saudi-arabia",
101
+ "thailand",
102
+ "philippines",
103
+ "latin-america",
104
+ "global-payments"
105
+ ],
106
+ "repository": {
107
+ "type": "git",
108
+ "url": "https://github.com/fastuptime/QuickPos.git"
109
+ },
110
+ "bugs": {
111
+ "url": "https://github.com/fastuptime/QuickPos/issues"
112
+ },
113
+ "homepage": "https://github.com/fastuptime/QuickPos",
114
+ "author": "Can & SpeedSMM <fastuptime@gmail.com>",
115
+ "license": "ISC",
116
+ "description": "",
117
+ "dependencies": {
118
+ "@tokenpayeng/tokenpay": "^0.0.14",
119
+ "@tosspayments/tosspayments-sdk": "^2.3.5",
120
+ "anypay-node": "^1.0.0",
121
+ "axios": "^1.7.2",
122
+ "body-parser": "^1.20.3",
123
+ "braintree": "^3.30.0",
124
+ "crypto": "^1.0.1",
125
+ "dayjs": "^1.11.13",
126
+ "esnekpos": "^1.0.0",
127
+ "express": "^4.21.2",
128
+ "fedapay": "^1.2.4",
129
+ "iyzipay": "^2.0.48",
130
+ "jssha": "^3.3.1",
131
+ "multer": "^1.4.5-lts.1",
132
+ "node-fetch": "^2.7.0",
133
+ "paymaya-integration": "^1.0.4",
134
+ "paymentwall": "^2.1.1",
135
+ "payu-websdk": "^1.2.0",
136
+ "uuid": "^9.0.1"
137
+ }
138
+ }