balanced 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/CHANGELOG.md +5 -0
  4. data/lib/balanced/resources/credit.rb +2 -7
  5. data/lib/balanced/resources/debit.rb +2 -7
  6. data/lib/balanced/resources/order.rb +10 -9
  7. data/lib/balanced/version.rb +1 -1
  8. data/scenarios/api_key_create/ruby.mako +6 -6
  9. data/scenarios/api_key_delete/ruby.mako +2 -2
  10. data/scenarios/api_key_list/ruby.mako +10 -10
  11. data/scenarios/api_key_show/ruby.mako +6 -6
  12. data/scenarios/bank_account_associate_to_customer/definition.rb +1 -1
  13. data/scenarios/bank_account_associate_to_customer/request.rb +2 -2
  14. data/scenarios/bank_account_associate_to_customer/ruby.mako +15 -15
  15. data/scenarios/bank_account_create/ruby.mako +11 -11
  16. data/scenarios/bank_account_credit/ruby.mako +15 -15
  17. data/scenarios/bank_account_debit/ruby.mako +15 -15
  18. data/scenarios/bank_account_delete/ruby.mako +2 -2
  19. data/scenarios/bank_account_list/ruby.mako +22 -22
  20. data/scenarios/bank_account_show/ruby.mako +12 -12
  21. data/scenarios/bank_account_update/ruby.mako +12 -12
  22. data/scenarios/bank_account_verification_create/ruby.mako +9 -9
  23. data/scenarios/bank_account_verification_show/ruby.mako +9 -9
  24. data/scenarios/bank_account_verification_update/ruby.mako +9 -9
  25. data/scenarios/callback_create/ruby.mako +4 -4
  26. data/scenarios/callback_delete/ruby.mako +2 -2
  27. data/scenarios/callback_list/ruby.mako +4 -4
  28. data/scenarios/callback_show/ruby.mako +5 -5
  29. data/scenarios/card_associate_to_customer/definition.rb +1 -1
  30. data/scenarios/card_associate_to_customer/request.rb +1 -1
  31. data/scenarios/card_associate_to_customer/ruby.mako +13 -14
  32. data/scenarios/card_create/ruby.mako +9 -9
  33. data/scenarios/card_create_dispute/definition.rb +1 -0
  34. data/scenarios/card_create_dispute/request.rb +4 -0
  35. data/scenarios/card_create_dispute/ruby.mako +53 -0
  36. data/scenarios/card_debit/ruby.mako +16 -16
  37. data/scenarios/card_debit_dispute/definition.rb +1 -0
  38. data/scenarios/card_debit_dispute/request.rb +5 -0
  39. data/scenarios/card_debit_dispute/ruby.mako +49 -0
  40. data/scenarios/card_delete/ruby.mako +2 -2
  41. data/scenarios/card_hold_capture/ruby.mako +16 -16
  42. data/scenarios/card_hold_create/ruby.mako +14 -14
  43. data/scenarios/card_hold_list/ruby.mako +25 -25
  44. data/scenarios/card_hold_show/ruby.mako +14 -14
  45. data/scenarios/card_hold_update/ruby.mako +14 -14
  46. data/scenarios/card_hold_void/definition.rb +1 -1
  47. data/scenarios/card_hold_void/request.rb +1 -1
  48. data/scenarios/card_hold_void/ruby.mako +17 -17
  49. data/scenarios/card_list/ruby.mako +18 -18
  50. data/scenarios/card_show/ruby.mako +10 -10
  51. data/scenarios/card_update/ruby.mako +10 -10
  52. data/scenarios/credit_list/ruby.mako +14 -14
  53. data/scenarios/credit_list_bank_account/ruby.mako +2 -2
  54. data/scenarios/credit_show/ruby.mako +15 -15
  55. data/scenarios/credit_update/ruby.mako +15 -15
  56. data/scenarios/customer_create/ruby.mako +18 -18
  57. data/scenarios/customer_delete/ruby.mako +1 -1
  58. data/scenarios/customer_list/ruby.mako +35 -35
  59. data/scenarios/customer_show/ruby.mako +19 -19
  60. data/scenarios/customer_update/ruby.mako +19 -19
  61. data/scenarios/debit_dispute_show/definition.rb +1 -0
  62. data/scenarios/debit_dispute_show/request.rb +3 -0
  63. data/scenarios/debit_dispute_show/ruby.mako +31 -0
  64. data/scenarios/debit_list/ruby.mako +29 -29
  65. data/scenarios/debit_show/ruby.mako +16 -16
  66. data/scenarios/debit_update/ruby.mako +16 -16
  67. data/scenarios/dispute_list/definition.rb +1 -0
  68. data/scenarios/dispute_list/request.rb +2 -0
  69. data/scenarios/dispute_list/ruby.mako +29 -0
  70. data/scenarios/dispute_show/definition.rb +1 -0
  71. data/scenarios/dispute_show/request.rb +2 -0
  72. data/scenarios/dispute_show/ruby.mako +31 -0
  73. data/scenarios/event_list/ruby.mako +55 -55
  74. data/scenarios/event_show/ruby.mako +35 -40
  75. data/scenarios/order_create/ruby.mako +14 -14
  76. data/scenarios/order_list/ruby.mako +13 -13
  77. data/scenarios/order_show/ruby.mako +14 -14
  78. data/scenarios/order_update/ruby.mako +14 -14
  79. data/scenarios/refund_create/ruby.mako +13 -13
  80. data/scenarios/refund_list/ruby.mako +12 -12
  81. data/scenarios/refund_show/ruby.mako +13 -13
  82. data/scenarios/refund_update/ruby.mako +13 -13
  83. data/scenarios/render_mako.rb +15 -3
  84. data/scenarios/reversal_create/ruby.mako +12 -12
  85. data/scenarios/reversal_list/ruby.mako +11 -11
  86. data/scenarios/reversal_show/ruby.mako +12 -12
  87. data/scenarios/reversal_update/ruby.mako +12 -12
  88. data/spec/balanced/resources/credit_spec.rb +26 -5
  89. data/spec/balanced/resources/debit_spec.rb +7 -2
  90. data/spec/balanced/resources/order_spec.rb +25 -3
  91. metadata +17 -3
  92. data/scenario.cache +0 -619
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62543312811ec0d4471ffdad6f315b97a852980b
4
- data.tar.gz: 94233502466ef24cccf974febc6ee8f759b175b7
3
+ metadata.gz: 86383adcd168385c196339d998930ac37ccdd332
4
+ data.tar.gz: b0b7d50c31202388212e00b1781093a485978816
5
5
  SHA512:
