listPayments()
- Returns the list of existing payments.createPayment(paymentObject)
- Creates a new paymentgetPayment(paymentId)
- Returns an existing paymentapprovePayment(paymentId)
- Approves a payment, effectively it moves money from a payer accountcancelPayment(paymentId)
- Cancels a created payment that hasn’t been approved yet.
- Call sdk as a constructor with object containing credentials and url
- On it instance call method which you need (sdk will take care of authorizing)
import Sdk from ...
const mySdk = new Sdk({
url: 'https://solitary-resonance-3442.getsandbox.com:443/v1',
credentials: {username: 'cool_business', password: 's3cur3passw0rd'}
})
mySdk.getPayment(2).then(resp => {
console.log(resp)
})
Other usage examples you can find in /examples
To run tests:
- clone repo
- run
npm i
in console- change server baseUrl if needed in
/test/test.js
- change server baseUrl if needed in
- run
npm run test
in console