Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boltpay

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boltpay

Library to interact with Bolt checkout APIs

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Bolt node.js library

Usage

Call POST order API

var boltClient = require('boltpay')({
    apiKey: 'API_KEY',
    environment: 'sandbox'
});
boltClient.createOrder({
  "cart": {
    "order_reference": "12345",
    "currency": "USD",
    "total_amount": 3998,
    "items": [
      {
        "name": "Bolt shirt",
        "unit_price": 2999,
        "quantity": 2,
        "total_amount": 5998,
        "sku": "shirt123",
        "color": "Black",
        "size": "M",
        "image_url": "https://example.com/image"
      }
    ],
    "discounts": [{
      "amount": 2000,
      "description: "Code: 20OFF"
    }]
  }
}).then(function(response) {
  // handle response
}).catch(function(err) {
  // handle error
});

Verify signature

var boltClient = require('boltpay')({
    signingSecret: 'SIGNING_SECRET',
});
var verified = boltClient.verifySignature(body, hmac);

For SDK developpers

Get started with the code

Clone the repo, npm i and then run two tasks:

  • npm run dev to compile the project while developing.
  • npm run test:dev to test on the fly while developping.

You can ndb npm run test:dev to get a better debugger

To run the dev mode, you will need a secrets.js file at the root of your folder:

/**
* Credentials to test the application in dev mode
*
* /!\ Must not be commited /!\
*/
module.exports = {
  apiKey: 'xxx',
  ngrokToken: 'xxx',
  ngrokURL: 'xxx',
  publicKey:'xxx',
  signingSecret:'xxx',
};

Get the value for the credentials in you sandbox Bolt account: https://merchant-sandbox.bolt.com/settings

For your ngrok url and token:

You can share it with other developpers. Once started, you can inspect the network on http://127.0.0.1:4040/inspect/http

Run in dev

You will need 3 processes :

  • Run npm run ngrok will launch the tunnel to expose your localhost to the web.
  • Run

Card details for dev :

  • Card number: 4111 1111 1111 3000
  • Expiration: Any future month/year
  • CVV: Any 3 digits

Keywords

FAQs

Package last updated on 05 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc