spreedly 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +5 -0
- data/README.md +7 -0
- data/lib/spreedly/environment.rb +4 -0
- data/lib/spreedly/gateway_class.rb +6 -1
- data/lib/spreedly/version.rb +1 -1
- data/test/unit/gateway_options_test.rb +24 -1
- data/test/unit/response_stubs/gateway_options_stubs.rb +6 -4
- metadata +4 -4
data/HISTORY.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.0.7
|
4
|
+
* Add support for company_name to gateway options [duff]
|
5
|
+
* Implemented gateway characteristics [ilyutov]
|
6
|
+
* Allow access to gateway options w/o credentials [duff]
|
7
|
+
|
3
8
|
## 2.0.6
|
4
9
|
* Add auth_mode support to gateway options call [sosedoff]
|
5
10
|
* Pass through verification_value when creating a card directly [duff]
|
data/README.md
CHANGED
@@ -140,6 +140,13 @@ transaction = env.retain_payment_method(payment_method_token)
|
|
140
140
|
transaction = env.redact_payment_method(payment_method_token)
|
141
141
|
```
|
142
142
|
|
143
|
+
#### Redact a gateway
|
144
|
+
|
145
|
+
``` ruby
|
146
|
+
transaction = env.redact_gateway(gateway_token)
|
147
|
+
```
|
148
|
+
|
149
|
+
|
143
150
|
#### Currencies
|
144
151
|
When you instantiate an environment, you can specify a default currency code like so:
|
145
152
|
|
data/lib/spreedly/environment.rb
CHANGED
@@ -96,6 +96,10 @@ module Spreedly
|
|
96
96
|
GatewayClass.new_list_from(xml_doc)
|
97
97
|
end
|
98
98
|
|
99
|
+
def self.gateway_options
|
100
|
+
self.new("", "").gateway_options
|
101
|
+
end
|
102
|
+
|
99
103
|
def add_gateway(gateway_type, credentials = {})
|
100
104
|
body = add_gateway_body(gateway_type, credentials)
|
101
105
|
xml_doc = ssl_post(add_gateway_url, body, headers)
|
@@ -3,7 +3,12 @@ module Spreedly
|
|
3
3
|
class GatewayClass
|
4
4
|
include Fields
|
5
5
|
|
6
|
-
field :gateway_type, :name, :supported_countries, :homepage
|
6
|
+
field :gateway_type, :name, :supported_countries, :homepage, :company_name
|
7
|
+
field :supports_purchase, :supports_authorize, :supports_capture, :supports_credit,
|
8
|
+
:supports_void, :supports_reference_purchase, :supports_purchase_via_preauthorization,
|
9
|
+
:supports_offsite_purchase, :supports_offsite_authorize, :supports_3dsecure_purchase,
|
10
|
+
:supports_3dsecure_authorize, :supports_store, :supports_remove, type: :boolean
|
11
|
+
|
7
12
|
attr_reader :supported_countries, :payment_methods, :auth_modes
|
8
13
|
|
9
14
|
def initialize(xml_doc)
|
data/lib/spreedly/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'unit/response_stubs/gateway_options_stubs'
|
3
3
|
|
4
|
-
class
|
4
|
+
class GatewayOptionsTest < Test::Unit::TestCase
|
5
5
|
|
6
6
|
include GatewayOptionsStubs
|
7
7
|
|
@@ -49,4 +49,27 @@ class ListGatewaysTest < Test::Unit::TestCase
|
|
49
49
|
assert_equal "Login", list.first.label
|
50
50
|
assert_equal true, list.first.safe
|
51
51
|
end
|
52
|
+
|
53
|
+
def test_characteristics
|
54
|
+
@environment.stubs(:raw_ssl_request).returns(successful_gateway_options_response)
|
55
|
+
gateway_class = @environment.gateway_options.first
|
56
|
+
|
57
|
+
[ :supports_purchase,
|
58
|
+
:supports_authorize,
|
59
|
+
:supports_capture,
|
60
|
+
:supports_credit,
|
61
|
+
:supports_void,
|
62
|
+
:supports_reference_purchase,
|
63
|
+
:supports_purchase_via_preauthorization,
|
64
|
+
:supports_offsite_purchase,
|
65
|
+
:supports_offsite_authorize,
|
66
|
+
:supports_3dsecure_purchase,
|
67
|
+
:supports_3dsecure_authorize,
|
68
|
+
:supports_store
|
69
|
+
].each do |c|
|
70
|
+
assert gateway_class.send("#{c}?")
|
71
|
+
end
|
72
|
+
|
73
|
+
assert !gateway_class.send(:supports_remove?)
|
74
|
+
end
|
52
75
|
end
|
@@ -72,10 +72,10 @@ module GatewayOptionsStubs
|
|
72
72
|
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
|
73
73
|
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
|
74
74
|
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
|
75
|
-
<supports_3dsecure_purchase type="boolean">
|
76
|
-
<supports_3dsecure_authorize type="boolean">
|
77
|
-
<supports_store type="boolean">
|
78
|
-
<supports_remove type="boolean">
|
75
|
+
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
|
76
|
+
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
|
77
|
+
<supports_store type="boolean">true</supports_store>
|
78
|
+
<supports_remove type="boolean">false</supports_remove>
|
79
79
|
</characteristics>
|
80
80
|
<payment_methods>
|
81
81
|
<payment_method>credit_card</payment_method>
|
@@ -86,6 +86,7 @@ module GatewayOptionsStubs
|
|
86
86
|
</gateway_specific_fields>
|
87
87
|
<supported_countries>US, GB, CA</supported_countries>
|
88
88
|
<homepage>http://paypal.com/</homepage>
|
89
|
+
<company_name>Paypal Inc.</company_name>
|
89
90
|
</gateway>
|
90
91
|
<gateway>
|
91
92
|
<gateway_type>worldpay</gateway_type>
|
@@ -129,6 +130,7 @@ module GatewayOptionsStubs
|
|
129
130
|
<gateway_specific_fields/>
|
130
131
|
<supported_countries>HK, US, GB, AU, AD, BE, CH, CY, CZ, DE, DK, ES, FI, FR, GI, GR, HU, IE, IL, IT, LI, LU, MC, MT, NL, NO, NZ, PL, PT, SE, SG, SI, SM, TR, UM, VA</supported_countries>
|
131
132
|
<homepage>http://worldpay.com</homepage>
|
133
|
+
<company_name>Worldpay</company_name>
|
132
134
|
</gateway>
|
133
135
|
</gateways>
|
134
136
|
XML
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: spreedly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.0.
|
5
|
+
version: 2.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Spreedly
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
prerelease: false
|
@@ -233,7 +233,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
233
233
|
- !ruby/object:Gem::Version
|
234
234
|
segments:
|
235
235
|
- 0
|
236
|
-
hash:
|
236
|
+
hash: 3183849061107919286
|
237
237
|
version: '0'
|
238
238
|
none: false
|
239
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -242,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
segments:
|
244
244
|
- 0
|
245
|
-
hash:
|
245
|
+
hash: 3183849061107919286
|
246
246
|
version: '0'
|
247
247
|
none: false
|
248
248
|
requirements: []
|