@shopwaive/credit
v1.0.6
Published
Shopwaive SDK offers ecommerce developers tools to create a custom user experience using Shopwaive's all-in-one platform for Checkout, Subscriptions and Payments, and Store Credit.
Downloads
8
Maintainers
Readme
@shopwaive/credit
Introducing the Shopwaive API. Ecommerce developers now have access to the same tools that power Shopwaive's leading credit accounting platform to create ultra-converting checkouts.
Prerequisites
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
Table of contents
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Installation
BEFORE YOU INSTALL: please read the prerequisites
Start with cloning this repo on your local machine:
$ git clone https://github.com/shopwaive/-shopwaive-credit.git
$ cd -shopwaive-credit
To install and set up the library, run:
$ npm install -S @shopwaive/credit
Or if you prefer using Yarn:
$ yarn add --dev @shopwaive/credit
Usage
Running tests
$ node script.js
API
getCustomer
Shopwaive.getCustomer(config, customer_email)
Supported options and result fields for getCustomer
are listed below.
Options
config
| Type | X-Shopwaive-Access-Token | X-Shopwaive-Platform | Content-Type | | --- | --- | --- | --- | | object | 'shpat_4b2f...' | 'shopify' | 'application/json' |
customer_email
| Type | email | | --- | --- | | string | '[email protected]' |
Request
Example: Perform an asynchronous http request to getCustomer
const config = {
headers: {
"X-Shopwaive-Access-Token": "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6",
"X-Shopwaive-Platform": "shopify",
"Content-Type":"application/json"
}
};
const Shopwaive = require('@shopwaive/credit');
const email = "[email protected]";
async function getCustomer() {
return new Promise((resolve, reject) => {
let data = Shopwaive.getCustomer(config, email);
resolve(data)
});
}
getCustomer().then(res => {
let data = res.data;
if (data) {
console.log(res.data);
}
console.log(res.status)
console.log(res.statusText)
})
Built With
- Axios
Versioning
We use SemVer for versioning.
Authors
- Shopwaive
License
© Shopwaive.