transact_pro 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/README.md +9 -1
- data/lib/transact_pro/request.rb +18 -3
- data/lib/transact_pro/request_specs.rb +13 -3
- data/lib/transact_pro/version.rb +1 -1
- data/lib/transact_pro.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28c8b3d76c94dc391ef973641485bdadfa1d8bae
|
4
|
+
data.tar.gz: 2e3654bc9f6ce94bced070728fca7fc43f47b329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e5d6f17b3c13117ca3f596eab5bf93539bfbe6e03283c6f2a207a5e7f54a3c44224af271b2760be9a78be9ea402179f5e50c7b17107cc7fce459885067c6df6
|
7
|
+
data.tar.gz: b71036ee0ae165a40cec6093ae27d31c280259d790fedeeb28b8c971a8d19fbe0470b11884329a992646667d17491d033dcef30a84c6d12e87b4923395e4d2b7
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [1.1.0] - 2018-02-20
|
8
|
+
### Added
|
9
|
+
- `LOOSENED_VALIDATIONS` gateway option.
|
10
|
+
|
11
|
+
### Removed
|
12
|
+
- Requests, especially :init* types no longer have placeholder defaults, use `LOOSENED_VALIDATIONS` instead.
|
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
|
9
|
+
Currently core functionality is supported - single and recurring SMS payments with card details entered gateway-side, 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 |
|
@@ -71,6 +71,14 @@ options = {
|
|
71
71
|
ACCOUNT_3D: "CS01", # default routing string of Account to be used for 3D transactions
|
72
72
|
ACCOUNT_NON3D: "CS02", # default routing string of Account to be used for non-3D transactions
|
73
73
|
ACCOUNT_RECURRING: "CS03", # default routing string of Account to be used for recurring payment execution
|
74
|
+
LOOSENED_VALIDATIONS: false, # set to true if you have arranged a custom subset of parameters to be sufficient for SMS requests. Disables mandation of these fields:
|
75
|
+
# name_on_card: {mandatory: false, format: NAME_ON_CARD},
|
76
|
+
# street: {mandatory: false, format: STREET},
|
77
|
+
# zip: {mandatory: false, format: ZIP},
|
78
|
+
# city: {mandatory: false, format: CITY},
|
79
|
+
# country: {mandatory: false, format: COUNTRY},
|
80
|
+
# state: {mandatory: false, format: STATE},
|
81
|
+
# phone: {mandatory: false, format: PHONE},
|
74
82
|
|
75
83
|
# The gem has the environment-specific endpoint uris in defaults,
|
76
84
|
# you may only need this if the domains used by TransactPro suddenly change
|
data/lib/transact_pro/request.rb
CHANGED
@@ -35,6 +35,7 @@ class TransactPro::Request
|
|
35
35
|
def details
|
36
36
|
return @details if defined?(@details)
|
37
37
|
|
38
|
+
# DEPRECATED
|
38
39
|
@defaults ||= TransactPro::RequestSpecs.const_get(
|
39
40
|
"#{method.to_s.upcase}_DEFAULTS"
|
40
41
|
)
|
@@ -42,9 +43,7 @@ class TransactPro::Request
|
|
42
43
|
@request_options ||= @defaults.merge(options)
|
43
44
|
@request_options[:rs] = routing_string
|
44
45
|
|
45
|
-
@spec ||=
|
46
|
-
"#{method.to_s.upcase}_SPEC"
|
47
|
-
)
|
46
|
+
@spec ||= spec_to_use
|
48
47
|
|
49
48
|
@postable_params = {}
|
50
49
|
@spec.each do |k, spec|
|
@@ -104,4 +103,20 @@ class TransactPro::Request
|
|
104
103
|
method == :init_recurring_registration ? :init : method
|
105
104
|
end
|
106
105
|
|
106
|
+
def spec_to_use
|
107
|
+
loosened_const = "LOOSENED_#{method.to_s.upcase}_SPEC" #=> "LOOSENED_INIT_SPEC"
|
108
|
+
const = "#{method.to_s.upcase}_SPEC" #=> "INIT_SPEC"
|
109
|
+
|
110
|
+
const =
|
111
|
+
if options[:LOOSENED_VALIDATIONS]
|
112
|
+
begin
|
113
|
+
TransactPro::RequestSpecs.const_get(loosened_const)
|
114
|
+
rescue
|
115
|
+
TransactPro::RequestSpecs.const_get(const)
|
116
|
+
end
|
117
|
+
else
|
118
|
+
TransactPro::RequestSpecs.const_get(const)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
107
122
|
end
|
@@ -103,17 +103,27 @@ module TransactPro
|
|
103
103
|
}.freeze
|
104
104
|
|
105
105
|
INIT_DEFAULTS = {
|
106
|
-
|
107
|
-
street: "NA", zip: "NA", city: "NA", country: "NA", state: "NA",
|
108
|
-
email: "john_doe@example.com", phone: "00371000000"
|
106
|
+
# noop, was used to provide placeholder values to requests
|
109
107
|
}.freeze
|
110
108
|
|
109
|
+
LOOSENED_INIT_SPEC = INIT_SPEC.dup.merge(
|
110
|
+
name_on_card: {mandatory: false, format: NAME_ON_CARD},
|
111
|
+
street: {mandatory: false, format: STREET},
|
112
|
+
zip: {mandatory: false, format: ZIP},
|
113
|
+
city: {mandatory: false, format: CITY},
|
114
|
+
country: {mandatory: false, format: COUNTRY},
|
115
|
+
state: {mandatory: false, format: STATE},
|
116
|
+
phone: {mandatory: false, format: PHONE},
|
117
|
+
).freeze
|
118
|
+
|
111
119
|
INIT_RECURRING_REGISTRATION_SPEC = INIT_SPEC.
|
112
120
|
# method: :init_recurring_registration
|
113
121
|
dup.merge(save_card: {mandatory: true, format: %r'\d+'}).freeze
|
114
122
|
INIT_RECURRING_REGISTRATION_DEFAULTS = INIT_DEFAULTS.
|
115
123
|
dup.merge(save_card: "1").freeze
|
116
124
|
|
125
|
+
LOOSENED_INIT_RECURRING_REGISTRATION_SPEC = LOOSENED_INIT_SPEC
|
126
|
+
|
117
127
|
# 32. Table
|
118
128
|
# Field Format Description
|
119
129
|
# guid ans(19) Your merchant GUID
|
data/lib/transact_pro/version.rb
CHANGED
data/lib/transact_pro.rb
CHANGED
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Epigene
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- .circleci/config.yml
|
134
134
|
- .gitignore
|
135
135
|
- .rspec
|
136
|
+
- CHANGELOG.md
|
136
137
|
- CODE_OF_CONDUCT.md
|
137
138
|
- Gemfile
|
138
139
|
- Gemfile.lock
|
@@ -169,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
170
|
version: '0'
|
170
171
|
requirements: []
|
171
172
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.6.14
|
173
174
|
signing_key:
|
174
175
|
specification_version: 4
|
175
176
|
summary: Ruby wrapper for communicating with TransactPro 1stpayments.net card payment
|