Have ideas to improve npm?Join in the discussion! »

    @solidgate/node-sdk

    1.1.1 • Public • Published

    npm

    SolidGate API

    This library provides basic API options of SolidGate payment gateway.

    Installation

    $ npm install @solidgate/node-sdk
    

    Usage host to host - return Promise

    const solidGate = require('@solidgate/node-sdk');
    
    let api = new solidGate.Api("merchant", "private_key", "base_solidgate_url");
    
    let promise = api.charge({
        'amount': 10000,
        'currency': 'USD',
        'customer_email': 'test@testmail.com',
        'order_description': 'Premium package',
        'order_id': "213",
        'platform': 'WEB',
        'geo_country': 'ESP',
        'form_design_name': 'form-design',
    });
    
    promise.then((res) => {
    //do smth
    })

    Usage for forms url - return string

    const solidGate = require('@solidgate/node-sdk');
    
    let api = new solidGate.Api("merchant", "private_key", "base_solidgate_url");
    
    let formUrl = api.formUrl({
      'amount': 10000,
      'currency': 'USD',
      'customer_email': 'test@testmail.com',
      'order_description': 'Premium package',
      'order_id': "213",
      'platform': 'WEB',
      'geo_country': 'ESP',
      'form_design_name': 'form-design',
    });

    Usage for new form url - return MerchantData class

    const solidGate = require('@solidgate/node-sdk');
    
    let api = new solidGate.Api("merchant", "private_key");
    
    let merchantData = api.formMerchantData({
      'amount': 10000,
      'currency': 'USD',
      'customer_email': 'test@testmail.com',
      'order_description': 'Premium package',
      'order_id': "213",
      'platform': 'WEB',
      'geo_country': 'ESP',
      'form_design_name': 'form-design',
    });
    
    const dataToFront = merchantData.toObject()

    Install

    npm i @solidgate/node-sdk

    DownloadsWeekly Downloads

    374

    Version

    1.1.1

    License

    ISC

    Unpacked Size

    6.84 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar