1.0.6 • Published 11 months ago

@shopwaive/credit v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

npm version code style: prettier

@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

TypeX-Shopwaive-Access-TokenX-Shopwaive-PlatformContent-Type
object'shpat_4b2f...''shopify''application/json'

customer_email

Typeemail
string'support@shopwaive.com'

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 = "support@shopwaive.com";

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.

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago