quickpos 1.0.905 → 1.0.906
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/example-cryptomus.js +40 -0
- package/example-shopier.js +1 -1
- package/lib/cryptomus.js +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const bodyParser = require('body-parser');
|
|
4
|
+
const QuickPos = require('./app');
|
|
5
|
+
|
|
6
|
+
const app = express();
|
|
7
|
+
app.use(bodyParser.urlencoded({ extended: true }));
|
|
8
|
+
app.use(require('multer')().none());
|
|
9
|
+
|
|
10
|
+
const quickPos = new QuickPos({
|
|
11
|
+
providers: {
|
|
12
|
+
cryptomus: {
|
|
13
|
+
merchantId: 'xxxx',
|
|
14
|
+
paymentKey: 'xxxxx'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
app.use(quickPos.middleware());
|
|
20
|
+
|
|
21
|
+
quickPos.providers['cryptomus'].createPayment({
|
|
22
|
+
orderId: `ST${Date.now()}`,
|
|
23
|
+
amount: String(123), //Sağlayıcı String istiyor.
|
|
24
|
+
currency: 'USD',
|
|
25
|
+
network: 'ETH',
|
|
26
|
+
callbackUrl: 'https://yourdomain.com/webhook',
|
|
27
|
+
returnUrl: 'https://yourdomain.com/return',
|
|
28
|
+
lifetime: 3600,
|
|
29
|
+
toCurrency: 'ETH'
|
|
30
|
+
})
|
|
31
|
+
.then(response => console.log(response))
|
|
32
|
+
.catch(error => console.error(error));
|
|
33
|
+
|
|
34
|
+
app.post('/cryptomusWebhook', quickPos.handleCallback('cryptomus'), (req, res) => {
|
|
35
|
+
console.log('Payment result:', req.paymentResult);
|
|
36
|
+
|
|
37
|
+
res.json({ status: 'success' });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
app.listen(3000, () => console.log('Server started on http://localhost:3000'));
|
package/example-shopier.js
CHANGED
package/lib/cryptomus.js
CHANGED
|
@@ -24,12 +24,12 @@ class Cryptomus {
|
|
|
24
24
|
order_id: options.orderId,
|
|
25
25
|
amount: options.amount,
|
|
26
26
|
currency: options.currency || 'USD',
|
|
27
|
-
network: options.network || 'ETH',
|
|
28
27
|
url_callback: options.callbackUrl,
|
|
29
28
|
url_return: options.returnUrl,
|
|
30
29
|
is_payment_multiple: false,
|
|
31
30
|
lifetime: options.lifetime || 3600,
|
|
32
|
-
|
|
31
|
+
// network: options.network || 'ETH',
|
|
32
|
+
// to_currency: options.toCurrency || 'ETH'
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const sign = this.createSignature(payload);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickpos",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.906",
|
|
4
4
|
"main": "app.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"crypto": "^1.0.1",
|
|
45
45
|
"express": "^4.19.2",
|
|
46
46
|
"jssha": "^3.3.1",
|
|
47
|
+
"multer": "^1.4.5-lts.1",
|
|
47
48
|
"payu-websdk": "^1.2.0"
|
|
48
49
|
}
|
|
49
50
|
}
|