spreedly 2.0.15 → 2.0.16

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/HISTORY.md +9 -0
  4. data/README.md +4 -4
  5. data/lib/spreedly/common/fields.rb +0 -1
  6. data/lib/spreedly/environment.rb +17 -6
  7. data/lib/spreedly/gateway_class.rb +1 -1
  8. data/lib/spreedly/payment_methods/credit_card.rb +1 -1
  9. data/lib/spreedly/transactions/gateway_transaction.rb +14 -2
  10. data/lib/spreedly/version.rb +1 -1
  11. data/test/remote/remote_add_credit_card_test.rb +9 -1
  12. data/test/remote/remote_add_gateway_test.rb +1 -1
  13. data/test/remote/remote_add_receiver_test.rb +1 -1
  14. data/test/remote/remote_purchase_test.rb +4 -1
  15. data/test/remote/remote_update_credit_card_test.rb +9 -0
  16. data/test/unit/gateway_options_test.rb +2 -1
  17. data/test/unit/purchase_test.rb +22 -0
  18. data/test/unit/response_stubs/add_credit_card_stubs.rb +1 -0
  19. data/test/unit/response_stubs/add_gateway_stubs.rb +1 -0
  20. data/test/unit/response_stubs/authorization_stubs.rb +2 -0
  21. data/test/unit/response_stubs/capture_stubs.rb +2 -0
  22. data/test/unit/response_stubs/deliver_payment_method_stubs.rb +1 -0
  23. data/test/unit/response_stubs/find_gateway_stubs.rb +1 -0
  24. data/test/unit/response_stubs/find_payment_method_stubs.rb +2 -0
  25. data/test/unit/response_stubs/find_transaction_stubs.rb +2 -0
  26. data/test/unit/response_stubs/gateway_options_stubs.rb +2 -0
  27. data/test/unit/response_stubs/list_gateways_stubs.rb +2 -0
  28. data/test/unit/response_stubs/list_payment_methods_stubs.rb +2 -0
  29. data/test/unit/response_stubs/list_transactions_stubs.rb +3 -0
  30. data/test/unit/response_stubs/purchase_stubs.rb +95 -0
  31. data/test/unit/response_stubs/redact_gateway_stubs.rb +1 -0
  32. data/test/unit/response_stubs/redact_payment_method_stubs.rb +1 -0
  33. data/test/unit/response_stubs/refund_stubs.rb +2 -0
  34. data/test/unit/response_stubs/retain_payment_method_stubs.rb +2 -0
  35. data/test/unit/response_stubs/store_stubs.rb +2 -0
  36. data/test/unit/response_stubs/update_credit_card_stubs.rb +1 -0
  37. data/test/unit/response_stubs/verification_stubs.rb +2 -0
  38. data/test/unit/response_stubs/void_stubs.rb +2 -0
  39. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a039097df66894fac8c6611d93ac56293888ace1
4
- data.tar.gz: b177d6b3d261a0c7f54dbd51b03b73265ceaaa4a
3
+ metadata.gz: a6681908d5f7ce7e0433d97dc0389343571976a4
4
+ data.tar.gz: 98d59f7c229ac9770443d54fafa2ae52fde2e444
5
5
  SHA512:
6
- metadata.gz: 0091081a875551c012e21d69afdd0fba443c52a01c22a4e171b6752ddfdaa59f43241af0157460fc24f7d4d7b7b44ea01fe81b1e4ad39536159f709da613c607
7
- data.tar.gz: 416efbaf986c32e256d733d171dd1796e02429984190cf930706ca351145c999e6cb8503c0be38ce01b0850ea7e47435cdde5f82424c2a1d76685bd989f2f37e
6
+ metadata.gz: f253a31fb72f599f5e51d3ffbd8f979de4827db9444dc2b89780c6ce04d497c5d04ee3d47dabd59cc4f77b8b8404eb404f86cb9e408281553c5f46a7fa1af909
7
+ data.tar.gz: dbabd8dc40937daa4ca9d4791ba1f0e5e8d9bf94efa97acc6d442648511f691c8fe246894f63734c24fc03e7da246394098eea1153f66b7f2e1df8d994e4cf88
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ pkg
6
6
  tmp
7
7
  vendor/ruby
8
8
  test/credentials/personal_credentials.yml
9
+ .ruby-version
data/HISTORY.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Next Version
4
4
 
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
+
5
14
  ## 2.0.15
6
15
  * Add support for supports_fraud_review gateway characteristic [markabe]
7
16
  * Add support for the store API call [duff]
data/README.md CHANGED
@@ -278,8 +278,8 @@ email: 'perrin@wot.com', number: '5555555555554444', month: 1, year: 2019, last_
278
278
  transaction = env.add_credit_card(options)
