balanced 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +1 -0
  4. data/balanced.gemspec +1 -1
  5. data/lib/balanced/client.rb +1 -2
  6. data/lib/balanced/error.rb +3 -3
  7. data/lib/balanced/resources/card.rb +15 -1
  8. data/lib/balanced/version.rb +1 -1
  9. data/scenarios/api_key_create/ruby.mako +6 -6
  10. data/scenarios/api_key_delete/ruby.mako +2 -2
  11. data/scenarios/api_key_list/ruby.mako +10 -10
  12. data/scenarios/api_key_show/ruby.mako +6 -6
  13. data/scenarios/bank_account_associate_to_customer/ruby.mako +14 -14
  14. data/scenarios/bank_account_create/ruby.mako +11 -11
  15. data/scenarios/bank_account_credit/ruby.mako +15 -15
  16. data/scenarios/bank_account_debit/ruby.mako +15 -15
  17. data/scenarios/bank_account_delete/ruby.mako +2 -2
  18. data/scenarios/bank_account_list/ruby.mako +22 -22
  19. data/scenarios/bank_account_show/ruby.mako +12 -12
  20. data/scenarios/bank_account_update/ruby.mako +12 -12
  21. data/scenarios/bank_account_verification_create/definition.rb +1 -1
  22. data/scenarios/bank_account_verification_create/ruby.mako +10 -10
  23. data/scenarios/bank_account_verification_show/definition.rb +1 -1
  24. data/scenarios/bank_account_verification_show/request.rb +1 -1
  25. data/scenarios/bank_account_verification_show/ruby.mako +10 -10
  26. data/scenarios/bank_account_verification_update/definition.rb +1 -1
  27. data/scenarios/bank_account_verification_update/request.rb +1 -1
  28. data/scenarios/bank_account_verification_update/ruby.mako +10 -10
  29. data/scenarios/callback_create/ruby.mako +4 -4
  30. data/scenarios/callback_delete/ruby.mako +2 -2
  31. data/scenarios/callback_list/ruby.mako +4 -4
  32. data/scenarios/callback_show/ruby.mako +5 -5
  33. data/scenarios/card_associate_to_customer/ruby.mako +21 -12
  34. data/scenarios/card_create/ruby.mako +18 -9
  35. data/scenarios/card_create_creditable/definition.rb +1 -0
  36. data/scenarios/card_create_creditable/request.rb +4 -0
  37. data/scenarios/card_create_creditable/ruby.mako +62 -0
  38. data/scenarios/card_create_dispute/ruby.mako +18 -9
  39. data/scenarios/card_credit/definition.rb +1 -0
  40. data/scenarios/card_credit/request.rb +5 -0
  41. data/scenarios/card_credit/ruby.mako +43 -0
  42. data/scenarios/card_debit/ruby.mako +16 -16
  43. data/scenarios/card_debit_dispute/ruby.mako +15 -15
  44. data/scenarios/card_delete/ruby.mako +2 -2
  45. data/scenarios/card_hold_capture/ruby.mako +16 -16
  46. data/scenarios/card_hold_create/ruby.mako +14 -14
  47. data/scenarios/card_hold_list/ruby.mako +25 -25
  48. data/scenarios/card_hold_show/ruby.mako +14 -14
  49. data/scenarios/card_hold_update/ruby.mako +14 -14
  50. data/scenarios/card_hold_void/ruby.mako +15 -15
  51. data/scenarios/card_list/ruby.mako +36 -18
  52. data/scenarios/card_show/ruby.mako +19 -10
  53. data/scenarios/card_update/ruby.mako +19 -10
  54. data/scenarios/credit_list/ruby.mako +14 -14
  55. data/scenarios/credit_list_bank_account/ruby.mako +2 -2
  56. data/scenarios/credit_order/definition.rb +1 -0
  57. data/scenarios/credit_order/request.rb +7 -0
  58. data/scenarios/credit_order/ruby.mako +26 -0
  59. data/scenarios/credit_show/ruby.mako +15 -15
  60. data/scenarios/credit_update/ruby.mako +15 -15
  61. data/scenarios/customer_create/ruby.mako +20 -18
  62. data/scenarios/customer_delete/ruby.mako +1 -1
  63. data/scenarios/customer_list/ruby.mako +39 -35
  64. data/scenarios/customer_show/ruby.mako +21 -19
  65. data/scenarios/customer_update/ruby.mako +21 -19
  66. data/scenarios/debit_dispute_show/ruby.mako +12 -12
  67. data/scenarios/debit_list/ruby.mako +34 -34
  68. data/scenarios/debit_order/definition.rb +1 -0
  69. data/scenarios/debit_order/request.rb +7 -0
  70. data/scenarios/debit_order/ruby.mako +49 -0
  71. data/scenarios/debit_show/ruby.mako +16 -16
  72. data/scenarios/debit_update/ruby.mako +16 -16
  73. data/scenarios/dispute_list/ruby.mako +11 -11
  74. data/scenarios/dispute_show/ruby.mako +12 -12
  75. data/scenarios/event_list/ruby.mako +56 -55
  76. data/scenarios/event_show/ruby.mako +41 -35
  77. data/scenarios/order_create/ruby.mako +14 -14
  78. data/scenarios/order_list/ruby.mako +45 -13
  79. data/scenarios/order_show/ruby.mako +14 -14
  80. data/scenarios/order_update/ruby.mako +14 -14
  81. data/scenarios/refund_create/ruby.mako +13 -13
  82. data/scenarios/refund_list/ruby.mako +12 -12
  83. data/scenarios/refund_show/ruby.mako +13 -13
  84. data/scenarios/refund_update/ruby.mako +13 -13
  85. data/scenarios/render_mako.rb +1 -1
  86. data/scenarios/reversal_create/ruby.mako +12 -12
  87. data/scenarios/reversal_list/ruby.mako +11 -11
  88. data/scenarios/reversal_show/ruby.mako +12 -12
  89. data/scenarios/reversal_update/ruby.mako +12 -12
  90. data/spec/balanced/resources/card_spec.rb +73 -11
  91. data/spec/balanced/resources/credit_spec.rb +155 -26
  92. data/spec/balanced/response/balanced_exception_middleware_spec.rb +1 -2
  93. data/spec/spec_helper.rb +3 -1
  94. metadata +22 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86383adcd168385c196339d998930ac37ccdd332
