diff --git a/ECPAY_Payment_node_js/.idea/workspace.xml b/ECPAY_Payment_node_js/.idea/workspace.xml
index f07ef3e..e517c53 100644
--- a/ECPAY_Payment_node_js/.idea/workspace.xml
+++ b/ECPAY_Payment_node_js/.idea/workspace.xml
@@ -2,7 +2,6 @@
-
@@ -34,47 +33,44 @@
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
-
+
-
+
-
+
-
+
@@ -87,22 +83,23 @@
-
-
-
+
+
+
-
-
+
-
-
+
+
+
+
@@ -123,6 +120,8 @@
+
+
1499138360726
@@ -172,20 +171,19 @@
-
+
+
@@ -195,4 +193,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/ECPAY_Payment_node_js/README.md b/ECPAY_Payment_node_js/README.md
new file mode 100644
index 0000000..4830bca
--- /dev/null
+++ b/ECPAY_Payment_node_js/README.md
@@ -0,0 +1,34 @@
+# 綠界 全方位(All In One)金流介接Node.js 第一版
+---
+
+## 1. 介紹
+
+ - 綠界對於有收款需求的會員,提供完整的交易介接API,並有多種收款方式(All In One)可選擇使用。 本套件為Node.js版,可使用作建立訂單,接受付款通知,查詢訂單等金流交易的應用。
+ - 收款方式清單:
+ - 信用卡(一次付清、分期付款、定期定額)
+ - 網路ATM
+ - ATM櫃員機
+ - 超商代碼
+ - 超商條碼
+ - Apple Pay
+ - Google Pay (須特別申請才能使用)(原Android Pay)
+
+
+## 2. 安裝環境
+ - node-v6.11.0-x64 以上
+ - ECMA Script6
+
+
+## 3. 使用教學
+ - 使用者文件放置於Doc資料夾內,可供參閱
+
+
+
+## 4. 聯絡我們
+ - 綠界技術服務工程師信箱: techsupport@ecpay.com.tw
+
+
+
+
+[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)
+
diff --git a/ECPAY_Payment_node_js/example/aio_check_out_applepay.js b/ECPAY_Payment_node_js/example/aio_check_out_applepay.js
new file mode 100644
index 0000000..e5efc09
--- /dev/null
+++ b/ECPAY_Payment_node_js/example/aio_check_out_applepay.js
@@ -0,0 +1,57 @@
+/**
+ * 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: 'johndoe@test.com',
+ // 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_applepay(parameters = base_param, invoice = inv_params)
+console.log(htm)
\ No newline at end of file
diff --git a/ECPAY_Payment_node_js/example/aio_check_out_credit_divide.js b/ECPAY_Payment_node_js/example/aio_check_out_credit_divide.js
index 8a708de..c2822c7 100644
--- a/ECPAY_Payment_node_js/example/aio_check_out_credit_divide.js
+++ b/ECPAY_Payment_node_js/example/aio_check_out_credit_divide.js
@@ -54,8 +54,7 @@ let inv_params = {
}
const inst = '12', //分期期數
- amt = 100, //分期總金額
options = require('../conf/config-example')
create = new ecpay_payment(options),
- htm = create.payment_client.aio_check_out_credit_divide(parameters = base_param, invoice = inv_params, installment = inst, amount = amt)
+ htm = create.payment_client.aio_check_out_credit_divide(parameters = base_param, invoice = inv_params, installment = inst)
console.log(htm)
\ No newline at end of file
diff --git a/ECPAY_Payment_node_js/example/aio_check_out_credit_onetime.js b/ECPAY_Payment_node_js/example/aio_check_out_credit_onetime.js
index f0e43a2..364084a 100644
--- a/ECPAY_Payment_node_js/example/aio_check_out_credit_onetime.js
+++ b/ECPAY_Payment_node_js/example/aio_check_out_credit_onetime.js
@@ -5,7 +5,6 @@ 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',
diff --git a/ECPAY_Payment_node_js/lib/ecpay_payment/ECpayPayment.xml b/ECPAY_Payment_node_js/lib/ecpay_payment/ECpayPayment.xml
index f35cdbd..85dec30 100644
--- a/ECPAY_Payment_node_js/lib/ecpay_payment/ECpayPayment.xml
+++ b/ECPAY_Payment_node_js/lib/ecpay_payment/ECpayPayment.xml
@@ -46,6 +46,7 @@
ALL
+ ApplePay
Credit
-
- 1
+ ^(3|6|12|18|24|30N){1}(,3|,6|,12|,18|,24|,30N){0,5}$
GE
diff --git a/ECPAY_Payment_node_js/lib/ecpay_payment/payment_client.js b/ECPAY_Payment_node_js/lib/ecpay_payment/payment_client.js
index 6105ece..778bb4e 100644
--- a/ECPAY_Payment_node_js/lib/ecpay_payment/payment_client.js
+++ b/ECPAY_Payment_node_js/lib/ecpay_payment/payment_client.js
@@ -24,7 +24,12 @@ class ECpayPaymentClient{
let html = this._aiochkout_pos_proc(parameters);
return html;
}
-
+ aio_check_out_applepay(parameters, invoice={}){
+ let unsupport = [];
+ this._aiochkout_base_proc(parameters, invoice, unsupport, 'ApplePay');
+ let html = this._aiochkout_pos_proc(parameters);
+ return html;
+ }
aio_check_out_credit_onetime(parameters, invoice={}){
let unsupport = [];
this._aiochkout_base_proc(parameters, invoice, unsupport, 'Credit');
@@ -39,13 +44,10 @@ class ECpayPaymentClient{
return html;
}*/
- aio_check_out_credit_divide(parameters, invoice={}, installment, amount){
+ aio_check_out_credit_divide(parameters, invoice={}, installment){
let unsupport = ['IgnorePayment', 'Redeem', 'PeriodAmount', 'PeriodType', 'Frequency', 'ExecTimes', 'PeriodReturnURL'];
this._aiochkout_base_proc(parameters, invoice, unsupport, 'Credit');
parameters['CreditInstallment'] = installment;
- if (parseInt(parameters['TotalAmount']) !== parseInt(amount)){
- parameters['InstallmentAmount'] = amount;
- }
let html = this._aiochkout_pos_proc(parameters);
return html;
}