279
279
 
280
280
  transaction.token # => "2nQEJaaY3egcVkCvg2s9qT37xrb"
281
- transaction.card.token # => "7rbEKaaY0egcBkCrg2sbqTo7Qrb"
282
- transaction.card.last_name # => "Aybara"
281
+ transaction.payment_method.token # => "7rbEKaaY0egcBkCrg2sbqTo7Qrb"
282
+ transaction.payment_method.last_name # => "Aybara"
283
283
  ```
284
284
 
285
285
  You can also retain the card immediately like so:
@@ -290,7 +290,7 @@ email: 'perrin@wot.com', number: '5555555555554444', month: 1, year: 2019, last_
290
290
  }
291
291
  transaction = env.add_credit_card(options)
292
292
 
293
- transaction.card.storage_state # => "retained"
293
+ transaction.payment_method.storage_state # => "retained"
294
294
  ```
295
295
 
296
296
  And you might want to specify a number of other details like the billing address, etc:
@@ -302,7 +302,7 @@ email: 'leavenworth@free.com', number: '9555555555554444', month: 3, year: 2021,
302
302
 
303
303
  transaction = env.add_credit_card(options)
304
304
 
305
- transaction.card.last_name # => "Smedry"
305
+ transaction.payment_method.last_name # => "Smedry"
306
306
 
