ecpay_payment 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/Rakefile +6 -0
- data/conf/payment_conf.xml +29 -0
- data/ecpay.gemspec +25 -0
- data/lib/ecpay_payment/ECpayPayment.xml +623 -0
- data/lib/ecpay_payment/core_ext/hash.rb +13 -0
- data/lib/ecpay_payment/core_ext/string.rb +5 -0
- data/lib/ecpay_payment/error.rb +8 -0
- data/lib/ecpay_payment/exec_grant_refund.rb +82 -0
- data/lib/ecpay_payment/helper.rb +205 -0
- data/lib/ecpay_payment/payment_client.rb +217 -0
- data/lib/ecpay_payment/query_client.rb +142 -0
- data/lib/ecpay_payment/verification.rb +469 -0
- data/lib/ecpay_payment/version.rb +3 -0
- data/lib/ecpay_payment.rb +7 -0
- metadata +101 -0
@@ -0,0 +1,623 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<ECPayPayment>
|
3
|
+
<AioCheckOut>
|
4
|
+
<ServiceAddress>
|
5
|
+
<url type="Production">https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5</url>
|
6
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5</url>
|
7
|
+
</ServiceAddress>
|
8
|
+
<Config>
|
9
|
+
<switchparam>
|
10
|
+
<n>ChoosePayment</n>
|
11
|
+
<n>InvoiceMark</n>
|
12
|
+
</switchparam>
|
13
|
+
</Config>
|
14
|
+
<Parameters>
|
15
|
+
<param type="String" require="1" name="MerchantID">
|
16
|
+
<pattern>^\d{7,10}$</pattern>
|
17
|
+
</param>
|
18
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
19
|
+
<pattern>^\w{4,20}$</pattern>
|
20
|
+
</param>
|
21
|
+
<param type="String" require="1" name="MerchantTradeDate">
|
22
|
+
<pattern>^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$</pattern>
|
23
|
+
</param>
|
24
|
+
<param type="String" require="0" name="StoreID">
|
25
|
+
<pattern>^.{0,20}</pattern>
|
26
|
+
</param>
|
27
|
+
<param type="String" require="1" name="PaymentType">
|
28
|
+
<pattern>aio</pattern>
|
29
|
+
</param>
|
30
|
+
<param type="Int" require="1" name="TotalAmount">
|
31
|
+
<!-- There's a special rule when payment type is CVS. The minimal value would be 27 and maximum be 20000.
|
32
|
+
This rule is embedded into code and will ignore all value setting here. -->
|
33
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
34
|
+
<maximum></maximum>
|
35
|
+
<minimal>1</minimal>
|
36
|
+
</param>
|
37
|
+
<param type="String" require="1" name="TradeDesc">
|
38
|
+
<pattern>^.{0,200}$</pattern>
|
39
|
+
</param>
|
40
|
+
<param type="String" require="1" name="ItemName">
|
41
|
+
<pattern>^.{0,200}$</pattern>
|
42
|
+
</param>
|
43
|
+
<param type="String" require="1" name="ReturnURL">
|
44
|
+
<pattern>^.{0,200}$</pattern>
|
45
|
+
</param>
|
46
|
+
<param type="Opt" require="1" name="ChoosePayment">
|
47
|
+
<option>ALL</option>
|
48
|
+
<!-- <option>GooglePay</option>--><!--2019/09/30暫時關閉GooglePay付款方式-->
|
49
|
+
<option>ApplePay</option>
|
50
|
+
<option>Credit</option>
|
51
|
+
<condparam owner="Credit">
|
52
|
+
<!--Reqirement checking of following credit card related sub parameter would be handled in
|
53
|
+
client.rb due to different credit payment type -->
|
54
|
+
<param type="Opt" require="0" name="Language">
|
55
|
+
<option>ENG</option>
|
56
|
+
<option>KOR</option>
|
57
|
+
<option>JPN</option>
|
58
|
+
<option>CHI</option>
|
59
|
+
</param>
|
60
|
+
<param type="Opt" require="0" name="BidingCard">
|
61
|
+
<option>1</option>
|
62
|
+
<option>0</option>
|
63
|
+
</param>
|
64
|
+
<param type="String" require="0" name="MerchantMemberID">
|
65
|
+
<pattern>^.{0,20}$</pattern>
|
66
|
+
</param>
|
67
|
+
<param type="Opt" require="0" name="Redeem" category="OneTime">
|
68
|
+
<option>Y</option>
|
69
|
+
<option>N</option>
|
70
|
+
</param>
|
71
|
+
<param type="Opt" require="0" name="UnionPay" category="OneTime">
|
72
|
+
<option>0</option>
|
73
|
+
<option>1</option>
|
74
|
+
<option>2</option>
|
75
|
+
</param>
|
76
|
+
<param type="String" require="0" name="CreditInstallment" category="Divide">
|
77
|
+
<pattern>^(3|6|12|18|24|30N){1}(,3|,6|,12|,18|,24|,30N){0,5}$</pattern>
|
78
|
+
</param>
|
79
|
+
<param type="Int" require="0" name="PeriodAmount" category="Period">
|
80
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
81
|
+
<maximum></maximum>
|
82
|
+
<minimal>1</minimal>
|
83
|
+
</param>
|
84
|
+
<param type="Opt" require="0" name="PeriodType" category="Period">
|
85
|
+
<option>Y</option>
|
86
|
+
<option>M</option>
|
87
|
+
<option>D</option>
|
88
|
+
</param>
|
89
|
+
<param type="Int" require="0" name="Frequency" category="Period">
|
90
|
+
<mode>BETWEEN</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
91
|
+
<maximum>365</maximum>
|
92
|
+
<minimal>1</minimal>
|
93
|
+
</param>
|
94
|
+
<param type="Int" require="0" name="ExecTimes" category="Period">
|
95
|
+
<mode>BETWEEN</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
96
|
+
<maximum>999</maximum>
|
97
|
+
<minimal>1</minimal>
|
98
|
+
</param>
|
99
|
+
<param type="String" require="0" name="PeriodReturnURL" category="Period">
|
100
|
+
<pattern>.{0,200}</pattern>
|
101
|
+
</param>
|
102
|
+
</condparam>
|
103
|
+
<option>WebATM</option>
|
104
|
+
<option>ATM</option>
|
105
|
+
<condparam owner="ATM">
|
106
|
+
<param type="Int" require="0" name="ExpireDate">
|
107
|
+
<mode>BETWEEN</mode>
|
108
|
+
<maximum>60</maximum>
|
109
|
+
<minimal>1</minimal>
|
110
|
+
</param>
|
111
|
+
<param type="String" require="0" name="PaymentInfoURL">
|
112
|
+
<pattern>^.{0,200}$</pattern>
|
113
|
+
</param>
|
114
|
+
<param type="String" require="0" name="ClientRedirectURL">
|
115
|
+
<pattern>^.{0,200}$</pattern>
|
116
|
+
</param>
|
117
|
+
</condparam>
|
118
|
+
<option>CVS</option>
|
119
|
+
<condparam owner="CVS">
|
120
|
+
<param type="Int" require="0" name="StoreExpireDate">
|
121
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
122
|
+
<maximum></maximum>
|
123
|
+
<minimal>1</minimal>
|
124
|
+
</param>
|
125
|
+
<param type="String" require="0" name="Desc_1">
|
126
|
+
<pattern>^.{0,20}$</pattern>
|
127
|
+
</param>
|
128
|
+
<param type="String" require="0" name="Desc_2">
|
129
|
+
<pattern>^.{0,20}$</pattern>
|
130
|
+
</param>
|
131
|
+
<param type="String" require="0" name="Desc_3">
|
132
|
+
<pattern>^.{0,20}$</pattern>
|
133
|
+
</param>
|
134
|
+
<param type="String" require="0" name="Desc_4">
|
135
|
+
<pattern>^.{0,20}$</pattern>
|
136
|
+
</param>
|
137
|
+
<param type="String" require="0" name="PaymentInfoURL">
|
138
|
+
<pattern>^.{0,200}$</pattern>
|
139
|
+
</param>
|
140
|
+
<param type="String" require="0" name="ClientRedirectURL">
|
141
|
+
<pattern>^.{0,200}$</pattern>
|
142
|
+
</param>
|
143
|
+
</condparam>
|
144
|
+
<option>BARCODE</option>
|
145
|
+
<condparam owner="BARCODE">
|
146
|
+
<param type="Int" require="0" name="StoreExpireDate">
|
147
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
148
|
+
<maximum></maximum>
|
149
|
+
<minimal>1</minimal>
|
150
|
+
</param>
|
151
|
+
<param type="String" require="0" name="Desc_1">
|
152
|
+
<pattern>^.{0,20}$</pattern>
|
153
|
+
</param>
|
154
|
+
<param type="String" require="0" name="Desc_2">
|
155
|
+
<pattern>^.{0,20}$</pattern>
|
156
|
+
</param>
|
157
|
+
<param type="String" require="0" name="Desc_3">
|
158
|
+
<pattern>^.{0,20}$</pattern>
|
159
|
+
</param>
|
160
|
+
<param type="String" require="0" name="Desc_4">
|
161
|
+
<pattern>^.{0,20}$</pattern>
|
162
|
+
</param>
|
163
|
+
<param type="String" require="0" name="PaymentInfoURL">
|
164
|
+
<pattern>^.{0,200}$</pattern>
|
165
|
+
</param>
|
166
|
+
<param type="String" require="0" name="ClientRedirectURL">
|
167
|
+
<pattern>^.{0,200}$</pattern>
|
168
|
+
</param>
|
169
|
+
</condparam>
|
170
|
+
</param>
|
171
|
+
<param type="String" require="0" name="ClientBackURL">
|
172
|
+
<pattern>^.{0,200}$</pattern>
|
173
|
+
</param>
|
174
|
+
<param type="String" require="0" name="ItemURL">
|
175
|
+
<pattern>^.{0,200}$</pattern>
|
176
|
+
</param>
|
177
|
+
<param type="String" require="0" name="Remark">
|
178
|
+
<pattern>^.{0,100}$</pattern>
|
179
|
+
</param>
|
180
|
+
<param type="DepOpt" main="ChoosePayment" require="0" name="ChooseSubPayment">
|
181
|
+
<mainoption name="ATM">
|
182
|
+
<option>TAISHIN</option>
|
183
|
+
<option>ESUN</option>
|
184
|
+
<option>BOT</option>
|
185
|
+
<option>FUBON</option>
|
186
|
+
<option>CHINATRUST</option>
|
187
|
+
<option>FIRST</option>
|
188
|
+
<option>LAND</option>
|
189
|
+
<option>CATHAY</option>
|
190
|
+
<option>TACHONG</option>
|
191
|
+
</mainoption>
|
192
|
+
<mainoption name="WebATM">
|
193
|
+
<option>TAISHIN</option>
|
194
|
+
<option>ESUN</option>
|
195
|
+
<option>BOT</option>
|
196
|
+
<option>FUBON</option>
|
197
|
+
<option>CHINATRUST</option>
|
198
|
+
<option>FIRST</option>
|
199
|
+
<option>CATHAY</option>
|
200
|
+
<option>MEGA</option>
|
201
|
+
<option>LAND</option>
|
202
|
+
<option>TACHONG</option>
|
203
|
+
<option>SINOPAC</option>
|
204
|
+
</mainoption>
|
205
|
+
<mainoption name="CVS">
|
206
|
+
<option>CVS</option>
|
207
|
+
<option>OK</option>
|
208
|
+
<option>FAMILY</option>
|
209
|
+
<option>HILIFE</option>
|
210
|
+
<option>IBON</option>
|
211
|
+
</mainoption>
|
212
|
+
<mainoption name="BARCODE">
|
213
|
+
<option>BARCODE</option>
|
214
|
+
</mainoption>
|
215
|
+
</param>
|
216
|
+
<param type="String" require="0" name="OrderResultURL">
|
217
|
+
<pattern>^.{0,200}$</pattern>
|
218
|
+
</param>
|
219
|
+
<param type="Opt" require="0" name="NeedExtraPaidInfo">
|
220
|
+
<option>Y</option>
|
221
|
+
<option>N</option>
|
222
|
+
</param>
|
223
|
+
<param type="String" require="0" name="DeviceSource">
|
224
|
+
<pattern>^.{0,200}$</pattern>
|
225
|
+
</param>
|
226
|
+
<param type="String" require="0" name="IgnorePayment">
|
227
|
+
<pattern>^.{0,100}$</pattern>
|
228
|
+
</param>
|
229
|
+
<param type="String" require="0" name="PlatformID">
|
230
|
+
<pattern>^(\d{7,10}|)$</pattern>
|
231
|
+
</param>
|
232
|
+
<param type="String" require="0" name="InvoiceMark">
|
233
|
+
<option>Y</option>
|
234
|
+
<condparam owner="Y">
|
235
|
+
<param type="String" require="1" name="RelateNumber">
|
236
|
+
<pattern>^[\w_\-#$]{0,30}$</pattern>
|
237
|
+
</param>
|
238
|
+
<param type="String" require="1" name="CustomerID">
|
239
|
+
<pattern>^[\w_]{0,20}$</pattern>
|
240
|
+
</param>
|
241
|
+
<param type="String" require="1" name="CustomerIdentifier">
|
242
|
+
<pattern>^(\d{8}|)$</pattern>
|
243
|
+
</param>
|
244
|
+
<param type="String" require="1" name="CustomerName" urlencode="1">
|
245
|
+
<pattern>^.{0,20}$</pattern>
|
246
|
+
</param>
|
247
|
+
<param type="String" require="1" name="CustomerAddr" urlencode="1">
|
248
|
+
<pattern>^.{0,200}$</pattern>
|
249
|
+
</param>
|
250
|
+
<param type="String" require="1" name="CustomerPhone">
|
251
|
+
<pattern>^(\d{10,20}|)$</pattern>
|
252
|
+
</param>
|
253
|
+
<param type="String" require="1" name="CustomerEmail" urlencode="1">
|
254
|
+
<pattern>^.{0,200}$</pattern>
|
255
|
+
</param>
|
256
|
+
<param type="Opt" require="1" name="ClearanceMark">
|
257
|
+
<option>1</option>
|
258
|
+
<option>2</option>
|
259
|
+
<option></option>
|
260
|
+
</param>
|
261
|
+
<param type="Opt" require="1" name="TaxType">
|
262
|
+
<option>1</option>
|
263
|
+
<option>2</option>
|
264
|
+
<option>3</option>
|
265
|
+
<option>9</option>
|
266
|
+
</param>
|
267
|
+
<param type="Opt" require="1" name="CarruerType">
|
268
|
+
<option>1</option>
|
269
|
+
<option>2</option>
|
270
|
+
<option>3</option>
|
271
|
+
<option></option>
|
272
|
+
</param>
|
273
|
+
<param type="String" require="1" name="CarruerNum"> <!-- Patten of this column is defined in verification.rb???-->
|
274
|
+
<pattern>.{0,16}</pattern>
|
275
|
+
</param>
|
276
|
+
<param type="Opt" require="1" name="Donation">
|
277
|
+
<option>0</option>
|
278
|
+
<option>1</option>
|
279
|
+
</param>
|
280
|
+
<param type="String" require="1" name="LoveCode">
|
281
|
+
<pattern>^([Xx]\d{2,6}|\d{3,7}|)$</pattern>
|
282
|
+
</param>
|
283
|
+
<param type="Opt" require="1" name="Print">
|
284
|
+
<option>0</option>
|
285
|
+
<option>1</option>
|
286
|
+
</param>
|
287
|
+
<param type="String" require="1" name="InvoiceItemName" urlencode="1">
|
288
|
+
<pattern>^.{0,4096}$</pattern>
|
289
|
+
</param>
|
290
|
+
<param type="String" require="1" name="InvoiceItemCount">
|
291
|
+
<pattern>^[\d\|]{0,4096}$</pattern>
|
292
|
+
</param>
|
293
|
+
<param type="String" require="1" name="InvoiceItemWord" urlencode="1">
|
294
|
+
<pattern>^.{0,4096}$</pattern>
|
295
|
+
</param>
|
296
|
+
<param type="String" require="1" name="InvoiceItemPrice">
|
297
|
+
<pattern>^.{0,4096}$</pattern>
|
298
|
+
</param>
|
299
|
+
<param type="String" require="1" name="InvoiceItemTaxType">
|
300
|
+
<pattern>^.{0,4096}$</pattern>
|
301
|
+
</param>
|
302
|
+
<param type="String" require="1" name="InvoiceRemark" urlencode="1">
|
303
|
+
<pattern>^.{0,4096}$</pattern>
|
304
|
+
</param>
|
305
|
+
<param type="Int" require="1" name="DelayDay">
|
306
|
+
<mode>BETWEEN</mode>
|
307
|
+
<maximum>15</maximum>
|
308
|
+
<minimal>0</minimal>
|
309
|
+
</param>
|
310
|
+
<param type="Opt" require="1" name="InvType">
|
311
|
+
<option>07</option>
|
312
|
+
<option>08</option>
|
313
|
+
</param>
|
314
|
+
</condparam>
|
315
|
+
<option>N</option>
|
316
|
+
</param>
|
317
|
+
<param type="Opt" require="0" name="HoldTradeAMT">
|
318
|
+
<option>0</option>
|
319
|
+
<option>1</option>
|
320
|
+
</param>
|
321
|
+
<param type="Opt" require="1" name="EncryptType">
|
322
|
+
<option>1</option>
|
323
|
+
</param>
|
324
|
+
<param type="String" require="0" name="CustomField1">
|
325
|
+
<pattern>^.{0,50}$</pattern>
|
326
|
+
</param>
|
327
|
+
<param type="String" require="0" name="CustomField2">
|
328
|
+
<pattern>^.{0,50}$</pattern>
|
329
|
+
</param>
|
330
|
+
<param type="String" require="0" name="CustomField3">
|
331
|
+
<pattern>^.{0,50}$</pattern>
|
332
|
+
</param>
|
333
|
+
<param type="String" require="0" name="CustomField4">
|
334
|
+
<pattern>^.{0,50}$</pattern>
|
335
|
+
</param>
|
336
|
+
</Parameters>
|
337
|
+
</AioCheckOut>
|
338
|
+
<QueryTradeInfo>
|
339
|
+
<ServiceAddress>
|
340
|
+
<url type="Production">https://payment.ecpay.com.tw/Cashier/QueryTradeInfo/V5</url>
|
341
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/Cashier/QueryTradeInfo/V5</url>
|
342
|
+
</ServiceAddress>
|
343
|
+
<Config>
|
344
|
+
<switchparam>
|
345
|
+
</switchparam>
|
346
|
+
<optparam>
|
347
|
+
</optparam>
|
348
|
+
</Config>
|
349
|
+
<Parameters>
|
350
|
+
<param type="String" require="1" name="MerchantID">
|
351
|
+
<pattern>^\d{7,10}$</pattern>
|
352
|
+
</param>
|
353
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
354
|
+
<pattern>^\w{4,20}$</pattern>
|
355
|
+
</param>
|
356
|
+
<param type="String" require="1" name="TimeStamp">
|
357
|
+
<pattern>^\d{10}$</pattern>
|
358
|
+
</param>
|
359
|
+
<param type="String" require="0" name="PlatformID">
|
360
|
+
<pattern>^(\d{7,10}|)$</pattern>
|
361
|
+
</param>
|
362
|
+
</Parameters>
|
363
|
+
</QueryTradeInfo>
|
364
|
+
|
365
|
+
<QueryCreditCardPeriodInfo>
|
366
|
+
<ServiceAddress>
|
367
|
+
<url type="Production">https://payment.ecpay.com.tw/Cashier/QueryCreditCardPeriodInfo</url>
|
368
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/Cashier/QueryCreditCardPeriodInfo</url>
|
369
|
+
</ServiceAddress>
|
370
|
+
<Config>
|
371
|
+
<switchparam>
|
372
|
+
</switchparam>
|
373
|
+
<optparam>
|
374
|
+
</optparam>
|
375
|
+
</Config>
|
376
|
+
<Parameters>
|
377
|
+
<param type="String" require="1" name="MerchantID">
|
378
|
+
<pattern>^\d{7,10}$</pattern>
|
379
|
+
</param>
|
380
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
381
|
+
<pattern>^\w{4,20}$</pattern>
|
382
|
+
</param>
|
383
|
+
<param type="String" require="1" name="TimeStamp">
|
384
|
+
<pattern>^\d{10}$</pattern>
|
385
|
+
</param>
|
386
|
+
</Parameters>
|
387
|
+
</QueryCreditCardPeriodInfo>
|
388
|
+
|
389
|
+
<DoAction>
|
390
|
+
<ServiceAddress>
|
391
|
+
<url type="Production">https://payment.ecpay.com.tw/CreditDetail/DoAction</url>
|
392
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/CreditDetail/DoAction</url>
|
393
|
+
</ServiceAddress>
|
394
|
+
<Config>
|
395
|
+
<switchparam>
|
396
|
+
</switchparam>
|
397
|
+
<optparam>
|
398
|
+
</optparam>
|
399
|
+
</Config>
|
400
|
+
<Parameters>
|
401
|
+
<param type="String" require="1" name="MerchantID">
|
402
|
+
<pattern>^\d{7,10}$</pattern>
|
403
|
+
</param>
|
404
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
405
|
+
<pattern>^\w{4,20}$</pattern>
|
406
|
+
</param>
|
407
|
+
<param type="String" require="1" name="TradeNo">
|
408
|
+
<pattern>^\w{4,20}$</pattern>
|
409
|
+
</param>
|
410
|
+
<param type="Opt" require="1" name="Action">
|
411
|
+
<option>C</option>
|
412
|
+
<option>R</option>
|
413
|
+
<option>E</option>
|
414
|
+
<option>N</option>
|
415
|
+
</param>
|
416
|
+
<param type="Int" require="1" name="TotalAmount">
|
417
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
418
|
+
<maximum></maximum>
|
419
|
+
<minimal>1</minimal>
|
420
|
+
</param>
|
421
|
+
<param type="String" require="0" name="PlatformID">
|
422
|
+
<pattern>^(\d{7,10}|)$</pattern>
|
423
|
+
</param>
|
424
|
+
</Parameters>
|
425
|
+
</DoAction>
|
426
|
+
|
427
|
+
<Capture>
|
428
|
+
<ServiceAddress>
|
429
|
+
<url type="Production">https://payment.ecpay.com.tw/Cashier/Capture</url>
|
430
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/Cashier/Capture</url>
|
431
|
+
</ServiceAddress>
|
432
|
+
<Config>
|
433
|
+
<switchparam>
|
434
|
+
</switchparam>
|
435
|
+
<optparam>
|
436
|
+
</optparam>
|
437
|
+
</Config>
|
438
|
+
<Parameters>
|
439
|
+
<param type="String" require="1" name="MerchantID">
|
440
|
+
<pattern>^\d{7,10}$</pattern>
|
441
|
+
</param>
|
442
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
443
|
+
<pattern>^\w{4,20}$</pattern>
|
444
|
+
</param>
|
445
|
+
<param type="Int" require="1" name="CaptureAMT">
|
446
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
447
|
+
<maximum></maximum>
|
448
|
+
<minimal>0</minimal>
|
449
|
+
</param>
|
450
|
+
<param type="Int" require="1" name="UserRefundAMT">
|
451
|
+
<mode>GE</mode> <!--BETWEEN, GE, LE, EXCLUDE -->
|
452
|
+
<maximum></maximum>
|
453
|
+
<minimal>0</minimal>
|
454
|
+
</param>
|
455
|
+
<param type="String" require="0" name="PlatformID">
|
456
|
+
<pattern>^(\d{7,10}|)$</pattern>
|
457
|
+
</param>
|
458
|
+
<param type="String" require="0" name="Remark">
|
459
|
+
<pattern>^.{0,30}$</pattern>
|
460
|
+
</param>
|
461
|
+
</Parameters>
|
462
|
+
</Capture>
|
463
|
+
|
464
|
+
<TradeNoAio>
|
465
|
+
<ServiceAddress>
|
466
|
+
<url type="Production">https://vendor.ecpay.com.tw/PaymentMedia/TradeNoAio</url>
|
467
|
+
<url type="Test">https://vendor-stage.ecpay.com.tw/PaymentMedia/TradeNoAio</url>
|
468
|
+
</ServiceAddress>
|
469
|
+
<Config>
|
470
|
+
<switchparam>
|
471
|
+
</switchparam>
|
472
|
+
<optparam>
|
473
|
+
</optparam>
|
474
|
+
</Config>
|
475
|
+
<Parameters>
|
476
|
+
<param type="String" require="1" name="MerchantID">
|
477
|
+
<pattern>^\d{7,10}$</pattern>
|
478
|
+
</param>
|
479
|
+
<param type="Opt" require="1" name="DateType">
|
480
|
+
<option>2</option>
|
481
|
+
<option>4</option>
|
482
|
+
<option>5</option>
|
483
|
+
<option>6</option>
|
484
|
+
</param>
|
485
|
+
<param type="String" require="1" name="BeginDate">
|
486
|
+
<pattern>^\d{4}-\d{2}-\d{2}</pattern>
|
487
|
+
</param>
|
488
|
+
<param type="String" require="1" name="EndDate">
|
489
|
+
<pattern>^\d{4}-\d{2}-\d{2}</pattern>
|
490
|
+
</param>
|
491
|
+
<param type="Opt" require="0" name="PaymentType">
|
492
|
+
<option>01</option>
|
493
|
+
<option>02</option>
|
494
|
+
<option>03</option>
|
495
|
+
<option>04</option>
|
496
|
+
<option>07</option>
|
497
|
+
<option>08</option>
|
498
|
+
<option>09</option>
|
499
|
+
</param>
|
500
|
+
<param type="Opt" require="0" name="PlatformStatus">
|
501
|
+
<option>1</option>
|
502
|
+
<option>2</option>
|
503
|
+
</param>
|
504
|
+
<param type="Opt" require="0" name="PaymentStatus">
|
505
|
+
<option>0</option>
|
506
|
+
<option>1</option>
|
507
|
+
<option>2</option>
|
508
|
+
</param>
|
509
|
+
<param type="Opt" require="0" name="AllocateStatus">
|
510
|
+
<option>0</option>
|
511
|
+
<option>1</option>
|
512
|
+
</param>
|
513
|
+
<param type="Opt" require="1" name="MediaFormated">
|
514
|
+
<option>0</option>
|
515
|
+
<option>1</option>
|
516
|
+
</param>
|
517
|
+
</Parameters>
|
518
|
+
</TradeNoAio>
|
519
|
+
|
520
|
+
<QueryTradeV2>
|
521
|
+
<ServiceAddress>
|
522
|
+
<url type="Production">https://payment.ecpay.com.tw/CreditDetail/QueryTrade/V2</url>
|
523
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/CreditDetail/QueryTrade/V2</url>
|
524
|
+
</ServiceAddress>
|
525
|
+
<Config>
|
526
|
+
<switchparam>
|
527
|
+
</switchparam>
|
528
|
+
<optparam>
|
529
|
+
</optparam>
|
530
|
+
</Config>
|
531
|
+
<Parameters>
|
532
|
+
<param type="String" require="1" name="MerchantID">
|
533
|
+
<pattern>^\d{7,10}$</pattern>
|
534
|
+
</param>
|
535
|
+
<param type="String" require="1" name="CreditRefundId">
|
536
|
+
<pattern>^\w{4,20}$</pattern>
|
537
|
+
</param>
|
538
|
+
<param type="Int" require="1" name="CreditAmount">
|
539
|
+
<mode>GE</mode>
|
540
|
+
<maximum></maximum>
|
541
|
+
<minimal>1</minimal>
|
542
|
+
</param>
|
543
|
+
<param type="String" require="1" name="CreditCheckCode">
|
544
|
+
<pattern>^\d{7,10}$</pattern>
|
545
|
+
</param>
|
546
|
+
</Parameters>
|
547
|
+
</QueryTradeV2>
|
548
|
+
|
549
|
+
<FundingReconDetail>
|
550
|
+
<ServiceAddress>
|
551
|
+
<url type="Production">https://payment.ecpay.com.tw/CreditDetail/FundingReconDetail</url>
|
552
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/CreditDetail/FundingReconDetail</url>
|
553
|
+
</ServiceAddress>
|
554
|
+
<Config>
|
555
|
+
<switchparam>
|
556
|
+
</switchparam>
|
557
|
+
<optparam>
|
558
|
+
</optparam>
|
559
|
+
</Config>
|
560
|
+
<Parameters>
|
561
|
+
<param type="String" require="1" name="MerchantID">
|
562
|
+
<pattern>^\d{7,10}$</pattern>
|
563
|
+
</param>
|
564
|
+
<param type="Opt" require="1" name="PayDateType">
|
565
|
+
<option>fund</option>
|
566
|
+
<option>close</option>
|
567
|
+
<option>enter</option>
|
568
|
+
</param>
|
569
|
+
<param type="String" require="1" name="StartDate">
|
570
|
+
<pattern>^\d{4}-\d{2}-\d{2}$</pattern>
|
571
|
+
</param>
|
572
|
+
<param type="String" require="1" name="EndDate">
|
573
|
+
<pattern>^\d{4}-\d{2}-\d{2}$</pattern>
|
574
|
+
</param>
|
575
|
+
</Parameters>
|
576
|
+
</FundingReconDetail>
|
577
|
+
|
578
|
+
<CreateServerOrder>
|
579
|
+
<ServiceAddress>
|
580
|
+
<url type="Production">https://payment.ecpay.com.tw/ApplePay/CreateServerOrder/V2</url>
|
581
|
+
<url type="Test">https://payment-stage.ecpay.com.tw/ApplePay/CreateServerOrder/V2</url>
|
582
|
+
</ServiceAddress>
|
583
|
+
<Config>
|
584
|
+
<switchparam>
|
585
|
+
</switchparam>
|
586
|
+
</Config>
|
587
|
+
<Parameters>
|
588
|
+
<param type="String" require="1" name="MerchantID">
|
589
|
+
<pattern>^\d{7,10}$</pattern>
|
590
|
+
</param>
|
591
|
+
<param type="String" require="1" name="MerchantTradeNo">
|
592
|
+
<pattern>^\w{4,20}$</pattern>
|
593
|
+
</param>
|
594
|
+
<param type="String" require="1" name="MerchantTradeDate">
|
595
|
+
<pattern>^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$</pattern>
|
596
|
+
</param>
|
597
|
+
<param type="Int" require="1" name="TotalAmount">
|
598
|
+
<mode>GE</mode> <!-- BETWEEN, GE, LE, EXCLUDE -->
|
599
|
+
<maximum></maximum>
|
600
|
+
<minimal>1</minimal>
|
601
|
+
</param>
|
602
|
+
<param type="String" require="1" name="CurrencyCode">
|
603
|
+
<pattern>^\w{2,20}$</pattern>
|
604
|
+
</param>
|
605
|
+
<param type="String" require="1" name="ItemName">
|
606
|
+
<pattern>^.{0,200}$</pattern>
|
607
|
+
</param>
|
608
|
+
<param type="String" require="1" name="PlatformID">
|
609
|
+
<pattern>^(\d{7,10}|)$</pattern>
|
610
|
+
</param>
|
611
|
+
<param type="String" require="1" name="TradeDesc">
|
612
|
+
<pattern>^.{0,200}$</pattern>
|
613
|
+
</param>
|
614
|
+
<param type="Opt" require="1" name="TradeType">
|
615
|
+
<option>1</option> <!-- In App -->
|
616
|
+
<option>2</option> <!-- On the Web -->
|
617
|
+
</param>
|
618
|
+
<param type="String" require="1" name="PaymentToken">
|
619
|
+
<pattern>.</pattern>
|
620
|
+
</param>
|
621
|
+
</Parameters>
|
622
|
+
</CreateServerOrder>
|
623
|
+
</ECPayPayment>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Hash
|
2
|
+
def stringify_keys
|
3
|
+
result = self.class.new
|
4
|
+
orig_key_len = keys.length()
|
5
|
+
each_key do |key|
|
6
|
+
result[key.to_s] = self[key]
|
7
|
+
end
|
8
|
+
unless result.keys.length() == orig_key_len
|
9
|
+
raise "Duplicate key name during convertion, there might be symbol & string key with the same name."
|
10
|
+
end
|
11
|
+
return result
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module ECpayErrorDefinition
|
2
|
+
# Generic Allpay exception class.
|
3
|
+
class ECpayError < StandardError; end
|
4
|
+
class ECpayMissingOption < ECpayError; end
|
5
|
+
class ECpayInvalidMode < ECpayError; end
|
6
|
+
class ECpayInvalidParam < ECpayError; end
|
7
|
+
class ECpayInvoiceRuleViolate < ECpayError; end
|
8
|
+
end
|