balanced 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -0
- data/balanced.gemspec +1 -1
- data/lib/balanced/client.rb +1 -2
- data/lib/balanced/error.rb +3 -3
- data/lib/balanced/resources/card.rb +15 -1
- 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/ruby.mako +14 -14
- 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/definition.rb +1 -1
- data/scenarios/bank_account_verification_create/ruby.mako +10 -10
- data/scenarios/bank_account_verification_show/definition.rb +1 -1
- data/scenarios/bank_account_verification_show/request.rb +1 -1
- data/scenarios/bank_account_verification_show/ruby.mako +10 -10
- data/scenarios/bank_account_verification_update/definition.rb +1 -1
- data/scenarios/bank_account_verification_update/request.rb +1 -1
- data/scenarios/bank_account_verification_update/ruby.mako +10 -10
- 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/ruby.mako +21 -12
- data/scenarios/card_create/ruby.mako +18 -9
- data/scenarios/card_create_creditable/definition.rb +1 -0
- data/scenarios/card_create_creditable/request.rb +4 -0
- data/scenarios/card_create_creditable/ruby.mako +62 -0
- data/scenarios/card_create_dispute/ruby.mako +18 -9
- data/scenarios/card_credit/definition.rb +1 -0
- data/scenarios/card_credit/request.rb +5 -0
- data/scenarios/card_credit/ruby.mako +43 -0
- data/scenarios/card_debit/ruby.mako +16 -16
- data/scenarios/card_debit_dispute/ruby.mako +15 -15
- 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/ruby.mako +15 -15
- data/scenarios/card_list/ruby.mako +36 -18
- data/scenarios/card_show/ruby.mako +19 -10
- data/scenarios/card_update/ruby.mako +19 -10
- data/scenarios/credit_list/ruby.mako +14 -14
- data/scenarios/credit_list_bank_account/ruby.mako +2 -2
- data/scenarios/credit_order/definition.rb +1 -0
- data/scenarios/credit_order/request.rb +7 -0
- data/scenarios/credit_order/ruby.mako +26 -0
- data/scenarios/credit_show/ruby.mako +15 -15
- data/scenarios/credit_update/ruby.mako +15 -15
- data/scenarios/customer_create/ruby.mako +20 -18
- data/scenarios/customer_delete/ruby.mako +1 -1
- data/scenarios/customer_list/ruby.mako +39 -35
- data/scenarios/customer_show/ruby.mako +21 -19
- data/scenarios/customer_update/ruby.mako +21 -19
- data/scenarios/debit_dispute_show/ruby.mako +12 -12
- data/scenarios/debit_list/ruby.mako +34 -34
- data/scenarios/debit_order/definition.rb +1 -0
- data/scenarios/debit_order/request.rb +7 -0
- data/scenarios/debit_order/ruby.mako +49 -0
- data/scenarios/debit_show/ruby.mako +16 -16
- data/scenarios/debit_update/ruby.mako +16 -16
- data/scenarios/dispute_list/ruby.mako +11 -11
- data/scenarios/dispute_show/ruby.mako +12 -12
- data/scenarios/event_list/ruby.mako +56 -55
- data/scenarios/event_show/ruby.mako +41 -35
- data/scenarios/order_create/ruby.mako +14 -14
- data/scenarios/order_list/ruby.mako +45 -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 +1 -1
- 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/card_spec.rb +73 -11
- data/spec/balanced/resources/credit_spec.rb +155 -26
- data/spec/balanced/response/balanced_exception_middleware_spec.rb +1 -2
- data/spec/spec_helper.rb +3 -1
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a7c70ad40d3145fa342b15bf08330a63d377a3f
|
4
|
+
data.tar.gz: 2b1ef00672901e32b9a74d6f326673b971495213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253351b491ff59782bd0a00ac0777ff403f5556da6d997bf4846714ae1c004bf26e184af476fd574905474ad038beb10f087e89d3bb596ec81b85fc3c6327878
|
7
|
+
data.tar.gz: a41466771abd2205cd54484877dda3588b4622cf4828ff73415db1103ff01893f58a1d921ae0c1a0bf6539f681ef9efdc58bb6e6899497e83bae8649938c59d9
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/balanced.gemspec
CHANGED
@@ -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", '
|
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
|
|
data/lib/balanced/client.rb
CHANGED
@@ -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 :
|
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 => {
|
data/lib/balanced/error.rb
CHANGED
@@ -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
|
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]
|
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
8
|
key = Balanced::ApiKey.new.save
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::ApiKey:
|
11
|
+
#<Balanced::ApiKey:0x007fa7d40b53a0
|
12
12
|
@attributes=
|
13
|
-
{"created_at"=>"2014-
|
14
|
-
"href"=>"/api_keys/
|
15
|
-
"id"=>"
|
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-
|
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-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
key = Balanced::ApiKey.fetch('/api_keys/
|
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-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
7
|
card = Balanced::ApiKey.all
|
8
8
|
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::ApiKey:
|
10
|
+
[#<Balanced::ApiKey:0x007fa7d409cc10
|
11
11
|
@attributes=
|
12
|
-
{"created_at"=>"2014-
|
13
|
-
"href"=>"/api_keys/
|
14
|
-
"id"=>"
|
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:
|
18
|
+
#<Balanced::ApiKey:0x007fa7d409ca58
|
19
19
|
@attributes=
|
20
|
-
{"created_at"=>"2014-
|
21
|
-
"href"=>"/api_keys/
|
22
|
-
"id"=>"
|
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-
|
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-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
card = Balanced::ApiKey.fetch('/api_keys/
|
7
|
+
card = Balanced::ApiKey.fetch('/api_keys/AK1B3lNyPQ63pRQa1JDC5os5')
|
8
8
|
% elif mode == 'response':
|
9
|
-
#<Balanced::ApiKey:
|
9
|
+
#<Balanced::ApiKey:0x007fa7d4086aa0
|
10
10
|
@attributes=
|
11
|
-
{"created_at"=>"2014-
|
12
|
-
"href"=>"/api_keys/
|
13
|
-
"id"=>"
|
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-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch("/bank_accounts/
|
9
|
-
bank_account.associate_to_customer("/customers/
|
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:
|
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-
|
26
|
+
"created_at"=>"2014-05-15T00:39:26.378338Z",
|
27
27
|
"fingerprint"=>
|
28
28
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
29
|
-
"href"=>"/bank_accounts/
|
30
|
-
"id"=>"
|
29
|
+
"href"=>"/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd",
|
30
|
+
"id"=>"BA2RqFlRIm0xqCNnHJNLYWMd",
|
31
31
|
"links"=>
|
32
|
-
{"bank_account_verification"=>nil, "customer"=>"
|
32
|
+
{"bank_account_verification"=>nil, "customer"=>"CU2L981m9AtPY8pjpGpjnjnf"},
|
33
33
|
"meta"=>{},
|
34
34
|
"name"=>"Johann Bernoulli",
|
35
35
|
"routing_number"=>"121000358",
|
36
|
-
"updated_at"=>"2014-
|
36
|
+
"updated_at"=>"2014-05-15T00:39:27.323054Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"bank_account_verification"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d40772d0/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"bank_account_verifications"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d4075340/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"credits"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d401f0d0/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"customer"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa7d401d730/lib/balanced/resources/resource.rb:60 (lambda)>,
|
46
46
|
"debits"=>
|
47
|
-
#<Proc:
|
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-
|
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:
|
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-
|
30
|
+
"created_at"=>"2014-05-15T00:39:26.378338Z",
|
31
31
|
"fingerprint"=>
|
32
32
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
33
|
-
"href"=>"/bank_accounts/
|
34
|
-
"id"=>"
|
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-
|
39
|
+
"updated_at"=>"2014-05-15T00:39:26.378342Z"},
|
40
40
|
@hyperlinks=
|
41
41
|
{"bank_account_verification"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d1e69468/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"bank_account_verifications"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d1e5b0e8/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"credits"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d1e50cd8/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"customer"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa7d1e534b0/lib/balanced/utils.rb:6 (lambda)>,
|
49
49
|
"debits"=>
|
50
|
-
#<Proc:
|
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-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA2RqFlRIm0xqCNnHJNLYWMd')
|
9
9
|
bank_account.credit(:amount => 5000)
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Credit:
|
11
|
+
#<Balanced::Credit:0x007fa7d1dbbe08
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
14
|
"appears_on_statement_as"=>"example.com",
|
15
|
-
"created_at"=>"2014-
|
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/
|
21
|
-
"id"=>"
|
20
|
+
"href"=>"/credits/CR7ushK6kWjPJYdh24QoM1A9",
|
21
|
+
"id"=>"CR7ushK6kWjPJYdh24QoM1A9",
|
22
22
|
"links"=>
|
23
|
-
{"customer"=>"
|
24
|
-
"destination"=>"
|
23
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
24
|
+
"destination"=>"BA2RqFlRIm0xqCNnHJNLYWMd",
|
25
25
|
"order"=>nil},
|
26
26
|
"meta"=>{},
|
27
27
|
"status"=>"succeeded",
|
28
|
-
"transaction_number"=>"
|
29
|
-
"updated_at"=>"2014-
|
28
|
+
"transaction_number"=>"CR169-215-3928",
|
29
|
+
"updated_at"=>"2014-05-15T00:43:46.428002Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"customer"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d1db3910/lib/balanced/resources/resource.rb:60 (lambda)>,
|
33
33
|
"destination"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d1daaea0/lib/balanced/resources/resource.rb:60 (lambda)>,
|
35
35
|
"events"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d1da23e0/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"order"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d1da0f68/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"reversals"=>
|
40
|
-
#<Proc:
|
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-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
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:
|
16
|
+
#<Balanced::Debit:0x007fa7d1d437c8
|
17
17
|
@attributes=
|
18
18
|
{"amount"=>5000,
|
19
19
|
"appears_on_statement_as"=>"BAL*Statement text",
|
20
|
-
"created_at"=>"2014-
|
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/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/debits/WD2UGQIxoTJkklZqAj2lpR9X",
|
26
|
+
"id"=>"WD2UGQIxoTJkklZqAj2lpR9X",
|
27
27
|
"links"=>
|
28
28
|
{"customer"=>nil,
|
29
29
|
"dispute"=>nil,
|
30
30
|
"order"=>nil,
|
31
|
-
"source"=>"
|
31
|
+
"source"=>"BA1W9SQLf5YRaGbUGiNIO2fb"},
|
32
32
|
"meta"=>{},
|
33
33
|
"status"=>"succeeded",
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
34
|
+
"transaction_number"=>"W708-603-3376",
|
35
|
+
"updated_at"=>"2014-05-15T00:39:31.007857Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"customer"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d1d31c80/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"dispute"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d1d2be98/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d1d28c70/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d1d231f8/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"refunds"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d1d19ce8/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"source"=>
|
48
|
-
#<Proc:
|
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-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
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-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
8
|
Balanced::BankAccount.all
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
[#<Balanced::BankAccount:
|
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-
|
25
|
+
"created_at"=>"2014-05-15T00:39:14.751497Z",
|
26
26
|
"fingerprint"=>
|
27
27
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
28
|
-
"href"=>"/bank_accounts/
|
29
|
-
"id"=>"
|
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-
|
34
|
+
"updated_at"=>"2014-05-15T00:39:14.751501Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"bank_account_verification"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d1c93260/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"bank_account_verifications"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d1c83860/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"credits"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d1c7b1b0/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"customer"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d1c79720/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"debits"=>
|
45
|
-
#<Proc:
|
46
|
-
#<Balanced::BankAccount:
|
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-
|
60
|
+
"created_at"=>"2014-05-15T00:38:35.458618Z",
|
61
61
|
"fingerprint"=>
|
62
62
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
63
|
-
"href"=>"/bank_accounts/
|
64
|
-
"id"=>"
|
63
|
+
"href"=>"/bank_accounts/BA1W9SQLf5YRaGbUGiNIO2fb",
|
64
|
+
"id"=>"BA1W9SQLf5YRaGbUGiNIO2fb",
|
65
65
|
"links"=>
|
66
|
-
{"bank_account_verification"=>"
|
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-
|
71
|
+
"updated_at"=>"2014-05-15T00:39:12.506691Z"},
|
72
72
|
@hyperlinks=
|
73
73
|
{"bank_account_verification"=>
|
74
|
-
#<Proc:
|
74
|
+
#<Proc:0x007fa7d1c68330/lib/balanced/resources/resource.rb:60 (lambda)>,
|
75
75
|
"bank_account_verifications"=>
|
76
|
-
#<Proc:
|
76
|
+
#<Proc:0x007fa7d1c58548/lib/balanced/utils.rb:6 (lambda)>,
|
77
77
|
"credits"=>
|
78
|
-
#<Proc:
|
78
|
+
#<Proc:0x007fa7d1c4bbe0/lib/balanced/utils.rb:6 (lambda)>,
|
79
79
|
"customer"=>
|
80
|
-
#<Proc:
|
80
|
+
#<Proc:0x007fa7d1c48ee0/lib/balanced/utils.rb:6 (lambda)>,
|
81
81
|
"debits"=>
|
82
|
-
#<Proc:
|
82
|
+
#<Proc:0x007fa7d1c320c8/lib/balanced/utils.rb:6 (lambda)>}>]
|
83
83
|
|
84
84
|
% endif
|