balanced 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +1 -0
  4. data/balanced.gemspec +1 -1
  5. data/lib/balanced/client.rb +1 -2
  6. data/lib/balanced/error.rb +3 -3
  7. data/lib/balanced/resources/card.rb +15 -1
  8. data/lib/balanced/version.rb +1 -1
  9. data/scenarios/api_key_create/ruby.mako +6 -6
  10. data/scenarios/api_key_delete/ruby.mako +2 -2
  11. data/scenarios/api_key_list/ruby.mako +10 -10
  12. data/scenarios/api_key_show/ruby.mako +6 -6
  13. data/scenarios/bank_account_associate_to_customer/ruby.mako +14 -14
  14. data/scenarios/bank_account_create/ruby.mako +11 -11
  15. data/scenarios/bank_account_credit/ruby.mako +15 -15
  16. data/scenarios/bank_account_debit/ruby.mako +15 -15
  17. data/scenarios/bank_account_delete/ruby.mako +2 -2
  18. data/scenarios/bank_account_list/ruby.mako +22 -22
  19. data/scenarios/bank_account_show/ruby.mako +12 -12
  20. data/scenarios/bank_account_update/ruby.mako +12 -12
  21. data/scenarios/bank_account_verification_create/definition.rb +1 -1
  22. data/scenarios/bank_account_verification_create/ruby.mako +10 -10
  23. data/scenarios/bank_account_verification_show/definition.rb +1 -1
  24. data/scenarios/bank_account_verification_show/request.rb +1 -1
  25. data/scenarios/bank_account_verification_show/ruby.mako +10 -10
  26. data/scenarios/bank_account_verification_update/definition.rb +1 -1
  27. data/scenarios/bank_account_verification_update/request.rb +1 -1
  28. data/scenarios/bank_account_verification_update/ruby.mako +10 -10
  29. data/scenarios/callback_create/ruby.mako +4 -4
  30. data/scenarios/callback_delete/ruby.mako +2 -2
  31. data/scenarios/callback_list/ruby.mako +4 -4
  32. data/scenarios/callback_show/ruby.mako +5 -5
  33. data/scenarios/card_associate_to_customer/ruby.mako +21 -12
  34. data/scenarios/card_create/ruby.mako +18 -9
  35. data/scenarios/card_create_creditable/definition.rb +1 -0
  36. data/scenarios/card_create_creditable/request.rb +4 -0
  37. data/scenarios/card_create_creditable/ruby.mako +62 -0
  38. data/scenarios/card_create_dispute/ruby.mako +18 -9
  39. data/scenarios/card_credit/definition.rb +1 -0
  40. data/scenarios/card_credit/request.rb +5 -0
  41. data/scenarios/card_credit/ruby.mako +43 -0
  42. data/scenarios/card_debit/ruby.mako +16 -16
  43. data/scenarios/card_debit_dispute/ruby.mako +15 -15
  44. data/scenarios/card_delete/ruby.mako +2 -2
  45. data/scenarios/card_hold_capture/ruby.mako +16 -16
  46. data/scenarios/card_hold_create/ruby.mako +14 -14
  47. data/scenarios/card_hold_list/ruby.mako +25 -25
  48. data/scenarios/card_hold_show/ruby.mako +14 -14
  49. data/scenarios/card_hold_update/ruby.mako +14 -14
  50. data/scenarios/card_hold_void/ruby.mako +15 -15
  51. data/scenarios/card_list/ruby.mako +36 -18
  52. data/scenarios/card_show/ruby.mako +19 -10
  53. data/scenarios/card_update/ruby.mako +19 -10
  54. data/scenarios/credit_list/ruby.mako +14 -14
  55. data/scenarios/credit_list_bank_account/ruby.mako +2 -2
  56. data/scenarios/credit_order/definition.rb +1 -0
  57. data/scenarios/credit_order/request.rb +7 -0
  58. data/scenarios/credit_order/ruby.mako +26 -0
  59. data/scenarios/credit_show/ruby.mako +15 -15
  60. data/scenarios/credit_update/ruby.mako +15 -15
  61. data/scenarios/customer_create/ruby.mako +20 -18
  62. data/scenarios/customer_delete/ruby.mako +1 -1
  63. data/scenarios/customer_list/ruby.mako +39 -35
  64. data/scenarios/customer_show/ruby.mako +21 -19
  65. data/scenarios/customer_update/ruby.mako +21 -19
  66. data/scenarios/debit_dispute_show/ruby.mako +12 -12
  67. data/scenarios/debit_list/ruby.mako +34 -34
  68. data/scenarios/debit_order/definition.rb +1 -0
  69. data/scenarios/debit_order/request.rb +7 -0
  70. data/scenarios/debit_order/ruby.mako +49 -0
  71. data/scenarios/debit_show/ruby.mako +16 -16
  72. data/scenarios/debit_update/ruby.mako +16 -16
  73. data/scenarios/dispute_list/ruby.mako +11 -11
  74. data/scenarios/dispute_show/ruby.mako +12 -12
  75. data/scenarios/event_list/ruby.mako +56 -55
  76. data/scenarios/event_show/ruby.mako +41 -35
  77. data/scenarios/order_create/ruby.mako +14 -14
  78. data/scenarios/order_list/ruby.mako +45 -13
  79. data/scenarios/order_show/ruby.mako +14 -14
  80. data/scenarios/order_update/ruby.mako +14 -14
  81. data/scenarios/refund_create/ruby.mako +13 -13
  82. data/scenarios/refund_list/ruby.mako +12 -12
  83. data/scenarios/refund_show/ruby.mako +13 -13
  84. data/scenarios/refund_update/ruby.mako +13 -13
  85. data/scenarios/render_mako.rb +1 -1
  86. data/scenarios/reversal_create/ruby.mako +12 -12
  87. data/scenarios/reversal_list/ruby.mako +11 -11
  88. data/scenarios/reversal_show/ruby.mako +12 -12
  89. data/scenarios/reversal_update/ruby.mako +12 -12
  90. data/spec/balanced/resources/card_spec.rb +73 -11
  91. data/spec/balanced/resources/credit_spec.rb +155 -26
  92. data/spec/balanced/response/balanced_exception_middleware_spec.rb +1 -2
  93. data/spec/spec_helper.rb +3 -1
  94. 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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- order = Balanced::Order.fetch('/orders/OR6d55qbtKx5aWSURkQeodRr')
