SkillAgentSearch skills...

Merchantsjs

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

Install / Use

/learn @garbin/Merchantsjs
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

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

Related Skills

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated3y ago
Forks1

Languages

JavaScript

Security Score

70/100

Audited on Dec 6, 2022

No findings