-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.js
More file actions
36 lines (32 loc) · 1020 Bytes
/
example.js
File metadata and controls
36 lines (32 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { Parampos } = require(".")
const initOptions = {
MODE: 'TEST',// TEST or PROD (Default is PROD)
CLIENT_CODE: '10738',
CLIENT_USERNAME: 'Test',
CLIENT_PASSWORD: 'Test',
GUID: '0c13d406-873b-403b-9c09-a5766840d98c',
}
// init Module
const client = new Parampos(initOptions)
const payOptions = {
cardName: 'Example User',
cardNumber: '5401341234567891',
cardExpmonth: '12',
cardExpyear: '2026',
cardCvv: '000',
cardHolderPhone: '5445555555',
failUrl: 'https://example.com/',
successUrl: 'https://example.com/',
orderId: Date.now(),
description: 'Example product description',
total: '10,00', // Total Price
securityType: 'NS',// NS or 3D (default = NS (Non security))
ipAddress: '127.1.1.1',// (default = 127.1.1.1)
installment: '1'//number of installments (Default = 1)
}
//Get paid function (Promise)
client.setPaid(payOptions).then(result => {
console.log("result", result)
}).catch(error => {
console.log("error", error)
})