8
+ order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Order:0x007fa93e82ee68
11
+ #<Balanced::Order:0x007fa7d334c588
12
12
  @attributes=
13
13
  {"amount"=>0,
14
14
  "amount_escrowed"=>0,
15
- "created_at"=>"2014-04-25T20:18:43.120760Z",
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/OR6d55qbtKx5aWSURkQeodRr",
26
- "id"=>"OR6d55qbtKx5aWSURkQeodRr",
27
- "links"=>{"merchant"=>"CU4MnFEab304anOtUtEu5hkN"},
25
+ "href"=>"/orders/OR6Zx317bzTVRgDxt3JqnZIx",
26
+ "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
27
+ "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
28
28
  "meta"=>{},
29
- "updated_at"=>"2014-04-25T20:18:43.120762Z"},
29
+ "updated_at"=>"2014-05-15T00:43:14.079632Z"},
30
30
  @hyperlinks=
31
31
  {"buyers"=>
32
- #<Proc:0x007fa93e819db0/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fa7d3349ef0/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "credits"=>
34
- #<Proc:0x007fa93e827dc0/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fa7d3347dd0/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "debits"=>
36
- #<Proc:0x007fa93e825750/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fa7d3344c70/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "merchant"=>
38
- #<Proc:0x007fa93e8139b0/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fa7d3342c18/lib/balanced/resources/resource.rb:60 (lambda)>,
39
39
  "refunds"=>
40
- #<Proc:0x007fa93e80bd50/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa7d3340d50/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "reversals"=>
42
- #<Proc:0x007fa93e8093e8/lib/balanced/utils.rb:6 (lambda)>}>
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- order = Balanced::Order.fetch('/orders/OR6d55qbtKx5aWSURkQeodRr')
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:0x007fa93b7e6058
17
+ #<Balanced::Order:0x007fa7d331ad80
18
18
  @attributes=
19
19
  {"amount"=>0,
20
20
  "amount_escrowed"=>0,
21
- "created_at"=>"2014-04-25T20:18:43.120760Z",
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/OR6d55qbtKx5aWSURkQeodRr",
32
- "id"=>"OR6d55qbtKx5aWSURkQeodRr",
33
- "links"=>{"merchant"=>"CU4MnFEab304anOtUtEu5hkN"},
31
+ "href"=>"/orders/OR6Zx317bzTVRgDxt3JqnZIx",
32
+ "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
33
+ "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
34
34
  "meta"=>{"anykey"=>"valuegoeshere", "product.id"=>"1234567890"},
35
- "updated_at"=>"2014-04-25T20:18:46.797463Z"},
35
+ "updated_at"=>"2014-05-15T00:43:27.654101Z"},
36
36
  @hyperlinks=