6
- metadata.gz: 3b0d73d1f77586f2793121c0d7b696dce73aef2ca6b798b8c069d07cfa2c2bbc971d7543a751c404adea8754f4ea376e6232648cd727dd5eefe4c6b29d809f67
7
- data.tar.gz: b3665359953b20bd00a3041251e491f80e8d5ad391e24ae942c2cd23a84afaff8ed688f731f438e400162ea263b392c45ce9f9cd7c5e23e5f28a1cd44d463c88
6
+ metadata.gz: 5003bffd36132ab0f971a82b73ab482f2b511a7ddb12368ec15732fb377992ade7ebea7004908b3e7ac583408966e976f6ea32d7bc6f32e3ce98ac6a04f146ed
7
+ data.tar.gz: 5fdafe3211fd76640ef15b0de62736da6cfdcb8f523e15527a41eaf2a31697ceb6535324a189f7d60995d6a520feee53c5bcbc1efe3a782405d122a487e9b924
data/.gitignore CHANGED
@@ -33,4 +33,5 @@ spec/cassettes
33
33
  # OS X
34
34
  .DS_Store
35
35
 
36
- .rbenv-version
36
+ .rbenv-version
37
+ scenario.cache
@@ -1,3 +1,8 @@
1
+ ## 1.0.2
2
+
3
+ * Pass all options through to underlying calls (#169, #170)
4
+
5
+
1
6
  ## 1.0.1
2
7
 
3
8
  * Fix for nil or empty string resource fetch
@@ -13,14 +13,9 @@ module Balanced
13
13
  define_hypermedia_types [:credits]
14
14
 
15
15
  def reverse(options={})
16
- amount = options[:amount]
17
- description = options[:description]
16
+ options[:href] = self.reversals.href
18
17
 
19
- reversal = Reversal.new(
20
- :href => self.reversals.href,
21
- :amount => amount,
22
- :description => description
23
- )
18
+ reversal = Reversal.new(options)
24
19
  reversal.save
25
20
  end
26
21
 
@@ -24,14 +24,9 @@ module Balanced
24
24
  # @return [Refund]
25
25
  def refund(options={})
26
26
 
27
- amount = options[:amount]
28
- description = options[:description]
27
+ options[:href] = self.refunds.href
29
28
 
30
- refund = Refund.new(
31
- :href => self.refunds.href,
32
- :amount => amount,
33
- :description => description
34
- )
29
+ refund = Refund.new(options)
35
30
  refund.save
36
31
  end
37
32
 
@@ -30,23 +30,24 @@ module Balanced
30
30
  def debit_from(options={})
31
31
  Balanced::Utils.assert_required_keys(options, :required => [:source, :amount])
32
32
 
33
+ options[:order] = self.href
33
34
  source = options[:source]
34
- amount = options[:amount]
35
-
36
- debit = source.debit(
37
- :amount => amount,
38
- :order => self.href
39
- )
40
-
35
+
36
+ debit = source.debit(options)
37
+
41
38
  debit
42
39
  end
43
40
 
44
41
  def credit_to(options={})
45
42
  Balanced::Utils.assert_required_keys(options, :required => [:destination, :amount])
43
+
44
+ options[:order] = self.href
46
45
  destination = options[:destination]
47
- amount = options[:amount]
46
+
48
47
  # should have a way here to disburse more funds to another account, but not required
49
- destination.credit(:amount => amount, :order => self.href)
48
+ credit = destination.credit(options)
49
+
50
+ credit
50
51
  end
51
52
 
52
53
  private
@@ -1,3 +1,3 @@
1
1
  module Balanced
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
7
7
 
8
8
  key = Balanced::ApiKey.new.save
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::ApiKey:0x007fa4e49e9748
11
+ #<Balanced::ApiKey:0x007fa93eb27070
12
12
  @attributes=
13
- {"created_at"=>"2014-03-06T19:22:18.256643Z",
14
- "href"=>"/api_keys/AK4Vt1mJyCtjdSiGgqAebarR",
15
- "id"=>"AK4Vt1mJyCtjdSiGgqAebarR",
13
+ {"created_at"=>"2014-04-25T20:09:11.537493Z",
14
+ "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
15
+ "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
16
16
  "links"=>{},
17
17
  "meta"=>{},
18
- "secret"=>"ak-test-4bQUCg96rUwLV8FZXSTeq8WUSqROO9yT"},
18
+ "secret"=>"ak-test-2hjXn5Ny6P9aFu5jitCvkF06nNIHc3sYN"},
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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
5
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
6
 
7
- key = Balanced::ApiKey.fetch('/api_keys/AK4Vt1mJyCtjdSiGgqAebarR')
7
+ key = Balanced::ApiKey.fetch('/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX')
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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
5
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
6
 
7
7
  card = Balanced::ApiKey.all
8
8
 
9
9
  % elif mode == 'response':
10
- [#<Balanced::ApiKey:0x007fa4e49d8858
10
+ [#<Balanced::ApiKey:0x007fa93eb37010
11
11
  @attributes=
12
- {"created_at"=>"2014-03-06T19:22:18.256643Z",
13
- "href"=>"/api_keys/AK4Vt1mJyCtjdSiGgqAebarR",
14
- "id"=>"AK4Vt1mJyCtjdSiGgqAebarR",
12
+ {"created_at"=>"2014-04-25T20:09:11.537493Z",
13
+ "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
14
+ "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
15
15
  "links"=>{},
16
16
  "meta"=>{}},
17
17
  @hyperlinks={}>,
18
- #<Balanced::ApiKey:0x007fa4e49d85b0
18
+ #<Balanced::ApiKey:0x007fa93eb36e58
19
19
  @attributes=
20
- {"created_at"=>"2014-03-06T19:22:11.872886Z",
21
- "href"=>"/api_keys/AK4OhVZUPzjD3YSCWBjU1dHO",
22
- "id"=>"AK4OhVZUPzjD3YSCWBjU1dHO",
20
+ {"created_at"=>"2014-04-25T20:09:07.465428Z",
21
+ "href"=>"/api_keys/AK3yH23MtlEAProTVXwOnvWl",
22
+ "id"=>"AK3yH23MtlEAProTVXwOnvWl",
23
23
  "links"=>{},
24
24
  "meta"=>{},
25
- "secret"=>"ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul"},
25
+ "secret"=>"ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV"},
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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
5
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
6
 
7
- card = Balanced::ApiKey.fetch('/api_keys/AK4Vt1mJyCtjdSiGgqAebarR')
7
+ card = Balanced::ApiKey.fetch('/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX')
8
8
  % elif mode == 'response':
9
- #<Balanced::ApiKey:0x007fa4e49c1d88
9
+ #<Balanced::ApiKey:0x007fa93eb45a48
10
10
  @attributes=
11
- {"created_at"=>"2014-03-06T19:22:18.256643Z",
12
- "href"=>"/api_keys/AK4Vt1mJyCtjdSiGgqAebarR",
13
- "id"=>"AK4Vt1mJyCtjdSiGgqAebarR",
11
+ {"created_at"=>"2014-04-25T20:09:11.537493Z",
12
+ "href"=>"/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX",
13
+ "id"=>"AK3DgZwSCD2ggxGSw1bsiyDX",
14
14
  "links"=>{},
15
15
  "meta"=>{}},
16
16
  @hyperlinks={}>
@@ -1 +1 @@
1
- Balanced::Customer.add_bank_account
1
+ Balanced::BankAccount.associate_to_customer
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
- customer = Balanced::Customer.fetch('<%= request['customer_href'] %>')
3
- customer.add_bank_account("<%= payload['bank_account_href'] %>")
2
+ bank_account = Balanced::BankAccount.fetch("<%= request['uri'] %>")
3
+ bank_account.associate_to_customer("<%= payload['customer'] %>")
@@ -1,15 +1,15 @@
1
1
  % if mode == 'definition':
2
- Balanced::Customer.add_bank_account
2
+ Balanced::BankAccount.associate_to_customer
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
7
7
 
8
- customer = Balanced::Customer.fetch('/customers/CU64R7DS6DwuXYVg9RTskFK8')
9
- customer.add_bank_account("")
8
+ bank_account = Balanced::BankAccount.fetch("/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd")
9
+ bank_account.associate_to_customer("/customers/CU3VYCUIfwngJsidJWdGw2W5")
10
10
 
11
11
  % elif mode == 'response':
12
- #<Balanced::BankAccount:0x007fa4e49b1fc8
12
+ #<Balanced::BankAccount:0x007fa93eb571d0
13
13
  @attributes=
14
14
  {"account_number"=>"xxxxxx0001",
15
15
  "account_type"=>"checking",
@@ -23,27 +23,27 @@ customer.add_bank_account("")
23
23
  "bank_name"=>"BANK OF AMERICA, N.A.",
24
24
  "can_credit"=>true,
25
25
  "can_debit"=>false,
26
- "created_at"=>"2014-03-06T19:23:27.876147Z",
26
+ "created_at"=>"2014-04-25T20:09:30.053834Z",
27
27
  "fingerprint"=>
28
28
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
29
- "href"=>"/bank_accounts/BA6bLGpQZPOiTNRxF24rMd9m",
30
- "id"=>"BA6bLGpQZPOiTNRxF24rMd9m",
29
+ "href"=>"/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd",
30
+ "id"=>"BA3Y63fK5STwlhKNMkE3Utmd",
31
31
  "links"=>
32
- {"bank_account_verification"=>nil, "customer"=>"CU64R7DS6DwuXYVg9RTskFK8"},
32
+ {"bank_account_verification"=>nil, "customer"=>"CU3VYCUIfwngJsidJWdGw2W5"},
33
33
  "meta"=>{},
34
34
  "name"=>"Johann Bernoulli",
35
35
  "routing_number"=>"121000358",
36
- "updated_at"=>"2014-03-06T19:23:28.930538Z"},
36
+ "updated_at"=>"2014-04-25T20:09:30.667083Z"},
37
37
  @hyperlinks=
38
38
  {"bank_account_verification"=>
39
- #<Proc:0x007fa4e49b09e8/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa93eb565a0/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "bank_account_verifications"=>
41
- #<Proc:0x007fa4e49a9f30/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa93eb54610/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "credits"=>
43
- #<Proc:0x007fa4e49a3ec8/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa93eb5e660/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "customer"=>
45
- #<Proc:0x007fa4e49a12b8/lib/balanced/resources/resource.rb:60 (lambda)>,
45
+ #<Proc:0x007fa93eb5ccc0/lib/balanced/resources/resource.rb:60 (lambda)>,
46
46
  "debits"=>
47
- #<Proc:0x007fa4e499a558/lib/balanced/utils.rb:6 (lambda)>}>
47
+ #<Proc:0x007fa93eb66d38/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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
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:0x007fa4e49749c0
16
+ #<Balanced::BankAccount:0x007fa93eb86bb0
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-03-06T19:23:27.876147Z",
30
+ "created_at"=>"2014-04-25T20:09:30.053834Z",
31
31
  "fingerprint"=>
32
32
  "5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
33
- "href"=>"/bank_accounts/BA6bLGpQZPOiTNRxF24rMd9m",
34
- "id"=>"BA6bLGpQZPOiTNRxF24rMd9m",
33
+ "href"=>"/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd",
34
+ "id"=>"BA3Y63fK5STwlhKNMkE3Utmd",
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-03-06T19:23:27.876150Z"},
39
+ "updated_at"=>"2014-04-25T20:09:30.053837Z"},
40
40
  @hyperlinks=
41
41
  {"bank_account_verification"=>
42
- #<Proc:0x007fa4e496f858/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa93eb86048/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "bank_account_verifications"=>
44
- #<Proc:0x007fa4e496d508/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fa93eb84130/lib/balanced/utils.rb:6 (lambda)>,
45
45
  "credits"=>
46
- #<Proc:0x007fa4e4966b40/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa93eb8e180/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "customer"=>
48
- #<Proc:0x007fa4e4965f60/lib/balanced/utils.rb:6 (lambda)>,
48
+ #<Proc:0x007fa93eb8d7d0/lib/balanced/utils.rb:6 (lambda)>,
49
49
  "debits"=>
50
- #<Proc:0x007fa4e495fcc8/lib/balanced/utils.rb:6 (lambda)>}>
50
+ #<Proc:0x007fa93eb97848/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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA6bLGpQZPOiTNRxF24rMd9m')
8
+ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd')
9
9
  bank_account.credit(:amount => 5000)
10
10
  % elif mode == 'response':
11
- #<Balanced::Credit:0x007fa4e412db40
11
+ #<Balanced::Credit:0x007fa93ebb71c0
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
14
  "appears_on_statement_as"=>"example.com",
15
- "created_at"=>"2014-03-06T19:23:54.514782Z",
15
+ "created_at"=>"2014-04-25T20:18:52.480929Z",
16
16
  "currency"=>"USD",
17
17
  "description"=>nil,
18
18
  "failure_reason"=>nil,
19
19
  "failure_reason_code"=>nil,
20
- "href"=>"/credits/CR6NpuEtezCdLTYngDrSEODv",
21
- "id"=>"CR6NpuEtezCdLTYngDrSEODv",
20
+ "href"=>"/credits/CR6nBcaGvGc4dtflEB1bjKBP",
21
+ "id"=>"CR6nBcaGvGc4dtflEB1bjKBP",
22
22
  "links"=>
23
- {"customer"=>"CU64R7DS6DwuXYVg9RTskFK8",
24
- "destination"=>"BA6bLGpQZPOiTNRxF24rMd9m",
23
+ {"customer"=>"CU3VYCUIfwngJsidJWdGw2W5",
24
+ "destination"=>"BA3Y63fK5STwlhKNMkE3Utmd",
25
25
  "order"=>nil},
26
26
  "meta"=>{},
27
27
  "status"=>"succeeded",
28
- "transaction_number"=>"CR855-415-1670",
29
- "updated_at"=>"2014-03-06T19:23:55.019500Z"},
28
+ "transaction_number"=>"CR666-481-5204",
29
+ "updated_at"=>"2014-04-25T20:18:54.380146Z"},
30
30
  @hyperlinks=
31
31
  {"customer"=>
32
- #<Proc:0x007fa4e411fe50/lib/balanced/resources/resource.rb:60 (lambda)>,
32
+ #<Proc:0x007fa93ebb5690/lib/balanced/resources/resource.rb:60 (lambda)>,
33
33
  "destination"=>
34
- #<Proc:0x007fa4e411e230/lib/balanced/resources/resource.rb:60 (lambda)>,
34
+ #<Proc:0x007fa93ebbfcf8/lib/balanced/resources/resource.rb:60 (lambda)>,
35
35
  "events"=>
36
- #<Proc:0x007fa4e4117980/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fa93ebbde80/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "order"=>
38
- #<Proc:0x007fa4e4116dc8/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa93ebbd4a8/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "reversals"=>
40
- #<Proc:0x007fa4e4114b90/lib/balanced/utils.rb:6 (lambda)>}>
40
+ #<Proc:0x007fa93ebc7610/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-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
+ Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
7
7
 
8
- bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA50LpPrCTB63Ecm0wEgdOQM')
8
+ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3IhKG3bIN22cLHbaOIGtHb')
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:0x007fa4e40e2a78
16
+ #<Balanced::Debit:0x007fa93ebddb68
17
17
  @attributes=
18
18
  {"amount"=>5000,
19
19
  "appears_on_statement_as"=>"BAL*Statement text",
20
- "created_at"=>"2014-03-06T19:22:35.961050Z",
20
+ "created_at"=>"2014-04-25T20:09:33.925749Z",
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/WD5qunOPeKdCnWXIg9EHyHge",
26
- "id"=>"WD5qunOPeKdCnWXIg9EHyHge",
25
+ "href"=>"/debits/WD42s4BBkPXvzXTxyo7CLfFj",
26
+ "id"=>"WD42s4BBkPXvzXTxyo7CLfFj",
27
27
  "links"=>
28
28
  {"customer"=>nil,
29
29
  "dispute"=>nil,
30
30
  "order"=>nil,
31
- "source"=>"BA50LpPrCTB63Ecm0wEgdOQM"},
31
+ "source"=>"BA3IhKG3bIN22cLHbaOIGtHb"},
32
32
  "meta"=>{},
33
33
  "status"=>"succeeded",
34
- "transaction_number"=>"W051-293-0823",
35
- "updated_at"=>"2014-03-06T19:22:36.418154Z"},
34
+ "transaction_number"=>"W212-186-3238",
35
+ "updated_at"=>"2014-04-25T20:09:34.551675Z"},
36
36
  @hyperlinks=
37
37
  {"customer"=>
38
- #<Proc:0x007fa4e40e1290/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa93ebdd028/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "dispute"=>
40
- #<Proc:0x007fa4e40dffa8/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa93ebdc6a0/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007fa4e40dd870/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa93ebe67e0/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "order"=>
44
- #<Proc:0x007fa4e40dc718/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fa93ebe5e08/lib/balanced/utils.rb:6 (lambda)>,
45
45
  "refunds"=>
46
- #<Proc:0x007fa4e40d62a0/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa93ebeff70/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "source"=>
48
- #<Proc:0x007fa4e40d44f0/lib/balanced/resources/resource.rb:60 (lambda)>}>
48
+ #<Proc:0x007fa93ebee5d0/lib/balanced/resources/resource.rb:60 (lambda)>}>
49
49
 
50
50
  % endif