@crystallize/node-vipps
v0.1.4
Published
Node Vipps SDK for easy Vipps integration
Downloads
82
Maintainers
Readme
node-vipps
Node Vipps SDK for easy Vipps integration in Node.JS. Generic Vipps Node integration with specific support for the Crystallize headless ecommerce service.
Crystallize enables you to build your next-gen e-commerce business by the help of Fast GraphQL API Service backed by super structured Product Information Management (PIM)
You can view the required body models documented in Vipps swagger documentation
Install
yarn add @crystallize/node-vipps
Usage
Initiate the client
const client = new VippsClient({
id: "MY_VIPPS_CLIENT_ID",
secret: "MY_VIPPS_CLIENT_SECRET",
subscriptionId: "MY_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();