37
37
  {"buyers"=>
38
- #<Proc:0x007fa93b7dfe60/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa7d3318990/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "credits"=>
40
- #<Proc:0x007fa93b7ddfe8/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa7d3316910/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "debits"=>
42
- #<Proc:0x007fa93b7dc148/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa7d33145e8/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "merchant"=>
44
- #<Proc:0x007fa93b7d66a8/lib/balanced/resources/resource.rb:60 (lambda)>,
44
+ #<Proc:0x007fa7d330ea08/lib/balanced/resources/resource.rb:60 (lambda)>,
45
45
  "refunds"=>
46
- #<Proc:0x007fa93b7d4830/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa7d330ca28/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "reversals"=>
48
- #<Proc:0x007fa93b7ce908/lib/balanced/utils.rb:6 (lambda)>}>
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- debit = Balanced::Debit.fetch('/debits/WD4SOTNKiZbBFrmMk6mfszIl')
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:0x007fa93b7ad5f0
19
+ #<Balanced::Refund:0x007fa7d32ee8e8
20
20
  @attributes=
21
21
  {"amount"=>3000,
22
- "created_at"=>"2014-04-25T20:10:22.593252Z",
22
+ "created_at"=>"2014-05-15T00:42:22.128891Z",
23
23
  "currency"=>"USD",
24
24
  "description"=>"Refund for Order #1111",
25
- "href"=>"/refunds/RF4VbbS5LdgSxlECITkHg0Zf",
26
- "id"=>"RF4VbbS5LdgSxlECITkHg0Zf",
25
+ "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
26
+ "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
27
27
  "links"=>
28
- {"debit"=>"WD4SOTNKiZbBFrmMk6mfszIl", "dispute"=>nil, "order"=>nil},
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"=>"RF854-846-2859",
35
- "updated_at"=>"2014-04-25T20:10:23.032505Z"},
34
+ "transaction_number"=>"RF710-400-6883",
35
+ "updated_at"=>"2014-05-15T00:42:32.373753Z"},
36
36
  @hyperlinks=
