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,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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
order = Balanced::Order.fetch('/orders/
|
8
|
+
order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Order:
|
11
|
+
#<Balanced::Order:0x007fa7d334c588
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>0,
|
14
14
|
"amount_escrowed"=>0,
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-05-15T00:43:14.079629Z",
|
16
16
|
"currency"=>"USD",
|
17
17
|
"delivery_address"=>
|
18
18
|
{"city"=>nil,
|
@@ -22,23 +22,23 @@ order = Balanced::Order.fetch('/orders/OR6d55qbtKx5aWSURkQeodRr')
|
|
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/OR6Zx317bzTVRgDxt3JqnZIx",
|
26
|
+
"id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
|
27
|
+
"links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
|
28
28
|
"meta"=>{},
|
29
|
-
"updated_at"=>"2014-
|
29
|
+
"updated_at"=>"2014-05-15T00:43:14.079632Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"buyers"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d3349ef0/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"credits"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d3347dd0/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"debits"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d3344c70/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"merchant"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d3342c18/lib/balanced/resources/resource.rb:60 (lambda)>,
|
39
39
|
"refunds"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d3340d50/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"reversals"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d333ab58/lib/balanced/utils.rb:6 (lambda)>}>
|
43
43
|
|
44
44
|
% 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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
order = Balanced::Order.fetch('/orders/
|
8
|
+
order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
|
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:0x007fa7d331ad80
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>0,
|
20
20
|
"amount_escrowed"=>0,
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-05-15T00:43:14.079629Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"delivery_address"=>
|
24
24
|
{"city"=>nil,
|
@@ -28,23 +28,23 @@ 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/OR6Zx317bzTVRgDxt3JqnZIx",
|
32
|
+
"id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
|
33
|
+
"links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
|
34
34
|
"meta"=>{"anykey"=>"valuegoeshere", "product.id"=>"1234567890"},
|
35
|
-
"updated_at"=>"2014-
|
35
|
+
"updated_at"=>"2014-05-15T00:43:27.654101Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"buyers"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d3318990/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"credits"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d3316910/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"debits"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d33145e8/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"merchant"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d330ea08/lib/balanced/resources/resource.rb:60 (lambda)>,
|
45
45
|
"refunds"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d330ca28/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"reversals"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa7d330aa98/lib/balanced/utils.rb:6 (lambda)>}>
|
49
49
|
|
50
50
|
% 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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
debit = Balanced::Debit.fetch('/debits/
|
7
|
+
debit = Balanced::Debit.fetch('/debits/WD5z5CvSR6PFx0GgUFn0icKx')
|
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:0x007fa7d32ee8e8
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
|
-
"created_at"=>"2014-
|
22
|
+
"created_at"=>"2014-05-15T00:42:22.128891Z",
|
23
23
|
"currency"=>"USD",
|
24
24
|
"description"=>"Refund for Order #1111",
|
25
|
-
"href"=>"/refunds/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
|
26
|
+
"id"=>"RF635DEq9cKcoNDr0ljY4dU1",
|
27
27
|
"links"=>
|
28
|
-
{"debit"=>"
|
28
|
+
{"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "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"=>"RF710-400-6883",
|
35
|
+
"updated_at"=>"2014-05-15T00:42:32.373753Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"debit"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d32ec4f8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
39
39
|
"dispute"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d32eb8f0/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d32e9258/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d32e87b8/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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
8
|
refunds = Balanced::Refund.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Refund:
|
10
|
+
[#<Balanced::Refund:0x007fa7d422dcf0
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
|
-
"created_at"=>"2014-
|
13
|
+
"created_at"=>"2014-05-15T00:42:22.128891Z",
|
14
14
|
"currency"=>"USD",
|
15
15
|
"description"=>"Refund for Order #1111",
|
16
|
-
"href"=>"/refunds/
|
17
|
-
"id"=>"
|
16
|
+
"href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
|
17
|
+
"id"=>"RF635DEq9cKcoNDr0ljY4dU1",
|
18
18
|
"links"=>
|
19
|
-
{"debit"=>"
|
19
|
+
{"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "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"=>"RF710-400-6883",
|
26
|
+
"updated_at"=>"2014-05-15T00:42:32.373753Z"},
|
27
27
|
@hyperlinks=
|
28
28
|
{"debit"=>
|
29
|
-
#<Proc:
|
29
|
+
#<Proc:0x007fa7d42275f8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
30
30
|
"dispute"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fa7d4226720/lib/balanced/utils.rb:6 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fa7d4224420/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fa7d421f970/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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
refund = Balanced::Refund.fetch('/refunds/
|
8
|
+
refund = Balanced::Refund.fetch('/refunds/RF635DEq9cKcoNDr0ljY4dU1')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Refund:
|
11
|
+
#<Balanced::Refund:0x007fa7d41ffbe8
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-05-15T00:42:22.128891Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>"Refund for Order #1111",
|
17
|
-
"href"=>"/refunds/
|
18
|
-
"id"=>"
|
17
|
+
"href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
|
18
|
+
"id"=>"RF635DEq9cKcoNDr0ljY4dU1",
|
19
19
|
"links"=>
|
20
|
-
{"debit"=>"
|
20
|
+
{"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "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"=>"RF710-400-6883",
|
27
|
+
"updated_at"=>"2014-05-15T00:42:32.373753Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"debit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fa7d41fcdf8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
31
31
|
"dispute"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d41f7df8/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"events"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d41f5968/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"order"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d41f4ef0/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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
refund = Balanced::Refund.fetch('/refunds/
|
8
|
+
refund = Balanced::Refund.fetch('/refunds/RF635DEq9cKcoNDr0ljY4dU1')
|
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:0x007fa7d41d66f8
|
19
19
|
@attributes=
|
20
20
|
{"amount"=>3000,
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-05-15T00:42:22.128891Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"update this description",
|
24
|
-
"href"=>"/refunds/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
|
25
|
+
"id"=>"RF635DEq9cKcoNDr0ljY4dU1",
|
26
26
|
"links"=>
|
27
|
-
{"debit"=>"
|
27
|
+
{"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "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"=>"RF710-400-6883",
|
34
|
+
"updated_at"=>"2014-05-15T00:43:36.139004Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"debit"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d41d4740/lib/balanced/resources/resource.rb:60 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d41cfdd0/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d41cddf0/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d41cd3c8/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
data/scenarios/render_mako.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
Balanced::Credit.reverse
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
reversal = Balanced::Credit.fetch('/credits/
|
7
|
+
reversal = Balanced::Credit.fetch('/credits/CR7ushK6kWjPJYdh24QoM1A9')
|
8
8
|
credit.reverse(
|
9
9
|
:amount => 3000,
|
10
10
|
:description => 'Reversal for Order #1111',
|
@@ -16,30 +16,30 @@ credit.reverse(
|
|
16
16
|
)
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Reversal:
|
19
|
+
#<Balanced::Reversal:0x007fa7d417fe70
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
|
-
"created_at"=>"2014-
|
22
|
+
"created_at"=>"2014-05-15T00:43:48.266113Z",
|
23
23
|
"currency"=>"USD",
|
24
24
|
"description"=>"Reversal for Order #1111",
|
25
25
|
"failure_reason"=>nil,
|
26
26
|
"failure_reason_code"=>nil,
|
27
|
-
"href"=>"/reversals/
|
28
|
-
"id"=>"
|
29
|
-
"links"=>{"credit"=>"
|
27
|
+
"href"=>"/reversals/RV7BYCqyLOKwcWigapAoGWdr",
|
28
|
+
"id"=>"RV7BYCqyLOKwcWigapAoGWdr",
|
29
|
+
"links"=>{"credit"=>"CR7ushK6kWjPJYdh24QoM1A9", "order"=>nil},
|
30
30
|
"meta"=>
|
31
31
|
{"fulfillment.item.condition"=>"OK",
|
32
32
|
"merchant.feedback"=>"positive",
|
33
33
|
"user.refund_reason"=>"not happy with product"},
|
34
34
|
"status"=>"succeeded",
|
35
|
-
"transaction_number"=>"
|
36
|
-
"updated_at"=>"2014-
|
35
|
+
"transaction_number"=>"RV689-626-0403",
|
36
|
+
"updated_at"=>"2014-05-15T00:43:53.755588Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"credit"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d417e1b0/lib/balanced/resources/resource.rb:60 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d4177c48/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d4176af0/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
@@ -3,34 +3,34 @@ Balanced::Reversal.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
|
reversals = Balanced::Reversal.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Reversal:
|
10
|
+
[#<Balanced::Reversal:0x007fa7d414f158
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
|
-
"created_at"=>"2014-
|
13
|
+
"created_at"=>"2014-05-15T00:43:48.266113Z",
|
14
14
|
"currency"=>"USD",
|
15
15
|
"description"=>"Reversal for Order #1111",
|
16
16
|
"failure_reason"=>nil,
|
17
17
|
"failure_reason_code"=>nil,
|
18
|
-
"href"=>"/reversals/
|
19
|
-
"id"=>"
|
20
|
-
"links"=>{"credit"=>"
|
18
|
+
"href"=>"/reversals/RV7BYCqyLOKwcWigapAoGWdr",
|
19
|
+
"id"=>"RV7BYCqyLOKwcWigapAoGWdr",
|
20
|
+
"links"=>{"credit"=>"CR7ushK6kWjPJYdh24QoM1A9", "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"=>"RV689-626-0403",
|
27
|
+
"updated_at"=>"2014-05-15T00:43:53.755588Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"credit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fa7d414d4e8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
31
31
|
"events"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d4147458/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"order"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d4146a08/lib/balanced/utils.rb:6 (lambda)>}>]
|
35
35
|
|
36
36
|
% endif
|
@@ -3,35 +3,35 @@ Balanced::Reversal.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
|
-
reversal = Balanced::Reversal.fetch('/reversals/
|
8
|
+
reversal = Balanced::Reversal.fetch('/reversals/RV7BYCqyLOKwcWigapAoGWdr')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Reversal:
|
11
|
+
#<Balanced::Reversal:0x007fa7d41277e8
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-05-15T00:43:48.266113Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>"Reversal for Order #1111",
|
17
17
|
"failure_reason"=>nil,
|
18
18
|
"failure_reason_code"=>nil,
|
19
|
-
"href"=>"/reversals/
|
20
|
-
"id"=>"
|
21
|
-
"links"=>{"credit"=>"
|
19
|
+
"href"=>"/reversals/RV7BYCqyLOKwcWigapAoGWdr",
|
20
|
+
"id"=>"RV7BYCqyLOKwcWigapAoGWdr",
|
21
|
+
"links"=>{"credit"=>"CR7ushK6kWjPJYdh24QoM1A9", "order"=>nil},
|
22
22
|
"meta"=>
|
23
23
|
{"fulfillment.item.condition"=>"OK",
|
24
24
|
"merchant.feedback"=>"positive",
|
25
25
|
"user.refund_reason"=>"not happy with product"},
|
26
26
|
"status"=>"succeeded",
|
27
|
-
"transaction_number"=>"
|
28
|
-
"updated_at"=>"2014-
|
27
|
+
"transaction_number"=>"RV689-626-0403",
|
28
|
+
"updated_at"=>"2014-05-15T00:43:53.755588Z"},
|
29
29
|
@hyperlinks=
|
30
30
|
{"credit"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fa7d41258d0/lib/balanced/resources/resource.rb:60 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fa7d411f4a8/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fa7d411e968/lib/balanced/utils.rb:6 (lambda)>}>
|
36
36
|
|
37
37
|
% endif
|