balanced 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.md +5 -0
- data/lib/balanced/resources/credit.rb +2 -7
- data/lib/balanced/resources/debit.rb +2 -7
- data/lib/balanced/resources/order.rb +10 -9
- data/lib/balanced/version.rb +1 -1
- data/scenarios/api_key_create/ruby.mako +6 -6
- data/scenarios/api_key_delete/ruby.mako +2 -2
- data/scenarios/api_key_list/ruby.mako +10 -10
- data/scenarios/api_key_show/ruby.mako +6 -6
- data/scenarios/bank_account_associate_to_customer/definition.rb +1 -1
- data/scenarios/bank_account_associate_to_customer/request.rb +2 -2
- data/scenarios/bank_account_associate_to_customer/ruby.mako +15 -15
- data/scenarios/bank_account_create/ruby.mako +11 -11
- data/scenarios/bank_account_credit/ruby.mako +15 -15
- data/scenarios/bank_account_debit/ruby.mako +15 -15
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_list/ruby.mako +22 -22
- data/scenarios/bank_account_show/ruby.mako +12 -12
- data/scenarios/bank_account_update/ruby.mako +12 -12
- data/scenarios/bank_account_verification_create/ruby.mako +9 -9
- data/scenarios/bank_account_verification_show/ruby.mako +9 -9
- data/scenarios/bank_account_verification_update/ruby.mako +9 -9
- data/scenarios/callback_create/ruby.mako +4 -4
- data/scenarios/callback_delete/ruby.mako +2 -2
- data/scenarios/callback_list/ruby.mako +4 -4
- data/scenarios/callback_show/ruby.mako +5 -5
- data/scenarios/card_associate_to_customer/definition.rb +1 -1
- data/scenarios/card_associate_to_customer/request.rb +1 -1
- data/scenarios/card_associate_to_customer/ruby.mako +13 -14
- data/scenarios/card_create/ruby.mako +9 -9
- data/scenarios/card_create_dispute/definition.rb +1 -0
- data/scenarios/card_create_dispute/request.rb +4 -0
- data/scenarios/card_create_dispute/ruby.mako +53 -0
- data/scenarios/card_debit/ruby.mako +16 -16
- data/scenarios/card_debit_dispute/definition.rb +1 -0
- data/scenarios/card_debit_dispute/request.rb +5 -0
- data/scenarios/card_debit_dispute/ruby.mako +49 -0
- data/scenarios/card_delete/ruby.mako +2 -2
- data/scenarios/card_hold_capture/ruby.mako +16 -16
- data/scenarios/card_hold_create/ruby.mako +14 -14
- data/scenarios/card_hold_list/ruby.mako +25 -25
- data/scenarios/card_hold_show/ruby.mako +14 -14
- data/scenarios/card_hold_update/ruby.mako +14 -14
- data/scenarios/card_hold_void/definition.rb +1 -1
- data/scenarios/card_hold_void/request.rb +1 -1
- data/scenarios/card_hold_void/ruby.mako +17 -17
- data/scenarios/card_list/ruby.mako +18 -18
- data/scenarios/card_show/ruby.mako +10 -10
- data/scenarios/card_update/ruby.mako +10 -10
- data/scenarios/credit_list/ruby.mako +14 -14
- data/scenarios/credit_list_bank_account/ruby.mako +2 -2
- data/scenarios/credit_show/ruby.mako +15 -15
- data/scenarios/credit_update/ruby.mako +15 -15
- data/scenarios/customer_create/ruby.mako +18 -18
- data/scenarios/customer_delete/ruby.mako +1 -1
- data/scenarios/customer_list/ruby.mako +35 -35
- data/scenarios/customer_show/ruby.mako +19 -19
- data/scenarios/customer_update/ruby.mako +19 -19
- data/scenarios/debit_dispute_show/definition.rb +1 -0
- data/scenarios/debit_dispute_show/request.rb +3 -0
- data/scenarios/debit_dispute_show/ruby.mako +31 -0
- data/scenarios/debit_list/ruby.mako +29 -29
- data/scenarios/debit_show/ruby.mako +16 -16
- data/scenarios/debit_update/ruby.mako +16 -16
- data/scenarios/dispute_list/definition.rb +1 -0
- data/scenarios/dispute_list/request.rb +2 -0
- data/scenarios/dispute_list/ruby.mako +29 -0
- data/scenarios/dispute_show/definition.rb +1 -0
- data/scenarios/dispute_show/request.rb +2 -0
- data/scenarios/dispute_show/ruby.mako +31 -0
- data/scenarios/event_list/ruby.mako +55 -55
- data/scenarios/event_show/ruby.mako +35 -40
- data/scenarios/order_create/ruby.mako +14 -14
- data/scenarios/order_list/ruby.mako +13 -13
- data/scenarios/order_show/ruby.mako +14 -14
- data/scenarios/order_update/ruby.mako +14 -14
- data/scenarios/refund_create/ruby.mako +13 -13
- data/scenarios/refund_list/ruby.mako +12 -12
- data/scenarios/refund_show/ruby.mako +13 -13
- data/scenarios/refund_update/ruby.mako +13 -13
- data/scenarios/render_mako.rb +15 -3
- data/scenarios/reversal_create/ruby.mako +12 -12
- data/scenarios/reversal_list/ruby.mako +11 -11
- data/scenarios/reversal_show/ruby.mako +12 -12
- data/scenarios/reversal_update/ruby.mako +12 -12
- data/spec/balanced/resources/credit_spec.rb +26 -5
- data/spec/balanced/resources/debit_spec.rb +7 -2
- data/spec/balanced/resources/order_spec.rb +25 -3
- metadata +17 -3
- data/scenario.cache +0 -619
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86383adcd168385c196339d998930ac37ccdd332
|
4
|
+
data.tar.gz: b0b7d50c31202388212e00b1781093a485978816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5003bffd36132ab0f971a82b73ab482f2b511a7ddb12368ec15732fb377992ade7ebea7004908b3e7ac583408966e976f6ea32d7bc6f32e3ce98ac6a04f146ed
|
7
|
+
data.tar.gz: 5fdafe3211fd76640ef15b0de62736da6cfdcb8f523e15527a41eaf2a31697ceb6535324a189f7d60995d6a520feee53c5bcbc1efe3a782405d122a487e9b924
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -13,14 +13,9 @@ module Balanced
|
|
13
13
|
define_hypermedia_types [:credits]
|
14
14
|
|
15
15
|
def reverse(options={})
|
16
|
-
|
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
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
46
|
+
|
48
47
|
# should have a way here to disburse more funds to another account, but not required
|
49
|
-
destination.credit(
|
48
|
+
credit = destination.credit(options)
|
49
|
+
|
50
|
+
credit
|
50
51
|
end
|
51
52
|
|
52
53
|
private
|
data/lib/balanced/version.rb
CHANGED
@@ -3,19 +3,19 @@ Balanced::ApiKey.new
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
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:
|
11
|
+
#<Balanced::ApiKey:0x007fa93eb27070
|
12
12
|
@attributes=
|
13
|
-
{"created_at"=>"2014-
|
14
|
-
"href"=>"/api_keys/
|
15
|
-
"id"=>"
|
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-
|
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-
|
5
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
6
6
|
|
7
|
-
key = Balanced::ApiKey.fetch('/api_keys/
|
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-
|
5
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
6
6
|
|
7
7
|
card = Balanced::ApiKey.all
|
8
8
|
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::ApiKey:
|
10
|
+
[#<Balanced::ApiKey:0x007fa93eb37010
|
11
11
|
@attributes=
|
12
|
-
{"created_at"=>"2014-
|
13
|
-
"href"=>"/api_keys/
|
14
|
-
"id"=>"
|
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:
|
18
|
+
#<Balanced::ApiKey:0x007fa93eb36e58
|
19
19
|
@attributes=
|
20
|
-
{"created_at"=>"2014-
|
21
|
-
"href"=>"/api_keys/
|
22
|
-
"id"=>"
|
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-
|
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-
|
5
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
6
6
|
|
7
|
-
card = Balanced::ApiKey.fetch('/api_keys/
|
7
|
+
card = Balanced::ApiKey.fetch('/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX')
|
8
8
|
% elif mode == 'response':
|
9
|
-
#<Balanced::ApiKey:
|
9
|
+
#<Balanced::ApiKey:0x007fa93eb45a48
|
10
10
|
@attributes=
|
11
|
-
{"created_at"=>"2014-
|
12
|
-
"href"=>"/api_keys/
|
13
|
-
"id"=>"
|
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::
|
1
|
+
Balanced::BankAccount.associate_to_customer
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
|
-
|
3
|
-
|
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::
|
2
|
+
Balanced::BankAccount.associate_to_customer
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
7
7
|
|
8
|
-
|
9
|
-
|
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:
|
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-
|
26
|
+
"created_at"=>"2014-04-25T20:09:30.053834Z",
|
27
27
|
"fingerprint"=>
|
28
28
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
29
|
-
"href"=>"/bank_accounts/
|
30
|
-
"id"=>"
|
29
|
+
"href"=>"/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd",
|
30
|
+
"id"=>"BA3Y63fK5STwlhKNMkE3Utmd",
|
31
31
|
"links"=>
|
32
|
-
{"bank_account_verification"=>nil, "customer"=>"
|
32
|
+
{"bank_account_verification"=>nil, "customer"=>"CU3VYCUIfwngJsidJWdGw2W5"},
|
33
33
|
"meta"=>{},
|
34
34
|
"name"=>"Johann Bernoulli",
|
35
35
|
"routing_number"=>"121000358",
|
36
|
-
"updated_at"=>"2014-
|
36
|
+
"updated_at"=>"2014-04-25T20:09:30.667083Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"bank_account_verification"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa93eb565a0/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"bank_account_verifications"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa93eb54610/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"credits"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa93eb5e660/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"customer"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa93eb5ccc0/lib/balanced/resources/resource.rb:60 (lambda)>,
|
46
46
|
"debits"=>
|
47
|
-
#<Proc:
|
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-
|
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:
|
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-
|
30
|
+
"created_at"=>"2014-04-25T20:09:30.053834Z",
|
31
31
|
"fingerprint"=>
|
32
32
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
33
|
-
"href"=>"/bank_accounts/
|
34
|
-
"id"=>"
|
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-
|
39
|
+
"updated_at"=>"2014-04-25T20:09:30.053837Z"},
|
40
40
|
@hyperlinks=
|
41
41
|
{"bank_account_verification"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa93eb86048/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"bank_account_verifications"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa93eb84130/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"credits"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa93eb8e180/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"customer"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa93eb8d7d0/lib/balanced/utils.rb:6 (lambda)>,
|
49
49
|
"debits"=>
|
50
|
-
#<Proc:
|
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-
|
6
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3Y63fK5STwlhKNMkE3Utmd')
|
9
9
|
bank_account.credit(:amount => 5000)
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Credit:
|
11
|
+
#<Balanced::Credit:0x007fa93ebb71c0
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
14
|
"appears_on_statement_as"=>"example.com",
|
15
|
-
"created_at"=>"2014-
|
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/
|
21
|
-
"id"=>"
|
20
|
+
"href"=>"/credits/CR6nBcaGvGc4dtflEB1bjKBP",
|
21
|
+
"id"=>"CR6nBcaGvGc4dtflEB1bjKBP",
|
22
22
|
"links"=>
|
23
|
-
{"customer"=>"
|
24
|
-
"destination"=>"
|
23
|
+
{"customer"=>"CU3VYCUIfwngJsidJWdGw2W5",
|
24
|
+
"destination"=>"BA3Y63fK5STwlhKNMkE3Utmd",
|
25
25
|
"order"=>nil},
|
26
26
|
"meta"=>{},
|
27
27
|
"status"=>"succeeded",
|
28
|
-
"transaction_number"=>"
|
29
|
-
"updated_at"=>"2014-
|
28
|
+
"transaction_number"=>"CR666-481-5204",
|
29
|
+
"updated_at"=>"2014-04-25T20:18:54.380146Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"customer"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa93ebb5690/lib/balanced/resources/resource.rb:60 (lambda)>,
|
33
33
|
"destination"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa93ebbfcf8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
35
35
|
"events"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa93ebbde80/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"order"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa93ebbd4a8/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"reversals"=>
|
40
|
-
#<Proc:
|
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-
|
6
|
+
Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
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:
|
16
|
+
#<Balanced::Debit:0x007fa93ebddb68
|
17
17
|
@attributes=
|
18
18
|
{"amount"=>5000,
|
19
19
|
"appears_on_statement_as"=>"BAL*Statement text",
|
20
|
-
"created_at"=>"2014-
|
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/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/debits/WD42s4BBkPXvzXTxyo7CLfFj",
|
26
|
+
"id"=>"WD42s4BBkPXvzXTxyo7CLfFj",
|
27
27
|
"links"=>
|
28
28
|
{"customer"=>nil,
|
29
29
|
"dispute"=>nil,
|
30
30
|
"order"=>nil,
|
31
|
-
"source"=>"
|
31
|
+
"source"=>"BA3IhKG3bIN22cLHbaOIGtHb"},
|
32
32
|
"meta"=>{},
|
33
33
|
"status"=>"succeeded",
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
34
|
+
"transaction_number"=>"W212-186-3238",
|
35
|
+
"updated_at"=>"2014-04-25T20:09:34.551675Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"customer"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa93ebdd028/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"dispute"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa93ebdc6a0/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa93ebe67e0/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa93ebe5e08/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"refunds"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa93ebeff70/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"source"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa93ebee5d0/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
49
49
|
|
50
50
|
% endif
|