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
@@ -2,39 +2,41 @@
2
2
  Balanced::Card.hold
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
6
 
7
- card = Balanced::Card.fetch('/cards/CC35aRYQB8XnL0CxtKGFG7d3')
7
+ card = Balanced::Card.fetch('/cards/CC6buB6OEtiIf7DMIKzpJ7k9')
8
8
  card.hold(
9
9
  :amount => 5000,
10
10
  :description => 'Some descriptive text for the debit in the dashboard'
11
11
  )
12
12
  % elif mode == 'response':
13
- #<Balanced::CardHold:0x007fa7d316d5a0
13
+ #<Balanced::CardHold:0x007fcde09b2868
14
14
  @attributes=
15
15
  {"amount"=>5000,
16
- "created_at"=>"2014-05-15T00:40:11.970823Z",
16
+ "created_at"=>"2014-12-17T21:24:51.371006Z",
17
17
  "currency"=>"USD",
18
18
  "description"=>"Some descriptive text for the debit in the dashboard",
19
- "expires_at"=>"2014-05-22T00:40:17.141216Z",
19
+ "expires_at"=>"2014-12-24T21:24:51.517986Z",
20
20
  "failure_reason"=>nil,
21
21
  "failure_reason_code"=>nil,
22
- "href"=>"/card_holds/HL3GI4qAmsr7ZdOzUgVuzmOF",
23
- "id"=>"HL3GI4qAmsr7ZdOzUgVuzmOF",
24
- "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
22
+ "href"=>"/card_holds/HL6ZzVVWQngH6S8RZOptz7Ak",
23
+ "id"=>"HL6ZzVVWQngH6S8RZOptz7Ak",
24
+ "links"=>{"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9", "debit"=>nil, "order"=>nil},
25
25
  "meta"=>{},
26
26
  "status"=>"succeeded",
27
- "transaction_number"=>"HL069-470-2887",
28
- "updated_at"=>"2014-05-15T00:40:24.943265Z",
27
+ "transaction_number"=>"HL5JD-E88-HXCG",
28
+ "updated_at"=>"2014-12-17T21:24:51.624161Z",
29
29
  "voided_at"=>nil},
30
30
  @hyperlinks=
