balanced 1.1.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +10 -6
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/balanced/resources.rb +2 -0
- data/lib/balanced/resources/account.rb +33 -0
- data/lib/balanced/resources/card.rb +1 -1
- data/lib/balanced/resources/customer.rb +8 -0
- data/lib/balanced/resources/resource.rb +4 -6
- data/lib/balanced/resources/settlement.rb +12 -0
- data/lib/balanced/response/balanced_exception_middleware.rb +1 -1
- data/lib/balanced/utils.rb +1 -1
- data/lib/balanced/version.rb +1 -1
- data/scenarios/account_credit/definition.rb +1 -0
- data/scenarios/account_credit/request.rb +5 -0
- data/scenarios/account_credit/ruby.mako +49 -0
- data/scenarios/account_list/definition.rb +1 -0
- data/scenarios/account_list/request.rb +2 -0
- data/scenarios/account_list/ruby.mako +64 -0
- data/scenarios/account_list_customer/definition.rb +1 -0
- data/scenarios/account_list_customer/request.rb +3 -0
- data/scenarios/account_list_customer/ruby.mako +38 -0
- data/scenarios/account_show/definition.rb +1 -0
- data/scenarios/account_show/request.rb +2 -0
- data/scenarios/account_show/ruby.mako +37 -0
- 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 +16 -14
- data/scenarios/bank_account_create/ruby.mako +13 -11
- data/scenarios/bank_account_credit/ruby.mako +16 -16
- data/scenarios/bank_account_debit/ruby.mako +21 -18
- data/scenarios/bank_account_debit_order/definition.rb +1 -0
- data/scenarios/bank_account_debit_order/request.rb +7 -0
- data/scenarios/bank_account_debit_order/ruby.mako +52 -0
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_list/ruby.mako +26 -22
- data/scenarios/bank_account_show/ruby.mako +14 -12
- data/scenarios/bank_account_update/ruby.mako +14 -12
- data/scenarios/bank_account_verification_create/ruby.mako +10 -10
- data/scenarios/bank_account_verification_show/ruby.mako +10 -10
- 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/ruby.mako +26 -26
- data/scenarios/card_create/ruby.mako +13 -15
- data/scenarios/card_create_creditable/ruby.mako +11 -11
- data/scenarios/card_create_dispute/ruby.mako +13 -13
- data/scenarios/card_credit/ruby.mako +16 -14
- data/scenarios/card_credit_order/definition.rb +1 -0
- data/scenarios/card_credit_order/request.rb +7 -0
- data/scenarios/card_credit_order/ruby.mako +45 -0
- data/scenarios/card_debit/ruby.mako +20 -17
- data/scenarios/card_debit_dispute/ruby.mako +20 -17
- data/scenarios/card_delete/ruby.mako +2 -2
- data/scenarios/card_hold_capture/ruby.mako +20 -17
- data/scenarios/card_hold_create/ruby.mako +16 -14
- data/scenarios/card_hold_list/ruby.mako +33 -27
- data/scenarios/card_hold_order/definition.rb +1 -0
- data/scenarios/card_hold_order/request.rb +6 -0
- data/scenarios/card_hold_order/ruby.mako +45 -0
- data/scenarios/card_hold_show/ruby.mako +16 -14
- data/scenarios/card_hold_update/ruby.mako +16 -14
- data/scenarios/card_hold_void/ruby.mako +17 -15
- data/scenarios/card_list/ruby.mako +25 -29
- data/scenarios/card_show/ruby.mako +14 -16
- data/scenarios/card_update/ruby.mako +14 -16
- data/scenarios/credit_list/ruby.mako +44 -14
- data/scenarios/credit_list_bank_account/ruby.mako +3 -3
- data/scenarios/credit_order/request.rb +2 -2
- data/scenarios/credit_order/ruby.mako +35 -14
- data/scenarios/credit_show/ruby.mako +16 -16
- data/scenarios/credit_update/ruby.mako +16 -16
- data/scenarios/customer_create/ruby.mako +22 -20
- data/scenarios/customer_delete/ruby.mako +1 -1
- data/scenarios/customer_list/ruby.mako +43 -39
- data/scenarios/customer_show/ruby.mako +23 -21
- data/scenarios/customer_update/ruby.mako +23 -21
- data/scenarios/debit_dispute_show/ruby.mako +12 -12
- data/scenarios/debit_list/ruby.mako +43 -37
- data/scenarios/debit_order/ruby.mako +22 -19
- data/scenarios/debit_show/ruby.mako +20 -17
- data/scenarios/debit_update/ruby.mako +20 -17
- data/scenarios/dispute_list/ruby.mako +11 -11
- data/scenarios/dispute_show/ruby.mako +12 -12
- data/scenarios/event_list/ruby.mako +55 -81
- data/scenarios/event_show/ruby.mako +35 -45
- data/scenarios/order_create/ruby.mako +16 -14
- data/scenarios/order_list/ruby.mako +33 -29
- data/scenarios/order_show/ruby.mako +16 -14
- data/scenarios/order_update/ruby.mako +16 -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/reversal_create/ruby.mako +13 -13
- data/scenarios/reversal_list/ruby.mako +12 -12
- data/scenarios/reversal_show/ruby.mako +13 -13
- data/scenarios/reversal_update/ruby.mako +13 -13
- data/scenarios/settlement_create/definition.rb +1 -0
- data/scenarios/settlement_create/request.rb +5 -0
- data/scenarios/settlement_create/ruby.mako +48 -0
- data/scenarios/settlement_list/definition.rb +1 -0
- data/scenarios/settlement_list/request.rb +2 -0
- data/scenarios/settlement_list/ruby.mako +40 -0
- data/scenarios/settlement_list_account/definition.rb +1 -0
- data/scenarios/settlement_list_account/request.rb +3 -0
- data/scenarios/settlement_list_account/ruby.mako +41 -0
- data/scenarios/settlement_show/definition.rb +1 -0
- data/scenarios/settlement_show/request.rb +2 -0
- data/scenarios/settlement_show/ruby.mako +40 -0
- data/snippets/account-balance.rb +1 -0
- data/snippets/bank-account-create.rb +6 -0
- data/snippets/bank-account-debit.rb +9 -0
- data/snippets/bank-account-verification-confirm.rb +5 -0
- data/snippets/bank-account-verification-create.rb +1 -0
- data/snippets/callback-create.rb +4 -0
- data/snippets/card-associate-to-customer.rb +2 -0
- data/snippets/card-create-dispute.rb +6 -0
- data/snippets/card-create.rb +7 -0
- data/snippets/card-credit.rb +9 -0
- data/snippets/card-debit.rb +9 -0
- data/snippets/card-hold-capture.rb +6 -0
- data/snippets/card-hold-create.rb +6 -0
- data/snippets/card-hold-void.rb +3 -0
- data/snippets/create-buyer-and-card.rb +13 -0
- data/snippets/credit-create.rb +8 -0
- data/snippets/credit-fetch.rb +1 -0
- data/snippets/credit-marketplace-escrow.rb +4 -0
- data/snippets/credit-reverse.rb +1 -0
- data/snippets/credit-soft-descriptor.rb +9 -0
- data/snippets/credit-split.rb +13 -0
- data/snippets/customer-create.rb +8 -0
- data/snippets/debit-dispute-show.rb +3 -0
- data/snippets/debit-fetch.rb +1 -0
- data/snippets/debit-marketplace-escrow.rb +4 -0
- data/snippets/debit-refund.rb +1 -0
- data/snippets/dispute-list.rb +1 -0
- data/snippets/dispute-show.rb +2 -0
- data/snippets/examine-order-after-refund.rb +3 -0
- data/snippets/examine-order-after-reversal.rb +3 -0
- data/snippets/example.rb +1 -0
- data/snippets/marketplace-in-escrow.rb +1 -0
- data/snippets/merchant-payable-account-fetch.rb +2 -0
- data/snippets/order-amount-escrowed.rb +3 -0
- data/snippets/order-bank-account-create.rb +8 -0
- data/snippets/order-create.rb +1 -0
- data/snippets/order-credit-marketplace.rb +5 -0
- data/snippets/order-credit-merchant-payable-account.rb +4 -0
- data/snippets/order-credit.rb +4 -0
- data/snippets/order-credits-fetch.rb +1 -0
- data/snippets/order-debit.rb +4 -0
- data/snippets/order-debits-fetch.rb +1 -0
- data/snippets/order-fetch.rb +1 -0
- data/snippets/order-update.rb +5 -0
- data/snippets/refund-create.rb +13 -0
- data/snippets/reversal-create.rb +13 -0
- data/snippets/settlement-create.rb +5 -0
- data/spec/balanced/resources/account_spec.rb +265 -0
- data/spec/balanced/resources/card_spec.rb +6 -6
- metadata +86 -2
@@ -3,18 +3,18 @@ Balanced::Customer.create_order
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
merchant_customer = Balanced::Customer.fetch('/customers/
|
8
|
+
merchant_customer = Balanced::Customer.fetch('/customers/CU7yoUz1HuDE7t7p9GcVNYbz')
|
9
9
|
merchant_customer.create_order(
|
10
10
|
:description => 'Order #12341234'
|
11
11
|
)
|
12
12
|
% elif mode == 'response':
|
13
|
-
#<Balanced::Order:
|
13
|
+
#<Balanced::Order:0x007fcde199c198
|
14
14
|
@attributes=
|
15
15
|
{"amount"=>0,
|
16
16
|
"amount_escrowed"=>0,
|
17
|
-
"created_at"=>"2014-
|
17
|
+
"created_at"=>"2014-12-17T21:25:55.028602Z",
|
18
18
|
"currency"=>"USD",
|
19
19
|
"delivery_address"=>
|
20
20
|
{"city"=>nil,
|
@@ -24,23 +24,25 @@ merchant_customer.create_order(
|
|
24
24
|
"postal_code"=>nil,
|
25
25
|
"state"=>nil},
|
26
26
|
"description"=>"Order #12341234",
|
27
|
-
"href"=>"/orders/
|
28
|
-
"id"=>"
|
29
|
-
"links"=>{"merchant"=>"
|
27
|
+
"href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
|
28
|
+
"id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
|
29
|
+
"links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
|
30
30
|
"meta"=>{},
|
31
|
-
"updated_at"=>"2014-
|
31
|
+
"updated_at"=>"2014-12-17T21:25:55.028603Z"},
|
32
32
|
@hyperlinks=
|
33
33
|
{"buyers"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde1995fa0/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"credits"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fcde1994038/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"debits"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde198e098/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"events"=>
|
40
|
+
#<Proc:0x007fcde198c0b8/lib/balanced/utils.rb:6 (lambda)>,
|
39
41
|
"merchant"=>
|
40
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde19865f0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
41
43
|
"refunds"=>
|
42
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde195fb80/lib/balanced/utils.rb:6 (lambda)>,
|
43
45
|
"reversals"=>
|
44
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde195dda8/lib/balanced/utils.rb:6 (lambda)>}>
|
45
47
|
|
46
48
|
% endif
|
@@ -2,15 +2,15 @@
|
|
2
2
|
Balanced::Order.all
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
7
|
orders = Balanced::Order.all
|
8
8
|
% elif mode == 'response':
|
9
|
-
[#<Balanced::Order:
|
9
|
+
[#<Balanced::Order:0x007fcde1382118
|
10
10
|
@attributes=
|
11
|
-
{"amount"=>
|
12
|
-
"amount_escrowed"=>
|
13
|
-
"created_at"=>"2014-
|
11
|
+
{"amount"=>10000,
|
12
|
+
"amount_escrowed"=>4000,
|
13
|
+
"created_at"=>"2014-12-17T21:24:07.380654Z",
|
14
14
|
"currency"=>"USD",
|
15
15
|
"delivery_address"=>
|
16
16
|
{"city"=>nil,
|
@@ -20,29 +20,31 @@ orders = Balanced::Order.all
|
|
20
20
|
"postal_code"=>nil,
|
21
21
|
"state"=>nil},
|
22
22
|
"description"=>"Order #12341234",
|
23
|
-
"href"=>"/orders/
|
24
|
-
"id"=>"
|
25
|
-
"links"=>{"merchant"=>"
|
23
|
+
"href"=>"/orders/OR6c6n11zKSFfjE6kGNKtsE8",
|
24
|
+
"id"=>"OR6c6n11zKSFfjE6kGNKtsE8",
|
25
|
+
"links"=>{"merchant"=>"CU68iUpvvUwpRpuuBL3u9Slq"},
|
26
26
|
"meta"=>{},
|
27
|
-
"updated_at"=>"2014-
|
27
|
+
"updated_at"=>"2014-12-17T21:24:07.380656Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"buyers"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fcde1380070/lib/balanced/utils.rb:6 (lambda)>,
|
31
31
|
"credits"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fcde13721a0/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"debits"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde1370300/lib/balanced/utils.rb:6 (lambda)>,
|
35
|
+
"events"=>
|
36
|
+
#<Proc:0x007fcde134a420/lib/balanced/utils.rb:6 (lambda)>,
|
35
37
|
"merchant"=>
|
36
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde1348a80/lib/balanced/resources/resource.rb:56 (lambda)>,
|
37
39
|
"refunds"=>
|
38
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde131abf8/lib/balanced/utils.rb:6 (lambda)>,
|
39
41
|
"reversals"=>
|
40
|
-
#<Proc:
|
41
|
-
#<Balanced::Order:
|
42
|
+
#<Proc:0x007fcde1318d58/lib/balanced/utils.rb:6 (lambda)>}>,
|
43
|
+
#<Balanced::Order:0x007fcde1318d08
|
42
44
|
@attributes=
|
43
|
-
{"amount"=>
|
44
|
-
"amount_escrowed"=>
|
45
|
-
"created_at"=>"2014-
|
45
|
+
{"amount"=>0,
|
46
|
+
"amount_escrowed"=>0,
|
47
|
+
"created_at"=>"2014-12-17T21:25:55.028602Z",
|
46
48
|
"currency"=>"USD",
|
47
49
|
"delivery_address"=>
|
48
50
|
{"city"=>nil,
|
@@ -52,23 +54,25 @@ orders = Balanced::Order.all
|
|
52
54
|
"postal_code"=>nil,
|
53
55
|
"state"=>nil},
|
54
56
|
"description"=>"Order #12341234",
|
55
|
-
"href"=>"/orders/
|
56
|
-
"id"=>"
|
57
|
-
"links"=>{"merchant"=>"
|
57
|
+
"href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
|
58
|
+
"id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
|
59
|
+
"links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
|
58
60
|
"meta"=>{},
|
59
|
-
"updated_at"=>"2014-
|
61
|
+
"updated_at"=>"2014-12-17T21:25:55.028603Z"},
|
60
62
|
@hyperlinks=
|
61
63
|
{"buyers"=>
|
62
|
-
#<Proc:
|
64
|
+
#<Proc:0x007fcde3adad00/lib/balanced/utils.rb:6 (lambda)>,
|
63
65
|
"credits"=>
|
64
|
-
#<Proc:
|
66
|
+
#<Proc:0x007fcde3ad8f50/lib/balanced/utils.rb:6 (lambda)>,
|
65
67
|
"debits"=>
|
66
|
-
#<Proc:
|
68
|
+
#<Proc:0x007fcde12b3110/lib/balanced/utils.rb:6 (lambda)>,
|
69
|
+
"events"=>
|
70
|
+
#<Proc:0x007fcde12b1310/lib/balanced/utils.rb:6 (lambda)>,
|
67
71
|
"merchant"=>
|
68
|
-
#<Proc:
|
72
|
+
#<Proc:0x007fcde12a3918/lib/balanced/resources/resource.rb:56 (lambda)>,
|
69
73
|
"refunds"=>
|
70
|
-
#<Proc:
|
74
|
+
#<Proc:0x007fcde12a1a78/lib/balanced/utils.rb:6 (lambda)>,
|
71
75
|
"reversals"=>
|
72
|
-
#<Proc:
|
76
|
+
#<Proc:0x007fcde129b830/lib/balanced/utils.rb:6 (lambda)>}>]
|
73
77
|
|
74
78
|
% endif
|
@@ -3,16 +3,16 @@ Balanced::Order.fetch
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
order = Balanced::Order.fetch('/orders/
|
8
|
+
order = Balanced::Order.fetch('/orders/ORm6xuCp6tf0DZMp7ESoOj3')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Order:
|
11
|
+
#<Balanced::Order:0x007fcde12135e8
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>0,
|
14
14
|
"amount_escrowed"=>0,
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-12-17T21:25:55.028602Z",
|
16
16
|
"currency"=>"USD",
|
17
17
|
"delivery_address"=>
|
18
18
|
{"city"=>nil,
|
@@ -22,23 +22,25 @@ order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
|
|
22
22
|
"postal_code"=>nil,
|
23
23
|
"state"=>nil},
|
24
24
|
"description"=>"Order #12341234",
|
25
|
-
"href"=>"/orders/
|
26
|
-
"id"=>"
|
27
|
-
"links"=>{"merchant"=>"
|
25
|
+
"href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
|
26
|
+
"id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
|
27
|
+
"links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
|
28
28
|
"meta"=>{},
|
29
|
-
"updated_at"=>"2014-
|
29
|
+
"updated_at"=>"2014-12-17T21:25:55.028603Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"buyers"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fcde1211400/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"credits"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde120b6e0/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"debits"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fcde12098b8/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"events"=>
|
38
|
+
#<Proc:0x007fcde1203a80/lib/balanced/utils.rb:6 (lambda)>,
|
37
39
|
"merchant"=>
|
38
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde1202018/lib/balanced/resources/resource.rb:56 (lambda)>,
|
39
41
|
"refunds"=>
|
40
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde1200128/lib/balanced/utils.rb:6 (lambda)>,
|
41
43
|
"reversals"=>
|
42
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde11fa278/lib/balanced/utils.rb:6 (lambda)>}>
|
43
45
|
|
44
46
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Order.save
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
order = Balanced::Order.fetch('/orders/
|
8
|
+
order = Balanced::Order.fetch('/orders/ORm6xuCp6tf0DZMp7ESoOj3')
|
9
9
|
order.description = 'New description for order'
|
10
10
|
order.meta = {
|
11
11
|
'anykey' => 'valuegoeshere',
|
@@ -14,11 +14,11 @@ order.meta = {
|
|
14
14
|
order.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Order:
|
17
|
+
#<Balanced::Order:0x007fcde11e1340
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>0,
|
20
20
|
"amount_escrowed"=>0,
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-12-17T21:25:55.028602Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"delivery_address"=>
|
24
24
|
{"city"=>nil,
|
@@ -28,23 +28,25 @@ order.save
|
|
28
28
|
"postal_code"=>nil,
|
29
29
|
"state"=>nil},
|
30
30
|
"description"=>"New description for order",
|
31
|
-
"href"=>"/orders/
|
32
|
-
"id"=>"
|
33
|
-
"links"=>{"merchant"=>"
|
31
|
+
"href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
|
32
|
+
"id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
|
33
|
+
"links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
|
34
34
|
"meta"=>{"anykey"=>"valuegoeshere", "product.id"=>"1234567890"},
|
35
|
-
"updated_at"=>"2014-
|
35
|
+
"updated_at"=>"2014-12-17T21:25:59.040054Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"buyers"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde125b230/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"credits"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde1259408/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"debits"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde18e7428/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"events"=>
|
44
|
+
#<Proc:0x007fcde18e53f8/lib/balanced/utils.rb:6 (lambda)>,
|
43
45
|
"merchant"=>
|
44
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde18df6b0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
45
47
|
"refunds"=>
|
46
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fcde18dca50/lib/balanced/utils.rb:6 (lambda)>,
|
47
49
|
"reversals"=>
|
48
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fcde18d69e8/lib/balanced/utils.rb:6 (lambda)>}>
|
49
51
|
|
50
52
|
% endif
|
@@ -2,9 +2,9 @@
|
|
2
2
|
Balanced::Debit.refund
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
|
-
debit = Balanced::Debit.fetch('/debits/
|
7
|
+
debit = Balanced::Debit.fetch('/debits/WD7HiEv2UJV5WlRSAcmGOFKJ')
|
8
8
|
debit.refund(
|
9
9
|
:amount => 3000,
|
10
10
|
:description => 'Refund for Order #1111',
|
@@ -16,31 +16,31 @@ debit.refund(
|
|
16
16
|
)
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Refund:
|
19
|
+
#<Balanced::Refund:0x007fcde18ac7b0
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
|
-
"created_at"=>"2014-
|
22
|
+
"created_at"=>"2014-12-17T21:25:31.528064Z",
|
23
23
|
"currency"=>"USD",
|
24
24
|
"description"=>"Refund for Order #1111",
|
25
|
-
"href"=>"/refunds/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
26
|
+
"id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
27
27
|
"links"=>
|
28
|
-
{"debit"=>"
|
28
|
+
{"debit"=>"WD7HiEv2UJV5WlRSAcmGOFKJ", "dispute"=>nil, "order"=>nil},
|
29
29
|
"meta"=>
|
30
30
|
{"fulfillment.item.condition"=>"OK",
|
31
31
|
"merchant.feedback"=>"positive",
|
32
32
|
"user.refund_reason"=>"not happy with product"},
|
33
33
|
"status"=>"succeeded",
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
34
|
+
"transaction_number"=>"RFS3R-YHO-DMB0",
|
35
|
+
"updated_at"=>"2014-12-17T21:25:31.950218Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"debit"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde18a6978/lib/balanced/resources/resource.rb:56 (lambda)>,
|
39
39
|
"dispute"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde18a5e38/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde189fec0/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde189eed0/lib/balanced/utils.rb:6 (lambda)>}>
|
45
45
|
|
46
46
|
% endif
|
@@ -3,35 +3,35 @@ Balanced::Refund.all
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
8
|
refunds = Balanced::Refund.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Refund:
|
10
|
+
[#<Balanced::Refund:0x007fcde3aca720
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
|
-
"created_at"=>"2014-
|
13
|
+
"created_at"=>"2014-12-17T21:25:31.528064Z",
|
14
14
|
"currency"=>"USD",
|
15
15
|
"description"=>"Refund for Order #1111",
|
16
|
-
"href"=>"/refunds/
|
17
|
-
"id"=>"
|
16
|
+
"href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
17
|
+
"id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
18
18
|
"links"=>
|
19
|
-
{"debit"=>"
|
19
|
+
{"debit"=>"WD7HiEv2UJV5WlRSAcmGOFKJ", "dispute"=>nil, "order"=>nil},
|
20
20
|
"meta"=>
|
21
21
|
{"fulfillment.item.condition"=>"OK",
|
22
22
|
"merchant.feedback"=>"positive",
|
23
23
|
"user.refund_reason"=>"not happy with product"},
|
24
24
|
"status"=>"succeeded",
|
25
|
-
"transaction_number"=>"
|
26
|
-
"updated_at"=>"2014-
|
25
|
+
"transaction_number"=>"RFS3R-YHO-DMB0",
|
26
|
+
"updated_at"=>"2014-12-17T21:25:31.950218Z"},
|
27
27
|
@hyperlinks=
|
28
28
|
{"debit"=>
|
29
|
-
#<Proc:
|
29
|
+
#<Proc:0x007fcde3ac89c0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
30
30
|
"dispute"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fcde3ac8038/lib/balanced/utils.rb:6 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fcde3ac1ee0/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fcde3ac1508/lib/balanced/utils.rb:6 (lambda)>}>]
|
36
36
|
|
37
37
|
% endif
|
@@ -3,36 +3,36 @@ Balanced::Refund.fetch
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
refund = Balanced::Refund.fetch('/refunds/
|
8
|
+
refund = Balanced::Refund.fetch('/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Refund:
|
11
|
+
#<Balanced::Refund:0x007fcde09f22d8
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-12-17T21:25:31.528064Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>"Refund for Order #1111",
|
17
|
-
"href"=>"/refunds/
|
18
|
-
"id"=>"
|
17
|
+
"href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
18
|
+
"id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
19
19
|
"links"=>
|
20
|
-
{"debit"=>"
|
20
|
+
{"debit"=>"WD7HiEv2UJV5WlRSAcmGOFKJ", "dispute"=>nil, "order"=>nil},
|
21
21
|
"meta"=>
|
22
22
|
{"fulfillment.item.condition"=>"OK",
|
23
23
|
"merchant.feedback"=>"positive",
|
24
24
|
"user.refund_reason"=>"not happy with product"},
|
25
25
|
"status"=>"succeeded",
|
26
|
-
"transaction_number"=>"
|
27
|
-
"updated_at"=>"2014-
|
26
|
+
"transaction_number"=>"RFS3R-YHO-DMB0",
|
27
|
+
"updated_at"=>"2014-12-17T21:25:31.950218Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"debit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fcde09f04b0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
31
31
|
"dispute"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fcde09eba78/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"events"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde09e9c28/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"order"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fcde09e9250/lib/balanced/utils.rb:6 (lambda)>}>
|
37
37
|
|
38
38
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Refund.save
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
refund = Balanced::Refund.fetch('/refunds/
|
8
|
+
refund = Balanced::Refund.fetch('/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p')
|
9
9
|
refund.description = 'update this description'
|
10
10
|
refund.meta = {
|
11
11
|
'refund.reason' => 'user not happy with product',
|
@@ -15,31 +15,31 @@ refund.meta = {
|
|
15
15
|
refund.save
|
16
16
|
|
17
17
|
% elif mode == 'response':
|
18
|
-
#<Balanced::Refund:
|
18
|
+
#<Balanced::Refund:0x007fcde0993468
|
19
19
|
@attributes=
|
20
20
|
{"amount"=>3000,
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-12-17T21:25:31.528064Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"update this description",
|
24
|
-
"href"=>"/refunds/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
25
|
+
"id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
|
26
26
|
"links"=>
|
27
|
-
{"debit"=>"
|
27
|
+
{"debit"=>"WD7HiEv2UJV5WlRSAcmGOFKJ", "dispute"=>nil, "order"=>nil},
|
28
28
|
"meta"=>
|
29
29
|
{"refund.reason"=>"user not happy with product",
|
30
30
|
"user.notes"=>"very polite on the phone",
|
31
31
|
"user.refund.count"=>"3"},
|
32
32
|
"status"=>"succeeded",
|
33
|
-
"transaction_number"=>"
|
34
|
-
"updated_at"=>"2014-
|
33
|
+
"transaction_number"=>"RFS3R-YHO-DMB0",
|
34
|
+
"updated_at"=>"2014-12-17T21:26:03.570873Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"debit"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fcde0991910/lib/balanced/resources/resource.rb:56 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fcde0990f88/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fcde098b100/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fcde098a728/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|