active_merchant_spgateway 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -0
- data/active_merchant_spgateway.gemspec +5 -4
- data/lib/active_merchant_spgateway.rb +1 -0
- data/lib/active_merchant_spgateway/version.rb +1 -1
- data/lib/offsite_payments/integrations/spgateway/helper.rb +1 -1
- data/lib/offsite_payments/integrations/spgateway/notification.rb +11 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f687d8f4c8c0f658720f9508db7c1978118b1c2
|
4
|
+
data.tar.gz: 12fec891fc8b8e3a8b98fe70f0d83e4848b189c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e28cfa362b7a06d7de47c2864dd39e7af73ea68d061422982377b0b5d439ec12afbeaded19c2f128d5db22fe03b4a757a0fe6ec3d1d61c53994358aa007dfb9
|
7
|
+
data.tar.gz: 814e386b37e61776b037dad684ebdb9404389077722b552a222177c74d40288e2d24bb71c087c68b3fb6f18fd64eb5e5d2a53261e076576d662a488f36efba7f
|
data/README.md
CHANGED
@@ -49,6 +49,26 @@ end
|
|
49
49
|
|
50
50
|
## Example
|
51
51
|
|
52
|
+
- Standard
|
53
|
+
|
54
|
+
```
|
55
|
+
<% payment_service_for @order,
|
56
|
+
@order.user.email,
|
57
|
+
service: :spgateway,
|
58
|
+
html: { :id => 'spgateway-form', :method => :post } do |service| %>
|
59
|
+
<% service.time_stamp @order.created_at %>
|
60
|
+
<% service.merchant_order_no @order.id %>
|
61
|
+
<% service.amt @order.total_amount.to_i %>
|
62
|
+
<% service.item_desc @order.description %>
|
63
|
+
<% service.email @order.user.email %>
|
64
|
+
<% service.login_type 0 %>
|
65
|
+
<% service.encrypted_data %>
|
66
|
+
<%= submit_tag '付款' %>
|
67
|
+
<% end %>
|
68
|
+
```
|
69
|
+
|
70
|
+
- Credit card agreement
|
71
|
+
|
52
72
|
```
|
53
73
|
<% payment_service_for @order,
|
54
74
|
@order.user.email,
|
@@ -60,6 +80,8 @@ end
|
|
60
80
|
<% service.item_desc @order.description %>
|
61
81
|
<% service.email @order.user.email %>
|
62
82
|
<% service.login_type 0 %>
|
83
|
+
<% service.creditagreement 1 %>
|
84
|
+
<% service.token_term billing.merchant_id %>
|
63
85
|
<% service.encrypted_data %>
|
64
86
|
<%= submit_tag '付款' %>
|
65
87
|
<% end %>
|
@@ -6,12 +6,12 @@ require 'active_merchant_spgateway/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "active_merchant_spgateway"
|
8
8
|
spec.version = ActiveMerchantSpgateway::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Eddie Li"]
|
10
|
+
spec.email = ["eddie@super-landing.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{spgateway (智付通)
|
12
|
+
spec.summary = %q{ActiveMerchant x spgateway (智付通)}
|
13
13
|
spec.description = %q{This gem integrate Rails with spgateway (智付通).}
|
14
|
-
spec.homepage = "https://github.com/
|
14
|
+
spec.homepage = "https://github.com/superlanding/active_merchant_spgateway"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency 'activemerchant', '~> 1.50'
|
23
|
+
spec.add_dependency 'money'
|
23
24
|
spec.add_dependency 'offsite_payments', '~> 2'
|
24
25
|
|
25
26
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
@@ -9,7 +9,7 @@ module OffsitePayments #:nodoc:
|
|
9
9
|
MerchantID LangType MerchantOrderNo Amt ItemDesc TradeLimit
|
10
10
|
ExpireDate ReturnURL NotifyURL CustomerURL ClientBackURL Email
|
11
11
|
EmailModify LoginType OrderComment CREDIT CreditRed InstFlag UNIONPAY
|
12
|
-
WEBATM VACC CVS BARCODE CUSTOM TokenTerm
|
12
|
+
WEBATM VACC CVS BARCODE CUSTOM TokenTerm CREDITAGREEMENT TokenLife
|
13
13
|
)
|
14
14
|
|
15
15
|
FIELDS.each do |field|
|
@@ -8,7 +8,7 @@ module OffsitePayments #:nodoc:
|
|
8
8
|
PARAMS_FIELDS = %w(
|
9
9
|
Status Message MerchantID Amt TradeNo MerchantOrderNo PaymentType RespondType CheckCode PayTime IP
|
10
10
|
EscrowBank TokenUseStatus RespondCode Auth Card6No Card4No Inst InstFirst InstEach ECI PayBankCode
|
11
|
-
PayerAccount5Code CodeNo BankCode Barcode_1 Barcode_2 Barcode_3 ExpireDate CheckCode
|
11
|
+
PayerAccount5Code CodeNo BankCode Barcode_1 Barcode_2 Barcode_3 ExpireDate CheckCode TokenValue TokenLife
|
12
12
|
)
|
13
13
|
|
14
14
|
PARAMS_FIELDS.each do |field|
|
@@ -56,6 +56,16 @@ module OffsitePayments #:nodoc:
|
|
56
56
|
hash_raw_data = "HashIV=#{hash_iv}&#{raw_data}&HashKey=#{hash_key}"
|
57
57
|
Digest::SHA256.hexdigest(hash_raw_data).upcase == check_code
|
58
58
|
end
|
59
|
+
|
60
|
+
# 是否為約定信用卡授權首次交易
|
61
|
+
def credit_card_agreement_first_trade?
|
62
|
+
token_use_status == "1"
|
63
|
+
end
|
64
|
+
|
65
|
+
# 是否為信用卡授權 token 交易
|
66
|
+
def credit_card_agreement_token_trade?
|
67
|
+
token_use_status.blank? && token_life.present?
|
68
|
+
end
|
59
69
|
end
|
60
70
|
end
|
61
71
|
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_merchant_spgateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Eddie Li
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.50'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: money
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: offsite_payments
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,7 +102,7 @@ dependencies:
|
|
88
102
|
version: '5'
|
89
103
|
description: This gem integrate Rails with spgateway (智付通).
|
90
104
|
email:
|
91
|
-
-
|
105
|
+
- eddie@super-landing.com
|
92
106
|
executables: []
|
93
107
|
extensions: []
|
94
108
|
extra_rdoc_files: []
|
@@ -111,7 +125,7 @@ files:
|
|
111
125
|
- lib/offsite_payments/integrations/spgateway.rb
|
112
126
|
- lib/offsite_payments/integrations/spgateway/helper.rb
|
113
127
|
- lib/offsite_payments/integrations/spgateway/notification.rb
|
114
|
-
homepage: https://github.com/
|
128
|
+
homepage: https://github.com/superlanding/active_merchant_spgateway
|
115
129
|
licenses:
|
116
130
|
- MIT
|
117
131
|
metadata: {}
|
@@ -134,5 +148,5 @@ rubyforge_project:
|
|
134
148
|
rubygems_version: 2.4.8
|
135
149
|
signing_key:
|
136
150
|
specification_version: 4
|
137
|
-
summary: spgateway (智付通)
|
151
|
+
summary: ActiveMerchant x spgateway (智付通)
|
138
152
|
test_files: []
|