Skip to content

sc0Vu/ecpay-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecpay-node

NPM

Build Status Dependency Status

A wrapper for ecpay in nodejs.

Depend on allpay package library.

Usage

npm install ecpay --save

const Ecpay = require('ecpay')

const PaymentService = new Ecpay({
  merchantID: "2000214",
  hashKey: "5294y06JbISpM5x9",
  hashIV: "v77hoKGq4kWxNNIS",
  mode: "production"
})

Example

Transaction

PaymentService.aioCheckOut({
  MerchantTradeNo: "EC20171001000001",
  MerchantTradeDate: "2017/10/01 00:00:00",
  TotalAmount: 199,
  TradeDesc: "HelloWorld",
  Items: [{
    name: "Cake",
    price: 199,
    currency: "NTD",
    quantity: 1
  }],
  ReturnURL: "http://localhost/res",
  ChoosePayment: "ALL"
}, function(err, result) {
  // Do something here...
});

Development

clone && npm install

Test

npm test

License

MIT

About

A wrapper for ecpay in nodejs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published