airwallex
Airwallex Nodejs SDK
Install
$ npm i airwallex --save
Usage
const Airwallex = require('airwallex')
const airwallexClient = new Airwallex({
clientId: 'xxx',
clientSecret: 'xxx',
environment: 'sandbox'
})
;(async () => {
const balanceRes = await airwallexClient.execute({
method: 'get',
url: '/api/v1/balances/current'
})
console.log(balanceRes)
const createPaymentIntentRes = await airwallexClient.execute({
method: 'post',
url: '/api/v1/pa/payment_intents/create',
body: {
amount: 0.99,
currency: 'USD',
merchant_order_id: '1',
request_id: '64d280f6-4852-44d2-9572-5f19ed2c0a11'
}
})
console.log(createPaymentIntentRes)
})().catch(console.error)