transact_pro 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -5
- data/lib/transact_pro/gateway.rb +10 -5
- data/lib/transact_pro/version.rb +1 -1
- data/lib/transact_pro.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 489d0c8023577678e52bab6119b2752c195e71b0
|
4
|
+
data.tar.gz: f0e4f7c450dfa3ad7bad504d4aba575e8f240fee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce087a2af93f2850fe44c5ac06c4c86cdc2f1acccb399c08c3d36291a8806dd9742b3f9d649b61bd9971afa79a2562aa639ff88c15dcb51a4b191a6c61ba2d3
|
7
|
+
data.tar.gz: 99e49fd89f9e81c6ca614a2181d16f7c634fdd3aa76486ab924eceb6b5783e5ae268367cdbaa05a6a548aaa6a1812f9d1b4825c1a1befda45a9f69903033d291
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
Lightweight Ruby wrapper for communicating with TransactPro 1stpayments.net card payment API.
|
7
7
|
|
8
8
|
### What can this gem do?
|
9
|
-
Currently core functionality is supported - single and recurring SMS payments with card details entered gateway-side (zero hassle with [PCI compliance](https://www.pcisecuritystandards.org)), and payment outcome check request.
|
9
|
+
Currently core functionality is supported - single and recurring SMS payments with card details entered gateway-side or with HostedFields approach (zero hassle with [PCI compliance](https://www.pcisecuritystandards.org)), and payment outcome check request.
|
10
10
|
As of v1.0.0 (2018-01-04) the full functionality status list is:
|
11
11
|
|
12
12
|
| Functionality | method name | Page in doc | Support in gem | response data |
|
@@ -62,15 +62,22 @@ To this end, initialize gateway instances like so:
|
|
62
62
|
|
63
63
|
```rb
|
64
64
|
options = {
|
65
|
-
TEST: false, # defaults to false, pass `true` if you want the gem to make requests to the sandbox endpoints
|
66
|
-
API_URI: "https://something.new" # gem has the endpoint uri in defaults, you may only need this if the domains used suddeny change
|
65
|
+
TEST: false, # defaults to false, pass `true` if you want the gem to make requests to the sandbox endpoints
|
67
66
|
GUID: "CAZY-7319-WI00-0C40", # mandatory
|
68
67
|
PASSWORD: "g44B/pAENO2E", # mandatory
|
69
68
|
ACCOUNT_3D: "CS01", # default routing string of Account to be used for 3D transactions
|
70
69
|
ACCOUNT_NON3D: "CS02", # default routing string of Account to be used for non-3D transactions
|
71
70
|
ACCOUNT_RECURRING: "CS03", # default routing string of Account to be used for recurring payment execution
|
72
|
-
|
73
|
-
|
71
|
+
|
72
|
+
# The gem has the environment-specific endpoint uris in defaults,
|
73
|
+
# you may only need this if the domains used by TransactPro suddenly change
|
74
|
+
API_URI: "https://something.new",
|
75
|
+
HOSTED_FIELDS_JS_URI: "https://something.new",
|
76
|
+
HOSTED_FIELDS_SUBMIT_URI: "https://something.new",
|
77
|
+
|
78
|
+
# You can specify return urls with path portions different from the ones in TransactPro account settings.
|
79
|
+
custom_return_url: "https://www.example.com/pay/transactpro/response?merchant_transaction_id=ZZZZZZZ", # can be overridden in transaction init request
|
80
|
+
custom_callback_url: "https://www.example.com/pay/transactpro/response?merchant_transaction_id=ZZZZZZZ", # can be overridden in transaction init request
|
74
81
|
}
|
75
82
|
|
76
83
|
gateway = TransactPro::Gateway.new(options)
|
data/lib/transact_pro/gateway.rb
CHANGED
@@ -8,23 +8,28 @@ class TransactPro::Gateway
|
|
8
8
|
|
9
9
|
@options = {
|
10
10
|
TEST: test,
|
11
|
-
API_URI: TransactPro::DEFAULTS[env_key][:API_URI],
|
12
11
|
pwd: Digest::SHA1.hexdigest(options[:PASSWORD].to_s),
|
13
12
|
guid: options[:GUID].to_s
|
14
|
-
}
|
13
|
+
}.merge(TransactPro::DEFAULTS[env_key])
|
15
14
|
|
16
15
|
@options.merge!(options)
|
17
16
|
|
18
17
|
unless @options[:GUID].to_s[%r'\A(?:\w){4}-(?:\w){4}-(?:\w){4}-(?:\w){4}\z']
|
19
|
-
raise ArgumentError.new(
|
18
|
+
raise ArgumentError.new(
|
19
|
+
"'#{@options[:GUID]}' is not a valid GUID for a gateway"
|
20
|
+
)
|
20
21
|
end
|
21
22
|
|
22
23
|
unless @options[:PASSWORD].to_s.size > 0
|
23
|
-
raise ArgumentError.new(
|
24
|
+
raise ArgumentError.new(
|
25
|
+
"'#{@options[:PASSWORD]}' is not a valid PASSWORD for a gateway"
|
26
|
+
)
|
24
27
|
end
|
25
28
|
|
26
29
|
if @options[:ACCOUNT_3D].to_s.size < 1 && @options[:ACCOUNT_NON3D].to_s.size < 1
|
27
|
-
raise ArgumentError.new(
|
30
|
+
raise ArgumentError.new(
|
31
|
+
"As a minimum specify a ACCOUNT_3D or a ACCOUNT_NON3D for a gateway"
|
32
|
+
)
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
data/lib/transact_pro/version.rb
CHANGED
data/lib/transact_pro.rb
CHANGED
@@ -13,10 +13,14 @@ module TransactPro
|
|
13
13
|
DEFAULTS = {
|
14
14
|
TEST: false,
|
15
15
|
PRODUCTION_ENV: {
|
16
|
-
API_URI: "https://www2.1stpayments.net/gwprocessor2.php"
|
16
|
+
API_URI: "https://www2.1stpayments.net/gwprocessor2.php",
|
17
|
+
HOSTED_FIELDS_JS_URI: "https://www2.1stpayments.net/hostedfields/hosted-fields-1.0.5.js",
|
18
|
+
HOSTED_FIELDS_SUBMIT_URI: "https://www2.1stpayments.net",
|
17
19
|
},
|
18
20
|
TEST_ENV: {
|
19
|
-
API_URI: "https://gw2sandbox.tpro.lv:8443/gw2test/gwprocessor2.php"
|
21
|
+
API_URI: "https://gw2sandbox.tpro.lv:8443/gw2test/gwprocessor2.php",
|
22
|
+
HOSTED_FIELDS_JS_URI: "https://gw2sandbox.tpro.lv:8443/gw2test/hostedfields/hosted-fields-1.0.5.js",
|
23
|
+
HOSTED_FIELDS_SUBMIT_URI: "https://gw2sandbox.tpro.lv:8443/gw2test",
|
20
24
|
}
|
21
25
|
}.freeze
|
22
26
|
|