balanced 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +10 -6
  4. data/CHANGELOG.md +4 -0
  5. data/README.md +1 -1
  6. data/lib/balanced/resources.rb +2 -0
  7. data/lib/balanced/resources/account.rb +33 -0
  8. data/lib/balanced/resources/card.rb +1 -1
  9. data/lib/balanced/resources/customer.rb +8 -0
  10. data/lib/balanced/resources/resource.rb +4 -6
  11. data/lib/balanced/resources/settlement.rb +12 -0
  12. data/lib/balanced/response/balanced_exception_middleware.rb +1 -1
  13. data/lib/balanced/utils.rb +1 -1
  14. data/lib/balanced/version.rb +1 -1
  15. data/scenarios/account_credit/definition.rb +1 -0
  16. data/scenarios/account_credit/request.rb +5 -0
  17. data/scenarios/account_credit/ruby.mako +49 -0
  18. data/scenarios/account_list/definition.rb +1 -0
  19. data/scenarios/account_list/request.rb +2 -0
  20. data/scenarios/account_list/ruby.mako +64 -0
  21. data/scenarios/account_list_customer/definition.rb +1 -0
  22. data/scenarios/account_list_customer/request.rb +3 -0
  23. data/scenarios/account_list_customer/ruby.mako +38 -0
  24. data/scenarios/account_show/definition.rb +1 -0
  25. data/scenarios/account_show/request.rb +2 -0
  26. data/scenarios/account_show/ruby.mako +37 -0
  27. data/scenarios/api_key_create/ruby.mako +6 -6
  28. data/scenarios/api_key_delete/ruby.mako +2 -2
  29. data/scenarios/api_key_list/ruby.mako +10 -10
  30. data/scenarios/api_key_show/ruby.mako +6 -6
  31. data/scenarios/bank_account_associate_to_customer/ruby.mako +16 -14
  32. data/scenarios/bank_account_create/ruby.mako +13 -11
  33. data/scenarios/bank_account_credit/ruby.mako +16 -16
  34. data/scenarios/bank_account_debit/ruby.mako +21 -18
  35. data/scenarios/bank_account_debit_order/definition.rb +1 -0
  36. data/scenarios/bank_account_debit_order/request.rb +7 -0
  37. data/scenarios/bank_account_debit_order/ruby.mako +52 -0
  38. data/scenarios/bank_account_delete/ruby.mako +2 -2
  39. data/scenarios/bank_account_list/ruby.mako +26 -22
  40. data/scenarios/bank_account_show/ruby.mako +14 -12
  41. data/scenarios/bank_account_update/ruby.mako +14 -12
  42. data/scenarios/bank_account_verification_create/ruby.mako +10 -10
  43. data/scenarios/bank_account_verification_show/ruby.mako +10 -10
  44. data/scenarios/bank_account_verification_update/ruby.mako +9 -9
  45. data/scenarios/callback_create/ruby.mako +4 -4
  46. data/scenarios/callback_delete/ruby.mako +2 -2
  47. data/scenarios/callback_list/ruby.mako +4 -4
  48. data/scenarios/callback_show/ruby.mako +5 -5
  49. data/scenarios/card_associate_to_customer/ruby.mako +26 -26
  50. data/scenarios/card_create/ruby.mako +13 -15
  51. data/scenarios/card_create_creditable/ruby.mako +11 -11
  52. data/scenarios/card_create_dispute/ruby.mako +13 -13
  53. data/scenarios/card_credit/ruby.mako +16 -14
  54. data/scenarios/card_credit_order/definition.rb +1 -0
  55. data/scenarios/card_credit_order/request.rb +7 -0
  56. data/scenarios/card_credit_order/ruby.mako +45 -0
  57. data/scenarios/card_debit/ruby.mako +20 -17
  58. data/scenarios/card_debit_dispute/ruby.mako +20 -17
  59. data/scenarios/card_delete/ruby.mako +2 -2
  60. data/scenarios/card_hold_capture/ruby.mako +20 -17
  61. data/scenarios/card_hold_create/ruby.mako +16 -14
  62. data/scenarios/card_hold_list/ruby.mako +33 -27
  63. data/scenarios/card_hold_order/definition.rb +1 -0
  64. data/scenarios/card_hold_order/request.rb +6 -0
  65. data/scenarios/card_hold_order/ruby.mako +45 -0
  66. data/scenarios/card_hold_show/ruby.mako +16 -14
  67. data/scenarios/card_hold_update/ruby.mako +16 -14
  68. data/scenarios/card_hold_void/ruby.mako +17 -15
  69. data/scenarios/card_list/ruby.mako +25 -29
  70. data/scenarios/card_show/ruby.mako +14 -16
  71. data/scenarios/card_update/ruby.mako +14 -16
  72. data/scenarios/credit_list/ruby.mako +44 -14
  73. data/scenarios/credit_list_bank_account/ruby.mako +3 -3
  74. data/scenarios/credit_order/request.rb +2 -2
  75. data/scenarios/credit_order/ruby.mako +35 -14
  76. data/scenarios/credit_show/ruby.mako +16 -16
  77. data/scenarios/credit_update/ruby.mako +16 -16
  78. data/scenarios/customer_create/ruby.mako +22 -20
  79. data/scenarios/customer_delete/ruby.mako +1 -1
  80. data/scenarios/customer_list/ruby.mako +43 -39
  81. data/scenarios/customer_show/ruby.mako +23 -21
  82. data/scenarios/customer_update/ruby.mako +23 -21
  83. data/scenarios/debit_dispute_show/ruby.mako +12 -12
  84. data/scenarios/debit_list/ruby.mako +43 -37
  85. data/scenarios/debit_order/ruby.mako +22 -19
  86. data/scenarios/debit_show/ruby.mako +20 -17
  87. data/scenarios/debit_update/ruby.mako +20 -17
  88. data/scenarios/dispute_list/ruby.mako +11 -11
  89. data/scenarios/dispute_show/ruby.mako +12 -12
  90. data/scenarios/event_list/ruby.mako +55 -81
  91. data/scenarios/event_show/ruby.mako +35 -45
  92. data/scenarios/order_create/ruby.mako +16 -14
  93. data/scenarios/order_list/ruby.mako +33 -29
  94. data/scenarios/order_show/ruby.mako +16 -14
  95. data/scenarios/order_update/ruby.mako +16 -14
  96. data/scenarios/refund_create/ruby.mako +13 -13
  97. data/scenarios/refund_list/ruby.mako +12 -12
  98. data/scenarios/refund_show/ruby.mako +13 -13
  99. data/scenarios/refund_update/ruby.mako +13 -13
  100. data/scenarios/reversal_create/ruby.mako +13 -13
  101. data/scenarios/reversal_list/ruby.mako +12 -12
  102. data/scenarios/reversal_show/ruby.mako +13 -13
  103. data/scenarios/reversal_update/ruby.mako +13 -13
  104. data/scenarios/settlement_create/definition.rb +1 -0
  105. data/scenarios/settlement_create/request.rb +5 -0
  106. data/scenarios/settlement_create/ruby.mako +48 -0
  107. data/scenarios/settlement_list/definition.rb +1 -0
  108. data/scenarios/settlement_list/request.rb +2 -0
  109. data/scenarios/settlement_list/ruby.mako +40 -0
  110. data/scenarios/settlement_list_account/definition.rb +1 -0
  111. data/scenarios/settlement_list_account/request.rb +3 -0
  112. data/scenarios/settlement_list_account/ruby.mako +41 -0
  113. data/scenarios/settlement_show/definition.rb +1 -0
  114. data/scenarios/settlement_show/request.rb +2 -0
  115. data/scenarios/settlement_show/ruby.mako +40 -0
  116. data/snippets/account-balance.rb +1 -0
  117. data/snippets/bank-account-create.rb +6 -0
  118. data/snippets/bank-account-debit.rb +9 -0
  119. data/snippets/bank-account-verification-confirm.rb +5 -0
  120. data/snippets/bank-account-verification-create.rb +1 -0
  121. data/snippets/callback-create.rb +4 -0
  122. data/snippets/card-associate-to-customer.rb +2 -0
  123. data/snippets/card-create-dispute.rb +6 -0
  124. data/snippets/card-create.rb +7 -0
  125. data/snippets/card-credit.rb +9 -0
  126. data/snippets/card-debit.rb +9 -0
  127. data/snippets/card-hold-capture.rb +6 -0
  128. data/snippets/card-hold-create.rb +6 -0
  129. data/snippets/card-hold-void.rb +3 -0
  130. data/snippets/create-buyer-and-card.rb +13 -0
  131. data/snippets/credit-create.rb +8 -0
  132. data/snippets/credit-fetch.rb +1 -0
  133. data/snippets/credit-marketplace-escrow.rb +4 -0
  134. data/snippets/credit-reverse.rb +1 -0
  135. data/snippets/credit-soft-descriptor.rb +9 -0
  136. data/snippets/credit-split.rb +13 -0
  137. data/snippets/customer-create.rb +8 -0
  138. data/snippets/debit-dispute-show.rb +3 -0
  139. data/snippets/debit-fetch.rb +1 -0
  140. data/snippets/debit-marketplace-escrow.rb +4 -0
  141. data/snippets/debit-refund.rb +1 -0
  142. data/snippets/dispute-list.rb +1 -0
  143. data/snippets/dispute-show.rb +2 -0
  144. data/snippets/examine-order-after-refund.rb +3 -0
  145. data/snippets/examine-order-after-reversal.rb +3 -0
  146. data/snippets/example.rb +1 -0
  147. data/snippets/marketplace-in-escrow.rb +1 -0
  148. data/snippets/merchant-payable-account-fetch.rb +2 -0
  149. data/snippets/order-amount-escrowed.rb +3 -0
  150. data/snippets/order-bank-account-create.rb +8 -0
  151. data/snippets/order-create.rb +1 -0
  152. data/snippets/order-credit-marketplace.rb +5 -0
  153. data/snippets/order-credit-merchant-payable-account.rb +4 -0
  154. data/snippets/order-credit.rb +4 -0
  155. data/snippets/order-credits-fetch.rb +1 -0
  156. data/snippets/order-debit.rb +4 -0
  157. data/snippets/order-debits-fetch.rb +1 -0
  158. data/snippets/order-fetch.rb +1 -0
  159. data/snippets/order-update.rb +5 -0
  160. data/snippets/refund-create.rb +13 -0
  161. data/snippets/reversal-create.rb +13 -0
  162. data/snippets/settlement-create.rb +5 -0
  163. data/spec/balanced/resources/account_spec.rb +265 -0
  164. data/spec/balanced/resources/card_spec.rb +6 -6
  165. 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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- merchant_customer = Balanced::Customer.fetch('/customers/CU56PvhKAwSiV6LahZCcBMJ7')
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:0x007fa7d32081e0
13
+ #<Balanced::Order:0x007fcde199c198
14
14
  @attributes=
