spreedly 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c7d94dc208fad4a7a5a4f97f591907c3f65e5ca
4
- data.tar.gz: f6a2d23c816d162a8397b25c491e9f5b22eecadf
3
+ metadata.gz: 1d3536add302f60e0f9c0a6d3e03f31ca6b1ba72
4
+ data.tar.gz: 05b193ba95d04a5b4fe40c3dbf8e87dc5ee0f3c8
5
5
  SHA512:
6
- metadata.gz: c4ef08fd584478af5a36df1186848f360705212029eb580ef194960ddf74db590b2068dc803728c6fe3d0b56d55ec768d66bdb4698be627b1a79e7d1b9bf2e4a
7
- data.tar.gz: 46adb6b5ebb0a6b0b86215a71758a005ed8e3ced97810768be30593ececcb26e06b8522815a990fbd18896fff05df89302511d1d62ae34b019c6b88d5046e4bf
6
+ metadata.gz: 389d569b613f65d763383b1fedba752adcca0b47024e4a2887ac323315e1e93e49fa28cbc7003bb0652a40852089c092feb65bb45c9593aea027d1036396d6e1
7
+ data.tar.gz: bb4f1a6b376557a35f67b5c249e7934dbdd839fe3a028d5341b69234629ce4fb5c18fab95335d61853a378a7959b7cf1279d8dc2a515b041d1e20a303205f92a
data/lib/spreedly.rb CHANGED
@@ -12,6 +12,7 @@ require 'spreedly/payment_methods/credit_card'
12
12
  require 'spreedly/payment_methods/paypal'
13
13
  require 'spreedly/payment_methods/sprel'
14
14
  require 'spreedly/payment_methods/bank_account'
15
+ require 'spreedly/payment_methods/third_party_token'
15
16
  require 'spreedly/transactions/transaction'
16
17
  require 'spreedly/transactions/gateway_transaction'
17
18
  require 'spreedly/transactions/add_payment_method'
@@ -24,6 +24,8 @@ module Spreedly
24
24
  return Sprel.new(xml_doc)
25
25
  when 'bank_account'
26
26
  return BankAccount.new(xml_doc)
27
+ when 'third_party_token'
28
+ return ThirdPartyToken.new(xml_doc)
27
29
  end
28
30
  end
29
31
 
@@ -0,0 +1,8 @@
1
+ module Spreedly
2
+
3
+ class ThirdPartyToken < Model
4
+ field :gateway_type, :storage_state
5
+ field :third_party_token
6
+ end
7
+
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Spreedly
2
- VERSION = "2.0.10"
2
+ VERSION = "2.0.11"
3
3
  end
@@ -13,12 +13,19 @@ class ListPaymentMethodsTest < Test::Unit::TestCase
13
13
  list = list_using(successful_list_payment_methods_response)
14
14
 
15
15
  assert_kind_of(Array, list)
16
- assert_equal 2, list.size
16
+ assert_equal 5, list.size
17
17
 
18
- assert_equal 'Perrin Aybara', list.first.full_name
19
- assert_equal 'Mat Cauthon', list.last.full_name
20
18
  assert_kind_of Spreedly::CreditCard, list.first
21
- assert_kind_of Spreedly::CreditCard, list.last
19
+ assert_kind_of Spreedly::CreditCard, list[1]
20
+ assert_kind_of Spreedly::ThirdPartyToken, list[2]
21
+ assert_kind_of Spreedly::Sprel, list[3]
22
+ assert_kind_of Spreedly::BankAccount, list[4]
23
+
24
+ assert_equal 'Perrin Aybara', list.first.full_name
25
+ assert_equal 'Mat Cauthon', list[1].full_name
26
+ assert_equal 'test_vault:4111111111111111', list[2].third_party_token
27
+ assert_equal 'retained', list[3].storage_state
28
+ assert_equal '4321', list[4].account_number_display_digits
22
29
  end
23
30
 
24
31
  def test_request_url
@@ -57,6 +57,53 @@ module ListPaymentMethodsStubs
57
57
  <verification_value></verification_value>
58
58
  <number>XXXX-XXXX-XXXX-4444</number>
59
59
  </payment_method>
60
+ <payment_method>
61
+ <token>RllfVekUSmqgEP8rpS2M1z9HG6C</token>
62
+ <created_at type="datetime">2014-05-30T19:51:48Z</created_at>
63
+ <updated_at type="datetime">2014-05-30T19:51:48Z</updated_at>
64
+ <gateway_type>test</gateway_type>
65
+ <storage_state>retained</storage_state>
66
+ <third_party_token>test_vault:4111111111111111</third_party_token>
67
+ <payment_method_type>third_party_token</payment_method_type>
68
+ <errors>
69
+ </errors>
70
+ </payment_method>
71
+ <payment_method>
72
+ <token>KX7Y1oePqya4JAQ5bMIY9Vi87xb</token>
73
+ <created_at type="datetime">2014-05-21T21:21:32Z</created_at>
74
+ <updated_at type="datetime">2014-05-22T03:42:27Z</updated_at>
75
+ <email nil="true"/>
76
+ <data>
77
+ <blah>whatever</blah>
78
+ </data>
79
+ <storage_state>retained</storage_state>
80
+ <test type="boolean">true</test>
81
+ <payment_method_type>sprel</payment_method_type>
82
+ <errors>
83
+ </errors>
84
+ </payment_method>
85
+ <payment_method>
86
+ <token>47KP5QXHYuv5N2LKu8hExMY7Okr</token>
87
+ <created_at type="datetime">2014-05-21T21:08:33Z</created_at>
88
+ <updated_at type="datetime">2014-05-21T21:08:33Z</updated_at>
89
+ <email nil="true"/>
90
+ <data nil="true"/>
91
+ <storage_state>cached</storage_state>
92
+ <test type="boolean">true</test>
93
+ <full_name>Bob Smith</full_name>
94
+ <bank_name>First Bank of Elbonia</bank_name>
95
+ <account_type>checking</account_type>
96
+ <account_holder_type>personal</account_holder_type>
97
+ <routing_number_display_digits>021</routing_number_display_digits>
98
+ <account_number_display_digits>4321</account_number_display_digits>
99
+ <first_name>Bob</first_name>
100
+ <last_name>Smith</last_name>
101
+ <payment_method_type>bank_account</payment_method_type>
102
+ <errors>
103
+ </errors>
104
+ <routing_number>021*</routing_number>
105
+ <account_number>*4321</account_number>
106
+ </payment_method>
60
107
  </payment_methods>
61
108
  XML
62
109
  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.10
4
+ version: 2.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spreedly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-09 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -125,6 +125,7 @@ files:
125
125
  - lib/spreedly/payment_methods/payment_method.rb
126
126
  - lib/spreedly/payment_methods/paypal.rb
127
127
  - lib/spreedly/payment_methods/sprel.rb
128
+ - lib/spreedly/payment_methods/third_party_token.rb
128
129
  - lib/spreedly/ssl_requester.rb
129
130
  - lib/spreedly/transactions/add_payment_method.rb
130
131
  - lib/spreedly/transactions/auth_purchase.rb