307
307
  ```
308
308
 
@@ -86,4 +86,3 @@ class Array
86
86
  end
87
87
  end
88
88
  end
89
-
@@ -96,8 +96,8 @@ module Spreedly
96
96
  Gateway.new_list_from(xml_doc)
97
97
  end
98
98
 
99
- def store_on_gateway(gateway_token, payment_method_token)
100
- body = store_body(payment_method_token)
99
+ def store_on_gateway(gateway_token, payment_method_token, options = {})
100
+ body = store_body(payment_method_token, options)
101
101
  api_post(store_url(gateway_token), body)
102
102
  end
103
103
 
@@ -211,9 +211,10 @@ module Spreedly
211
211
  end
212
212
  end
213
213
 
214
- def store_body(payment_method_token)
214
+ def store_body(payment_method_token, options)
215
215
  build_xml_request('transaction') do |doc|
216
216
  doc.payment_method_token(payment_method_token)
217
+ add_gateway_specific_fields(doc, options)
217
218
  end
218
219
  end
219
220
 
@@ -231,7 +232,7 @@ module Spreedly
231
232
  build_xml_request('payment_method') do |doc|
232
233
  add_to_doc(doc, options, :data, :retained, :email)
233
234
  doc.credit_card do
234
- add_to_doc(doc, options, :number, :verification_value, :month, :first_name, :last_name,
235
+ add_to_doc(doc, options, :number, :verification_value, :month, :full_name, :first_name, :last_name,
235
236
  :year, :address1, :address2, :city, :state, :zip, :country, :phone_number,
236
237
  :company, :eligible_for_card_updater)
237
238
  end
@@ -240,7 +241,7 @@ module Spreedly
240
241
 
241
242
  def update_credit_card_body(options)
242
243
  build_xml_request('payment_method') do |doc|
243
- add_to_doc(doc, options, :email, :month, :first_name, :last_name, :year,
244
+ add_to_doc(doc, options, :email, :month, :full_name, :first_name, :last_name, :year,
244
245
  :address1, :address2, :city, :state, :zip, :country, :phone_number,
245
246
  :eligible_for_card_updater)
246
247
  end
@@ -267,7 +268,8 @@ module Spreedly
267
268
 
268
269
  def add_extra_options_for_basic_ops(doc, options)
269
270
  add_gateway_specific_fields(doc, options)
270
- add_to_doc(doc, options, :order_id, :description, :ip, :merchant_name_descriptor,
271
+ add_shipping_address_override(doc, options)
272
+ add_to_doc(doc, options, :order_id, :description, :ip, :email, :merchant_name_descriptor,
271
273
  :merchant_location_descriptor)
272
274
  end
273
275
 
@@ -276,6 +278,15 @@ module Spreedly
276
278
  doc << "<gateway_specific_fields>#{xml_for_hash(options[:gateway_specific_fields])}</gateway_specific_fields>"
277
279
  end
278
280
 
281
+ def add_shipping_address_override(doc, options)
282
+ return unless options[:shipping_address].kind_of?(Hash)
283
+ doc.send(:shipping_address) do
284
+ options[:shipping_address].each do |k, v|
285
+ doc.send(k, v)
286
+ end
287
+ end
288
+ end
289
+
279
290
  def xml_for_hash(hash)
280
291
  hash.map do |key, value|
281
292
  text = value.kind_of?(Hash) ? xml_for_hash(value) : value
@@ -9,7 +9,7 @@ module Spreedly
9
9
  :supports_purchase_via_preauthorization, :supports_offsite_purchase,
10
10
  :supports_offsite_authorize, :supports_3dsecure_purchase, :supports_3dsecure_authorize,
11
11
  :supports_store, :supports_remove, :supports_general_credit,
12
- :supports_fraud_review, type: :boolean
12
+ :supports_fraud_review, :supports_disburse, type: :boolean
13
13
 
14
14
  attr_reader :supported_countries, :payment_methods, :auth_modes, :regions
15
15
 
@@ -3,7 +3,7 @@ module Spreedly
3
3
  class CreditCard < PaymentMethod
4
4
  field :first_name, :last_name, :full_name, :month, :year
5
5
  field :number, :last_four_digits, :first_six_digits, :card_type, :verification_value
6
- field :address1, :address2, :city, :state, :zip, :country, :phone_number, :company
6
+ field :address1, :address2, :city, :state, :zip, :country, :phone_number, :company, :fingerprint
7
7
  field :eligible_for_card_updater, type: :boolean
8
8
  end
9
9
 
@@ -2,16 +2,18 @@ module Spreedly
2
2
 
3
3
  class GatewayTransaction < Transaction
4
4
 
5
- field :order_id, :ip, :description, :gateway_token, :gateway_transaction_id
5
+ field :order_id, :ip, :description, :gateway_token, :gateway_transaction_id, :email
6
6
  field :merchant_name_descriptor, :merchant_location_descriptor
7
7
  field :on_test_gateway, type: :boolean
8
8
 
9
- attr_reader :response, :gateway_specific_fields
9
+ attr_reader :response, :gateway_specific_fields, :shipping_address
10
10
 
11
11
  def initialize(xml_doc)
12
12
  super
13
13
  response_xml_doc = xml_doc.at_xpath('.//response')
14
+ shipping_address_xml_doc = xml_doc.at_xpath('.//shipping_address')
14
15
  @response = response_xml_doc ? Response.new(response_xml_doc) : nil
16
+ @shipping_address = shipping_address_xml_doc ? ShippingAddress.new(shipping_address_xml_doc) : nil
15
17
  @gateway_specific_fields = parse_gateway_specific_fields(xml_doc)
16
18
  end
17
19
 
@@ -47,4 +49,14 @@ module Spreedly
47
49
 
48
50
  end
49
51
 
52
+ class ShippingAddress
53
+ include Fields
54
+
55
+ field :name, :address1, :address2, :city, :state, :zip, :country, :phone_number
56
+
57
+ def initialize(xml_doc)
58
+ initialize_fields(xml_doc)
59
+ end
60
+
61
+ end
50
62
  end
@@ -1,3 +1,3 @@
1
1
  module Spreedly
2
- VERSION = "2.0.15"
2
+ VERSION = "2.0.16"
3
3
  end
@@ -27,7 +27,7 @@ class RemoteAddCreditCardTest < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_payment_required
30
- assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
30
+ assert_raise_with_message(Spreedly::PaymentRequiredError, "Your environment (R7lHscqcYkZeDGGbthKp6GKMu15) has not been activated for real transactions with real payment methods. If you're using a Test Gateway you can *ONLY* use Test payment methods - ( https://docs.spreedly.com/test-data). All other credit card numbers are considered real credit cards; real credit cards are not allowed when using a Test Gateway.") do
31
31
  @environment.add_credit_card(card_deets(number: '343'))
32
32
  end
33
33
  end
@@ -50,6 +50,14 @@ class RemoteAddCreditCardTest < Test::Unit::TestCase
50
50
  assert_equal 'retained', t.payment_method.storage_state
51
51
  end
52
52
 
53
+ def test_successfull_add_using_full_name
54
+ t = @environment.add_credit_card(number: '5555555555554444', month: 1, year: 2019, full_name: "Kvothe Jones")
55
+ assert t.succeeded?
56
+ assert_equal "Kvothe", t.payment_method.first_name
57
+ assert_equal "Jones", t.payment_method.last_name
58
+ assert_equal "Kvothe Jones", t.payment_method.full_name
59
+ end
60
+
53
61
 
54
62
  private
55
63
  def card_deets(options = {})
@@ -26,7 +26,7 @@ class RemoteAddGatewayTest < Test::Unit::TestCase
26
26
  end
27
27
 
28
28
  def test_need_active_account
29
- assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
29
+ assert_raise_with_message(Spreedly::PaymentRequiredError, "Your environment (R7lHscqcYkZeDGGbthKp6GKMu15) has not been activated for real transactions with real payment methods. If you're using a Test Gateway you can *ONLY* use Test payment methods - ( https://docs.spreedly.com/test-data). All other credit card numbers are considered real credit cards; real credit cards are not allowed when using a Test Gateway.") do
30
30
  @environment.add_gateway(:wirecard)
31
31
  end
32
32
  end
@@ -31,7 +31,7 @@ class RemoteAddReceiverTest < Test::Unit::TestCase
31
31
  end
32
32
 
33
33
  def test_need_active_account
34
- assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
34
+ assert_raise_with_message(Spreedly::PaymentRequiredError, "Your environment (R7lHscqcYkZeDGGbthKp6GKMu15) has not been activated for real transactions with real payment methods. If you're using a Test Gateway you can *ONLY* use Test payment methods - ( https://docs.spreedly.com/test-data). All other credit card numbers are considered real credit cards; real credit cards are not allowed when using a Test Gateway.") do
35
35
  @environment.add_receiver(:braintree)
36
36
  end
37
37
  end
@@ -53,6 +53,7 @@ class RemotePurchaseTest < Test::Unit::TestCase
53
53
  order_id: "8675",
54
54
  description: "SuperDuper",
55
55
  ip: "183.128.100.103",
56
+ email: "fred@example.com",
56
57
  merchant_name_descriptor: "Real Stuff",
57
58
  merchant_location_descriptor: "Raleigh",
58
59
  retain_on_success: true)
@@ -63,7 +64,9 @@ class RemotePurchaseTest < Test::Unit::TestCase
63
64
  assert_equal "183.128.100.103", transaction.ip
64
65
  assert_equal "Real Stuff", transaction.merchant_name_descriptor
65
66
  assert_equal "Raleigh", transaction.merchant_location_descriptor
66
- assert_equal "retained", transaction.payment_method.storage_state
67
+ assert_equal "cached", transaction.payment_method.storage_state
68
+ assert_equal "fred@example.com", transaction.email
69
+ assert_equal "perrin@wot.com", transaction.payment_method.email
67
70
  assert_match /\d/, transaction.gateway_transaction_id
68
71
  end
69
72
 
@@ -44,6 +44,15 @@ class RemoteUpdateCreditCardTest < Test::Unit::TestCase
44
44
  assert_equal false, result.eligible_for_card_updater
45
45
  end
46
46
 
47
+ def test_successfull_update_using_full_name
48
+ card = create_card_on(@environment)
49
+ result = @environment.update_credit_card(card.token, full_name: "Murray Rothbard")
50
+
51
+ assert_equal "Murray", result.first_name
52
+ assert_equal "Rothbard", result.last_name
53
+ assert_equal "Murray Rothbard", result.full_name
54
+ end
55
+
47
56
  private
48
57
  def card_deets(options = {})
49
58
  {
@@ -67,7 +67,8 @@ class GatewayOptionsTest < Test::Unit::TestCase
67
67
  :supports_3dsecure_purchase,
68
68
  :supports_3dsecure_authorize,
69
69
  :supports_store,
70
- :supports_fraud_review
70
+ :supports_fraud_review,
71
+ :supports_disburse
71
72
  ].each do |c|
72
73
  assert gateway_class.send("#{c}?")
73
74
  end
@@ -43,6 +43,15 @@ class PurchaseTest < Test::Unit::TestCase
43
43
  assert !t.response.cancelled
44
44
  assert_equal Time.parse('2013-07-31T19:46:26Z'), t.response.created_at
45
45
  assert_equal Time.parse('2013-07-31T19:46:27Z'), t.response.updated_at
46
+
47
+ assert_equal '', t.shipping_address.name
48
+ assert_equal '', t.shipping_address.address1
49
+ assert_equal '', t.shipping_address.address2
50
+ assert_equal '', t.shipping_address.city
51
+ assert_equal '', t.shipping_address.state
52
+ assert_equal '', t.shipping_address.zip
53
+ assert_equal '', t.shipping_address.country
54
+ assert_equal '', t.shipping_address.phone_number
46
55
  end
47
56
 
48
57
  def test_failed_purchase
@@ -57,6 +66,19 @@ class PurchaseTest < Test::Unit::TestCase
57
66
  assert_equal 'The eagle is dead Jim.', t.response.error_detail
58
67
  end
59
68
 
69
+ def test_successful_purchase_with_shipping_address_override
70
+ t = purchase_using(successful_purchase_with_shipping_address_override_response)
71
+
72
+ assert_equal 'John Doe', t.shipping_address.name
73
+ assert_equal '123 Main St.', t.shipping_address.address1
74
+ assert_equal 'Unit 1', t.shipping_address.address2
75
+ assert_equal 'Acme', t.shipping_address.city
76
+ assert_equal 'Corp', t.shipping_address.state
77
+ assert_equal '45678', t.shipping_address.zip
78
+ assert_equal 'USA', t.shipping_address.country
79
+ assert_equal '123-456-7890', t.shipping_address.phone_number
80
+ end
81
+
60
82
  def test_request_body_params
61
83
  body = get_request_body(successful_purchase_response) do
62
84
  @environment.purchase_on_gateway("TheGatewayToken", "TheCardToken", 2001, all_possible_options)
@@ -39,6 +39,7 @@ module AddCreditCardStubs
39
39
  <errors>
40
40
  </errors>
41
41
  <verification_value></verification_value>
42
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
42
43
  <number>XXXX-XXXX-XXXX-4942</number>
43
44
  </payment_method>
44
45
  </transaction>
@@ -21,6 +21,7 @@ module AddGatewayStubs
21
21
  <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
22
22
  <supports_store type="boolean">true</supports_store>
23
23
  <supports_remove type="boolean">true</supports_remove>
24
+ <supports_disburse type="boolean">true</supports_disburse>
24
25
  <supports_fraud_review type="boolean">true</supports_fraud_review>
25
26
  </characteristics>
26
27
  <state>retained</state>
@@ -74,6 +74,7 @@ module AuthorizationStubs
74
74
  <errors>
75
75
  </errors>
76
76
  <verification_value></verification_value>
77
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
77
78
  <number>XXXX-XXXX-XXXX-4444</number>
78
79
  </payment_method>
79
80
  <api_urls>
@@ -147,6 +148,7 @@ module AuthorizationStubs
147
148
  <errors>
148
149
  </errors>
149
150
  <verification_value></verification_value>
151
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
150
152
  <number>XXXX-XXXX-XXXX-1881</number>
151
153
  </payment_method>
152
154
  <api_urls>
@@ -13,6 +13,7 @@ module CaptureStubs
13
13
  <token>T41uDjYsxGybSsp7RHuRTohMjg2</token>
14
14
  <transaction_type>Capture</transaction_type>
15
15
  <order_id>99a1</order_id>
16
+ <email>joe@example.com</email>
16
17
  <ip>182.129.106.102</ip>
17
18
  <description>LotsOCoffee</description>
18
19
  <merchant_name_descriptor>My Writeoff Inc.</merchant_name_descriptor>
@@ -58,6 +59,7 @@ module CaptureStubs
58
59
  <transaction_type>Capture</transaction_type>
59
60
  <order_id nil="true"/>
60
61
  <ip nil="true"/>
62
+ <email nil="true"/>
61
63
  <description nil="true"/>
62
64
  <merchant_name_descriptor nil="true"/>
63
65
  <merchant_location_descriptor nil="true"/>
@@ -72,6 +72,7 @@ module DeliverPaymentMethodStubs
72
72
  <company>Acme</company>
73
73
  <eligible_for_card_updater>true</eligible_for_card_updater>
74
74
  <verification_value></verification_value>
75
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
75
76
  <number>XXXX-XXXX-XXXX-1111</number>
76
77
  </payment_method>
77
78
  </transaction>
@@ -23,6 +23,7 @@ module FindGatewayStubs
23
23
  <supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
24
24
  <supports_store type="boolean">false</supports_store>
25
25
  <supports_remove type="boolean">false</supports_remove>
26
+ <supports_disburse type="boolean">false</supports_disburse>
26
27
  <supports_fraud_review type="boolean">false</supports_fraud_review>
27
28
  </characteristics>
28
29
  <credentials>
@@ -32,6 +32,7 @@ module FindPaymentMethodStubs
32
32
  <errors>
33
33
  </errors>
34
34
  <verification_value></verification_value>
35
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
35
36
  <number>XXXX-XXXX-XXXX-4445</number>
36
37
  </payment_method>
37
38
  XML
@@ -74,6 +75,7 @@ module FindPaymentMethodStubs
74
75
  <error attribute="number" key="errors.blank">Number can't be blank</error>
75
76
  </errors>
76
77
  <verification_value></verification_value>
78
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
77
79
  <number>XXXX-XXXX-XXXX-1881</number>
78
80
  </payment_method>
79
81
  XML
@@ -39,6 +39,7 @@ module FindTransactionStubs
39
39
  <errors>
40
40
  </errors>
41
41
  <verification_value></verification_value>
42
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
42
43
  <number>XXXX-XXXX-XXXX-4444</number>
43
44
  </payment_method>
44
45
  </transaction>
@@ -95,6 +96,7 @@ module FindTransactionStubs
95
96
  <errors>
96
97
  </errors>
97
98
  <verification_value></verification_value>
99
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
98
100
  <number>XXXX-XXXX-XXXX-2111</number>
99
101
  </payment_method>
100
102
  <api_urls>
@@ -78,6 +78,7 @@ module GatewayOptionsStubs
78
78
  <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
79
79
  <supports_store type="boolean">true</supports_store>
80
80
  <supports_remove type="boolean">false</supports_remove>
81
+ <supports_disburse type="boolean">true</supports_disburse>
81
82
  <supports_fraud_review type="boolean">true</supports_fraud_review>
82
83
  </characteristics>
83
84
  <payment_methods>
@@ -129,6 +130,7 @@ module GatewayOptionsStubs
129
130
  <supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
130
131
  <supports_store type="boolean">false</supports_store>
131
132
  <supports_remove type="boolean">false</supports_remove>
133
+ <supports_disburse type="boolean">true</supports_disburse>
132
134
  <supports_fraud_review type="boolean">false</supports_fraud_review>
133
135
  </characteristics>
134
136
  <payment_methods>
@@ -22,6 +22,7 @@ module ListGatewaysStubs
22
22
  <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
23
23
  <supports_store type="boolean">true</supports_store>
24
24
  <supports_remove type="boolean">true</supports_remove>
25
+ <supports_disburse type="boolean">true</supports_disburse>
25
26
  <supports_fraud_review type="boolean">true</supports_fraud_review>
26
27
  </characteristics>
27
28
  <credentials>
@@ -57,6 +58,7 @@ module ListGatewaysStubs
57
58
  <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
58
59
  <supports_store type="boolean">true</supports_store>
59
60
  <supports_remove type="boolean">true</supports_remove>
61
+ <supports_disburse type="boolean">true</supports_disburse>
60
62
  </characteristics>
61
63
  <credentials>
62
64
  </credentials>
@@ -31,6 +31,7 @@ module ListPaymentMethodsStubs
31
31
  <errors>
32
32
  </errors>
33
33
  <verification_value></verification_value>
34
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
34
35
  <number>XXXX-XXXX-XXXX-4444</number>
35
36
  </payment_method>
36
37
  <payment_method>
@@ -61,6 +62,7 @@ module ListPaymentMethodsStubs
61
62
  <errors>
62
63
  </errors>
63
64
  <verification_value></verification_value>
65
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
64
66
  <number>XXXX-XXXX-XXXX-4444</number>
65
67
  </payment_method>
66
68
  <payment_method>
@@ -16,6 +16,7 @@ module ListTransactionsStubs
16
16
  <order_id nil="true"/>
17
17
  <ip nil="true"/>
18
18
  <description nil="true"/>
19
+ <email nil="true"/>
19
20
  <merchant_name_descriptor nil="true"/>
20
21
  <merchant_location_descriptor nil="true"/>
21
22
  <gateway_specific_fields nil="true"/>
@@ -66,6 +67,7 @@ module ListTransactionsStubs
66
67
  <errors>
67
68
  </errors>
68
69
  <verification_value></verification_value>
70
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
69
71
  <number>XXXX-XXXX-XXXX-4444</number>
70
72
  </payment_method>
71
73
  <api_urls>
@@ -84,6 +86,7 @@ module ListTransactionsStubs
84
86
  <transaction_type>Capture</transaction_type>
85
87
  <order_id nil="true"/>
86
88
  <ip nil="true"/>
89
+ <email nil="true"/>
87
90
  <description nil="true"/>
88
91
  <merchant_name_descriptor nil="true"/>
89
92
  <merchant_location_descriptor nil="true"/>
@@ -22,6 +22,16 @@ module PurchaseStubs
22
22
  <message key="messages.transaction_succeeded">Succeeded!</message>
23
23
  <gateway_token>YOaCn5a9xRaBTGgmGAWbkgWUuqv</gateway_token>
24
24
  <gateway_transaction_id>44</gateway_transaction_id>
25
+ <shipping_address>
26
+ <name nil="true"/>
27
+ <address1 nil="true"/>
28
+ <address2 nil="true"/>
29
+ <city nil="true"/>
30
+ <state nil="true"/>
31
+ <zip nil="true"/>
32
+ <country nil="true"/>
33
+ <phone_number nil="true"//>
34
+ </shipping_address>
25
35
  <response>
26
36
  <success type="boolean">true</success>
27
37
  <message>Successful purchase</message>
@@ -65,6 +75,7 @@ module PurchaseStubs
65
75
  <errors>
66
76
  </errors>
67
77
  <verification_value></verification_value>
78
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
68
79
  <number>XXXX-XXXX-XXXX-4444</number>
69
80
  </payment_method>
70
81
  <api_urls>
@@ -73,6 +84,89 @@ module PurchaseStubs
73
84
  XML
74
85
  end
75
86
 
87
+ def successful_purchase_with_shipping_address_override_response
88
+ StubResponse.succeeded <<-XML
89
+ <transaction>
90
+ <amount type="integer">144</amount>
91
+ <on_test_gateway type="boolean">true</on_test_gateway>
92
+ <created_at type="datetime">2013-07-31T19:46:26Z</created_at>
93
+ <updated_at type="datetime">2013-07-31T19:46:32Z</updated_at>
94
+ <currency_code>USD</currency_code>
95
+ <succeeded type="boolean">true</succeeded>
96
+ <state>succeeded</state>
97
+ <token>Btcyks35m4JLSNOs9ymJoNQLjeX</token>
98
+ <transaction_type>Purchase</transaction_type>
99
+ <order_id>187A</order_id>
100
+ <ip nil="true"/>
101
+ <description>4 Shardblades</description>
102
+ <merchant_name_descriptor nil="true"/>
103
+ <merchant_location_descriptor nil="true"/>
104
+ <gateway_specific_fields nil="true"/>
105
+ <gateway_specific_response_fields nil="true"/>
106
+ <message key="messages.transaction_succeeded">Succeeded!</message>
107
+ <gateway_token>YOaCn5a9xRaBTGgmGAWbkgWUuqv</gateway_token>
108
+ <gateway_transaction_id>44</gateway_transaction_id>
109
+ <shipping_address>
110
+ <name>John Doe</name>
111
+ <address1>123 Main St.</address1>
112
+ <address2>Unit 1</address2>
113
+ <city>Acme</city>
114
+ <state>Corp</state>
115
+ <zip>45678</zip>
116
+ <country>USA</country>
117
+ <phone_number>123-456-7890</phone_number>
118
+ </shipping_address>
119
+ <response>
120
+ <success type="boolean">true</success>
121
+ <message>Successful purchase</message>
122
+ <avs_code>22</avs_code>
123
+ <avs_message nil="true">I will be back</avs_message>
124
+ <cvv_code>31</cvv_code>
125
+ <cvv_message nil="true">Rutabaga</cvv_message>
126
+ <pending type="boolean">false</pending>
127
+ <fraud_review type="boolean">false</fraud_review>
128
+ <error_code>899</error_code>
129
+ <error_detail nil="true">The eagle lives!</error_detail>
130
+ <cancelled type="boolean">false</cancelled>
131
+ <created_at type="datetime">2013-07-31T19:46:26Z</created_at>
132
+ <updated_at type="datetime">2013-07-31T19:46:27Z</updated_at>
133
+ </response>
134
+ <payment_method>
135
+ <token>8xXXIPGXTaPXysDA5OUpgnjTEjK</token>
136
+ <created_at type="datetime">2013-07-31T19:46:25Z</created_at>
137
+ <updated_at type="datetime">2013-07-31T19:46:26Z</updated_at>
138
+ <email>perrin@wot.com</email>
139
+ <data nil="true"/>
140
+ <storage_state>retained</storage_state>
141
+ <last_four_digits>4444</last_four_digits>
142
+ <first_six_digits>411111</first_six_digits>
143
+ <card_type>master</card_type>
144
+ <first_name>Perrin</first_name>
145
+ <last_name>Aybara</last_name>
146
+ <month type="integer">1</month>
147
+ <year type="integer">2019</year>
148
+ <address1 nil="true"/>
149
+ <address2 nil="true"/>
150
+ <city nil="true"/>
151
+ <state nil="true"/>
152
+ <zip nil="true"/>
153
+ <country nil="true"/>
154
+ <phone_number nil="true"/>
155
+ <company>Acme</company>
156
+ <full_name>Perrin Aybara</full_name>
157
+ <payment_method_type>credit_card</payment_method_type>
158
+ <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
159
+ <errors>
160
+ </errors>
161
+ <verification_value></verification_value>
162
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
163
+ <number>XXXX-XXXX-XXXX-4444</number>
164
+ </payment_method>
165
+ <api_urls>
166
+ </api_urls>
167
+ </transaction>
168
+ XML
169
+ end
76
170
  def failed_purchase_response
77
171
  StubResponse.failed <<-XML
78
172
  <transaction>
@@ -138,6 +232,7 @@ module PurchaseStubs
138
232
  <errors>
139
233
  </errors>
140
234
  <verification_value></verification_value>
235
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
141
236
  <number>XXXX-XXXX-XXXX-1881</number>
142
237
  </payment_method>
143
238
  <api_urls>
@@ -28,6 +28,7 @@ module RedactGatewayStubs
28
28
  <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
29
29
  <supports_store type="boolean">true</supports_store>
30
30
  <supports_remove type="boolean">true</supports_remove>
31
+ <supports_disburse type="boolean">true</supports_disburse>
31
32
  </characteristics>
32
33
  <state>redacted</state>
33
34
  <payment_methods>
@@ -43,6 +43,7 @@ module RedactPaymentMethodStubs
43
43
  <errors>
44
44
  </errors>
45
45
  <verification_value></verification_value>
46
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
46
47
  <number>XXXX-XXXX-XXXX-4444</number>
47
48
  </payment_method>
48
49
  </transaction>
@@ -14,6 +14,7 @@ module RefundStubs
14
14
  <transaction_type>Credit</transaction_type>
15
15
  <order_id>99a1</order_id>
16
16
  <ip>182.129.106.102</ip>
17
+ <email>joe@example.com</email>
17
18
  <description>LotsOCoffee</description>
18
19
  <merchant_name_descriptor>My Writeoff Inc.</merchant_name_descriptor>
19
20
  <merchant_location_descriptor>Tax Free Zone</merchant_location_descriptor>
@@ -58,6 +59,7 @@ module RefundStubs
58
59
  <transaction_type>Credit</transaction_type>
59
60
  <order_id nil="true"/>
60
61
  <ip nil="true"/>
62
+ <email nil="true"/>
61
63
  <description nil="true"/>
62
64
  <merchant_name_descriptor nil="true"/>
63
65
  <merchant_location_descriptor nil="true"/>
@@ -38,6 +38,7 @@ module RetainPaymentMethodStubs
38
38
  <errors>
39
39
  </errors>
40
40
  <verification_value></verification_value>
41
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
41
42
  <number>XXXX-XXXX-XXXX-4444</number>
42
43
  </payment_method>
43
44
  </transaction>
@@ -82,6 +83,7 @@ module RetainPaymentMethodStubs
82
83
  <errors>
83
84
  </errors>
84
85
  <verification_value></verification_value>
86
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
85
87
  <number>XXXX-XXXX-XXXX-4444</number>
86
88
  </payment_method>
87
89
  </transaction>
@@ -61,6 +61,7 @@ module StoreStubs
61
61
  <errors>
62
62
  </errors>
63
63
  <verification_value/>
64
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
64
65
  <number>XXXX-XXXX-XXXX-4444</number>
65
66
  </basis_payment_method>
66
67
  <response>
@@ -133,6 +134,7 @@ module StoreStubs
133
134
  <errors>
134
135
  </errors>
135
136
  <verification_value/>
137
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
136
138
  <number>XXXX-XXXX-XXXX-1119</number>
137
139
  </basis_payment_method>
138
140
  <response>
@@ -30,6 +30,7 @@ module UpdateCreditCardStubs
30
30
  <errors>
31
31
  </errors>
32
32
  <verification_value></verification_value>
33
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
33
34
  <number>XXXX-XXXX-XXXX-4444</number>
34
35
  </payment_method>
35
36
  XML
@@ -67,6 +67,7 @@ module VerificationStubs
67
67
  <errors>
68
68
  </errors>
69
69
  <verification_value/>
70
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
70
71
  <number>XXXX-XXXX-XXXX-4444</number>
71
72
  </payment_method>
72
73
  </transaction>
@@ -138,6 +139,7 @@ module VerificationStubs
138
139
  <errors>
139
140
  </errors>
140
141
  <verification_value/>
142
+ <fingerprint>ac5579920013cc571e506805f1c8f3220eff</fingerprint>
141
143
  <number>XXXX-XXXX-XXXX-1881</number>
142
144
  </payment_method>
143
145
  </transaction>
@@ -14,6 +14,7 @@ module VoidStubs
14
14
  <transaction_type>Void</transaction_type>
15
15
  <order_id>49J</order_id>
16
16
  <ip>102.122.012.111</ip>
17
+ <email>joe@example.com</email>
17
18
  <description>Wonderful Description</description>
18
19
  <merchant_name_descriptor>DopeCorp</merchant_name_descriptor>
19
20
  <merchant_location_descriptor>Somewhere</merchant_location_descriptor>
@@ -54,6 +55,7 @@ module VoidStubs
54
55
  <transaction_type>Void</transaction_type>
55
56
  <order_id nil="true"/>
56
57
  <ip nil="true"/>
58
+ <email nil="true"/>
57
59
  <description nil="true"/>
58
60
  <merchant_name_descriptor nil="true"/>
59
61
  <merchant_location_descriptor nil="true"/>
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.15
4
+ version: 2.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spreedly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  requirements: []
260
260
  rubyforge_project:
261
- rubygems_version: 2.4.5
261
+ rubygems_version: 2.4.8
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Provides a Ruby wrapper for the Spreedly API.