15
15
  {"amount"=>0,
16
16
  "amount_escrowed"=>0,
17
- "created_at"=>"2014-05-15T00:43:14.079629Z",
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/OR6Zx317bzTVRgDxt3JqnZIx",
28
- "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
29
- "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
27
+ "href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
28
+ "id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
29
+ "links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
30
30
  "meta"=>{},
31
- "updated_at"=>"2014-05-15T00:43:14.079632Z"},
31
+ "updated_at"=>"2014-12-17T21:25:55.028603Z"},
32
32
  @hyperlinks=
33
33
  {"buyers"=>
34
- #<Proc:0x007fa7d3204e00/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde1995fa0/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "credits"=>
36
- #<Proc:0x007fa7d3202588/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fcde1994038/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "debits"=>
38
- #<Proc:0x007fa7d31fb8a0/lib/balanced/utils.rb:6 (lambda)>,
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:0x007fa7d31f97f8/lib/balanced/resources/resource.rb:60 (lambda)>,
42
+ #<Proc:0x007fcde19865f0/lib/balanced/resources/resource.rb:56 (lambda)>,
41
43
  "refunds"=>
42
- #<Proc:0x007fa7d31f30d8/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fcde195fb80/lib/balanced/utils.rb:6 (lambda)>,
43
45
  "reversals"=>
44
- #<Proc:0x007fa7d31f1120/lib/balanced/utils.rb:6 (lambda)>}>
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
6
 
7
7
  orders = Balanced::Order.all
8
8
  % elif mode == 'response':
9
- [#<Balanced::Order:0x007fa7d33a99b8
9
+ [#<Balanced::Order:0x007fcde1382118
10
10
  @attributes=
11
- {"amount"=>0,
12
- "amount_escrowed"=>0,
13
- "created_at"=>"2014-05-15T00:43:14.079629Z",
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/OR6Zx317bzTVRgDxt3JqnZIx",
24
- "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
25
- "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
23
+ "href"=>"/orders/OR6c6n11zKSFfjE6kGNKtsE8",
24
+ "id"=>"OR6c6n11zKSFfjE6kGNKtsE8",
25
+ "links"=>{"merchant"=>"CU68iUpvvUwpRpuuBL3u9Slq"},
26
26
  "meta"=>{},
27
- "updated_at"=>"2014-05-15T00:43:14.079632Z"},
27
+ "updated_at"=>"2014-12-17T21:24:07.380656Z"},
28
28
  @hyperlinks=
29
29
  {"buyers"=>
30
- #<Proc:0x007fa7d33a28c0/lib/balanced/utils.rb:6 (lambda)>,
30
+ #<Proc:0x007fcde1380070/lib/balanced/utils.rb:6 (lambda)>,
31
31
  "credits"=>
32
- #<Proc:0x007fa7d339be08/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fcde13721a0/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "debits"=>
34
- #<Proc:0x007fa7d3399360/lib/balanced/utils.rb:6 (lambda)>,
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:0x007fa7d3392f10/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fcde1348a80/lib/balanced/resources/resource.rb:56 (lambda)>,
37
39
  "refunds"=>
38
- #<Proc:0x007fa7d3390620/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fcde131abf8/lib/balanced/utils.rb:6 (lambda)>,
39
41
  "reversals"=>
40
- #<Proc:0x007fa7d338d268/lib/balanced/utils.rb:6 (lambda)>}>,
41
- #<Balanced::Order:0x007fa7d338d1f0
42
+ #<Proc:0x007fcde1318d58/lib/balanced/utils.rb:6 (lambda)>}>,
43
+ #<Balanced::Order:0x007fcde1318d08
42
44
  @attributes=
43
- {"amount"=>5000,
44
- "amount_escrowed"=>5000,
45
- "created_at"=>"2014-05-15T00:41:16.316070Z",
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/OR4R53c8wdUiVEUiegSHpwaN",
56
- "id"=>"OR4R53c8wdUiVEUiegSHpwaN",
57
- "links"=>{"merchant"=>"CU2L981m9AtPY8pjpGpjnjnf"},
57
+ "href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
58
+ "id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
59
+ "links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
58
60
  "meta"=>{},
59
- "updated_at"=>"2014-05-15T00:41:16.316074Z"},
61
+ "updated_at"=>"2014-12-17T21:25:55.028603Z"},
60
62
  @hyperlinks=
61
63
  {"buyers"=>
62
- #<Proc:0x007fa7d338a9f0/lib/balanced/utils.rb:6 (lambda)>,
64
+ #<Proc:0x007fcde3adad00/lib/balanced/utils.rb:6 (lambda)>,
63
65
  "credits"=>
64
- #<Proc:0x007fa7d3388b78/lib/balanced/utils.rb:6 (lambda)>,
66
+ #<Proc:0x007fcde3ad8f50/lib/balanced/utils.rb:6 (lambda)>,
65
67
  "debits"=>
66
- #<Proc:0x007fa7d33823b8/lib/balanced/utils.rb:6 (lambda)>,
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:0x007fa7d3380860/lib/balanced/resources/resource.rb:60 (lambda)>,
72
+ #<Proc:0x007fcde12a3918/lib/balanced/resources/resource.rb:56 (lambda)>,
69
73
  "refunds"=>
70
- #<Proc:0x007fa7d337a960/lib/balanced/utils.rb:6 (lambda)>,
74
+ #<Proc:0x007fcde12a1a78/lib/balanced/utils.rb:6 (lambda)>,
71
75
  "reversals"=>
72
- #<Proc:0x007fa7d3378a48/lib/balanced/utils.rb:6 (lambda)>}>]
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
8
+ order = Balanced::Order.fetch('/orders/ORm6xuCp6tf0DZMp7ESoOj3')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Order:0x007fa7d334c588
11
+ #<Balanced::Order:0x007fcde12135e8
12
12
  @attributes=
13
13
  {"amount"=>0,
14
14
  "amount_escrowed"=>0,
15
- "created_at"=>"2014-05-15T00:43:14.079629Z",
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/OR6Zx317bzTVRgDxt3JqnZIx",
26
- "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
27
- "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
25
+ "href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
26
+ "id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
27
+ "links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
28
28
  "meta"=>{},
29
- "updated_at"=>"2014-05-15T00:43:14.079632Z"},
29
+ "updated_at"=>"2014-12-17T21:25:55.028603Z"},
30
30
  @hyperlinks=
31
31
  {"buyers"=>
32
- #<Proc:0x007fa7d3349ef0/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fcde1211400/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "credits"=>
34
- #<Proc:0x007fa7d3347dd0/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde120b6e0/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "debits"=>
36
- #<Proc:0x007fa7d3344c70/lib/balanced/utils.rb:6 (lambda)>,
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:0x007fa7d3342c18/lib/balanced/resources/resource.rb:60 (lambda)>,
40
+ #<Proc:0x007fcde1202018/lib/balanced/resources/resource.rb:56 (lambda)>,
39
41
  "refunds"=>
40
- #<Proc:0x007fa7d3340d50/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fcde1200128/lib/balanced/utils.rb:6 (lambda)>,
41
43
  "reversals"=>
42
- #<Proc:0x007fa7d333ab58/lib/balanced/utils.rb:6 (lambda)>}>
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- order = Balanced::Order.fetch('/orders/OR6Zx317bzTVRgDxt3JqnZIx')
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:0x007fa7d331ad80
17
+ #<Balanced::Order:0x007fcde11e1340
18
18
  @attributes=
19
19
  {"amount"=>0,
20
20
  "amount_escrowed"=>0,
21
- "created_at"=>"2014-05-15T00:43:14.079629Z",
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/OR6Zx317bzTVRgDxt3JqnZIx",
32
- "id"=>"OR6Zx317bzTVRgDxt3JqnZIx",
33
- "links"=>{"merchant"=>"CU56PvhKAwSiV6LahZCcBMJ7"},
31
+ "href"=>"/orders/ORm6xuCp6tf0DZMp7ESoOj3",
32
+ "id"=>"ORm6xuCp6tf0DZMp7ESoOj3",
33
+ "links"=>{"merchant"=>"CU7yoUz1HuDE7t7p9GcVNYbz"},
34
34
  "meta"=>{"anykey"=>"valuegoeshere", "product.id"=>"1234567890"},
35
- "updated_at"=>"2014-05-15T00:43:27.654101Z"},
35
+ "updated_at"=>"2014-12-17T21:25:59.040054Z"},
36
36
  @hyperlinks=
37
37
  {"buyers"=>
38
- #<Proc:0x007fa7d3318990/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fcde125b230/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "credits"=>
40
- #<Proc:0x007fa7d3316910/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fcde1259408/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "debits"=>
42
- #<Proc:0x007fa7d33145e8/lib/balanced/utils.rb:6 (lambda)>,
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:0x007fa7d330ea08/lib/balanced/resources/resource.rb:60 (lambda)>,
46
+ #<Proc:0x007fcde18df6b0/lib/balanced/resources/resource.rb:56 (lambda)>,
45
47
  "refunds"=>
46
- #<Proc:0x007fa7d330ca28/lib/balanced/utils.rb:6 (lambda)>,
48
+ #<Proc:0x007fcde18dca50/lib/balanced/utils.rb:6 (lambda)>,
47
49
  "reversals"=>
48
- #<Proc:0x007fa7d330aa98/lib/balanced/utils.rb:6 (lambda)>}>
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
6
 
7
- debit = Balanced::Debit.fetch('/debits/WD5z5CvSR6PFx0GgUFn0icKx')
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:0x007fa7d32ee8e8
19
+ #<Balanced::Refund:0x007fcde18ac7b0
20
20
  @attributes=
21
21
  {"amount"=>3000,
22
- "created_at"=>"2014-05-15T00:42:22.128891Z",
22
+ "created_at"=>"2014-12-17T21:25:31.528064Z",
23
23
  "currency"=>"USD",
24
24
  "description"=>"Refund for Order #1111",
25
- "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
26
- "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
25
+ "href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
26
+ "id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
27
27
  "links"=>
28
- {"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "dispute"=>nil, "order"=>nil},
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"=>"RF710-400-6883",
35
- "updated_at"=>"2014-05-15T00:42:32.373753Z"},
34
+ "transaction_number"=>"RFS3R-YHO-DMB0",
35
+ "updated_at"=>"2014-12-17T21:25:31.950218Z"},
36
36
  @hyperlinks=
37
37
  {"debit"=>
38
- #<Proc:0x007fa7d32ec4f8/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fcde18a6978/lib/balanced/resources/resource.rb:56 (lambda)>,
39
39
  "dispute"=>
40
- #<Proc:0x007fa7d32eb8f0/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fcde18a5e38/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007fa7d32e9258/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fcde189fec0/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "order"=>
44
- #<Proc:0x007fa7d32e87b8/lib/balanced/utils.rb:6 (lambda)>}>
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
8
  refunds = Balanced::Refund.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::Refund:0x007fa7d422dcf0
10
+ [#<Balanced::Refund:0x007fcde3aca720
11
11
  @attributes=
12
12
  {"amount"=>3000,
13
- "created_at"=>"2014-05-15T00:42:22.128891Z",
13
+ "created_at"=>"2014-12-17T21:25:31.528064Z",
14
14
  "currency"=>"USD",
15
15
  "description"=>"Refund for Order #1111",
16
- "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
17
- "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
16
+ "href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
17
+ "id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
18
18
  "links"=>
19
- {"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "dispute"=>nil, "order"=>nil},
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"=>"RF710-400-6883",
26
- "updated_at"=>"2014-05-15T00:42:32.373753Z"},
25
+ "transaction_number"=>"RFS3R-YHO-DMB0",
26
+ "updated_at"=>"2014-12-17T21:25:31.950218Z"},
27
27
  @hyperlinks=
28
28
  {"debit"=>
29
- #<Proc:0x007fa7d42275f8/lib/balanced/resources/resource.rb:60 (lambda)>,
29
+ #<Proc:0x007fcde3ac89c0/lib/balanced/resources/resource.rb:56 (lambda)>,
30
30
  "dispute"=>
31
- #<Proc:0x007fa7d4226720/lib/balanced/utils.rb:6 (lambda)>,
31
+ #<Proc:0x007fcde3ac8038/lib/balanced/utils.rb:6 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007fa7d4224420/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fcde3ac1ee0/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007fa7d421f970/lib/balanced/utils.rb:6 (lambda)>}>]
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- refund = Balanced::Refund.fetch('/refunds/RF635DEq9cKcoNDr0ljY4dU1')
8
+ refund = Balanced::Refund.fetch('/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Refund:0x007fa7d41ffbe8
11
+ #<Balanced::Refund:0x007fcde09f22d8
12
12
  @attributes=
13
13
  {"amount"=>3000,
14
- "created_at"=>"2014-05-15T00:42:22.128891Z",
14
+ "created_at"=>"2014-12-17T21:25:31.528064Z",
15
15
  "currency"=>"USD",
16
16
  "description"=>"Refund for Order #1111",
17
- "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
18
- "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
17
+ "href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
18
+ "id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
19
19
  "links"=>
20
- {"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "dispute"=>nil, "order"=>nil},
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"=>"RF710-400-6883",
27
- "updated_at"=>"2014-05-15T00:42:32.373753Z"},
26
+ "transaction_number"=>"RFS3R-YHO-DMB0",
27
+ "updated_at"=>"2014-12-17T21:25:31.950218Z"},
28
28
  @hyperlinks=
29
29
  {"debit"=>
30
- #<Proc:0x007fa7d41fcdf8/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fcde09f04b0/lib/balanced/resources/resource.rb:56 (lambda)>,
31
31
  "dispute"=>
32
- #<Proc:0x007fa7d41f7df8/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fcde09eba78/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "events"=>
34
- #<Proc:0x007fa7d41f5968/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde09e9c28/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "order"=>
36
- #<Proc:0x007fa7d41f4ef0/lib/balanced/utils.rb:6 (lambda)>}>
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-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- refund = Balanced::Refund.fetch('/refunds/RF635DEq9cKcoNDr0ljY4dU1')
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:0x007fa7d41d66f8
18
+ #<Balanced::Refund:0x007fcde0993468
19
19
  @attributes=
20
20
  {"amount"=>3000,
21
- "created_at"=>"2014-05-15T00:42:22.128891Z",
21
+ "created_at"=>"2014-12-17T21:25:31.528064Z",
22
22
  "currency"=>"USD",
23
23
  "description"=>"update this description",
24
- "href"=>"/refunds/RF635DEq9cKcoNDr0ljY4dU1",
25
- "id"=>"RF635DEq9cKcoNDr0ljY4dU1",
24
+ "href"=>"/refunds/RF7IJ4JDvDf4DLzJ9lgh6D8p",
25
+ "id"=>"RF7IJ4JDvDf4DLzJ9lgh6D8p",
26
26
  "links"=>
27
- {"debit"=>"WD5z5CvSR6PFx0GgUFn0icKx", "dispute"=>nil, "order"=>nil},
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"=>"RF710-400-6883",
34
- "updated_at"=>"2014-05-15T00:43:36.139004Z"},
33
+ "transaction_number"=>"RFS3R-YHO-DMB0",
34
+ "updated_at"=>"2014-12-17T21:26:03.570873Z"},
35
35
  @hyperlinks=
36
36
  {"debit"=>
37
- #<Proc:0x007fa7d41d4740/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007fcde0991910/lib/balanced/resources/resource.rb:56 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fa7d41cfdd0/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fcde0990f88/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa7d41cddf0/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fcde098b100/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa7d41cd3c8/lib/balanced/utils.rb:6 (lambda)>}>
43
+ #<Proc:0x007fcde098a728/lib/balanced/utils.rb:6 (lambda)>}>
44
44
 
45
45
  % endif