spreedly 2.0.20 → 2.0.21
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 +4 -4
- data/CHANGELOG.md +140 -1
- data/lib/spreedly.rb +2 -0
- data/lib/spreedly/environment.rb +4 -2
- data/lib/spreedly/gateway_class.rb +1 -0
- data/lib/spreedly/ssl_requester.rb +1 -4
- data/lib/spreedly/transactions/auth_purchase.rb +1 -0
- data/lib/spreedly/transactions/authorization.rb +1 -5
- data/lib/spreedly/transactions/gateway_transaction.rb +0 -26
- data/lib/spreedly/transactions/response.rb +13 -0
- data/lib/spreedly/transactions/shipping_address.rb +11 -0
- data/lib/spreedly/transactions/transaction.rb +0 -4
- data/lib/spreedly/urls.rb +0 -4
- data/lib/spreedly/version.rb +1 -1
- data/spreedly.gemspec +11 -8
- data/test/remote/remote_authorize_test.rb +17 -2
- data/test/remote/remote_purchase_test.rb +18 -0
- data/test/test_helper.rb +1 -0
- data/test/unit/authorize_test.rb +1 -0
- data/test/unit/gateway_options_test.rb +16 -12
- metadata +21 -5
- data/HISTORY.md +0 -153
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f105b5ecb9f008f4d3a04bedf4a7026defc96e289406ad0908b78d074f143b62
|
|
4
|
+
data.tar.gz: 3707e41d28d74bba1120b97699e7700906f2a313ac38e98ac5b9c9226a4c4c58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f86c23493e8a73d815191236381ac666361d329d4b3bb172cf24c664f95cb69a6a62c9617488e3231d7fc6390649c61ac4e7d8ef50cd803cb728ad038d880bcd
|
|
7
|
+
data.tar.gz: e6527587bf7abac8921ede32794c738d2fa300b302e262f8403a1d6c9d72dc21c56d4c0e721ca525d607ced08f255529a173734038654f2305fdae745350e555
|
data/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [2.0.21] - 2019-07-19
|
|
6
|
+
### Added
|
|
7
|
+
- @jeremywrowe - Support for Stored Credentials on authorization / purchase
|
|
8
|
+
- @jeremywrowe - 3D Secure 2 abilities to gateway class
|
|
6
9
|
|
|
7
10
|
## [2.0.20] - 2019-06-27
|
|
8
11
|
### Changed
|
|
@@ -20,3 +23,139 @@ All notable changes to this project will be documented in this file.
|
|
|
20
23
|
- @adamcohen - Expose `transaction_type` on transaction
|
|
21
24
|
- @adamcohen - Expose `gateway_specific_response_fields` on transaction
|
|
22
25
|
- @adamcohen - Expose `payment_method_type` on transaction
|
|
26
|
+
|
|
27
|
+
## [2.0.16]
|
|
28
|
+
- Support disburse [rwdaigle]
|
|
29
|
+
- Support full_name property [maccca]
|
|
30
|
+
- Add support for purchase shipping address override [davidsantoso]
|
|
31
|
+
- Allow email override in transactions [duff]
|
|
32
|
+
- Add options for store_on_gateway [fedesoria]
|
|
33
|
+
- Support fingerprint [duff]
|
|
34
|
+
|
|
35
|
+
## 2.0.15
|
|
36
|
+
- Add support for supports_fraud_review gateway characteristic [markabe]
|
|
37
|
+
- Add support for the store API call [duff]
|
|
38
|
+
- Add support for company name property on credit card [duff]
|
|
39
|
+
- Deliver payment method uses talking to gateway timeout [duff]
|
|
40
|
+
- Fix issue creating production receiver [duff]
|
|
41
|
+
|
|
42
|
+
## 2.0.14
|
|
43
|
+
- Add support for gateway_specific_fields [duff]
|
|
44
|
+
|
|
45
|
+
## 2.0.13
|
|
46
|
+
- Check attributes for non-nil before sending [markabe]
|
|
47
|
+
- Add supports_verify option to Gateway [duff]
|
|
48
|
+
- Add support for verify_on_gateway API call [duff]
|
|
49
|
+
- Add support for RecacheSensitiveData transaction [duff]
|
|
50
|
+
- Remove cacert.pem and rely on system certs [duff]
|
|
51
|
+
- Adds add_receiver method to environment [Thomas Hoen]
|
|
52
|
+
- Adds deliver_receiver functionality [Thomas Hoen]
|
|
53
|
+
- Add support for first_six_digits [duff]
|
|
54
|
+
- Add support for supports_general_credit characteristic [markabe]
|
|
55
|
+
|
|
56
|
+
## 2.0.12
|
|
57
|
+
- Add support for new credit card field: eligible_for_card_updater [markabe]
|
|
58
|
+
|
|
59
|
+
## 2.0.11
|
|
60
|
+
- Add support for ThirdPartyTokens [duff]
|
|
61
|
+
|
|
62
|
+
## 2.0.10
|
|
63
|
+
- Add support for gateway_transaction_id [hoenth]
|
|
64
|
+
|
|
65
|
+
## 2.0.9
|
|
66
|
+
- Improve support for base_url around ssl [duff]
|
|
67
|
+
|
|
68
|
+
## 2.0.8
|
|
69
|
+
- Add support for gateway regions [duff]
|
|
70
|
+
|
|
71
|
+
## 2.0.7
|
|
72
|
+
- Add support for company_name to gateway options [duff]
|
|
73
|
+
- Implemented gateway characteristics [ilyutov]
|
|
74
|
+
- Allow access to gateway options w/o credentials [duff]
|
|
75
|
+
|
|
76
|
+
## 2.0.6
|
|
77
|
+
- Add auth_mode support to gateway options call [sosedoff]
|
|
78
|
+
- Pass through verification_value when creating a card directly [duff]
|
|
79
|
+
|
|
80
|
+
## 2.0.5
|
|
81
|
+
- Add ability to retrieve a transcript [hoenth]
|
|
82
|
+
|
|
83
|
+
## 2.0.3
|
|
84
|
+
- Readme improvements
|
|
85
|
+
- Smarter about timeouts - now only have long timeout for calls
|
|
86
|
+
that actually talk to a payment gateway. The other calls can
|
|
87
|
+
have shorter timeouts.
|
|
88
|
+
|
|
89
|
+
## 2.0.2
|
|
90
|
+
- Add support for gateway options call.
|
|
91
|
+
|
|
92
|
+
## 2.0.1
|
|
93
|
+
- List the transactions for a payment method
|
|
94
|
+
- Allow adding other gateways
|
|
95
|
+
- Listing Payment Methods (retained on an account)
|
|
96
|
+
- Updating a Payment Method
|
|
97
|
+
- Listing Your Gateways
|
|
98
|
+
- Finding a Gateway
|
|
99
|
+
- Fix Ruby 1.9.2 private method issue
|
|
100
|
+
- Add ability to find a bank account payment method
|
|
101
|
+
- Add ability to redact a gateway
|
|
102
|
+
|
|
103
|
+
## 2.0.0
|
|
104
|
+
- This gem is now intended for the Spreedly API. For the Spreedly
|
|
105
|
+
Subscriptions API, you can use the spreedly_subscriptions gem
|
|
106
|
+
which has everything that 1.4.0 had.
|
|
107
|
+
|
|
108
|
+
## 1.4.0
|
|
109
|
+
- Add accessor for invoices
|
|
110
|
+
- Add accessor for last successful invoice
|
|
111
|
+
|
|
112
|
+
## 1.3.6
|
|
113
|
+
- Modernize packaging
|
|
114
|
+
- Improve handling of bad credentials
|
|
115
|
+
|
|
116
|
+
## 1.3.5
|
|
117
|
+
- Move to Spreedly repo.
|
|
118
|
+
|
|
119
|
+
## 1.3.4
|
|
120
|
+
- Add result body to comp validation failure. [ntalbott]
|
|
121
|
+
|
|
122
|
+
## 1.3.3
|
|
123
|
+
- Add support for return_url in Spreedly.edit_subscriber_url [jjthrash]
|
|
124
|
+
- Add support for return_url in Spreedly.subscribe_url [jjthrash]
|
|
125
|
+
|
|
126
|
+
## 1.3.2
|
|
127
|
+
- Added methods on subscriber: update, allow_free_trial,
|
|
128
|
+
add_fee [mateuszzawisza]
|
|
129
|
+
- Fixing tests: generate spreedly url and edit url working with all
|
|
130
|
+
site names [mateuszzawisza]
|
|
131
|
+
- Add support for pre-population of the subscribe page via the subscribe
|
|
132
|
+
url. [davemcp]
|
|
133
|
+
|
|
134
|
+
## 1.3.1
|
|
135
|
+
- Handle new error reporting when creating a subscriber.
|
|
136
|
+
- Use a more sane way of setting attributes in the mock, and make plans have a
|
|
137
|
+
plan type [seancribbs].
|
|
138
|
+
- Allow optional arguments to be passed when creating subscribers [jaknowlden].
|
|
139
|
+
|
|
140
|
+
## 1.3.0 / 2009-06-04
|
|
141
|
+
- Properly handle invalid Subscriber lookup [karnowski].
|
|
142
|
+
- Added support for stopping auto renew [scottmotte, dsimard].
|
|
143
|
+
|
|
144
|
+
## 1.2.2 / 2009-05-11
|
|
145
|
+
- Fixed an error in the README [karnowski].
|
|
146
|
+
|
|
147
|
+
## 1.2.1 / 2009-04-30
|
|
148
|
+
- A few documentation tweaks.
|
|
149
|
+
|
|
150
|
+
## 1.2.0 / 2009-04-30
|
|
151
|
+
- Added mock support for Subscriber#activate_free_trial [scottmotte].
|
|
152
|
+
- Added tests for Subscriber#activate_free_trial.
|
|
153
|
+
|
|
154
|
+
## 1.1.0 / 2009-04-24
|
|
155
|
+
- Compatibility with the latest hoe and HTTParty [seancribbs].
|
|
156
|
+
- Added Subscriber.delete! [scottmotte].
|
|
157
|
+
- Added Subscriber#activate_free_trial [scottmotte].
|
|
158
|
+
|
|
159
|
+
## 1.0.0 / 2009-03-17
|
|
160
|
+
- Initial release.
|
|
161
|
+
|
data/lib/spreedly.rb
CHANGED
|
@@ -13,6 +13,8 @@ require 'spreedly/payment_methods/paypal'
|
|
|
13
13
|
require 'spreedly/payment_methods/sprel'
|
|
14
14
|
require 'spreedly/payment_methods/bank_account'
|
|
15
15
|
require 'spreedly/payment_methods/third_party_token'
|
|
16
|
+
require 'spreedly/transactions/shipping_address'
|
|
17
|
+
require 'spreedly/transactions/response'
|
|
16
18
|
require 'spreedly/transactions/transaction'
|
|
17
19
|
require 'spreedly/transactions/gateway_transaction'
|
|
18
20
|
require 'spreedly/transactions/add_payment_method'
|
data/lib/spreedly/environment.rb
CHANGED
|
@@ -30,7 +30,8 @@ module Spreedly
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def find_transcript(transaction_token)
|
|
33
|
-
|
|
33
|
+
transcript_url = find_transcript_url(transaction_token)
|
|
34
|
+
ssl_raw_get(transcript_url, headers)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
def find_gateway(token)
|
|
@@ -171,6 +172,8 @@ module Spreedly
|
|
|
171
172
|
doc.currency_code(options[:currency_code] || currency_code)
|
|
172
173
|
doc.payment_method_token(payment_method_token)
|
|
173
174
|
add_to_doc(doc, options, :retain_on_success)
|
|
175
|
+
add_to_doc(doc, options, :stored_credential_initiator)
|
|
176
|
+
add_to_doc(doc, options, :stored_credential_reason_type)
|
|
174
177
|
add_extra_options_for_basic_ops(doc, options)
|
|
175
178
|
end
|
|
176
179
|
end
|
|
@@ -335,6 +338,5 @@ module Spreedly
|
|
|
335
338
|
xml_doc = ssl_post(url, body, headers, talking_to_gateway)
|
|
336
339
|
Transaction.new_from(xml_doc)
|
|
337
340
|
end
|
|
338
|
-
|
|
339
341
|
end
|
|
340
342
|
end
|
|
@@ -8,6 +8,7 @@ module Spreedly
|
|
|
8
8
|
:supports_void, :supports_verify, :supports_reference_purchase,
|
|
9
9
|
:supports_purchase_via_preauthorization, :supports_offsite_purchase,
|
|
10
10
|
:supports_offsite_authorize, :supports_3dsecure_purchase, :supports_3dsecure_authorize,
|
|
11
|
+
:supports_3dsecure_2_purchase, :supports_3dsecure_2_authorize,
|
|
11
12
|
:supports_store, :supports_remove, :supports_general_credit,
|
|
12
13
|
:supports_fraud_review, type: :boolean
|
|
13
14
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
module Spreedly
|
|
2
|
-
|
|
3
2
|
module SslRequester
|
|
4
|
-
|
|
5
3
|
def ssl_get(endpoint, headers)
|
|
6
4
|
ssl_request(:get, endpoint, nil, headers)
|
|
7
5
|
end
|
|
@@ -23,6 +21,7 @@ module Spreedly
|
|
|
23
21
|
end
|
|
24
22
|
|
|
25
23
|
private
|
|
24
|
+
|
|
26
25
|
def ssl_request(method, endpoint, body, headers, options = {})
|
|
27
26
|
opts = { talking_to_gateway: false, return_raw: false }.merge(options)
|
|
28
27
|
how_long = opts[:talking_to_gateway] ? 66 : 10
|
|
@@ -73,7 +72,5 @@ module Spreedly
|
|
|
73
72
|
puts raw_response.inspect
|
|
74
73
|
puts "\nraw_response.code: #{raw_response.code}\nraw_response.body:\n#{raw_response.body}"
|
|
75
74
|
end
|
|
76
|
-
|
|
77
75
|
end
|
|
78
|
-
|
|
79
76
|
end
|
|
@@ -2,6 +2,7 @@ module Spreedly
|
|
|
2
2
|
class AuthPurchase < GatewayTransaction
|
|
3
3
|
field :currency_code, :checkout_url, :checkout_form, :redirect_url, :callback_url
|
|
4
4
|
field :required_action, :challenge_form, :challenge_url, :device_fingerprint_form
|
|
5
|
+
field :stored_credential_initiator, :stored_credential_reason_type
|
|
5
6
|
field :amount, type: :integer
|
|
6
7
|
|
|
7
8
|
attr_reader :payment_method
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
module Spreedly
|
|
2
|
-
|
|
3
2
|
class GatewayTransaction < Transaction
|
|
4
|
-
|
|
5
3
|
field :order_id, :ip, :description, :gateway_token, :gateway_transaction_id, :email, :transaction_type
|
|
6
4
|
field :merchant_name_descriptor, :merchant_location_descriptor
|
|
7
5
|
field :on_test_gateway, type: :boolean
|
|
@@ -36,28 +34,4 @@ module Spreedly
|
|
|
36
34
|
result
|
|
37
35
|
end
|
|
38
36
|
end
|
|
39
|
-
|
|
40
|
-
class Response
|
|
41
|
-
include Fields
|
|
42
|
-
|
|
43
|
-
field :success, :pending, :cancelled, :fraud_review, type: :boolean
|
|
44
|
-
field :created_at, :updated_at, type: :date_time
|
|
45
|
-
field :message, :avs_code, :avs_message, :cvv_code, :cvv_message, :error_code, :error_detail
|
|
46
|
-
|
|
47
|
-
def initialize(xml_doc)
|
|
48
|
-
initialize_fields(xml_doc)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
class ShippingAddress
|
|
54
|
-
include Fields
|
|
55
|
-
|
|
56
|
-
field :name, :address1, :address2, :city, :state, :zip, :country, :phone_number
|
|
57
|
-
|
|
58
|
-
def initialize(xml_doc)
|
|
59
|
-
initialize_fields(xml_doc)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
63
37
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Spreedly
|
|
2
|
+
class Response
|
|
3
|
+
include Fields
|
|
4
|
+
|
|
5
|
+
field :success, :pending, :cancelled, :fraud_review, type: :boolean
|
|
6
|
+
field :created_at, :updated_at, type: :date_time
|
|
7
|
+
field :message, :avs_code, :avs_message, :cvv_code, :cvv_message, :error_code, :error_detail
|
|
8
|
+
|
|
9
|
+
def initialize(xml_doc)
|
|
10
|
+
initialize_fields(xml_doc)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/spreedly/urls.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
module Spreedly
|
|
2
|
-
|
|
3
2
|
module Urls
|
|
4
|
-
|
|
5
3
|
def find_payment_method_url(token)
|
|
6
4
|
"#{base_url}/v1/payment_methods/#{token}.xml"
|
|
7
5
|
end
|
|
@@ -119,7 +117,5 @@ module Spreedly
|
|
|
119
117
|
def deliver_to_receiver_url(receiver_token)
|
|
120
118
|
"#{base_url}/v1/receivers/#{receiver_token}/deliver.xml"
|
|
121
119
|
end
|
|
122
|
-
|
|
123
120
|
end
|
|
124
|
-
|
|
125
121
|
end
|
data/lib/spreedly/version.rb
CHANGED
data/spreedly.gemspec
CHANGED
|
@@ -3,14 +3,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
require 'spreedly/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |s|
|
|
6
|
-
s.name
|
|
7
|
-
s.version
|
|
8
|
-
s.authors
|
|
9
|
-
s.email
|
|
10
|
-
s.summary
|
|
11
|
-
s.description
|
|
12
|
-
s.homepage
|
|
13
|
-
s.license
|
|
6
|
+
s.name = 'spreedly'
|
|
7
|
+
s.version = Spreedly::VERSION
|
|
8
|
+
s.authors = ['Spreedly']
|
|
9
|
+
s.email = ['duff@spreedly.com', 'doug@spreedly.com', 'jeremy@spreedly.com']
|
|
10
|
+
s.summary = 'Provides a Ruby wrapper for the Spreedly API.'
|
|
11
|
+
s.description = 'The Spreedly gem provides a convenient Ruby wrapper for the Spreedly API.'
|
|
12
|
+
s.homepage = 'https://github.com/spreedly/spreedly-gem'
|
|
13
|
+
s.license = 'MIT'
|
|
14
|
+
|
|
15
|
+
s.metadata["changelog_uri"] = 'https://github.com/spreedly/spreedly-gem/blob/master/CHANGELOG.md'
|
|
14
16
|
|
|
15
17
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
16
18
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
@@ -24,4 +26,5 @@ Gem::Specification.new do |s|
|
|
|
24
26
|
s.add_development_dependency 'mocha'
|
|
25
27
|
s.add_development_dependency 'rake'
|
|
26
28
|
s.add_development_dependency 'test-unit'
|
|
29
|
+
s.add_development_dependency 'pry'
|
|
27
30
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'test_helper'
|
|
2
2
|
|
|
3
3
|
class RemoteAuthorizeTest < Test::Unit::TestCase
|
|
4
|
-
|
|
5
4
|
def setup
|
|
6
5
|
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
|
|
7
6
|
end
|
|
@@ -35,6 +34,23 @@ class RemoteAuthorizeTest < Test::Unit::TestCase
|
|
|
35
34
|
assert_equal 899, transaction.amount
|
|
36
35
|
end
|
|
37
36
|
|
|
37
|
+
def test_successful_authorize_with_stored_credentials
|
|
38
|
+
gateway_token = @environment.add_gateway(:test).token
|
|
39
|
+
card_token = create_card_on(@environment).token
|
|
40
|
+
|
|
41
|
+
transaction = @environment.authorize_on_gateway(
|
|
42
|
+
gateway_token,
|
|
43
|
+
card_token,
|
|
44
|
+
899,
|
|
45
|
+
stored_credential_initiator: :merchant,
|
|
46
|
+
stored_credential_reason_type: :installment
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
assert transaction.succeeded?
|
|
50
|
+
assert_equal 'merchant', transaction.stored_credential_initiator
|
|
51
|
+
assert_equal 'installment', transaction.stored_credential_reason_type
|
|
52
|
+
end
|
|
53
|
+
|
|
38
54
|
def test_failed_authorize
|
|
39
55
|
gateway_token = @environment.add_gateway(:test).token
|
|
40
56
|
card_token = create_failed_card_on(@environment).token
|
|
@@ -44,5 +60,4 @@ class RemoteAuthorizeTest < Test::Unit::TestCase
|
|
|
44
60
|
assert_equal "Unable to process the authorize transaction.", transaction.message
|
|
45
61
|
assert_equal gateway_token, transaction.gateway_token
|
|
46
62
|
end
|
|
47
|
-
|
|
48
63
|
end
|
|
@@ -35,6 +35,24 @@ class RemotePurchaseTest < Test::Unit::TestCase
|
|
|
35
35
|
assert_equal 144, transaction.amount
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
def test_successful_purchase_with_stored_credentials
|
|
39
|
+
gateway_token = @environment.add_gateway(:test).token
|
|
40
|
+
card_token = create_card_on(@environment).token
|
|
41
|
+
|
|
42
|
+
transaction = @environment.purchase_on_gateway(
|
|
43
|
+
gateway_token,
|
|
44
|
+
card_token,
|
|
45
|
+
899,
|
|
46
|
+
stored_credential_initiator: :merchant,
|
|
47
|
+
stored_credential_reason_type: :installment
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
assert transaction.succeeded?
|
|
51
|
+
assert_equal 'merchant', transaction.stored_credential_initiator
|
|
52
|
+
assert_equal 'installment', transaction.stored_credential_reason_type
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
|
|
38
56
|
def test_failed_purchase
|
|
39
57
|
gateway_token = @environment.add_gateway(:test).token
|
|
40
58
|
card_token = create_failed_card_on(@environment).token
|
data/test/test_helper.rb
CHANGED
data/test/unit/authorize_test.rb
CHANGED
|
@@ -76,6 +76,7 @@ class AuthorizeTest < Test::Unit::TestCase
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
private
|
|
79
|
+
|
|
79
80
|
def authorize_using(response)
|
|
80
81
|
@environment.stubs(:raw_ssl_request).returns(response)
|
|
81
82
|
@environment.authorize_on_gateway("IgnoredGatewayTokenSinceResponseIsStubbed", "IgnoredPaymentMethodTokenSinceResponseIsStubbed", 5921)
|
|
@@ -53,25 +53,29 @@ class GatewayOptionsTest < Test::Unit::TestCase
|
|
|
53
53
|
def test_characteristics
|
|
54
54
|
@environment.stubs(:raw_ssl_request).returns(successful_gateway_options_response)
|
|
55
55
|
gateway_class = @environment.gateway_options.first
|
|
56
|
-
|
|
57
|
-
[
|
|
56
|
+
characteristics = gateway_class.class.fields.select{|f| f =~ /supports/ }.sort
|
|
57
|
+
expected_characteristics = [
|
|
58
|
+
:supports_3dsecure_authorize,
|
|
59
|
+
:supports_3dsecure_purchase,
|
|
60
|
+
:supports_3dsecure_2_authorize,
|
|
61
|
+
:supports_3dsecure_2_purchase,
|
|
58
62
|
:supports_authorize,
|
|
59
63
|
:supports_capture,
|
|
60
64
|
:supports_credit,
|
|
65
|
+
:supports_fraud_review,
|
|
61
66
|
:supports_general_credit,
|
|
62
|
-
:supports_void,
|
|
63
|
-
:supports_reference_purchase,
|
|
64
|
-
:supports_purchase_via_preauthorization,
|
|
65
|
-
:supports_offsite_purchase,
|
|
66
67
|
:supports_offsite_authorize,
|
|
67
|
-
:
|
|
68
|
-
:
|
|
68
|
+
:supports_offsite_purchase,
|
|
69
|
+
:supports_purchase,
|
|
70
|
+
:supports_purchase_via_preauthorization,
|
|
71
|
+
:supports_reference_purchase,
|
|
72
|
+
:supports_remove,
|
|
69
73
|
:supports_store,
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
end
|
|
74
|
+
:supports_verify,
|
|
75
|
+
:supports_void,
|
|
76
|
+
].sort
|
|
74
77
|
|
|
78
|
+
assert_equal expected_characteristics, characteristics
|
|
75
79
|
assert !gateway_class.send(:supports_remove?)
|
|
76
80
|
end
|
|
77
81
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spreedly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Spreedly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-07-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -108,6 +108,20 @@ dependencies:
|
|
|
108
108
|
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: pry
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
111
125
|
description: The Spreedly gem provides a convenient Ruby wrapper for the Spreedly
|
|
112
126
|
API.
|
|
113
127
|
email:
|
|
@@ -121,7 +135,6 @@ files:
|
|
|
121
135
|
- ".gitignore"
|
|
122
136
|
- CHANGELOG.md
|
|
123
137
|
- Gemfile
|
|
124
|
-
- HISTORY.md
|
|
125
138
|
- LICENSE.txt
|
|
126
139
|
- README.md
|
|
127
140
|
- Rakefile
|
|
@@ -157,7 +170,9 @@ files:
|
|
|
157
170
|
- lib/spreedly/transactions/redact_gateway.rb
|
|
158
171
|
- lib/spreedly/transactions/redact_payment_method.rb
|
|
159
172
|
- lib/spreedly/transactions/refund.rb
|
|
173
|
+
- lib/spreedly/transactions/response.rb
|
|
160
174
|
- lib/spreedly/transactions/retain_payment_method.rb
|
|
175
|
+
- lib/spreedly/transactions/shipping_address.rb
|
|
161
176
|
- lib/spreedly/transactions/store.rb
|
|
162
177
|
- lib/spreedly/transactions/transaction.rb
|
|
163
178
|
- lib/spreedly/transactions/verification.rb
|
|
@@ -253,7 +268,8 @@ files:
|
|
|
253
268
|
homepage: https://github.com/spreedly/spreedly-gem
|
|
254
269
|
licenses:
|
|
255
270
|
- MIT
|
|
256
|
-
metadata:
|
|
271
|
+
metadata:
|
|
272
|
+
changelog_uri: https://github.com/spreedly/spreedly-gem/blob/master/CHANGELOG.md
|
|
257
273
|
post_install_message:
|
|
258
274
|
rdoc_options: []
|
|
259
275
|
require_paths:
|
|
@@ -269,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
269
285
|
- !ruby/object:Gem::Version
|
|
270
286
|
version: '0'
|
|
271
287
|
requirements: []
|
|
272
|
-
rubygems_version: 3.0.
|
|
288
|
+
rubygems_version: 3.0.3
|
|
273
289
|
signing_key:
|
|
274
290
|
specification_version: 4
|
|
275
291
|
summary: Provides a Ruby wrapper for the Spreedly API.
|
data/HISTORY.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## Next Version
|
|
4
|
-
* Removes support for disbursements [bpollack]
|
|
5
|
-
|
|
6
|
-
## 2.0.16
|
|
7
|
-
* Support disburse [rwdaigle]
|
|
8
|
-
* Support full_name property [maccca]
|
|
9
|
-
* Add support for purchase shipping address override [davidsantoso]
|
|
10
|
-
* Allow email override in transactions [duff]
|
|
11
|
-
* Add options for store_on_gateway [fedesoria]
|
|
12
|
-
* Support fingerprint [duff]
|
|
13
|
-
|
|
14
|
-
## 2.0.15
|
|
15
|
-
* Add support for supports_fraud_review gateway characteristic [markabe]
|
|
16
|
-
* Add support for the store API call [duff]
|
|
17
|
-
* Add support for company name property on credit card [duff]
|
|
18
|
-
* Deliver payment method uses talking to gateway timeout [duff]
|
|
19
|
-
* Fix issue creating production receiver [duff]
|
|
20
|
-
|
|
21
|
-
## 2.0.14
|
|
22
|
-
* Add support for gateway_specific_fields [duff]
|
|
23
|
-
|
|
24
|
-
## 2.0.13
|
|
25
|
-
* Check attributes for non-nil before sending [markabe]
|
|
26
|
-
* Add supports_verify option to Gateway [duff]
|
|
27
|
-
* Add support for verify_on_gateway API call [duff]
|
|
28
|
-
* Add support for RecacheSensitiveData transaction [duff]
|
|
29
|
-
* Remove cacert.pem and rely on system certs [duff]
|
|
30
|
-
* Adds add_receiver method to environment [Thomas Hoen]
|
|
31
|
-
* Adds deliver_receiver functionality [Thomas Hoen]
|
|
32
|
-
* Add support for first_six_digits [duff]
|
|
33
|
-
* Add support for supports_general_credit characteristic [markabe]
|
|
34
|
-
|
|
35
|
-
## 2.0.12
|
|
36
|
-
* Add support for new credit card field: eligible_for_card_updater [markabe]
|
|
37
|
-
|
|
38
|
-
## 2.0.11
|
|
39
|
-
* Add support for ThirdPartyTokens [duff]
|
|
40
|
-
|
|
41
|
-
## 2.0.10
|
|
42
|
-
* Add support for gateway_transaction_id [hoenth]
|
|
43
|
-
|
|
44
|
-
## 2.0.9
|
|
45
|
-
* Improve support for base_url around ssl [duff]
|
|
46
|
-
|
|
47
|
-
## 2.0.8
|
|
48
|
-
* Add support for gateway regions [duff]
|
|
49
|
-
|
|
50
|
-
## 2.0.7
|
|
51
|
-
* Add support for company_name to gateway options [duff]
|
|
52
|
-
* Implemented gateway characteristics [ilyutov]
|
|
53
|
-
* Allow access to gateway options w/o credentials [duff]
|
|
54
|
-
|
|
55
|
-
## 2.0.6
|
|
56
|
-
* Add auth_mode support to gateway options call [sosedoff]
|
|
57
|
-
* Pass through verification_value when creating a card directly [duff]
|
|
58
|
-
|
|
59
|
-
## 2.0.5
|
|
60
|
-
* Add ability to retrieve a transcript [hoenth]
|
|
61
|
-
|
|
62
|
-
## 2.0.3
|
|
63
|
-
* Readme improvements
|
|
64
|
-
* Smarter about timeouts - now only have long timeout for calls
|
|
65
|
-
that actually talk to a payment gateway. The other calls can
|
|
66
|
-
have shorter timeouts.
|
|
67
|
-
|
|
68
|
-
## 2.0.2
|
|
69
|
-
* Add support for gateway options call.
|
|
70
|
-
|
|
71
|
-
## 2.0.1
|
|
72
|
-
* List the transactions for a payment method
|
|
73
|
-
* Allow adding other gateways
|
|
74
|
-
* Listing Payment Methods (retained on an account)
|
|
75
|
-
* Updating a Payment Method
|
|
76
|
-
* Listing Your Gateways
|
|
77
|
-
* Finding a Gateway
|
|
78
|
-
* Fix Ruby 1.9.2 private method issue
|
|
79
|
-
* Add ability to find a bank account payment method
|
|
80
|
-
* Add ability to redact a gateway
|
|
81
|
-
|
|
82
|
-
## 2.0.0
|
|
83
|
-
* This gem is now intended for the Spreedly API. For the Spreedly
|
|
84
|
-
Subscriptions API, you can use the spreedly_subscriptions gem
|
|
85
|
-
which has everything that 1.4.0 had.
|
|
86
|
-
|
|
87
|
-
## 1.4.0
|
|
88
|
-
|
|
89
|
-
* Add accessor for invoices
|
|
90
|
-
* Add accessor for last successful invoice
|
|
91
|
-
|
|
92
|
-
## 1.3.6
|
|
93
|
-
|
|
94
|
-
* Modernize packaging
|
|
95
|
-
* Improve handling of bad credentials
|
|
96
|
-
|
|
97
|
-
## 1.3.5
|
|
98
|
-
|
|
99
|
-
* Move to Spreedly repo.
|
|
100
|
-
|
|
101
|
-
## 1.3.4
|
|
102
|
-
|
|
103
|
-
* Add result body to comp validation failure. [ntalbott]
|
|
104
|
-
|
|
105
|
-
## 1.3.3
|
|
106
|
-
|
|
107
|
-
* Add support for return_url in Spreedly.edit_subscriber_url [jjthrash]
|
|
108
|
-
* Add support for return_url in Spreedly.subscribe_url [jjthrash]
|
|
109
|
-
|
|
110
|
-
## 1.3.2
|
|
111
|
-
|
|
112
|
-
* Added methods on subscriber: update, allow_free_trial,
|
|
113
|
-
add_fee [mateuszzawisza]
|
|
114
|
-
* Fixing tests: generate spreedly url and edit url working with all
|
|
115
|
-
site names [mateuszzawisza]
|
|
116
|
-
* Add support for pre-population of the subscribe page via the subscribe
|
|
117
|
-
url. [davemcp]
|
|
118
|
-
|
|
119
|
-
## 1.3.1
|
|
120
|
-
|
|
121
|
-
* Handle new error reporting when creating a subscriber.
|
|
122
|
-
* Use a more sane way of setting attributes in the mock, and make plans have a
|
|
123
|
-
plan type [seancribbs].
|
|
124
|
-
* Allow optional arguments to be passed when creating subscribers [jaknowlden].
|
|
125
|
-
|
|
126
|
-
## 1.3.0 / 2009-06-04
|
|
127
|
-
|
|
128
|
-
* Properly handle invalid Subscriber lookup [karnowski].
|
|
129
|
-
* Added support for stopping auto renew [scottmotte, dsimard].
|
|
130
|
-
|
|
131
|
-
## 1.2.2 / 2009-05-11
|
|
132
|
-
|
|
133
|
-
* Fixed an error in the README [karnowski].
|
|
134
|
-
|
|
135
|
-
## 1.2.1 / 2009-04-30
|
|
136
|
-
|
|
137
|
-
* A few documentation tweaks.
|
|
138
|
-
|
|
139
|
-
## 1.2.0 / 2009-04-30
|
|
140
|
-
|
|
141
|
-
* Added mock support for Subscriber#activate_free_trial [scottmotte].
|
|
142
|
-
* Added tests for Subscriber#activate_free_trial.
|
|
143
|
-
|
|
144
|
-
## 1.1.0 / 2009-04-24
|
|
145
|
-
|
|
146
|
-
* Compatibility with the latest hoe and HTTParty [seancribbs].
|
|
147
|
-
* Added Subscriber.delete! [scottmotte].
|
|
148
|
-
* Added Subscriber#activate_free_trial [scottmotte].
|
|
149
|
-
|
|
150
|
-
## 1.0.0 / 2009-03-17
|
|
151
|
-
|
|
152
|
-
* Initial release.
|
|
153
|
-
|