37
37
  {"debit"=>
38
- #<Proc:0x007fa93b7a79c0/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fa7d32ec4f8/lib/balanced/resources/resource.rb:60 (lambda)>,
39
39
  "dispute"=>
40
- #<Proc:0x007fa93b7a6fe8/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa7d32eb8f0/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007fa93b7a5058/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa7d32e9258/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "order"=>
44
- #<Proc:0x007fa93b7a4680/lib/balanced/utils.rb:6 (lambda)>}>
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
8
  refunds = Balanced::Refund.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::Refund:0x007fa93b7854d8
10
+ [#<Balanced::Refund:0x007fa7d422dcf0
11
11
  @attributes=
12
12
  {"amount"=>3000,
13
- "created_at"=>"2014-04-25T20:10:22.593252Z",
13
+ "created_at"=>"2014-05-15T00:42:22.128891Z",
14
14
  "currency"=>"USD",
15
15
  "description"=>"Refund for Order #1111",
16
- "href"=>"/refunds/RF4VbbS5LdgSxlECITkHg0Zf",
17
- "id"=>"RF4VbbS5LdgSxlECITkHg0Zf",
16
+ "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
17
+ "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
18
18
  "links"=>
19
- {"debit"=>"WD4SOTNKiZbBFrmMk6mfszIl", "dispute"=>nil, "order"=>nil},
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"=>"RF854-846-2859",
26
- "updated_at"=>"2014-04-25T20:10:23.032505Z"},
25
+ "transaction_number"=>"RF710-400-6883",
26
+ "updated_at"=>"2014-05-15T00:42:32.373753Z"},
27
27
  @hyperlinks=
28
28
  {"debit"=>
29
- #<Proc:0x007fa93b77f718/lib/balanced/resources/resource.rb:60 (lambda)>,
29
+ #<Proc:0x007fa7d42275f8/lib/balanced/resources/resource.rb:60 (lambda)>,
30
30
  "dispute"=>
31
- #<Proc:0x007fa93b77ed90/lib/balanced/utils.rb:6 (lambda)>,
31
+ #<Proc:0x007fa7d4226720/lib/balanced/utils.rb:6 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007fa93b77ce50/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fa7d4224420/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007fa93b77c450/lib/balanced/utils.rb:6 (lambda)>}>]
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- refund = Balanced::Refund.fetch('/refunds/RF4VbbS5LdgSxlECITkHg0Zf')
8
+ refund = Balanced::Refund.fetch('/refunds/RF635DEq9cKcoNDr0ljY4dU1')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Refund:0x007fa93b75f490
11
+ #<Balanced::Refund:0x007fa7d41ffbe8
12
12
  @attributes=
13
13
  {"amount"=>3000,
14
- "created_at"=>"2014-04-25T20:10:22.593252Z",
14
+ "created_at"=>"2014-05-15T00:42:22.128891Z",
15
15
  "currency"=>"USD",
16
16
  "description"=>"Refund for Order #1111",
17
- "href"=>"/refunds/RF4VbbS5LdgSxlECITkHg0Zf",
18
- "id"=>"RF4VbbS5LdgSxlECITkHg0Zf",
17
+ "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
18
+ "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
19
19
  "links"=>
20
- {"debit"=>"WD4SOTNKiZbBFrmMk6mfszIl", "dispute"=>nil, "order"=>nil},
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"=>"RF854-846-2859",
27
- "updated_at"=>"2014-04-25T20:10:23.032505Z"},
26
+ "transaction_number"=>"RF710-400-6883",
27
+ "updated_at"=>"2014-05-15T00:42:32.373753Z"},
28
28
  @hyperlinks=
29
29
  {"debit"=>
30
- #<Proc:0x007fa93b75d8e8/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fa7d41fcdf8/lib/balanced/resources/resource.rb:60 (lambda)>,
31
31
  "dispute"=>
32
- #<Proc:0x007fa93b75cf60/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fa7d41f7df8/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "events"=>
34
- #<Proc:0x007fa93b756fc0/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fa7d41f5968/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "order"=>
36
- #<Proc:0x007fa93b7565c0/lib/balanced/utils.rb:6 (lambda)>}>
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- refund = Balanced::Refund.fetch('/refunds/RF4VbbS5LdgSxlECITkHg0Zf')
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:0x007fa93b73c148
18
+ #<Balanced::Refund:0x007fa7d41d66f8
19
19
  @attributes=
20
20
  {"amount"=>3000,
21
- "created_at"=>"2014-04-25T20:10:22.593252Z",
21
+ "created_at"=>"2014-05-15T00:42:22.128891Z",
22
22
  "currency"=>"USD",
23
23
  "description"=>"update this description",
24
- "href"=>"/refunds/RF4VbbS5LdgSxlECITkHg0Zf",
25
- "id"=>"RF4VbbS5LdgSxlECITkHg0Zf",
24
+ "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
25
+ "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
26
26
  "links"=>
27
- {"debit"=>"WD4SOTNKiZbBFrmMk6mfszIl", "dispute"=>nil, "order"=>nil},
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"=>"RF854-846-2859",
34
- "updated_at"=>"2014-04-25T20:18:50.969971Z"},
33
+ "transaction_number"=>"RF710-400-6883",
34
+ "updated_at"=>"2014-05-15T00:43:36.139004Z"},
35
35
  @hyperlinks=
36
36
  {"debit"=>
37
- #<Proc:0x007fa93b735cf8/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007fa7d41d4740/lib/balanced/resources/resource.rb:60 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fa93b734ee8/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d41cfdd0/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa93b72ebd8/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d41cddf0/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa93b72e200/lib/balanced/utils.rb:6 (lambda)>}>
43
+ #<Proc:0x007fa7d41cd3c8/lib/balanced/utils.rb:6 (lambda)>}>
44
44
 
45
45
  % endif
@@ -53,7 +53,7 @@ def fetch_scenario_cache
53
53
  end
54
54
  end
55
55
 
56
- #fetch_scenario_cache
56
+ fetch_scenario_cache
57
57
 
58
58
  raise RuntimeError, "scenario.cache not present" if ! File.exists? 'scenario.cache'
59
59
 
@@ -2,9 +2,9 @@
2
2
  Balanced::Credit.reverse
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- reversal = Balanced::Credit.fetch('/credits/CR6nBcaGvGc4dtflEB1bjKBP')
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:0x007fa93b70ee00
19
+ #<Balanced::Reversal:0x007fa7d417fe70
20
20
  @attributes=
21
21
  {"amount"=>3000,
22
- "created_at"=>"2014-04-25T20:18:55.008280Z",
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/RV6qrEOTouLeIJuPu4s73Ra1",
28
- "id"=>"RV6qrEOTouLeIJuPu4s73Ra1",
29
- "links"=>{"credit"=>"CR6nBcaGvGc4dtflEB1bjKBP", "order"=>nil},
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"=>"RV296-883-6069",
36
- "updated_at"=>"2014-04-25T20:18:57.393905Z"},
35
+ "transaction_number"=>"RV689-626-0403",
36
+ "updated_at"=>"2014-05-15T00:43:53.755588Z"},
37
37
  @hyperlinks=
38
38
  {"credit"=>
39
- #<Proc:0x007fa93b70d1e0/lib/balanced/resources/resource.rb:60 (lambda)>,
39
+ #<Proc:0x007fa7d417e1b0/lib/balanced/resources/resource.rb:60 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa93b707290/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d4177c48/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa93b7068b8/lib/balanced/utils.rb:6 (lambda)>}>
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
8
  reversals = Balanced::Reversal.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::Reversal:0x007fa93b6e73f0
10
+ [#<Balanced::Reversal:0x007fa7d414f158
11
11
  @attributes=
12
12
  {"amount"=>3000,
13
- "created_at"=>"2014-04-25T20:18:55.008280Z",
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/RV6qrEOTouLeIJuPu4s73Ra1",
19
- "id"=>"RV6qrEOTouLeIJuPu4s73Ra1",
20
- "links"=>{"credit"=>"CR6nBcaGvGc4dtflEB1bjKBP", "order"=>nil},
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"=>"RV296-883-6069",
27
- "updated_at"=>"2014-04-25T20:18:57.393905Z"},
26
+ "transaction_number"=>"RV689-626-0403",
27
+ "updated_at"=>"2014-05-15T00:43:53.755588Z"},
28
28
  @hyperlinks=
29
29
  {"credit"=>
30
- #<Proc:0x007fa93b6e5848/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fa7d414d4e8/lib/balanced/resources/resource.rb:60 (lambda)>,
31
31
  "events"=>
32
- #<Proc:0x007fa93b6df330/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fa7d4147458/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "order"=>
34
- #<Proc:0x007fa93b6de908/lib/balanced/utils.rb:6 (lambda)>}>]
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-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
6
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
7
7
 
8
- reversal = Balanced::Reversal.fetch('/reversals/RV6qrEOTouLeIJuPu4s73Ra1')
8
+ reversal = Balanced::Reversal.fetch('/reversals/RV7BYCqyLOKwcWigapAoGWdr')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Reversal:0x007fa93b6c4c38
11
+ #<Balanced::Reversal:0x007fa7d41277e8
12
12
  @attributes=
13
13
  {"amount"=>3000,
14
- "created_at"=>"2014-04-25T20:18:55.008280Z",
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/RV6qrEOTouLeIJuPu4s73Ra1",
20
- "id"=>"RV6qrEOTouLeIJuPu4s73Ra1",
21
- "links"=>{"credit"=>"CR6nBcaGvGc4dtflEB1bjKBP", "order"=>nil},
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"=>"RV296-883-6069",
28
- "updated_at"=>"2014-04-25T20:18:57.393905Z"},
27
+ "transaction_number"=>"RV689-626-0403",
28
+ "updated_at"=>"2014-05-15T00:43:53.755588Z"},
29
29
  @hyperlinks=
30
30
  {"credit"=>
31
- #<Proc:0x007fa93b6bf030/lib/balanced/resources/resource.rb:60 (lambda)>,
31
+ #<Proc:0x007fa7d41258d0/lib/balanced/resources/resource.rb:60 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007fa93b6bd0c8/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fa7d411f4a8/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007fa93b6bc6a0/lib/balanced/utils.rb:6 (lambda)>}>
35
+ #<Proc:0x007fa7d411e968/lib/balanced/utils.rb:6 (lambda)>}>
36
36
 
37
37
  % endif