4
- data.tar.gz: b0b7d50c31202388212e00b1781093a485978816
3
+ metadata.gz: 5a7c70ad40d3145fa342b15bf08330a63d377a3f
4
+ data.tar.gz: 2b1ef00672901e32b9a74d6f326673b971495213
5
5
  SHA512:
6
- metadata.gz: 5003bffd36132ab0f971a82b73ab482f2b511a7ddb12368ec15732fb377992ade7ebea7004908b3e7ac583408966e976f6ea32d7bc6f32e3ce98ac6a04f146ed
7
- data.tar.gz: 5fdafe3211fd76640ef15b0de62736da6cfdcb8f523e15527a41eaf2a31697ceb6535324a189f7d60995d6a520feee53c5bcbc1efe3a782405d122a487e9b924
6
+ metadata.gz: 253351b491ff59782bd0a00ac0777ff403f5556da6d997bf4846714ae1c004bf26e184af476fd574905474ad038beb10f087e89d3bb596ec81b85fc3c6327878
7
+ data.tar.gz: a41466771abd2205cd54484877dda3588b4622cf4828ff73415db1103ff01893f58a1d921ae0c1a0bf6539f681ef9efdc58bb6e6899497e83bae8649938c59d9
@@ -1,3 +1,8 @@
1
+ ## 1.1.0
2
+
3
+ * Push to card support
4
+ * Workaround fixes to allow flexible Faraday versions up to 0.9 (#173)
5
+
1
6
  ## 1.0.2
2
7
 
3
8
  * Pass all options through to underlying calls (#169, #170)
data/Gemfile CHANGED
@@ -19,4 +19,5 @@ group :test do
19
19
  gem "rspec", '~> 2.14.1'
20
20
  gem "rake", '~> 10.0.3'
21
21
  gem "vcr", '~> 2.4.0'
22
+ gem "webmock"
22
23
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.summary = %q{https://docs.balancedpayments.com/}
11
11
  gem.homepage = "https://www.balancedpayments.com"
12
12
 
13
- gem.add_dependency("faraday", '~> 0.8.6')
13
+ gem.add_dependency("faraday", ['>= 0.8.6', '<= 0.9.0'])
14
14
  gem.add_dependency("faraday_middleware", '~> 0.9.0')
15
15
  gem.add_dependency("addressable", '~> 2.3.5')
16
16
 
@@ -39,8 +39,7 @@ module Balanced
39
39
  logger.level = Logger.const_get(config[:logging_level].to_s)
40
40
  end
41
41
 
42
- Faraday.register_middleware :response,
43
- :handle_balanced_errors => lambda {Faraday::Response::RaiseBalancedError}
42
+ Faraday::Response.register_middleware :handle_balanced_errors => lambda { Faraday::Response::RaiseBalancedError }
44
43
 
45
44
  options = {
46
45
  :request => {
@@ -129,8 +129,8 @@ module Balanced
129
129
  class FundingInstrumentVerificationError < Error; end
130
130
 
131
131
  # Raised when Balanced has an issue with you verifying a bank account
132
- class BankAccountVerificationFailure < FundingInstrumentVerificationError
133
-
134
- end
132
+ class BankAccountVerificationFailure < FundingInstrumentVerificationError; end
133
+
134
+ class FundingInstrumentNotCreditable < Error; end
135
135
 
136
136
  end
@@ -8,7 +8,7 @@ module Balanced
8
8
 
9
9
  define_hypermedia_types [:cards]
10
10
 
11
- # Creates a Debit of funds from this Card to the Marketplace's escrow account.
11
+ # Creates a Debit of funds from this Card.
12
12
  #
13
13
  # @param [Hash] options
14
14
  # @return [Debit]
@@ -18,6 +18,20 @@ module Balanced
18
18
  debit.save
19
19
  end
20
20
 
21
+ # Creates a Credit of funds to this Card.
22
+ #
23
+ # @param [Hash] options
24
+ # @return [Credit]
25
+ def credit(options={})
26
+ if ! defined? self.credits
27
+ raise Balanced::FundingInstrumentNotCreditable
28
+ end
29
+
30
+ options[:href] = self.credits.href
31
+ credit = Balanced::Credit.new(options)
32
+ credit.save
33
+ end
34
+
21
35
  # Creates a Hold of funds from this Card to your Marketplace.
22
36
  #
23
37
  # @return [Hold]
@@ -1,3 +1,3 @@
1
1
  module Balanced
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -3,19 +3,19 @@ Balanced::ApiKey.new
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
8
  key = Balanced::ApiKey.new.save
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::ApiKey:0x007fa93eb27070
11
+ #<Balanced::ApiKey:0x007fa7d40b53a0
12
12
  @attributes=
13
- {"created_at"=>"2014-04-25T20:09:11.537493Z",
14
- "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
15
- "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
13
+ {"created_at"=>"2014-05-15T00:38:16.692063Z",
14
+ "href"=>"/api_keys/AK1B3lNyPQ63pRQa1JDC5os5",
15
+ "id"=>"AK1B3lNyPQ63pRQa1JDC5os5",
16
16
  "links"=>{},
17
17
  "meta"=>{},
18
- "secret"=>"ak-test-2hjXn5Ny6P9aFu5jitCvkF06nNIHc3sYN"},
18
+ "secret"=>"ak-test-1GkkDibAyqrZDI1LDfepJSuUqKbSUnqA5"},
19
19
  @hyperlinks={}>
20
20
 
21
21
  % endif
@@ -2,9 +2,9 @@
2
2
  Balanced::ApiKey.unstore
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- key = Balanced::ApiKey.fetch('/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX')
7
+ key = Balanced::ApiKey.fetch('/api_keys/AK1B3lNyPQ63pRQa1JDC5os5')
8
8
  key.unstore
9
9
 
10
10
  % elif mode == 'response':
@@ -2,27 +2,27 @@
2
2
  Balanced::ApiKey.all
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
7
  card = Balanced::ApiKey.all
8
8
 
9
9
  % elif mode == 'response':
10
- [#<Balanced::ApiKey:0x007fa93eb37010
10
+ [#<Balanced::ApiKey:0x007fa7d409cc10
11
11
  @attributes=
12
- {"created_at"=>"2014-04-25T20:09:11.537493Z",
13
- "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
14
- "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
12
+ {"created_at"=>"2014-05-15T00:38:16.692063Z",
13
+ "href"=>"/api_keys/AK1B3lNyPQ63pRQa1JDC5os5",
14
+ "id"=>"AK1B3lNyPQ63pRQa1JDC5os5",
15
15
  "links"=>{},
16
16
  "meta"=>{}},
17
17
  @hyperlinks={}>,
18
- #<Balanced::ApiKey:0x007fa93eb36e58
18
+ #<Balanced::ApiKey:0x007fa7d409ca58
19
19
  @attributes=
20
- {"created_at"=>"2014-04-25T20:09:07.465428Z",
21
- "href"=>"/api_keys/AK3yH23MtlEAProTVXwOnvWl",
22
- "id"=>"AK3yH23MtlEAProTVXwOnvWl",
20
+ {"created_at"=>"2014-05-15T00:38:03.172007Z",
21
+ "href"=>"/api_keys/AK1lQQL8kjXl6bLc7VE4wkUV",
22
+ "id"=>"AK1lQQL8kjXl6bLc7VE4wkUV",
23
23
  "links"=>{},
24
24
  "meta"=>{},
25
- "secret"=>"ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV"},
25
+ "secret"=>"ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp"},
26
26
  @hyperlinks={}>]
27
27
 
28
28
  % endif
@@ -2,15 +2,15 @@
2
2
  Balanced::ApiKey.fetch
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- card = Balanced::ApiKey.fetch('/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX')
7
+ card = Balanced::ApiKey.fetch('/api_keys/AK1B3lNyPQ63pRQa1JDC5os5')
8
8
  % elif mode == 'response':
9
- #<Balanced::ApiKey:0x007fa93eb45a48
9
+ #<Balanced::ApiKey:0x007fa7d4086aa0
10
10
  @attributes=
11
- {"created_at"=>"2014-04-25T20:09:11.537493Z",
12
- "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
13
- "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
11
+ {"created_at"=>"2014-05-15T00:38:16.692063Z",
12
+ "href"=>"/api_keys/AK1B3lNyPQ63pRQa1JDC5os5",
13
+ "id"=>"AK1B3lNyPQ63pRQa1JDC5os5",
14
14
  "links"=>{},
15
15
  "meta"=>{}},
16
16
  @hyperlinks={}>
@@ -3,13 +3,13 @@ Balanced::BankAccount.associate_to_customer
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch("/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd")
9
- bank_account.associate_to_customer("/customers/CU3VYCUIfwngJsidJWdGw2W5")
8
+ bank_account = Balanced::BankAccount.fetch("/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd")
9
+ bank_account.associate_to_customer("/customers/CU2L981m9AtPY8pjpGpjnjnf")
10
10
 
11
11
  % elif mode == 'response':
12
- #<Balanced::BankAccount:0x007fa93eb571d0
12
+ #<Balanced::BankAccount:0x007fa7d4077f00
13
13
  @attributes=
14
14
  {"account_number"=>"xxxxxx0001",
15
15
  "account_type"=>"checking",
@@ -23,27 +23,27 @@ bank_account.associate_to_customer("/customers/CU3VYCUIfwngJsidJWdGw2W5")
23
23
  "bank_name"=>"BANK OF AMERICA, N.A.",
24
24
  "can_credit"=>true,
25
25
  "can_debit"=>false,
26
- "created_at"=>"2014-04-25T20:09:30.053834Z",
26
+ "created_at"=>"2014-05-15T00:39:26.378338Z",
27
27
  "fingerprint"=>
28
28
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
29
- "href"=>"/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd",
30
- "id"=>"BA3Y63fK5STwlhKNMkE3Utmd",
29
+ "href"=>"/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd",
30
+ "id"=>"BA2RqFlRIm0xqCNnHJNLYWMd",
31
31
  "links"=>
32
- {"bank_account_verification"=>nil, "customer"=>"CU3VYCUIfwngJsidJWdGw2W5"},
32
+ {"bank_account_verification"=>nil, "customer"=>"CU2L981m9AtPY8pjpGpjnjnf"},
33
33
  "meta"=>{},
34
34
  "name"=>"Johann Bernoulli",
35
35
  "routing_number"=>"121000358",
36
- "updated_at"=>"2014-04-25T20:09:30.667083Z"},
36
+ "updated_at"=>"2014-05-15T00:39:27.323054Z"},
37
37
  @hyperlinks=
38
38
  {"bank_account_verification"=>
39
- #<Proc:0x007fa93eb565a0/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d40772d0/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "bank_account_verifications"=>
41
- #<Proc:0x007fa93eb54610/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d4075340/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "credits"=>
43
- #<Proc:0x007fa93eb5e660/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa7d401f0d0/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "customer"=>
45
- #<Proc:0x007fa93eb5ccc0/lib/balanced/resources/resource.rb:60 (lambda)>,
45
+ #<Proc:0x007fa7d401d730/lib/balanced/resources/resource.rb:60 (lambda)>,
46
46
  "debits"=>
47
- #<Proc:0x007fa93eb66d38/lib/balanced/utils.rb:6 (lambda)>}>
47
+ #<Proc:0x007fa7d30164e0/lib/balanced/utils.rb:6 (lambda)>}>
48
48
 
49
49
  % endif
@@ -3,7 +3,7 @@ Balanced::BankAccount.new
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
8
  bank_account = Balanced::BankAccount.new(
9
9
  :account_number => '9900000001',
@@ -13,7 +13,7 @@ bank_account = Balanced::BankAccount.new(
13
13
  ).save
14
14
 
15
15
  % elif mode == 'response':
16
- #<Balanced::BankAccount:0x007fa93eb86bb0
16
+ #<Balanced::BankAccount:0x007fa7d1e706c8
17
17
  @attributes=
18
18
  {"account_number"=>"xxxxxx0001",
19
19
  "account_type"=>"checking",
@@ -27,26 +27,26 @@ bank_account = Balanced::BankAccount.new(
27
27
  "bank_name"=>"BANK OF AMERICA, N.A.",
28
28
  "can_credit"=>true,
29
29
  "can_debit"=>false,
30
- "created_at"=>"2014-04-25T20:09:30.053834Z",
30
+ "created_at"=>"2014-05-15T00:39:26.378338Z",
31
31
  "fingerprint"=>
32
32
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
33
- "href"=>"/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd",
34
- "id"=>"BA3Y63fK5STwlhKNMkE3Utmd",
33
+ "href"=>"/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd",
34
+ "id"=>"BA2RqFlRIm0xqCNnHJNLYWMd",
35
35
  "links"=>{"bank_account_verification"=>nil, "customer"=>nil},
36
36
  "meta"=>{},
37
37
  "name"=>"Johann Bernoulli",
38
38
  "routing_number"=>"121000358",
39
- "updated_at"=>"2014-04-25T20:09:30.053837Z"},
39
+ "updated_at"=>"2014-05-15T00:39:26.378342Z"},
40
40
  @hyperlinks=
41
41
  {"bank_account_verification"=>
42
- #<Proc:0x007fa93eb86048/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa7d1e69468/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "bank_account_verifications"=>
44
- #<Proc:0x007fa93eb84130/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fa7d1e5b0e8/lib/balanced/utils.rb:6 (lambda)>,
45
45
  "credits"=>
46
- #<Proc:0x007fa93eb8e180/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa7d1e50cd8/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "customer"=>
48
- #<Proc:0x007fa93eb8d7d0/lib/balanced/utils.rb:6 (lambda)>,
48
+ #<Proc:0x007fa7d1e534b0/lib/balanced/utils.rb:6 (lambda)>,
49
49
  "debits"=>
50
- #<Proc:0x007fa93eb97848/lib/balanced/utils.rb:6 (lambda)>}>
50
+ #<Proc:0x007fa7d1e43538/lib/balanced/utils.rb:6 (lambda)>}>
51
51
 
52
52
  % endif
@@ -3,40 +3,40 @@ Balanced::BankAccount.credit
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd')
8
+ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd')
9
9
  bank_account.credit(:amount => 5000)
10
10
  % elif mode == 'response':
11
- #<Balanced::Credit:0x007fa93ebb71c0
11
+ #<Balanced::Credit:0x007fa7d1dbbe08
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
14
  "appears_on_statement_as"=>"example.com",
15
- "created_at"=>"2014-04-25T20:18:52.480929Z",
15
+ "created_at"=>"2014-05-15T00:43:41.582121Z",
16
16
  "currency"=>"USD",
17
17
  "description"=>nil,
18
18
  "failure_reason"=>nil,
19
19
  "failure_reason_code"=>nil,
20
- "href"=>"/credits/CR6nBcaGvGc4dtflEB1bjKBP",
21
- "id"=>"CR6nBcaGvGc4dtflEB1bjKBP",
20
+ "href"=>"/credits/CR7ushK6kWjPJYdh24QoM1A9",
21
+ "id"=>"CR7ushK6kWjPJYdh24QoM1A9",
22
22
  "links"=>
23
- {"customer"=>"CU3VYCUIfwngJsidJWdGw2W5",
24
- "destination"=>"BA3Y63fK5STwlhKNMkE3Utmd",
23
+ {"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
24
+ "destination"=>"BA2RqFlRIm0xqCNnHJNLYWMd",
25
25
  "order"=>nil},
26
26
  "meta"=>{},
27
27
  "status"=>"succeeded",
28
- "transaction_number"=>"CR666-481-5204",
29
- "updated_at"=>"2014-04-25T20:18:54.380146Z"},
28
+ "transaction_number"=>"CR169-215-3928",
29
+ "updated_at"=>"2014-05-15T00:43:46.428002Z"},
30
30
  @hyperlinks=
31
31
  {"customer"=>
32
- #<Proc:0x007fa93ebb5690/lib/balanced/resources/resource.rb:60 (lambda)>,
32
+ #<Proc:0x007fa7d1db3910/lib/balanced/resources/resource.rb:60 (lambda)>,
33
33
  "destination"=>
34
- #<Proc:0x007fa93ebbfcf8/lib/balanced/resources/resource.rb:60 (lambda)>,
34
+ #<Proc:0x007fa7d1daaea0/lib/balanced/resources/resource.rb:60 (lambda)>,
35
35
  "events"=>
36
- #<Proc:0x007fa93ebbde80/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fa7d1da23e0/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "order"=>
38
- #<Proc:0x007fa93ebbd4a8/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa7d1da0f68/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "reversals"=>
40
- #<Proc:0x007fa93ebc7610/lib/balanced/utils.rb:6 (lambda)>}>
40
+ #<Proc:0x007fa7d1d913b0/lib/balanced/utils.rb:6 (lambda)>}>
41
41
 
42
42
  % endif
@@ -3,9 +3,9 @@ Balanced::BankAccount.debit
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3IhKG3bIN22cLHbaOIGtHb')
8
+ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA1W9SQLf5YRaGbUGiNIO2fb')
9
9
  bank_account.debit(
10
10
  :amount => 5000,
11
11
  :appears_on_statement_as => 'Statement text',
@@ -13,38 +13,38 @@ bank_account.debit(
13
13
  )
14
14
 
15
15
  % elif mode == 'response':
16
- #<Balanced::Debit:0x007fa93ebddb68
16
+ #<Balanced::Debit:0x007fa7d1d437c8
17
17
  @attributes=
18
18
  {"amount"=>5000,
19
19
  "appears_on_statement_as"=>"BAL*Statement text",
20
- "created_at"=>"2014-04-25T20:09:33.925749Z",
20
+ "created_at"=>"2014-05-15T00:39:29.277773Z",
21
21
  "currency"=>"USD",
22
22
  "description"=>"Some descriptive text for the debit in the dashboard",
23
23
  "failure_reason"=>nil,
24
24
  "failure_reason_code"=>nil,
25
- "href"=>"/debits/WD42s4BBkPXvzXTxyo7CLfFj",
26
- "id"=>"WD42s4BBkPXvzXTxyo7CLfFj",
25
+ "href"=>"/debits/WD2UGQIxoTJkklZqAj2lpR9X",
26
+ "id"=>"WD2UGQIxoTJkklZqAj2lpR9X",
27
27
  "links"=>
28
28
  {"customer"=>nil,
29
29
  "dispute"=>nil,
30
30
  "order"=>nil,
31
- "source"=>"BA3IhKG3bIN22cLHbaOIGtHb"},
31
+ "source"=>"BA1W9SQLf5YRaGbUGiNIO2fb"},
32
32
  "meta"=>{},
33
33
  "status"=>"succeeded",
34
- "transaction_number"=>"W212-186-3238",
35
- "updated_at"=>"2014-04-25T20:09:34.551675Z"},
34
+ "transaction_number"=>"W708-603-3376",
35
+ "updated_at"=>"2014-05-15T00:39:31.007857Z"},
36
36
  @hyperlinks=
37
37
  {"customer"=>
38
- #<Proc:0x007fa93ebdd028/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa7d1d31c80/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "dispute"=>
40
- #<Proc:0x007fa93ebdc6a0/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa7d1d2be98/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007fa93ebe67e0/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa7d1d28c70/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "order"=>
44
- #<Proc:0x007fa93ebe5e08/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fa7d1d231f8/lib/balanced/utils.rb:6 (lambda)>,
45
45
  "refunds"=>
46
- #<Proc:0x007fa93ebeff70/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa7d1d19ce8/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "source"=>
48
- #<Proc:0x007fa93ebee5d0/lib/balanced/resources/resource.rb:60 (lambda)>}>
48
+ #<Proc:0x007fa7d1d139d8/lib/balanced/resources/resource.rb:60 (lambda)>}>
49
49
 
50
50
  % endif
@@ -3,9 +3,9 @@ Balanced::BankAccount.unstore
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3PDwDCkdeC4OgPtPNwoCWl')
8
+ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj')
9
9
  bank_account.unstore
10
10
 
11
11
  % elif mode == 'response':
@@ -3,12 +3,12 @@ Balanced::BankAccount.all
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
8
  Balanced::BankAccount.all
9
9
 
10
10
  % elif mode == 'response':
11
- [#<Balanced::BankAccount:0x007fa93ec0c3a0
11
+ [#<Balanced::BankAccount:0x007fa7d1c9b410
12
12
  @attributes=
13
13
  {"account_number"=>"xxxxxx0001",
14
14
  "account_type"=>"checking",
@@ -22,28 +22,28 @@ Balanced::BankAccount.all
22
22
  "bank_name"=>"BANK OF AMERICA, N.A.",
23
23
  "can_credit"=>true,
24
24
  "can_debit"=>false,
25
- "created_at"=>"2014-04-25T20:09:22.528624Z",
25
+ "created_at"=>"2014-05-15T00:39:14.751497Z",
26
26
  "fingerprint"=>
27
27
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
28
- "href"=>"/bank_accounts/BA3PDwDCkdeC4OgPtPNwoCWl",
29
- "id"=>"BA3PDwDCkdeC4OgPtPNwoCWl",
28
+ "href"=>"/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj",
29
+ "id"=>"BA2EmblHC08bmwiwwNrbI0Rj",
30
30
  "links"=>{"bank_account_verification"=>nil, "customer"=>nil},
31
31
  "meta"=>{},
32
32
  "name"=>"Johann Bernoulli",
33
33
  "routing_number"=>"121000358",
34
- "updated_at"=>"2014-04-25T20:09:22.528628Z"},
34
+ "updated_at"=>"2014-05-15T00:39:14.751501Z"},
35
35
  @hyperlinks=
36
36
  {"bank_account_verification"=>
37
- #<Proc:0x007fa93ec177f0/lib/balanced/utils.rb:6 (lambda)>,
37
+ #<Proc:0x007fa7d1c93260/lib/balanced/utils.rb:6 (lambda)>,
38
38
  "bank_account_verifications"=>
39
- #<Proc:0x007fa93ec158d8/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d1c83860/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "credits"=>
41
- #<Proc:0x007fa93ec1f900/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d1c7b1b0/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "customer"=>
43
- #<Proc:0x007fa93ec1ef50/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa7d1c79720/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "debits"=>
45
- #<Proc:0x007fa93ec1d010/lib/balanced/utils.rb:6 (lambda)>}>,
46
- #<Balanced::BankAccount:0x007fa93ec1cfc0
45
+ #<Proc:0x007fa7d1c6af90/lib/balanced/utils.rb:6 (lambda)>}>,
46
+ #<Balanced::BankAccount:0x007fa7d1c6af40
47
47
  @attributes=
48
48
  {"account_number"=>"xxxxxx0001",
49
49
  "account_type"=>"checking",
@@ -57,28 +57,28 @@ Balanced::BankAccount.all
57
57
  "bank_name"=>"BANK OF AMERICA, N.A.",
58
58
  "can_credit"=>true,
59
59
  "can_debit"=>true,
60
- "created_at"=>"2014-04-25T20:09:15.992626Z",
60
+ "created_at"=>"2014-05-15T00:38:35.458618Z",
61
61
  "fingerprint"=>
62
62
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
63
- "href"=>"/bank_accounts/BA3IhKG3bIN22cLHbaOIGtHb",
64
- "id"=>"BA3IhKG3bIN22cLHbaOIGtHb",
63
+ "href"=>"/bank_accounts/BA1W9SQLf5YRaGbUGiNIO2fb",
64
+ "id"=>"BA1W9SQLf5YRaGbUGiNIO2fb",
65
65
  "links"=>
66
- {"bank_account_verification"=>"BZ3KkIZuSazKfqFrFIfsrhmB",
66
+ {"bank_account_verification"=>"BZ2hpl7vb9rgWVZxrXRzZb93",
67
67
  "customer"=>nil},
68
68
  "meta"=>{},
69
69
  "name"=>"Johann Bernoulli",
70
70
  "routing_number"=>"121000358",
71
- "updated_at"=>"2014-04-25T20:09:20.850706Z"},
71
+ "updated_at"=>"2014-05-15T00:39:12.506691Z"},
72
72
  @hyperlinks=
73
73
  {"bank_account_verification"=>
74
- #<Proc:0x007fa93ec1f310/lib/balanced/resources/resource.rb:60 (lambda)>,
74
+ #<Proc:0x007fa7d1c68330/lib/balanced/resources/resource.rb:60 (lambda)>,
75
75
  "bank_account_verifications"=>
76
- #<Proc:0x007fa93ec1d380/lib/balanced/utils.rb:6 (lambda)>,
76
+ #<Proc:0x007fa7d1c58548/lib/balanced/utils.rb:6 (lambda)>,
77
77
  "credits"=>
78
- #<Proc:0x007fa93ec169e0/lib/balanced/utils.rb:6 (lambda)>,
78
+ #<Proc:0x007fa7d1c4bbe0/lib/balanced/utils.rb:6 (lambda)>,
79
79
  "customer"=>
80
- #<Proc:0x007fa93ec16030/lib/balanced/utils.rb:6 (lambda)>,
80
+ #<Proc:0x007fa7d1c48ee0/lib/balanced/utils.rb:6 (lambda)>,
81
81
  "debits"=>
82
- #<Proc:0x007fa93ec0ffa0/lib/balanced/utils.rb:6 (lambda)>}>]
82
+ #<Proc:0x007fa7d1c320c8/lib/balanced/utils.rb:6 (lambda)>}>]
83
83
 
84
84
  % endif