https://github.com/crystallizeapi/node-vipps
Node Vipps SDK for easy Vipps integration
https://github.com/crystallizeapi/node-vipps
Last synced: 13 days ago
JSON representation
Node Vipps SDK for easy Vipps integration
- Host: GitHub
- URL: https://github.com/crystallizeapi/node-vipps
- Owner: CrystallizeAPI
- Created: 2020-06-04T13:17:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T21:53:22.000Z (about 3 years ago)
- Last Synced: 2025-06-11T20:38:03.939Z (13 days ago)
- Language: JavaScript
- Size: 274 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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](https://crystallize.com/).
Crystallize enables you to build your next-gen e-commerce business by the help of [Fast GraphQL API Service](https://crystallize.com/product/graphql-commerce-api) backed by super structured [Product Information Management (PIM)](https://crystallize.com/product/product-information-management)
You can view the required body models documented in [Vipps swagger documentation](https://vippsas.github.io/vipps-ecom-api/)
## 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();
```