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
@@ -3,11 +3,11 @@ Balanced::Customer.fetch
|
|
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
|
-
customer = Balanced::Customer.fetch('/customers/
|
8
|
+
customer = Balanced::Customer.fetch('/customers/CU4ZKTtaAaR7Rc5M8EP2gLlP')
|
9
9
|
% elif mode == 'response':
|
10
|
-
#<Balanced::Customer:
|
10
|
+
#<Balanced::Customer:0x007fa7d1c78d70
|
11
11
|
@attributes=
|
12
12
|
{"address"=>
|
13
13
|
{"city"=>nil,
|
@@ -17,44 +17,46 @@ customer = Balanced::Customer.fetch('/customers/CU4GAx8tZTDNIgAmwfV35e53')
|
|
17
17
|
"postal_code"=>"48120",
|
18
18
|
"state"=>nil},
|
19
19
|
"business_name"=>nil,
|
20
|
-
"created_at"=>"2014-
|
20
|
+
"created_at"=>"2014-05-15T00:41:24.028958Z",
|
21
21
|
"dob_month"=>7,
|
22
22
|
"dob_year"=>1963,
|
23
23
|
"ein"=>nil,
|
24
24
|
"email"=>nil,
|
25
|
-
"href"=>"/customers/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/customers/CU4ZKTtaAaR7Rc5M8EP2gLlP",
|
26
|
+
"id"=>"CU4ZKTtaAaR7Rc5M8EP2gLlP",
|
27
27
|
"links"=>{"destination"=>nil, "source"=>nil},
|
28
28
|
"merchant_status"=>"underwritten",
|
29
29
|
"meta"=>{},
|
30
30
|
"name"=>"Henry Ford",
|
31
31
|
"phone"=>nil,
|
32
32
|
"ssn_last4"=>nil,
|
33
|
-
"updated_at"=>"2014-
|
33
|
+
"updated_at"=>"2014-05-15T00:41:24.914750Z"},
|
34
34
|
@hyperlinks=
|
35
35
|
{"bank_accounts"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d1c6aa40/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"card_holds"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d1c63718/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"cards"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d1c53868/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"credits"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d1c4ac68/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"debits"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d1c33748/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"destination"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d1c318f8/lib/balanced/utils.rb:6 (lambda)>,
|
47
|
+
"disputes"=>
|
48
|
+
#<Proc:0x007fa7d1c21bb0/lib/balanced/utils.rb:6 (lambda)>,
|
47
49
|
"external_accounts"=>
|
48
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fa7d1c13880/lib/balanced/utils.rb:6 (lambda)>,
|
49
51
|
"orders"=>
|
50
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fa7d1bfad80/lib/balanced/utils.rb:6 (lambda)>,
|
51
53
|
"refunds"=>
|
52
|
-
#<Proc:
|
54
|
+
#<Proc:0x007fa7d1c01db0/lib/balanced/utils.rb:6 (lambda)>,
|
53
55
|
"reversals"=>
|
54
|
-
#<Proc:
|
56
|
+
#<Proc:0x007fa7d1bf03a8/lib/balanced/utils.rb:6 (lambda)>,
|
55
57
|
"source"=>
|
56
|
-
#<Proc:
|
58
|
+
#<Proc:0x007fa7d1be6b00/lib/balanced/utils.rb:6 (lambda)>,
|
57
59
|
"transactions"=>
|
58
|
-
#<Proc:
|
60
|
+
#<Proc:0x007fa7d1bdacd8/lib/balanced/utils.rb:6 (lambda)>}>
|
59
61
|
|
60
62
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Customer.save
|
|
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
|
-
customer = Balanced::Customer.fetch('/customers/
|
8
|
+
customer = Balanced::Customer.fetch('/customers/CU4ZKTtaAaR7Rc5M8EP2gLlP')
|
9
9
|
customer.email = 'email@newdomain.com'
|
10
10
|
customer.meta = {
|
11
11
|
'shipping-preference' => 'ground'
|
@@ -13,7 +13,7 @@ customer.meta = {
|
|
13
13
|
customer.save
|
14
14
|
|
15
15
|
% elif mode == 'response':
|
16
|
-
#<Balanced::Customer:
|
16
|
+
#<Balanced::Customer:0x007fa7d1b29fc8
|
17
17
|
@attributes=
|
18
18
|
{"address"=>
|
19
19
|
{"city"=>nil,
|
@@ -23,44 +23,46 @@ customer.save
|
|
23
23
|
"postal_code"=>"48120",
|
24
24
|
"state"=>nil},
|
25
25
|
"business_name"=>nil,
|
26
|
-
"created_at"=>"2014-
|
26
|
+
"created_at"=>"2014-05-15T00:41:24.028958Z",
|
27
27
|
"dob_month"=>7,
|
28
28
|
"dob_year"=>1963,
|
29
29
|
"ein"=>nil,
|
30
30
|
"email"=>"email@newdomain.com",
|
31
|
-
"href"=>"/customers/
|
32
|
-
"id"=>"
|
31
|
+
"href"=>"/customers/CU4ZKTtaAaR7Rc5M8EP2gLlP",
|
32
|
+
"id"=>"CU4ZKTtaAaR7Rc5M8EP2gLlP",
|
33
33
|
"links"=>{"destination"=>nil, "source"=>nil},
|
34
34
|
"merchant_status"=>"underwritten",
|
35
35
|
"meta"=>{"shipping-preference"=>"ground"},
|
36
36
|
"name"=>"Henry Ford",
|
37
37
|
"phone"=>nil,
|
38
38
|
"ssn_last4"=>nil,
|
39
|
-
"updated_at"=>"2014-
|
39
|
+
"updated_at"=>"2014-05-15T00:41:28.733238Z"},
|
40
40
|
@hyperlinks=
|
41
41
|
{"bank_accounts"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d1b1a410/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"card_holds"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d1b09a20/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"cards"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d1af31d0/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"credits"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa7d1ae87f8/lib/balanced/utils.rb:6 (lambda)>,
|
49
49
|
"debits"=>
|
50
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fa7d1adba80/lib/balanced/utils.rb:6 (lambda)>,
|
51
51
|
"destination"=>
|
52
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fa7d1ada4a0/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"disputes"=>
|
54
|
+
#<Proc:0x007fa7d1ad1c88/lib/balanced/utils.rb:6 (lambda)>,
|
53
55
|
"external_accounts"=>
|
54
|
-
#<Proc:
|
56
|
+
#<Proc:0x007fa7d1ac0190/lib/balanced/utils.rb:6 (lambda)>,
|
55
57
|
"orders"=>
|
56
|
-
#<Proc:
|
58
|
+
#<Proc:0x007fa7d1ab1028/lib/balanced/utils.rb:6 (lambda)>,
|
57
59
|
"refunds"=>
|
58
|
-
#<Proc:
|
60
|
+
#<Proc:0x007fa7d1aa2870/lib/balanced/utils.rb:6 (lambda)>,
|
59
61
|
"reversals"=>
|
60
|
-
#<Proc:
|
62
|
+
#<Proc:0x007fa7d1a93848/lib/balanced/utils.rb:6 (lambda)>,
|
61
63
|
"source"=>
|
62
|
-
#<Proc:
|
64
|
+
#<Proc:0x007fa7d1a8ba80/lib/balanced/utils.rb:6 (lambda)>,
|
63
65
|
"transactions"=>
|
64
|
-
#<Proc:
|
66
|
+
#<Proc:0x007fa7d1a812d8/lib/balanced/utils.rb:6 (lambda)>}>
|
65
67
|
|
66
68
|
% endif
|
@@ -2,30 +2,30 @@
|
|
2
2
|
Balanced::Debit.dispute
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
debit = Balanced::Debit.fetch('/debits/
|
7
|
+
debit = Balanced::Debit.fetch('/debits/WD6mairBakAx5t8ETjMYFu7T')
|
8
8
|
dispute = debit.dispute
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Dispute:
|
11
|
+
#<Balanced::Dispute:0x007fa7d1a071e0
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-05-15T00:42:52.610582Z",
|
15
15
|
"currency"=>"USD",
|
16
|
-
"href"=>"/disputes/
|
17
|
-
"id"=>"
|
18
|
-
"initiated_at"=>"2014-
|
19
|
-
"links"=>{"transaction"=>"
|
16
|
+
"href"=>"/disputes/DT6BoisMcacTIu3QWX32JVtl",
|
17
|
+
"id"=>"DT6BoisMcacTIu3QWX32JVtl",
|
18
|
+
"initiated_at"=>"2014-05-15T00:42:41.973330Z",
|
19
|
+
"links"=>{"transaction"=>"WD6mairBakAx5t8ETjMYFu7T"},
|
20
20
|
"meta"=>{},
|
21
21
|
"reason"=>"fraud",
|
22
|
-
"respond_by"=>"2014-
|
22
|
+
"respond_by"=>"2014-06-14T00:42:41.973334Z",
|
23
23
|
"status"=>"pending",
|
24
|
-
"updated_at"=>"2014-
|
24
|
+
"updated_at"=>"2014-05-15T00:42:52.610592Z"},
|
25
25
|
@hyperlinks=
|
26
26
|
{"events"=>
|
27
|
-
#<Proc:
|
27
|
+
#<Proc:0x007fa7d19fe0b8/lib/balanced/utils.rb:6 (lambda)>,
|
28
28
|
"transaction"=>
|
29
|
-
#<Proc:
|
29
|
+
#<Proc:0x007fa7d19f6ae8/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
30
30
|
|
31
31
|
% endif
|
@@ -3,75 +3,75 @@ Balanced::Debit.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
|
debits = Balanced::Debit.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Debit:
|
10
|
+
[#<Balanced::Debit:0x007fa7d1968d60
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>5000,
|
13
|
-
"appears_on_statement_as"=>"BAL*
|
14
|
-
"created_at"=>"2014-
|
13
|
+
"appears_on_statement_as"=>"BAL*example.com",
|
14
|
+
"created_at"=>"2014-05-15T00:41:37.159166Z",
|
15
15
|
"currency"=>"USD",
|
16
|
-
"description"=>"
|
16
|
+
"description"=>"Order #12341234",
|
17
17
|
"failure_reason"=>nil,
|
18
18
|
"failure_reason_code"=>nil,
|
19
|
-
"href"=>"/debits/
|
20
|
-
"id"=>"
|
19
|
+
"href"=>"/debits/WD5ewolo9HEVQkv8dcyx87gd",
|
20
|
+
"id"=>"WD5ewolo9HEVQkv8dcyx87gd",
|
21
21
|
"links"=>
|
22
|
-
{"customer"=>"
|
22
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
23
23
|
"dispute"=>nil,
|
24
|
-
"order"=>
|
25
|
-
"source"=>"
|
24
|
+
"order"=>"OR4R53c8wdUiVEUiegSHpwaN",
|
25
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
26
26
|
"meta"=>{},
|
27
27
|
"status"=>"succeeded",
|
28
|
-
"transaction_number"=>"
|
29
|
-
"updated_at"=>"2014-
|
28
|
+
"transaction_number"=>"W941-130-0831",
|
29
|
+
"updated_at"=>"2014-05-15T00:41:40.522871Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"customer"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d1959f90/lib/balanced/resources/resource.rb:60 (lambda)>,
|
33
33
|
"dispute"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d1958ff0/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"events"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d1950648/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"order"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d1940a68/lib/balanced/resources/resource.rb:60 (lambda)>,
|
39
39
|
"refunds"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d1930708/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"source"=>
|
42
|
-
#<Proc:
|
43
|
-
#<Balanced::Debit:
|
42
|
+
#<Proc:0x007fa7d19235f8/lib/balanced/resources/resource.rb:60 (lambda)>}>,
|
43
|
+
#<Balanced::Debit:0x007fa7d1923558
|
44
44
|
@attributes=
|
45
45
|
{"amount"=>5000,
|
46
|
-
"appears_on_statement_as"=>"BAL*
|
47
|
-
"created_at"=>"2014-
|
46
|
+
"appears_on_statement_as"=>"BAL*Statement text",
|
47
|
+
"created_at"=>"2014-05-15T00:41:07.283881Z",
|
48
48
|
"currency"=>"USD",
|
49
49
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
50
50
|
"failure_reason"=>nil,
|
51
51
|
"failure_reason_code"=>nil,
|
52
|
-
"href"=>"/debits/
|
53
|
-
"id"=>"
|
52
|
+
"href"=>"/debits/WD4GV5z2pEIRZ9cBSuyuykQx",
|
53
|
+
"id"=>"WD4GV5z2pEIRZ9cBSuyuykQx",
|
54
54
|
"links"=>
|
55
|
-
{"customer"=>"
|
55
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
56
56
|
"dispute"=>nil,
|
57
57
|
"order"=>nil,
|
58
|
-
"source"=>"
|
59
|
-
"meta"=>{
|
58
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
59
|
+
"meta"=>{},
|
60
60
|
"status"=>"succeeded",
|
61
|
-
"transaction_number"=>"
|
62
|
-
"updated_at"=>"2014-
|
61
|
+
"transaction_number"=>"W235-372-7348",
|
62
|
+
"updated_at"=>"2014-05-15T00:41:11.755100Z"},
|
63
63
|
@hyperlinks=
|
64
64
|
{"customer"=>
|
65
|
-
#<Proc:
|
65
|
+
#<Proc:0x007fa7d191b010/lib/balanced/resources/resource.rb:60 (lambda)>,
|
66
66
|
"dispute"=>
|
67
|
-
#<Proc:
|
67
|
+
#<Proc:0x007fa7d1919b70/lib/balanced/utils.rb:6 (lambda)>,
|
68
68
|
"events"=>
|
69
|
-
#<Proc:
|
69
|
+
#<Proc:0x007fa7d1910e58/lib/balanced/utils.rb:6 (lambda)>,
|
70
70
|
"order"=>
|
71
|
-
#<Proc:
|
71
|
+
#<Proc:0x007fa7d18ed6b0/lib/balanced/utils.rb:6 (lambda)>,
|
72
72
|
"refunds"=>
|
73
|
-
#<Proc:
|
73
|
+
#<Proc:0x007fa7d18d5fb0/lib/balanced/utils.rb:6 (lambda)>,
|
74
74
|
"source"=>
|
75
|
-
#<Proc:
|
75
|
+
#<Proc:0x007fa7d18cddd8/lib/balanced/resources/resource.rb:60 (lambda)>}>]
|
76
76
|
|
77
77
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Order.debit_from
|
@@ -0,0 +1,49 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Order.debit_from
|
3
|
+
% elif mode == 'request':
|
4
|
+
require 'balanced'
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
|
+
|
7
|
+
order = Balanced::Order.fetch('/orders/OR4R53c8wdUiVEUiegSHpwaN')
|
8
|
+
card = Balanced::Card.fetch('/cards/CC4xXVOyMBDdk7FtzG9HwtBv')
|
9
|
+
order.debit_from(
|
10
|
+
:source => card,
|
11
|
+
:amount => 5000
|
12
|
+
)
|
13
|
+
|
14
|
+
% elif mode == 'response':
|
15
|
+
#<Balanced::Debit:0x007fa7d40fd6a0
|
16
|
+
@attributes=
|
17
|
+
{"amount"=>5000,
|
18
|
+
"appears_on_statement_as"=>"BAL*example.com",
|
19
|
+
"created_at"=>"2014-05-15T00:41:37.159166Z",
|
20
|
+
"currency"=>"USD",
|
21
|
+
"description"=>"Order #12341234",
|
22
|
+
"failure_reason"=>nil,
|
23
|
+
"failure_reason_code"=>nil,
|
24
|
+
"href"=>"/debits/WD5ewolo9HEVQkv8dcyx87gd",
|
25
|
+
"id"=>"WD5ewolo9HEVQkv8dcyx87gd",
|
26
|
+
"links"=>
|
27
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
28
|
+
"dispute"=>nil,
|
29
|
+
"order"=>"OR4R53c8wdUiVEUiegSHpwaN",
|
30
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
31
|
+
"meta"=>{},
|
32
|
+
"status"=>"succeeded",
|
33
|
+
"transaction_number"=>"W941-130-0831",
|
34
|
+
"updated_at"=>"2014-05-15T00:41:40.522871Z"},
|
35
|
+
@hyperlinks=
|
36
|
+
{"customer"=>
|
37
|
+
#<Proc:0x007fa7d4187b48/lib/balanced/resources/resource.rb:60 (lambda)>,
|
38
|
+
"dispute"=>
|
39
|
+
#<Proc:0x007fa7d41871c0/lib/balanced/utils.rb:6 (lambda)>,
|
40
|
+
"events"=>
|
41
|
+
#<Proc:0x007fa7d4185370/lib/balanced/utils.rb:6 (lambda)>,
|
42
|
+
"order"=>
|
43
|
+
#<Proc:0x007fa7d418f988/lib/balanced/resources/resource.rb:60 (lambda)>,
|
44
|
+
"refunds"=>
|
45
|
+
#<Proc:0x007fa7d418db38/lib/balanced/utils.rb:6 (lambda)>,
|
46
|
+
"source"=>
|
47
|
+
#<Proc:0x007fa7d418c1c0/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
48
|
+
|
49
|
+
% endif
|
@@ -3,43 +3,43 @@ Balanced::Debit.fetch
|
|
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
|
-
debit = Balanced::Debit.fetch('/debits/
|
8
|
+
debit = Balanced::Debit.fetch('/debits/WD4GV5z2pEIRZ9cBSuyuykQx')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Debit:
|
11
|
+
#<Balanced::Debit:0x007fa7d4196bc0
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
14
|
"appears_on_statement_as"=>"BAL*Statement text",
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-05-15T00:41:07.283881Z",
|
16
16
|
"currency"=>"USD",
|
17
17
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
18
18
|
"failure_reason"=>nil,
|
19
19
|
"failure_reason_code"=>nil,
|
20
|
-
"href"=>"/debits/
|
21
|
-
"id"=>"
|
20
|
+
"href"=>"/debits/WD4GV5z2pEIRZ9cBSuyuykQx",
|
21
|
+
"id"=>"WD4GV5z2pEIRZ9cBSuyuykQx",
|
22
22
|
"links"=>
|
23
|
-
{"customer"=>"
|
23
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
24
24
|
"dispute"=>nil,
|
25
25
|
"order"=>nil,
|
26
|
-
"source"=>"
|
26
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
27
27
|
"meta"=>{},
|
28
28
|
"status"=>"succeeded",
|
29
|
-
"transaction_number"=>"
|
30
|
-
"updated_at"=>"2014-
|
29
|
+
"transaction_number"=>"W235-372-7348",
|
30
|
+
"updated_at"=>"2014-05-15T00:41:11.755100Z"},
|
31
31
|
@hyperlinks=
|
32
32
|
{"customer"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fa7d4195068/lib/balanced/resources/resource.rb:60 (lambda)>,
|
34
34
|
"dispute"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fa7d4194460/lib/balanced/utils.rb:6 (lambda)>,
|
36
36
|
"events"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d40a65d0/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"order"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d40a5bd0/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"refunds"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d4043d40/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"source"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d40423c8/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Debit.save
|
|
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
|
-
debit = Balanced::Debit.fetch('/debits/
|
8
|
+
debit = Balanced::Debit.fetch('/debits/WD4GV5z2pEIRZ9cBSuyuykQx')
|
9
9
|
debit.description = 'New description for debit'
|
10
10
|
debit.meta = {
|
11
11
|
'anykey' => 'valuegoeshere',
|
@@ -14,38 +14,38 @@ debit.meta = {
|
|
14
14
|
debit.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Debit:
|
17
|
+
#<Balanced::Debit:0x007fa7d3452d38
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>5000,
|
20
20
|
"appears_on_statement_as"=>"BAL*Statement text",
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-05-15T00:41:07.283881Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"New description for debit",
|
24
24
|
"failure_reason"=>nil,
|
25
25
|
"failure_reason_code"=>nil,
|
26
|
-
"href"=>"/debits/
|
27
|
-
"id"=>"
|
26
|
+
"href"=>"/debits/WD4GV5z2pEIRZ9cBSuyuykQx",
|
27
|
+
"id"=>"WD4GV5z2pEIRZ9cBSuyuykQx",
|
28
28
|
"links"=>
|
29
|
-
{"customer"=>"
|
29
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
30
30
|
"dispute"=>nil,
|
31
31
|
"order"=>nil,
|
32
|
-
"source"=>"
|
32
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
33
33
|
"meta"=>{"anykey"=>"valuegoeshere", "facebook.id"=>"1234567890"},
|
34
34
|
"status"=>"succeeded",
|
35
|
-
"transaction_number"=>"
|
36
|
-
"updated_at"=>"2014-
|
35
|
+
"transaction_number"=>"W235-372-7348",
|
36
|
+
"updated_at"=>"2014-05-15T00:41:44.238176Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"customer"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d3451078/lib/balanced/resources/resource.rb:60 (lambda)>,
|
40
40
|
"dispute"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d3450560/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"events"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d310a5b8/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"order"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa7d3109b68/lib/balanced/utils.rb:6 (lambda)>,
|
46
46
|
"refunds"=>
|
47
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fa7d3103c40/lib/balanced/utils.rb:6 (lambda)>,
|
48
48
|
"source"=>
|
49
|
-
#<Proc:
|
49
|
+
#<Proc:0x007fa7d3102070/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
50
50
|
|
51
51
|
% endif
|