-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ECPay/ECPayAIO_Node.js
- Loading branch information
Showing
25 changed files
with
615 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Doc/ | ||
ECPAY_Payment_node_js/.idea/ | ||
ECPAY_Payment_node_js/node_modules/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const options = { | ||
"OperationMode": "Test", //Test or Production | ||
"MercProfile": { | ||
"MerchantID": "2000132", | ||
"HashKey": "5294y06JbISpM5x9", | ||
"HashIV": "v77hoKGq4kWxNNIS" | ||
}, | ||
"IgnorePayment": [ | ||
// "Credit", | ||
// "WebATM", | ||
// "ATM", | ||
// "CVS", | ||
// "BARCODE", | ||
// "AndroidPay" | ||
], | ||
"IsProjectContractor": false | ||
} | ||
|
||
module.exports = options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
/** | ||
* Created by ying.wu on 2017/6/27. | ||
*/ | ||
const ecpay_payment = require('../lib/ecpay_payment.js'); | ||
const ecpay_payment = require('../lib/ecpay_payment.js') | ||
//參數值為[PLEASE MODIFY]者,請在每次測試時給予獨特值 | ||
//若要測試非必帶參數請將base_param內註解的參數依需求取消註解 // | ||
let base_param = { | ||
MerchantTradeNo: 'PLEASE MODIFY', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
CaptureAMT: '70', | ||
UserRefundAMT: '30', | ||
// MerchantID: '', | ||
// Remark: '撥款備註' | ||
}; | ||
|
||
let create = new ecpay_payment(); | ||
let res = create.exec_grant_refund.aio_capture(parameters = base_param); | ||
MerchantTradeNo: 'PLEASE MODIFY', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
CaptureAMT: '70', | ||
UserRefundAMT: '30', | ||
// MerchantID: '', | ||
// Remark: '撥款備註' | ||
} | ||
const options = require('../conf/config-example'), | ||
create = new ecpay_payment(options), | ||
res = create.exec_grant_refund.aio_capture(parameters = base_param) | ||
res.then(function (result) { | ||
console.log(result); | ||
console.log(result) | ||
}).catch(function (err) { | ||
console.log(err); | ||
}); | ||
console.log(err) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,58 @@ | ||
|
||
/** | ||
* Created by ying.wu on 2017/6/27. | ||
*/ | ||
const ecpay_payment = require('../lib/ecpay_payment.js'); | ||
const ecpay_payment = require('../lib/ecpay_payment.js') | ||
//參數值為[PLEASE MODIFY]者,請在每次測試時給予獨特值 | ||
//若要測試非必帶參數請將base_param內註解的參數依需求取消註解 // | ||
let base_param = { | ||
MerchantTradeNo: 'f0a0sa9fabkkuy111', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
MerchantTradeDate: '2018/06/13 15:45:30', //ex: 2017/02/13 15:45:30 | ||
TotalAmount: '100', | ||
TradeDesc: '測試交易描述', | ||
ItemName: '測試商品等', | ||
ReturnURL: 'https://us-central1-qraft-app.cloudfunctions.net/dev-createSampleOrder', | ||
EncryptType:'1', | ||
// ChooseSubPayment: '', | ||
// OrderResultURL: 'http://192.168.0.1/payment_result', | ||
// NeedExtraPaidInfo: '1', | ||
// ClientBackURL: 'https://www.google.com', | ||
// ItemURL: 'http://item.test.tw', | ||
// Remark: '交易備註', | ||
// StoreID: '', | ||
// CustomField1: '', | ||
// CustomField2: '', | ||
// CustomField3: '', | ||
// CustomField4: '' | ||
}; | ||
MerchantTradeNo: 'PLEASE MODIFY', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
MerchantTradeDate: 'PLEASE MODIFY', //ex: 2017/02/13 15:45:30 | ||
TotalAmount: '100', | ||
TradeDesc: '測試交易描述', | ||
ItemName: '測試商品等', | ||
ReturnURL: 'http://192.168.0.1', | ||
// ChooseSubPayment: '', | ||
// OrderResultURL: 'http://192.168.0.1/payment_result', | ||
// NeedExtraPaidInfo: '1', | ||
// ClientBackURL: 'https://www.google.com', | ||
// ItemURL: 'http://item.test.tw', | ||
// Remark: '交易備註', | ||
// HoldTradeAMT: '1', | ||
// StoreID: '', | ||
// CustomField1: '', | ||
// CustomField2: '', | ||
// CustomField3: '', | ||
// CustomField4: '' | ||
} | ||
|
||
// 若要測試開立電子發票,請將inv_params內的"所有"參數取消註解 // | ||
let inv_params = { | ||
RelateNumber: 'SJDFJas97Gj11VOMSfK', //請帶30碼uid ex: SJDFJGH24FJIL97G73653XM0VOMS4K | ||
CustomerID: '', //會員編號 | ||
CustomerIdentifier: '', //統一編號 | ||
CustomerName: '測試買家', | ||
CustomerAddr: '測試用地址', | ||
CustomerPhone: '0123456789', | ||
CustomerEmail: '[email protected]', | ||
ClearanceMark: '2', | ||
TaxType: '1', | ||
CarruerType: '', | ||
CarruerNum: '', | ||
Donation: '2', | ||
LoveCode: '', | ||
Print: '1', | ||
InvoiceItemName: '測試商品1|測試商品2', | ||
InvoiceItemCount: '2|3', | ||
InvoiceItemWord: '個|包', | ||
InvoiceItemPrice: '35|10', | ||
InvoiceItemTaxType: '1|1', | ||
InvoiceRemark: '測試商品1的說明|測試商品2的說明', | ||
DelayDay: '0', | ||
InvType: '07' | ||
}; | ||
// RelateNumber: 'PLEASE MODIFY', //請帶30碼uid ex: SJDFJGH24FJIL97G73653XM0VOMS4K | ||
// CustomerID: 'MEM_0000001', //會員編號 | ||
// CustomerIdentifier: '', //統一編號 | ||
// CustomerName: '測試買家', | ||
// CustomerAddr: '測試用地址', | ||
// CustomerPhone: '0123456789', | ||
// CustomerEmail: '[email protected]', | ||
// ClearanceMark: '2', | ||
// TaxType: '1', | ||
// CarruerType: '', | ||
// CarruerNum: '', | ||
// Donation: '2', | ||
// LoveCode: '', | ||
// Print: '1', | ||
// InvoiceItemName: '測試商品1|測試商品2', | ||
// InvoiceItemCount: '2|3', | ||
// InvoiceItemWord: '個|包', | ||
// InvoiceItemPrice: '35|10', | ||
// InvoiceItemTaxType: '1|1', | ||
// InvoiceRemark: '測試商品1的說明|測試商品2的說明', | ||
// DelayDay: '0', | ||
// InvType: '07' | ||
} | ||
const options = require('../conf/config-example'), | ||
create = new ecpay_payment(options), | ||
htm = create.payment_client.aio_check_out_all(parameters = base_param, invoice = inv_params) | ||
console.log(htm) | ||
|
||
let create = new ecpay_payment(); | ||
let htm = create.payment_client.aio_check_out_all(parameters = base_param, invoice = inv_params); | ||
console.log(htm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
/** | ||
* Created by ying.wu on 2017/6/27. | ||
*/ | ||
const ecpay_payment = require('../lib/ecpay_payment.js'); | ||
//參數值為[PLEASE MODIFY]者,請在每次測試時給予獨特值 | ||
//若要測試非必帶參數請將base_param內註解的參數依需求取消註解 // | ||
let base_param = { | ||
MerchantTradeNo: 'f0a0d7eggfhf11Y', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
MerchantTradeDate: '2018/06/13 15:45:30', //ex: 2017/02/13 15:45:30 | ||
TotalAmount: '100', | ||
TradeDesc: '測試交易描述', | ||
ItemName: '測試商品等', | ||
ReturnURL: 'http://192.168.0.1', | ||
EncryptType:'1', | ||
// ChooseSubPayment: '', | ||
// OrderResultURL: 'http://192.168.0.1/payment_result', | ||
// NeedExtraPaidInfo: '1', | ||
// ClientBackURL: 'https://www.google.com', | ||
// ItemURL: 'http://item.test.tw', | ||
// Remark: '交易備註', | ||
// StoreID: '', | ||
// CustomField1: '', | ||
// CustomField2: '', | ||
// CustomField3: '', | ||
// CustomField4: '' | ||
}; | ||
|
||
// 若要測試開立電子發票,請將inv_params內的"所有"參數取消註解 // | ||
let inv_params = { | ||
// RelateNumber: 'PLEASE MODIFY', //請帶30碼uid ex: SJDFJGH24FJIL97G73653XM0VOMS4K | ||
// CustomerID: 'MEM_0000001', //會員編號 | ||
// CustomerIdentifier: '', //統一編號 | ||
// CustomerName: '測試買家', | ||
// CustomerAddr: '測試用地址', | ||
// CustomerPhone: '0123456789', | ||
// CustomerEmail: '[email protected]', | ||
// ClearanceMark: '2', | ||
// TaxType: '1', | ||
// CarruerType: '', | ||
// CarruerNum: '', | ||
// Donation: '2', | ||
// LoveCode: '', | ||
// Print: '1', | ||
// InvoiceItemName: '測試商品1|測試商品2', | ||
// InvoiceItemCount: '2|3', | ||
// InvoiceItemWord: '個|包', | ||
// InvoiceItemPrice: '35|10', | ||
// InvoiceItemTaxType: '1|1', | ||
// InvoiceRemark: '測試商品1的說明|測試商品2的說明', | ||
// DelayDay: '0', | ||
// InvType: '07' | ||
}; | ||
|
||
let pay_info_url = 'http://192.168.0.1'; | ||
let exp = '7'; | ||
let cli_redir_url = 'http://www.ecpay.com.tw'; | ||
|
||
let create = new ecpay_payment(); | ||
let htm = create.payment_client.aio_check_out_atm(parameters = base_param, url_return_payinfo = pay_info_url, exp_period = exp, client_redirect = cli_redir_url, invoice = inv_params); | ||
console.log(htm); | ||
/** | ||
* Created by ying.wu on 2017/6/27. | ||
*/ | ||
const ecpay_payment = require('../lib/ecpay_payment.js') | ||
//參數值為[PLEASE MODIFY]者,請在每次測試時給予獨特值 | ||
//若要測試非必帶參數請將base_param內註解的參數依需求取消註解 // | ||
let base_param = { | ||
MerchantTradeNo: 'PLEASE MODIFY', //請帶20碼uid, ex: f0a0d7e9fae1bb72bc93 | ||
MerchantTradeDate: 'PLEASE MODIFY', //ex: 2017/02/13 15:45:30 | ||
TotalAmount: '100', | ||
TradeDesc: '測試交易描述', | ||
ItemName: '測試商品等', | ||
ReturnURL: 'http://192.168.0.1', | ||
// ChooseSubPayment: '', | ||
// OrderResultURL: 'http://192.168.0.1/payment_result', | ||
// NeedExtraPaidInfo: '1', | ||
// ClientBackURL: 'https://www.google.com', | ||
// ItemURL: 'http://item.test.tw', | ||
// Remark: '交易備註', | ||
// HoldTradeAMT: '1', | ||
// StoreID: '', | ||
// CustomField1: '', | ||
// CustomField2: '', | ||
// CustomField3: '', | ||
// CustomField4: '' | ||
} | ||
|
||
|
||
// 若要測試開立電子發票,請將inv_params內的"所有"參數取消註解 // | ||
let inv_params = { | ||
// RelateNumber: 'PLEASE MODIFY', //請帶30碼uid ex: SJDFJGH24FJIL97G73653XM0VOMS4K | ||
// CustomerID: 'MEM_0000001', //會員編號 | ||
// CustomerIdentifier: '', //統一編號 | ||
// CustomerName: '測試買家', | ||
// CustomerAddr: '測試用地址', | ||
// CustomerPhone: '0123456789', | ||
// CustomerEmail: '[email protected]', | ||
// ClearanceMark: '2', | ||
// TaxType: '1', | ||
// CarruerType: '', | ||
// CarruerNum: '', | ||
// Donation: '2', | ||
// LoveCode: '', | ||
// Print: '1', | ||
// InvoiceItemName: '測試商品1|測試商品2', | ||
// InvoiceItemCount: '2|3', | ||
// InvoiceItemWord: '個|包', | ||
// InvoiceItemPrice: '35|10', | ||
// InvoiceItemTaxType: '1|1', | ||
// InvoiceRemark: '測試商品1的說明|測試商品2的說明', | ||
// DelayDay: '0', | ||
// InvType: '07' | ||
} | ||
|
||
|
||
const pay_info_url = 'http://192.168.0.1', | ||
exp = '7', | ||
cli_redir_url = 'http://192.168.0.1/payment_result', | ||
options = require('../conf/config-example'), | ||
create = new ecpay_payment(options), | ||
htm = create.payment_client.aio_check_out_atm(parameters = base_param, url_return_payinfo = pay_info_url, exp_period = exp, client_redirect = cli_redir_url, invoice = inv_params) | ||
console.log(htm) | ||
|
Oops, something went wrong.