https://github.com/molda/gopay-api-nodejs
GoPay API for Node.js
https://github.com/molda/gopay-api-nodejs
Last synced: about 1 year ago
JSON representation
GoPay API for Node.js
- Host: GitHub
- URL: https://github.com/molda/gopay-api-nodejs
- Owner: molda
- License: mit
- Created: 2016-04-09T08:15:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-29T17:39:21.000Z (over 8 years ago)
- Last Synced: 2025-03-20T15:59:29.212Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gopay-api-nodejs
### Usage
```javascript
var GoPay = require('gopay');
GoPay.init({
clientID: 'xxxxxx'
clientSecret: 'xxxxxxx'
}/* , true */); // true for production, since default is debug mode
// default scope is 'payment-create'
GoPay.getToken(/*scope, */function(err, token){
var payment = new Payment()
.payer({contact: { email: 'test@test.cz' }})
.target({
type:'ACCOUNT',
goid: gp.goid
})
.amount(1000)
.currency("CZK")
.orderNo("001")
.orderDesc("pojisteni01")
.items([{ name:'item01', amount:1000 }])
.preAuth(true)
.additional_params([{"name":"invoicenumber", "value":"2015001003"}])
.callback({
"return_url":"http://martin.smola/return",
// "notification_url":"http://www.eshop.cz/notify"
})
.toObj();
GoPay.createPayment(payment, token, function(err, data){
GoPay.getStatus(data.id, token, function(err, data){
});
});
});
```
License: MIT