31
31
  {"card"=>
32
- #<Proc:0x007fa7d3167a10/lib/balanced/resources/resource.rb:60 (lambda)>,
32
+ #<Proc:0x007fcde09b0d38/lib/balanced/resources/resource.rb:56 (lambda)>,
33
33
  "debit"=>
34
- #<Proc:0x007fa7d3166fe8/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde09b03b0/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "debits"=>
36
- #<Proc:0x007fa7d3164e28/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fcde09ba400/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "events"=>
38
- #<Proc:0x007fa7d3162a10/lib/balanced/utils.rb:6 (lambda)>}>
38
+ #<Proc:0x007fcde09b8498/lib/balanced/utils.rb:6 (lambda)>,
39
+ "order"=>
40
+ #<Proc:0x007fcde09cba98/lib/balanced/utils.rb:6 (lambda)>}>
39
41
 
40
42
  % endif
@@ -3,62 +3,68 @@ Balanced::CardHold.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
  holds = Balanced::CardHold.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::CardHold:0x007fa7d314e920
10
+ [#<Balanced::CardHold:0x007fcde18c7bc8
11
11
  @attributes=
12
12
  {"amount"=>5000,
13
- "created_at"=>"2014-05-15T00:39:39.384771Z",
13
+ "created_at"=>"2014-12-17T21:24:44.413118Z",
14
14
  "currency"=>"USD",
15
15
  "description"=>"Some descriptive text for the debit in the dashboard",
16
- "expires_at"=>"2014-05-22T00:39:39.775030Z",
16
+ "expires_at"=>"2014-12-24T21:24:44.632300Z",
17
17
  "failure_reason"=>nil,
18
18
  "failure_reason_code"=>nil,
19
- "href"=>"/card_holds/HL363Kap0nkbuV050V9DHpjf",
20
- "id"=>"HL363Kap0nkbuV050V9DHpjf",
21
- "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
19
+ "href"=>"/card_holds/HL6RKKEl9zNhtZGgnZaElcwU",
20
+ "id"=>"HL6RKKEl9zNhtZGgnZaElcwU",
21
+ "links"=>{"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9", "debit"=>nil, "order"=>nil},
22
22
  "meta"=>{},
23
23
  "status"=>"succeeded",
24
- "transaction_number"=>"HL376-078-9747",
25
- "updated_at"=>"2014-05-15T00:39:40.103344Z",
24
+ "transaction_number"=>"HL1YW-4PE-JOHZ",
25
+ "updated_at"=>"2014-12-17T21:24:44.745782Z",
26
26
  "voided_at"=>nil},
27
27
  @hyperlinks=
28
28
  {"card"=>
29
- #<Proc:0x007fa7d314c9e0/lib/balanced/resources/resource.rb:60 (lambda)>,
29
+ #<Proc:0x007fcde18c5f30/lib/balanced/resources/resource.rb:56 (lambda)>,
30
30
  "debit"=>
31
- #<Proc:0x007fa7d314e358/lib/balanced/utils.rb:6 (lambda)>,
31
+ #<Proc:0x007fcde18c55a8/lib/balanced/utils.rb:6 (lambda)>,
32
32
  "debits"=>
33
- #<Proc:0x007fa7d3149c40/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fcde12ab7a8/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "events"=>
35
- #<Proc:0x007fa7d3147af8/lib/balanced/utils.rb:6 (lambda)>}>,
36
- #<Balanced::CardHold:0x007fa7d3147aa8
35
+ #<Proc:0x007fcde12a9840/lib/balanced/utils.rb:6 (lambda)>,
36
+ "order"=>
37
+ #<Proc:0x007fcde12a8e90/lib/balanced/utils.rb:6 (lambda)>}>,
38
+ #<Balanced::CardHold:0x007fcde12a8e40
37
39
  @attributes=
38
- {"amount"=>10000000,
39
- "created_at"=>"2014-05-15T00:38:09.797065Z",
40
+ {"amount"=>5000,
41
+ "created_at"=>"2014-12-17T21:24:42.793067Z",
40
42
  "currency"=>"USD",
41
- "description"=>nil,
42
- "expires_at"=>"2014-05-22T00:38:10.721627Z",
43
+ "description"=>"Some descriptive text for the debit in the dashboard",
44
+ "expires_at"=>"2014-12-24T21:24:43.058281Z",
43
45
  "failure_reason"=>nil,
44
46
  "failure_reason_code"=>nil,
45
- "href"=>"/card_holds/HL1tiQ6q1MB2h7L4RjznIibT",
46
- "id"=>"HL1tiQ6q1MB2h7L4RjznIibT",
47
+ "href"=>"/card_holds/HL6PVNaA1GWBdqnxhOfauxlm",
48
+ "id"=>"HL6PVNaA1GWBdqnxhOfauxlm",
47
49
  "links"=>
48
- {"card"=>"CC1rSjzxK321d4qkS81yg4zf", "debit"=>"WD1tD4DVB1YM8LnsmmZ5GEHL"},
50
+ {"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9",
51
+ "debit"=>nil,
52
+ "order"=>"OR6c6n11zKSFfjE6kGNKtsE8"},
49
53
  "meta"=>{},
50
54
  "status"=>"succeeded",
51
- "transaction_number"=>"HL330-466-8498",
52
- "updated_at"=>"2014-05-15T00:38:16.149117Z",
55
+ "transaction_number"=>"HLRNL-8VJ-BWFX",
56
+ "updated_at"=>"2014-12-17T21:24:43.126760Z",
53
57
  "voided_at"=>nil},
54
58
  @hyperlinks=
55
59
  {"card"=>
56
- #<Proc:0x007fa7d3145ac8/lib/balanced/resources/resource.rb:60 (lambda)>,
60
+ #<Proc:0x007fcde12bb2c0/lib/balanced/resources/resource.rb:56 (lambda)>,
57
61
  "debit"=>
58
- #<Proc:0x007fa7d3147d28/lib/balanced/resources/resource.rb:60 (lambda)>,
62
+ #<Proc:0x007fcde12ba938/lib/balanced/utils.rb:6 (lambda)>,
59
63
  "debits"=>
60
- #<Proc:0x007fa7d3141ba8/lib/balanced/utils.rb:6 (lambda)>,
64
+ #<Proc:0x007fcde12b8a20/lib/balanced/utils.rb:6 (lambda)>,
61
65
  "events"=>
62
- #<Proc:0x007fa7d313f9e8/lib/balanced/utils.rb:6 (lambda)>}>]
66
+ #<Proc:0x007fcde12c2a98/lib/balanced/utils.rb:6 (lambda)>,
67
+ "order"=>
68
+ #<Proc:0x007fcde12c1120/lib/balanced/resources/resource.rb:56 (lambda)>}>]
63
69
 
64
70
  % endif
@@ -0,0 +1 @@
1
+ Balanced::Card.hold
@@ -0,0 +1,6 @@
1
+ <%= boiler_plate %>
2
+ card = Balanced::Card.fetch('<%= request['card_href'] %>')
3
+ card.hold(
4
+ :amount => <%= request['payload']['amount'] %>,
5
+ :order => '<%= request['order_href'] %>'
6
+ )
@@ -0,0 +1,45 @@
1
+ % if mode == 'definition':
2
+ Balanced::Card.hold
3
+ % elif mode == 'request':
4
+ require 'balanced'
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
+
7
+ card = Balanced::Card.fetch('/cards/CC6buB6OEtiIf7DMIKzpJ7k9')
8
+ card.hold(
9
+ :amount => 5000,
10
+ :order => '/orders/OR6c6n11zKSFfjE6kGNKtsE8'
11
+ )
12
+ % elif mode == 'response':
13
+ #<Balanced::CardHold:0x007fcde12f07e0
14
+ @attributes=
15
+ {"amount"=>5000,
16
+ "created_at"=>"2014-12-17T21:24:42.793067Z",
17
+ "currency"=>"USD",
18
+ "description"=>"Some descriptive text for the debit in the dashboard",
19
+ "expires_at"=>"2014-12-24T21:24:43.058281Z",
20
+ "failure_reason"=>nil,
21
+ "failure_reason_code"=>nil,
22
+ "href"=>"/card_holds/HL6PVNaA1GWBdqnxhOfauxlm",
23
+ "id"=>"HL6PVNaA1GWBdqnxhOfauxlm",
24
+ "links"=>
25
+ {"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9",
26
+ "debit"=>nil,
27
+ "order"=>"OR6c6n11zKSFfjE6kGNKtsE8"},
28
+ "meta"=>{},
29
+ "status"=>"succeeded",
30
+ "transaction_number"=>"HLRNL-8VJ-BWFX",
31
+ "updated_at"=>"2014-12-17T21:24:43.126760Z",
32
+ "voided_at"=>nil},
33
+ @hyperlinks=
34
+ {"card"=>
35
+ #<Proc:0x007fcde12fac68/lib/balanced/resources/resource.rb:56 (lambda)>,
36
+ "debit"=>
37
+ #<Proc:0x007fcde12fa2e0/lib/balanced/utils.rb:6 (lambda)>,
38
+ "debits"=>
39
+ #<Proc:0x007fcde12f83a0/lib/balanced/utils.rb:6 (lambda)>,
40
+ "events"=>
41
+ #<Proc:0x007fcde13023f0/lib/balanced/utils.rb:6 (lambda)>,
42
+ "order"=>
43
+ #<Proc:0x007fcde1300a78/lib/balanced/resources/resource.rb:56 (lambda)>}>
44
+
45
+ % endif
@@ -3,36 +3,38 @@ Balanced::CardHold.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
- card_hold = Balanced::CardHold.fetch('/card_holds/HL363Kap0nkbuV050V9DHpjf')
8
+ card_hold = Balanced::CardHold.fetch('/card_holds/HL6RKKEl9zNhtZGgnZaElcwU')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::CardHold:0x007fa7d31ec468
11
+ #<Balanced::CardHold:0x007fcde132a7d8
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
- "created_at"=>"2014-05-15T00:39:39.384771Z",
14
+ "created_at"=>"2014-12-17T21:24:44.413118Z",
15
15
  "currency"=>"USD",
16
16
  "description"=>"Some descriptive text for the debit in the dashboard",
17
- "expires_at"=>"2014-05-22T00:39:39.775030Z",
17
+ "expires_at"=>"2014-12-24T21:24:44.632300Z",
18
18
  "failure_reason"=>nil,
19
19
  "failure_reason_code"=>nil,
20
- "href"=>"/card_holds/HL363Kap0nkbuV050V9DHpjf",
21
- "id"=>"HL363Kap0nkbuV050V9DHpjf",
22
- "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
20
+ "href"=>"/card_holds/HL6RKKEl9zNhtZGgnZaElcwU",
21
+ "id"=>"HL6RKKEl9zNhtZGgnZaElcwU",
22
+ "links"=>{"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9", "debit"=>nil, "order"=>nil},
23
23
  "meta"=>{},
24
24
  "status"=>"succeeded",
25
- "transaction_number"=>"HL376-078-9747",
26
- "updated_at"=>"2014-05-15T00:39:40.103344Z",
25
+ "transaction_number"=>"HL1YW-4PE-JOHZ",
26
+ "updated_at"=>"2014-12-17T21:24:44.745782Z",
27
27
  "voided_at"=>nil},
28
28
  @hyperlinks=
29
29
  {"card"=>
30
- #<Proc:0x007fa7d33b6460/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fcde1328ca8/lib/balanced/resources/resource.rb:56 (lambda)>,
31
31
  "debit"=>
32
- #<Proc:0x007fa7d33b5768/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fcde1328320/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "debits"=>
34
- #<Proc:0x007fa7d33b2cc0/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde1332370/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "events"=>
36
- #<Proc:0x007fa7d33b08d0/lib/balanced/utils.rb:6 (lambda)>}>
36
+ #<Proc:0x007fcde1330408/lib/balanced/utils.rb:6 (lambda)>,
37
+ "order"=>
38
+ #<Proc:0x007fcde133ba10/lib/balanced/utils.rb:6 (lambda)>}>
37
39
 
38
40
  % endif
@@ -3,9 +3,9 @@ Balanced::CardHold.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
- card_hold = Balanced::CardHold.fetch('/card_holds/HL363Kap0nkbuV050V9DHpjf')
8
+ card_hold = Balanced::CardHold.fetch('/card_holds/HL6RKKEl9zNhtZGgnZaElcwU')
9
9
  card_hold.description = 'update this description'
10
10
  card_hold.meta = {
11
11
  'holding.for' => 'user1',
@@ -14,31 +14,33 @@ card_hold.meta = {
14
14
  card_hold.save
15
15
 
16
16
  % elif mode == 'response':
17
- #<Balanced::CardHold:0x007fa7d3391ca0
17
+ #<Balanced::CardHold:0x007fcde1359ab0
18
18
  @attributes=
19
19
  {"amount"=>5000,
20
- "created_at"=>"2014-05-15T00:39:39.384771Z",
20
+ "created_at"=>"2014-12-17T21:24:44.413118Z",
21
21
  "currency"=>"USD",
22
22
  "description"=>"update this description",
23
- "expires_at"=>"2014-05-22T00:39:39.775030Z",
23
+ "expires_at"=>"2014-12-24T21:24:44.632300Z",
24
24
  "failure_reason"=>nil,
25
25
  "failure_reason_code"=>nil,
26
- "href"=>"/card_holds/HL363Kap0nkbuV050V9DHpjf",
27
- "id"=>"HL363Kap0nkbuV050V9DHpjf",
28
- "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
26
+ "href"=>"/card_holds/HL6RKKEl9zNhtZGgnZaElcwU",
27
+ "id"=>"HL6RKKEl9zNhtZGgnZaElcwU",
28
+ "links"=>{"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9", "debit"=>nil, "order"=>nil},
29
29
  "meta"=>{"holding.for"=>"user1", "meaningful.key"=>"some.value"},
30
30
  "status"=>"succeeded",
31
- "transaction_number"=>"HL376-078-9747",
32
- "updated_at"=>"2014-05-15T00:39:44.237965Z",
31
+ "transaction_number"=>"HL1YW-4PE-JOHZ",
32
+ "updated_at"=>"2014-12-17T21:24:48.351903Z",
33
33
  "voided_at"=>nil},
34
34
  @hyperlinks=
35
35
  {"card"=>
36
- #<Proc:0x007fa7d338f6a8/lib/balanced/resources/resource.rb:60 (lambda)>,
36
+ #<Proc:0x007fcde1363f38/lib/balanced/resources/resource.rb:56 (lambda)>,
37
37
  "debit"=>
38
- #<Proc:0x007fa7d338e690/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fcde13635b0/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "debits"=>
40
- #<Proc:0x007fa7d338b788/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fcde1361670/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007fa7d3389690/lib/balanced/utils.rb:6 (lambda)>}>
42
+ #<Proc:0x007fcde136b6c0/lib/balanced/utils.rb:6 (lambda)>,
43
+ "order"=>
44
+ #<Proc:0x007fcde136ad10/lib/balanced/utils.rb:6 (lambda)>}>
43
45
 
44
46
  % endif
@@ -3,36 +3,38 @@ Balanced::CardHold.unstore
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
- card_hold = Balanced::CardHold.fetch('/card_holds/HL3GI4qAmsr7ZdOzUgVuzmOF')
8
+ card_hold = Balanced::CardHold.fetch('/card_holds/HL6ZzVVWQngH6S8RZOptz7Ak')
9
9
  card_hold.unstore
10
10
  % elif mode == 'response':
11
- #<Balanced::CardHold:0x007fa7d3370230
11
+ #<Balanced::CardHold:0x007fcde18ff2f8
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
- "created_at"=>"2014-05-15T00:40:11.970823Z",
14
+ "created_at"=>"2014-12-17T21:24:51.371006Z",
15
15
  "currency"=>"USD",
16
16
  "description"=>"Some descriptive text for the debit in the dashboard",
17
- "expires_at"=>"2014-05-22T00:40:17.141216Z",
17
+ "expires_at"=>"2014-12-24T21:24:51.517986Z",
18
18
  "failure_reason"=>nil,
19
19
  "failure_reason_code"=>nil,
20
- "href"=>"/card_holds/HL3GI4qAmsr7ZdOzUgVuzmOF",
21
- "id"=>"HL3GI4qAmsr7ZdOzUgVuzmOF",
22
- "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
20
+ "href"=>"/card_holds/HL6ZzVVWQngH6S8RZOptz7Ak",
21
+ "id"=>"HL6ZzVVWQngH6S8RZOptz7Ak",
22
+ "links"=>{"card"=>"CC6buB6OEtiIf7DMIKzpJ7k9", "debit"=>nil, "order"=>nil},
23
23
  "meta"=>{},
24
24
  "status"=>"succeeded",
25
- "transaction_number"=>"HL069-470-2887",
26
- "updated_at"=>"2014-05-15T00:40:27.177705Z",
27
- "voided_at"=>"2014-05-15T00:40:27.177708Z"},
25
+ "transaction_number"=>"HL5JD-E88-HXCG",
26
+ "updated_at"=>"2014-12-17T21:24:52.515923Z",
27
+ "voided_at"=>"2014-12-17T21:24:52.158210Z"},
28
28
  @hyperlinks=
29
29
  {"card"=>
30
- #<Proc:0x007fa7d336a448/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fcde18fd7c8/lib/balanced/resources/resource.rb:56 (lambda)>,
31
31
  "debit"=>
32
- #<Proc:0x007fa7d3369ac0/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fcde18fce40/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "debits"=>
34
- #<Proc:0x007fa7d3363a30/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fcde1906eb8/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "events"=>
36
- #<Proc:0x007fa7d3361a28/lib/balanced/utils.rb:6 (lambda)>}>
36
+ #<Proc:0x007fcde1904f50/lib/balanced/utils.rb:6 (lambda)>,
37
+ "order"=>
38
+ #<Proc:0x007fcde19045a0/lib/balanced/utils.rb:6 (lambda)>}>
37
39
 
38
40
  % endif
@@ -2,11 +2,11 @@
2
2
  Balanced::Card.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
  cards = Balanced::Card.all
8
8
  % elif mode == 'response':
9
- [#<Balanced::Card:0x007fa7d3349590
9
+ [#<Balanced::Card:0x007fcde192c910
10
10
  @attributes=
11
11
  {"address"=>
12
12
  {"city"=>nil,
@@ -18,12 +18,12 @@ cards = Balanced::Card.all
18
18
  "avs_postal_match"=>nil,
19
19
  "avs_result"=>nil,
20
20
  "avs_street_match"=>nil,
21
- "bank"=>"BANK OF HAWAII",
21
+ "bank_name"=>"BANK OF HAWAII",
22
22
  "brand"=>"MasterCard",
23
23
  "can_credit"=>false,
24
24
  "can_debit"=>true,
25
- "category"=>nil,
26
- "created_at"=>"2014-05-15T00:40:43.949061Z",
25
+ "category"=>"other",
26
+ "created_at"=>"2014-12-17T21:24:55.056930Z",
27
27
  "cvv"=>"xxx",
28
28
  "cvv_match"=>"yes",
29
29
  "cvv_result"=>"Match",
@@ -31,27 +31,25 @@ cards = Balanced::Card.all
31
31
  "expiration_year"=>2020,
32
32
  "fingerprint"=>
33
33
  "fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
34
- "href"=>"/cards/CC4gG6BE70pMOYKPBive9qoF",
35
- "id"=>"CC4gG6BE70pMOYKPBive9qoF",
34
+ "href"=>"/cards/CC73IyzxPUu2z89NH8GrJhLn",
35
+ "id"=>"CC73IyzxPUu2z89NH8GrJhLn",
36
36
  "is_verified"=>true,
37
37
  "links"=>{"customer"=>nil},
38
38
  "meta"=>{},
39
39
  "name"=>nil,
40
40
  "number"=>"xxxxxxxxxxxx5100",
41
- "type"=>"",
42
- "updated_at"=>"2014-05-15T00:40:43.949064Z"},
41
+ "type"=>"credit",
42
+ "updated_at"=>"2014-12-17T21:24:55.056933Z"},
43
43
  @hyperlinks=
44
44
  {"card_holds"=>
45
- #<Proc:0x007fa7d3346bb0/lib/balanced/utils.rb:6 (lambda)>,
46
- "credits"=>
47
- #<Proc:0x007fa7d3343af0/lib/balanced/utils.rb:6 (lambda)>,
45
+ #<Proc:0x007fcde1936820/lib/balanced/utils.rb:6 (lambda)>,
48
46
  "customer"=>
49
- #<Proc:0x007fa7d3343140/lib/balanced/utils.rb:6 (lambda)>,
47
+ #<Proc:0x007fcde1935e70/lib/balanced/utils.rb:6 (lambda)>,
50
48
  "debits"=>
51
- #<Proc:0x007fa7d3341278/lib/balanced/utils.rb:6 (lambda)>,
49
+ #<Proc:0x007fcde1934020/lib/balanced/utils.rb:6 (lambda)>,
52
50
  "disputes"=>
53
- #<Proc:0x007fa7d333b0a8/lib/balanced/utils.rb:6 (lambda)>}>,
54
- #<Balanced::Card:0x007fa7d333b058
51
+ #<Proc:0x007fcde193e160/lib/balanced/utils.rb:6 (lambda)>}>,
52
+ #<Balanced::Card:0x007fcde193e110
55
53
  @attributes=
56
54
  {"address"=>
57
55
  {"city"=>nil,
@@ -63,12 +61,12 @@ cards = Balanced::Card.all
63
61
  "avs_postal_match"=>nil,
64
62
  "avs_result"=>nil,
65
63
  "avs_street_match"=>nil,
66
- "bank"=>"BANK OF HAWAII",
64
+ "bank_name"=>"BANK OF HAWAII",
67
65
  "brand"=>"MasterCard",
68
66
  "can_credit"=>false,
69
67
  "can_debit"=>true,
70
- "category"=>nil,
71
- "created_at"=>"2014-05-15T00:39:38.599386Z",
68
+ "category"=>"other",
69
+ "created_at"=>"2014-12-17T21:24:06.842721Z",
72
70
  "cvv"=>"xxx",
73
71
  "cvv_match"=>"yes",
74
72
  "cvv_result"=>"Match",
@@ -76,25 +74,23 @@ cards = Balanced::Card.all
76
74
  "expiration_year"=>2020,
77
75
  "fingerprint"=>
78
76
  "fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
79
- "href"=>"/cards/CC35aRYQB8XnL0CxtKGFG7d3",
80
- "id"=>"CC35aRYQB8XnL0CxtKGFG7d3",
77
+ "href"=>"/cards/CC6buB6OEtiIf7DMIKzpJ7k9",
78
+ "id"=>"CC6buB6OEtiIf7DMIKzpJ7k9",
81
79
  "is_verified"=>true,
82
80
  "links"=>{"customer"=>nil},
83
81
  "meta"=>{},
84
82
  "name"=>nil,
85
83
  "number"=>"xxxxxxxxxxxx5100",
86
- "type"=>"",
87
- "updated_at"=>"2014-05-15T00:39:38.599390Z"},
84
+ "type"=>"credit",
85
+ "updated_at"=>"2014-12-17T21:24:06.842723Z"},
88
86
  @hyperlinks=
89
87
  {"card_holds"=>
90
- #<Proc:0x007fa7d3338e98/lib/balanced/utils.rb:6 (lambda)>,
91
- "credits"=>
92
- #<Proc:0x007fa7d3332f98/lib/balanced/utils.rb:6 (lambda)>,
88
+ #<Proc:0x007fcde193c0b8/lib/balanced/utils.rb:6 (lambda)>,
93
89
  "customer"=>
94
- #<Proc:0x007fa7d3332598/lib/balanced/utils.rb:6 (lambda)>,
90
+ #<Proc:0x007fcde1947698/lib/balanced/utils.rb:6 (lambda)>,
95
91
  "debits"=>
96
- #<Proc:0x007fa7d3330040/lib/balanced/utils.rb:6 (lambda)>,
92
+ #<Proc:0x007fcde1945870/lib/balanced/utils.rb:6 (lambda)>,
97
93
  "disputes"=>
98
- #<Proc:0x007fa7d3329920/lib/balanced/utils.rb:6 (lambda)>}>]
94
+ #<Proc:0x007fcde194fa00/lib/balanced/utils.rb:6 (lambda)>}>]
99
95
 
100
96
  % endif