react-vipps-payments
v0.1.0
Published
Vipps payments es6 JavaScript and React NODE SDK for capture, refind,init payment
Downloads
2
Maintainers
Readme
Usage
Initiate the client
const client = new VippsClient({
id: VIPPS_CLIENT_ID",
secret: "VIPPS_CLIENT_SECRET",
subscriptionId: "VIPPS_SUB_KEY",
testDrive: isProd ? false : true
});
Initiate a payment
await client.initiatePayment({order:VippsCheckoutModel});
Capture a payment
await client.capture({ orderId: VippsOrderId, body: VippsCaptureBodyModel });
Refund a payment
await client.refund({ orderId: VippsOrderId, body: VippsRefundBodyModel });
Get order payment details
await client.getOrderDetails({ orderId: VippsOrderId});
Get an access token
await client.getAccessToken();