newebpay-turbo 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +7 -7
- data/lib/generators/newebpay/templates/initializer.rb +33 -33
- data/lib/newebpay/config.rb +39 -3
- data/lib/newebpay/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ec5cef0b04c6f588041466802fd8137959e454bbede928338ef52217717c58f
|
4
|
+
data.tar.gz: 45bf0d3c5751f6e62a55c9737489fd8b2b1d99c69adc6b00f3f4f7f2a01715d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bcaf5370831941fbea8fee5a1a1268271644b79ce1825e8ccc1167f25be436a15cb4160dcdc44b38d1271f6fb8a5ad0feec8a092d2dd72c0e85b16a6b82c374
|
7
|
+
data.tar.gz: 170710871730c56bd4d05a3793c54984f9379226dd90d75749074ff2f75815fb4e7a76fd4ff7b64acbfc1efc71c4287cb3518d65aae294254bd09d2d05823996
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Robeeerto
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Online payment processing for internet businesses by newebpay from Taiwan
|
|
21
21
|
|
22
22
|
目前這個 Gem 只在 Rails 專案內支援,故安裝方式請放在 `Gemfile` 內
|
23
23
|
|
24
|
-
`gem 'newebpay-turbo', '~> 0.
|
24
|
+
`gem 'newebpay-turbo', '~> 0.7.0'`
|
25
25
|
|
26
26
|
`bundle install`
|
27
27
|
|
@@ -36,12 +36,12 @@ Online payment processing for internet businesses by newebpay from Taiwan
|
|
36
36
|
下列為必填參數,不然會造成錯誤
|
37
37
|
|
38
38
|
```
|
39
|
-
config.
|
40
|
-
config.
|
41
|
-
config.
|
42
|
-
config.
|
43
|
-
config.version
|
44
|
-
config.
|
39
|
+
config.merchant_id = nil # 建議使用環境變數帶入
|
40
|
+
config.hash_key = nil # 建議使用環境變數帶入
|
41
|
+
config.hash_iv = nil # 建議使用環境變數帶入
|
42
|
+
config.respond_type = 'JSON'
|
43
|
+
config.version = '2.0'
|
44
|
+
config.login_type = 0
|
45
45
|
...
|
46
46
|
```
|
47
47
|
|
@@ -6,104 +6,104 @@ Newebpay.configure do |config|
|
|
6
6
|
# ====================
|
7
7
|
|
8
8
|
# Puts your MerchantID/HashKey/HashIV in environment variable
|
9
|
-
config.
|
10
|
-
config.
|
11
|
-
config.
|
9
|
+
config.merchant_id = nil
|
10
|
+
config.hash_key = nil
|
11
|
+
config.hash_iv = nil
|
12
12
|
|
13
13
|
# Currently this gem only supports JSON format
|
14
|
-
config.
|
14
|
+
config.respond_type = 'JSON'
|
15
15
|
|
16
16
|
# Newebpay api version
|
17
17
|
config.version = '2.0'
|
18
18
|
|
19
19
|
# 0 = No login required for newebpay, 1 = Must login to newebpay
|
20
|
-
config.
|
20
|
+
config.login_type = 0
|
21
21
|
|
22
22
|
# ====================
|
23
23
|
# non-required parameters
|
24
24
|
# ====================
|
25
25
|
|
26
26
|
# The default language is zh-tw, you can also change it to en or jp
|
27
|
-
# config.
|
27
|
+
# config.lang_type = ''
|
28
28
|
|
29
29
|
# Accept integer format only, 0 means not enabled, maximum seconds is 900, minimum is 60
|
30
|
-
# config.
|
30
|
+
# config.trade_limit = 0
|
31
31
|
|
32
32
|
# Paydeadline, accept varchar format only, maximum accepted 180 days
|
33
|
-
# config.
|
33
|
+
# config.expire_date = ''
|
34
34
|
|
35
35
|
# The URL returned when payment is completed, method: :post
|
36
|
-
# config.
|
36
|
+
# config.return_url = ''
|
37
37
|
|
38
38
|
# The URL ending payment information by asynchronous, method: :post
|
39
|
-
# config.
|
39
|
+
# config.notify_url = ''
|
40
40
|
|
41
41
|
# The URL of the numbering system, method: :post
|
42
|
-
# config.
|
42
|
+
# config.customer_url = ''
|
43
43
|
|
44
44
|
# Return button URL on the newebpay page
|
45
|
-
# config.
|
45
|
+
# config.client_back_url = ''
|
46
46
|
|
47
47
|
# Email open for modification or not, 0 means not enabled, 1 means enabled
|
48
|
-
# config.
|
48
|
+
# config.email_modify = 0
|
49
49
|
|
50
50
|
# Credit card lump sum, 0 means not enabled, 1 means enabled
|
51
|
-
# config.
|
51
|
+
# config.credit = 0
|
52
52
|
|
53
53
|
# Android Pay, 0 means not enabled, 1 means enabled
|
54
|
-
# config.
|
54
|
+
# config.android_pay = 0
|
55
55
|
|
56
56
|
# Samsung Pay, 0 means not enabled, 1 means enabled
|
57
|
-
# config.
|
57
|
+
# config.samsung_pay = 0
|
58
58
|
|
59
59
|
# LINEPAY, 0 means not enabled, 1 means enabled
|
60
|
-
# config.
|
60
|
+
# config.line_pay = 0
|
61
61
|
|
62
62
|
# LINEPAY Product image URL, only accept varchar
|
63
|
-
# config.
|
63
|
+
# config.image_url = ''
|
64
64
|
|
65
65
|
# Credit card pay in installments, only accept varchar, 1 means open all options, 0 means not enabled, example: '3,6,12' means open 3 & 6 & 12 installments etc.
|
66
|
-
# config.
|
66
|
+
# config.inst_flag = '0'
|
67
67
|
|
68
68
|
# Credit card bonus, 0 means not enabled, 1 means enabled
|
69
|
-
# config.
|
69
|
+
# config.credit_red = 0
|
70
70
|
|
71
71
|
# UNIONPAY, 0 means not enabled, 1 means enabled
|
72
|
-
# config.
|
72
|
+
# config.union_pay = 0
|
73
73
|
|
74
74
|
# WEBATM, 0 means not enabled, 1 means enabled, maximum amount is 50,000 NTD
|
75
|
-
# config.
|
75
|
+
# config.web_atm = 0
|
76
76
|
|
77
77
|
# Transfer money, 0 means not enabled, 1 means enabled, maximum amount is 50,000 NTD
|
78
|
-
# config.
|
78
|
+
# config.vacc = 0
|
79
79
|
|
80
80
|
# Financial institutions can be designated, example: 'BOT,Taishin' etc.
|
81
|
-
# config.
|
81
|
+
# config.bank_type = ''
|
82
82
|
|
83
83
|
# Supermarket codes payment, 0 means not enabled, 1 means enabled, maximum amount is 20,000 NTD, minimum amount is 30 NTD
|
84
|
-
# config.
|
84
|
+
# config.cvs = 0
|
85
85
|
|
86
86
|
# Supermarket barcode payment, 0 means not enabled, 1 means enabled, maximum amount is 40,000 NTD, minimum amount is 20 NTD
|
87
|
-
# config.
|
87
|
+
# config.bar_code = 0
|
88
88
|
|
89
89
|
# Esum Wallet, 0 means not enabled, 1 means enabled
|
90
|
-
# config.
|
90
|
+
# config.esun_wallet = 0
|
91
91
|
|
92
92
|
# Taiwan pay, 0 means not enabled, 1 means enabled
|
93
|
-
# config.
|
93
|
+
# config.taiwan_pay = 0
|
94
94
|
|
95
95
|
# Logistics Activation, 1 means Pickup without payment, 2 means Pickup with payment, 3 means both
|
96
|
-
# config.
|
96
|
+
# config.cvscom = 0
|
97
97
|
|
98
98
|
# EZPay, 0 means not enabled, 1 means enabled
|
99
|
-
# config.
|
99
|
+
# config.ez_pay = 0
|
100
100
|
|
101
101
|
# EZWechat Pay, 0 means not enabled, 1 means enabled
|
102
|
-
# config.
|
102
|
+
# config.ezp_wechat = 0
|
103
103
|
|
104
104
|
# EZPali Pay, 0 means not enabled, 1 means enabled
|
105
|
-
# config.
|
105
|
+
# config.ezp_ali_pay = 0
|
106
106
|
|
107
107
|
# Logistics Type, only accpet varchar, 'B2C' and 'C2C'
|
108
|
-
# config.
|
108
|
+
# config.lgs_type = ''
|
109
109
|
end
|
data/lib/newebpay/config.rb
CHANGED
@@ -41,12 +41,48 @@ module Newebpay
|
|
41
41
|
LgsType
|
42
42
|
].freeze
|
43
43
|
|
44
|
+
MAPPING_TABLE = {
|
45
|
+
MerchantID: 'merchant_id',
|
46
|
+
HashKey: 'hash_key',
|
47
|
+
HashIV: 'hash_iv',
|
48
|
+
RespondType: 'respond_type',
|
49
|
+
Version: 'version',
|
50
|
+
LangType: 'lang_type',
|
51
|
+
TradeLimit: 'trade_limit',
|
52
|
+
ExpireDate: 'expire_date',
|
53
|
+
ReturnURL: 'return_url',
|
54
|
+
NotifyURL: 'notify_url',
|
55
|
+
CustomerURL: 'customer_url',
|
56
|
+
ClientBackURL: 'client_back_url',
|
57
|
+
EmailModify: 'email_modify',
|
58
|
+
LoginType: 'login_type',
|
59
|
+
CREDIT: 'credit',
|
60
|
+
ANDROIDPAY: 'android_pay',
|
61
|
+
SAMSUNGPAY: 'samsung_pay',
|
62
|
+
LINEPAY: 'line_pay',
|
63
|
+
ImageUrl: 'image_url',
|
64
|
+
InstFlag: 'inst_flag',
|
65
|
+
CreditRed: 'credit_red',
|
66
|
+
UNIONPAY: 'union_pay',
|
67
|
+
WEBATM: 'web_atm',
|
68
|
+
VACC: 'vacc',
|
69
|
+
BankType: 'bank_type',
|
70
|
+
CVS: 'cvs',
|
71
|
+
BARCODE: 'bar_code',
|
72
|
+
ESUNWALLET: 'esun_wallet',
|
73
|
+
TAIWANPAY: 'taiwan_pay',
|
74
|
+
CVSCOM: 'cvscom',
|
75
|
+
EZPAY: 'ez_pay',
|
76
|
+
EZPWECHAT: 'ezp_wechat',
|
77
|
+
EZPALIPAY: 'ezp_ali_pay',
|
78
|
+
LgsType: 'lgs_type'
|
79
|
+
}.freeze
|
80
|
+
|
44
81
|
self.options = {}.with_indifferent_access
|
45
82
|
|
46
83
|
OPTIONS.each do |option|
|
47
|
-
|
48
|
-
|
49
|
-
define_method("#{duped_option}=") do |value|
|
84
|
+
transfer_option = MAPPING_TABLE[:"#{option}"]
|
85
|
+
define_method("#{transfer_option}=") do |value|
|
50
86
|
options[option] = value
|
51
87
|
end
|
52
88
|
end
|
data/lib/newebpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newebpay-turbo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RobertChang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Online payment processing for internet businesses by newebpay from Taiwan
|
14
14
|
email:
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- ".rspec"
|
21
21
|
- ".rubocop.yml"
|
22
22
|
- Gemfile
|
23
|
+
- LICENSE
|
23
24
|
- README.md
|
24
25
|
- Rakefile
|
25
26
|
- lib/generators/newebpay/helpers.rb
|