New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

merchants

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merchants

A framework agnostic, multi-gateway payment processing library for node.js, like Omnipay for php or ActiveMerchants for ruby

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

merchants for Node.js

merchants is a framework agnostic, multi-gateway payment processing library for node.js, like Omnipay for php or ActiveMerchant for ruby

Gateways support currently

  • Alipay
  • Stripe
  • more to come...

Installation

npm i merchants

Usage

Initialize

const { Merchants, gateways: { Stripe } } = require('merchants')
const merchants = new Merchants()
merchants.use(new Stripe({
  key: 'YOUR STRIPE KEY HERE'
}))
merchants.use(new Alipay({
  // ...alipay config here
}))

Make a sync request & Grab the response

const request = merchants.using('stripe').purchase({
  amount: 100
}, {
  currency: 'usd',
  // ...stripe charges create options here
})
const response = await request.send()
if (response.success) {
  // do some staff when success
  console.log(response.body)
}

Make an async request & Grab the response

const request = merchants.using('alipay').purchase({
  amount: 100
}, {
  currency: 'usd',
  // ...stripe charges create options here
})
const redirect = request.redirect()
// form koa
// ctx.body = redirect

Keywords

FAQs

Package last updated on 12 May 2017

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