transact_pro 0.9.1 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea2547ebfc5653b2be09521f5bf08f9b549087f9
4
- data.tar.gz: b574d8c300e908ca5c44cb77068f097ae29c10c9
3
+ metadata.gz: 489d0c8023577678e52bab6119b2752c195e71b0
4
+ data.tar.gz: f0e4f7c450dfa3ad7bad504d4aba575e8f240fee
5
5
  SHA512:
6
- metadata.gz: 6d92cea0402398bee8ee3624e676886767492b0f6abfc03c50ca5f24ff1fab1cf7904b1955b26527b4fb8c9b57caa29f39dbc4e7f59068b40e36196f23724361
7
- data.tar.gz: ef18c075501d2eba2a8a33e5edf5a56f9673cc7d63a2dc5cc111b35c6a7f6007bf37267f784bd8e9f657b7ea4b46a0e38c22d08330553a1b5535d1e4e54f2bc4
6
+ metadata.gz: 4ce087a2af93f2850fe44c5ac06c4c86cdc2f1acccb399c08c3d36291a8806dd9742b3f9d649b61bd9971afa79a2562aa639ff88c15dcb51a4b191a6c61ba2d3
7
+ data.tar.gz: 99e49fd89f9e81c6ca614a2181d16f7c634fdd3aa76486ab924eceb6b5783e5ae268367cdbaa05a6a548aaa6a1812f9d1b4825c1a1befda45a9f69903033d291
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transact_pro (0.9.1)
4
+ transact_pro (0.9.2)
5
5
  rest-client (~> 2.0.2)
6
6
 
7
7
  GEM
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
- custom_return_url: "https://www.example.com/pay/transactpro/response?merchant_transaction_id=ZZZZZZZ" # can be overridden in transaction init request
73
- custom_callback_url: "https://www.example.com/pay/transactpro/response?merchant_transaction_id=ZZZZZZZ" # can be overridden in transaction init request
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)
@@ -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("'#{@options[:GUID]}' is not a valid GUID for a gateway")
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("'#{@options[:PASSWORD]}' is not a valid PASSWORD for a gateway")
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("As a minimum specify a ACCOUNT_3D or a ACCOUNT_NON3D for a gateway")
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
 
@@ -1,3 +1,3 @@
1
1
  module TransactPro
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transact_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Epigene