簡化實作智付通付款流程與相關功能串接
已實作功能
- MPG API (v1.2)
- Periodical API (v1.0)
- CreditCard Collect Refund API (v1.0)
- CreditCard DeAuthorize API (v1.0)
- Transaction API
範例
MPG Service
- 付款(建立付款表單)
const SpGateway = ; const spgateway = true //(true for a dry run) your MerchantID your HashKey your HashIV true // if you want to print info in console to debug. default is false; const mpgService = spgateway; // crate payModellet payModel = mpgService;// set propertiespayModelMerchantOrderNo = "myordernohere";payModelNotifyURL = "http://mysite.com/api/spgateway/notify";payModelReturnURL = "http://mysite.com/api/spgateway/return";payModelClientBackURL = "http://mysite.com/shop";payModelAmt = 928;payModelItemDesc = "ProductX"; // create payformlet payFormHtml = mpgService;
- 接收通知(notify & return)
// take express request as examplelet JSONData = requestbodyJSONData; mpgService
Period Service (定期定額)
- 付款(建立付款表單)
let periodService = spgateway;let payModel = periodService; // set propertiespayModelPeriodAmt = 829; // create pay form htmllet payFormHtml = periodService;
- 接收通知(notify & return)
// take express request as examplelet body = requestbody; // it would be { "Period": "xxxxx..." } periodService
交易查詢
let tradeInfoService = spgateway; tradeInfoService
信用卡取消授權
let cardCancelService = spgateway; cardCancelService
信用卡請/退款
let cardloseService = spgateway; // 請款cardloseService // 退款cardloseService
Debug Logger
const spgateway = true //(true for a dry run) your MerchantID your HashKey your HashIV true // if you want to print info to debug, default is false ;
關於
歡迎 fork & pull request