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
@@ -0,0 +1 @@
1
+ Balanced::Card.new
@@ -0,0 +1,4 @@
1
+ <%= boiler_plate %>
2
+ card = Balanced::Card.new(
3
+ <%= params_to_hash.call(payload).indent(2) %>
4
+ ).save
@@ -0,0 +1,62 @@
1
+ % if mode == 'definition':
2
+ Balanced::Card.new
3
+
4
+ % elif mode == 'request':
5
+ require 'balanced'
6
+ Balanced.configure('ak-test-2jJSjIixy2qkOMmIONPtXnawOUftBDRSK')
7
+
8
+ card = Balanced::Card.new(
9
+ :expiration_month => '05',
10
+ :expiration_year => '2020',
11
+ :name => 'Johannes Bach',
12
+ :number => '4342561111111118'
13
+ ).save
14
+
15
+ % elif mode == 'response':
16
+ #<Balanced::Card:0x007f86fe899ba8
17
+ @attributes=
18
+ {"address"=>
19
+ {"city"=>nil,
20
+ "country_code"=>nil,
21
+ "line1"=>nil,
22
+ "line2"=>nil,
23
+ "postal_code"=>nil,
24
+ "state"=>nil},
25
+ "avs_postal_match"=>nil,
26
+ "avs_result"=>nil,
27
+ "avs_street_match"=>nil,
28
+ "bank_name"=>"WELLS FARGO BANK, N.A.",
29
+ "brand"=>"Visa",
30
+ "can_credit"=>true,
31
+ "can_debit"=>true,
32
+ "category"=>"other",
33
+ "created_at"=>"2014-05-19T20:27:07.461892Z",
34
+ "cvv"=>nil,
35
+ "cvv_match"=>nil,
36
+ "cvv_result"=>nil,
37
+ "expiration_month"=>5,
38
+ "expiration_year"=>2020,
39
+ "fingerprint"=>
40
+ "7dc93d35b59078a1da8e0ebd2cbec65a6ca205760a1be1b90a143d7f2b00e355",
41
+ "href"=>"/cards/CC7nMc4BAti7DgvWmpGV5e6N",
42
+ "id"=>"CC7nMc4BAti7DgvWmpGV5e6N",
43
+ "is_verified"=>true,
44
+ "links"=>{"customer"=>nil},
45
+ "meta"=>{},
46
+ "name"=>"Johannes Bach",
47
+ "number"=>"xxxxxxxxxxxx1118",
48
+ "type"=>"debit",
49
+ "updated_at"=>"2014-05-19T20:27:07.461894Z"},
50
+ @hyperlinks=
51
+ {"card_holds"=>
52
+ #<Proc:0x007f86fe8d3ad8/lib/balanced/utils.rb:6 (lambda)>,
53
+ "credits"=>
54
+ #<Proc:0x007f86fe8d1c60/lib/balanced/utils.rb:6 (lambda)>,
55
+ "customer"=>
56
+ #<Proc:0x007f86fe8d12b0/lib/balanced/utils.rb:6 (lambda)>,
57
+ "debits"=>
58
+ #<Proc:0x007f86fe913408/lib/balanced/utils.rb:6 (lambda)>,
59
+ "disputes"=>
60
+ #<Proc:0x007f86fe911590/lib/balanced/utils.rb:6 (lambda)>}>
61
+
62
+ % endif
@@ -3,7 +3,7 @@ Balanced::Card.new
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
  card = Balanced::Card.new(
9
9
  :cvv => '123',
@@ -13,7 +13,7 @@ card = Balanced::Card.new(
13
13
  ).save
14
14
 
15
15
  % elif mode == 'response':
16
- #<Balanced::Card:0x007fa93e98c9e0
16
+ #<Balanced::Card:0x007fa7d310c160
17
17
  @attributes=
18
18
  {"address"=>
19
19
  {"city"=>nil,
@@ -25,8 +25,12 @@ card = Balanced::Card.new(
25
25
  "avs_postal_match"=>nil,
26
26
  "avs_result"=>nil,
27
27
  "avs_street_match"=>nil,
28
+ "bank"=>"BANK OF AMERICA",
28
29
  "brand"=>"Discover",
29
- "created_at"=>"2014-04-25T20:10:24.900273Z",
30
+ "can_credit"=>true,
31
+ "can_debit"=>true,
32
+ "category"=>"consumer card",
33
+ "created_at"=>"2014-05-15T00:42:36.010022Z",
30
34
  "cvv"=>"xxx",
31
35
  "cvv_match"=>"yes",
32
36
  "cvv_result"=>"Match",
@@ -34,20 +38,25 @@ card = Balanced::Card.new(
34
38
  "expiration_year"=>3000,
35
39
  "fingerprint"=>
36
40
  "3c667a62653e187f29b5781eeb0703f26e99558080de0c0f9490b5f9c4ac2871",
37
- "href"=>"/cards/CC4XMSQg2OY6rrcrkeEGtLcZ",
38
- "id"=>"CC4XMSQg2OY6rrcrkeEGtLcZ",
41
+ "href"=>"/cards/CC6iIaFL1QliTaYG47BArZAh",
42
+ "id"=>"CC6iIaFL1QliTaYG47BArZAh",
39
43
  "is_verified"=>true,
40
44
  "links"=>{"customer"=>nil},
41
45
  "meta"=>{},
42
46
  "name"=>nil,
43
47
  "number"=>"xxxxxxxxxxxx0002",
44
- "updated_at"=>"2014-04-25T20:10:24.900275Z"},
48
+ "type"=>"debit",
49
+ "updated_at"=>"2014-05-15T00:42:36.010024Z"},
45
50
  @hyperlinks=
46
51
  {"card_holds"=>
47
- #<Proc:0x007fa93e985fa0/lib/balanced/utils.rb:6 (lambda)>,
52
+ #<Proc:0x007fa7d3451e88/lib/balanced/utils.rb:6 (lambda)>,
53
+ "credits"=>
54
+ #<Proc:0x007fa7d310bdf0/lib/balanced/utils.rb:6 (lambda)>,
48
55
  "customer"=>
49
- #<Proc:0x007fa93e9852a8/lib/balanced/utils.rb:6 (lambda)>,
56
+ #<Proc:0x007fa7d310b3a0/lib/balanced/utils.rb:6 (lambda)>,
50
57
  "debits"=>
51
- #<Proc:0x007fa93e97eae8/lib/balanced/utils.rb:6 (lambda)>}>
58
+ #<Proc:0x007fa7d3109410/lib/balanced/utils.rb:6 (lambda)>,
59
+ "disputes"=>
60
+ #<Proc:0x007fa7d3103510/lib/balanced/utils.rb:6 (lambda)>}>
52
61
 
53
62
  % endif
@@ -0,0 +1 @@
1
+ Balanced::Card.credit
@@ -0,0 +1,5 @@
1
+ <%= boiler_plate %>
2
+ card = Balanced::Card.fetch('<%= request['card_href'] %>')
3
+ card.credit(
4
+ <%= params_to_hash.call(payload).indent(2) %>
5
+ )
@@ -0,0 +1,43 @@
1
+ % if mode == 'definition':
2
+ Balanced::Card.credit
3
+ % elif mode == 'request':
4
+ require 'balanced'
5
+ Balanced.configure('ak-test-2jJSjIixy2qkOMmIONPtXnawOUftBDRSK')
6
+
7
+ card = Balanced::Card.fetch('/cards/CC7nMc4BAti7DgvWmpGV5e6N')
8
+ card.credit(
9
+ :amount => 5000,
10
+ :description => 'Some descriptive text for the debit in the dashboard'
11
+ )
12
+
13
+ % elif mode == 'response':
14
+ #<Balanced::Credit:0x007f86fda2eed8
15
+ @attributes=
16
+ {"amount"=>5000,
17
+ "appears_on_statement_as"=>"example.com",
18
+ "created_at"=>"2014-05-19T20:27:07.904059Z",
19
+ "currency"=>"USD",
20
+ "description"=>"Some descriptive text for the debit in the dashboard",
21
+ "failure_reason"=>nil,
22
+ "failure_reason_code"=>nil,
23
+ "href"=>"/credits/CR7oh5wk2EfSuMu34r2YzT0l",
24
+ "id"=>"CR7oh5wk2EfSuMu34r2YzT0l",
25
+ "links"=>
26
+ {"customer"=>nil, "destination"=>"CC7nMc4BAti7DgvWmpGV5e6N", "order"=>nil},
27
+ "meta"=>{},
28
+ "status"=>"succeeded",
29
+ "transaction_number"=>"CR018-897-7930",
30
+ "updated_at"=>"2014-05-19T20:27:08.244392Z"},
31
+ @hyperlinks=
32
+ {"customer"=>
33
+ #<Proc:0x007f86fda2e2f8/lib/balanced/utils.rb:6 (lambda)>,
34
+ "destination"=>
35
+ #<Proc:0x007f86fda2c778/lib/balanced/resources/resource.rb:60 (lambda)>,
36
+ "events"=>
37
+ #<Proc:0x007f86fda26788/lib/balanced/utils.rb:6 (lambda)>,
38
+ "order"=>
39
+ #<Proc:0x007f86fda25d38/lib/balanced/utils.rb:6 (lambda)>,
40
+ "reversals"=>
41
+ #<Proc:0x007f86fda1fd98/lib/balanced/utils.rb:6 (lambda)>}>
42
+
43
+ % endif
@@ -2,9 +2,9 @@
2
2
  Balanced::Card.debit
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- card = Balanced::Card.fetch('/cards/CC4tvKLTKXcBJAgkGvPEW58N')
7
+ card = Balanced::Card.fetch('/cards/CC4xXVOyMBDdk7FtzG9HwtBv')
8
8
  card.debit(
9
9
  :amount => 5000,
10
10
  :appears_on_statement_as => 'Statement text',
@@ -12,38 +12,38 @@ card.debit(
12
12
  )
13
13
 
14
14
  % elif mode == 'response':
15
- #<Balanced::Debit:0x007fa93e9568e0
15
+ #<Balanced::Debit:0x007fa7d30da520
16
16
  @attributes=
17
17
  {"amount"=>5000,
18
18
  "appears_on_statement_as"=>"BAL*Statement text",
19
- "created_at"=>"2014-04-25T20:10:20.485474Z",
19
+ "created_at"=>"2014-05-15T00:41:55.448643Z",
20
20
  "currency"=>"USD",
21
21
  "description"=>"Some descriptive text for the debit in the dashboard",
22
22
  "failure_reason"=>nil,
23
23
  "failure_reason_code"=>nil,
24
- "href"=>"/debits/WD4SOTNKiZbBFrmMk6mfszIl",
25
- "id"=>"WD4SOTNKiZbBFrmMk6mfszIl",
24
+ "href"=>"/debits/WD5z5CvSR6PFx0GgUFn0icKx",
25
+ "id"=>"WD5z5CvSR6PFx0GgUFn0icKx",
26
26
  "links"=>
27
- {"customer"=>"CU3VYCUIfwngJsidJWdGw2W5",
27
+ {"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
28
28
  "dispute"=>nil,
29
29
  "order"=>nil,
30
- "source"=>"CC4tvKLTKXcBJAgkGvPEW58N"},
30
+ "source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
31
31
  "meta"=>{},
32
32
  "status"=>"succeeded",
33
- "transaction_number"=>"W060-183-8881",
34
- "updated_at"=>"2014-04-25T20:10:21.476140Z"},
33
+ "transaction_number"=>"W588-680-6120",
34
+ "updated_at"=>"2014-05-15T00:42:17.739744Z"},
35
35
  @hyperlinks=
36
36
  {"customer"=>
37
- #<Proc:0x007fa93e954c48/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007fa7d30d8810/lib/balanced/resources/resource.rb:60 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fa93e954270/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d30d3d38/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa93e94e348/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d30d1bc8/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa93e94d970/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa7d30d1128/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "refunds"=>
45
- #<Proc:0x007fa93e9477c8/lib/balanced/utils.rb:6 (lambda)>,
45
+ #<Proc:0x007fa7d30cb070/lib/balanced/utils.rb:6 (lambda)>,
46
46
  "source"=>
47
- #<Proc:0x007fa93e9456a8/lib/balanced/resources/resource.rb:60 (lambda)>}>
47
+ #<Proc:0x007fa7d30c9338/lib/balanced/resources/resource.rb:60 (lambda)>}>
48
48
 
49
49
  % endif
@@ -2,9 +2,9 @@
2
2
  Balanced::Card.debit
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- card = Balanced::Card.fetch('/cards/CC4XMSQg2OY6rrcrkeEGtLcZ')
7
+ card = Balanced::Card.fetch('/cards/CC6iIaFL1QliTaYG47BArZAh')
8
8
  card.debit(
9
9
  :amount => 5000,
10
10
  :appears_on_statement_as => 'Statement text',
@@ -12,38 +12,38 @@ card.debit(
12
12
  )
13
13
 
14
14
  % elif mode == 'response':
15
- #<Balanced::Debit:0x007fa93e856df0
15
+ #<Balanced::Debit:0x007fa7d31cb830
16
16
  @attributes=
17
17
  {"amount"=>5000,
18
18
  "appears_on_statement_as"=>"BAL*Statement text",
19
- "created_at"=>"2014-04-25T20:10:25.648099Z",
19
+ "created_at"=>"2014-05-15T00:42:39.077752Z",
20
20
  "currency"=>"USD",
21
21
  "description"=>"Some descriptive text for the debit in the dashboard",
22
22
  "failure_reason"=>nil,
23
23
  "failure_reason_code"=>nil,
24
- "href"=>"/debits/WD4YCKAyFrQBFYuFCUCRynOx",
25
- "id"=>"WD4YCKAyFrQBFYuFCUCRynOx",
24
+ "href"=>"/debits/WD6mairBakAx5t8ETjMYFu7T",
25
+ "id"=>"WD6mairBakAx5t8ETjMYFu7T",
26
26
  "links"=>
27
27
  {"customer"=>nil,
28
28
  "dispute"=>nil,
29
29
  "order"=>nil,
30
- "source"=>"CC4XMSQg2OY6rrcrkeEGtLcZ"},
30
+ "source"=>"CC6iIaFL1QliTaYG47BArZAh"},
31
31
  "meta"=>{},
32
32
  "status"=>"succeeded",
33
- "transaction_number"=>"W630-477-8252",
34
- "updated_at"=>"2014-04-25T20:10:26.775361Z"},
33
+ "transaction_number"=>"W755-582-8394",
34
+ "updated_at"=>"2014-05-15T00:42:42.685055Z"},
35
35
  @hyperlinks=
36
36
  {"customer"=>
37
- #<Proc:0x007fa93e856198/lib/balanced/utils.rb:6 (lambda)>,
37
+ #<Proc:0x007fa7d31cacf0/lib/balanced/utils.rb:6 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fa93e8557e8/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d31ca278/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa93e84f8e8/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d31c8400/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa93e84ef10/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa7d31c39c8/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "refunds"=>
45
- #<Proc:0x007fa93e84d048/lib/balanced/utils.rb:6 (lambda)>,
45
+ #<Proc:0x007fa7d31c1a60/lib/balanced/utils.rb:6 (lambda)>,
46
46
  "source"=>
47
- #<Proc:0x007fa93e847670/lib/balanced/resources/resource.rb:60 (lambda)>}>
47
+ #<Proc:0x007fa7d31c0070/lib/balanced/resources/resource.rb:60 (lambda)>}>
48
48
 
49
49
  % endif
@@ -3,9 +3,9 @@ Balanced::Card.unstore
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
- card = Balanced::Card.fetch('/cards/CC4mYF7dj7X6OA2K5F0Qyb4N')
8
+ card = Balanced::Card.fetch('/cards/CC4gG6BE70pMOYKPBive9qoF')
9
9
  card.unstore
10
10
 
11
11
  % elif mode == 'response':
@@ -3,47 +3,47 @@ Balanced::CardHold.capture
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
- card_hold = Balanced::CardHold.fetch('/card_holds/HL4bdnO7ELS2JfyJ2T8elYOl')
8
+ card_hold = Balanced::CardHold.fetch('/card_holds/HL363Kap0nkbuV050V9DHpjf')
9
9
  debit = card_hold.capture(
10
10
  :appears_on_statement_as => 'ShowsUpOnStmt',
11
11
  :description => 'Some descriptive text for the debit in the dashboard'
12
12
  )
13
13
 
14
14
  % elif mode == 'response':
15
- #<Balanced::Debit:0x007fa93e819d38
15
+ #<Balanced::Debit:0x007fa7d319ac30
16
16
  @attributes=
17
17
  {"amount"=>5000,
18
18
  "appears_on_statement_as"=>"BAL*ShowsUpOnStmt",
19
- "created_at"=>"2014-04-25T20:09:46.854710Z",
19
+ "created_at"=>"2014-05-15T00:39:50.951932Z",
20
20
  "currency"=>"USD",
21
21
  "description"=>"Some descriptive text for the debit in the dashboard",
22
22
  "failure_reason"=>nil,
23
23
  "failure_reason_code"=>nil,
24
- "href"=>"/debits/WD4gZDOJ1DB443FYcbwNN5EV",
25
- "id"=>"WD4gZDOJ1DB443FYcbwNN5EV",
24
+ "href"=>"/debits/WD3j4fH7OIZgWaAF3SMTTu0l",
25
+ "id"=>"WD3j4fH7OIZgWaAF3SMTTu0l",
26
26
  "links"=>
27
- {"customer"=>"CU3z3rwGWGazDwwyLy0rNqfj",
27
+ {"customer"=>nil,
28
28
  "dispute"=>nil,
29
29
  "order"=>nil,
30
- "source"=>"CC4auQXiAWMBxJcEUIMYeZFj"},
30
+ "source"=>"CC35aRYQB8XnL0CxtKGFG7d3"},
31
31
  "meta"=>{"holding.for"=>"user1", "meaningful.key"=>"some.value"},
32
32
  "status"=>"succeeded",
33
- "transaction_number"=>"W815-967-5010",
34
- "updated_at"=>"2014-04-25T20:09:47.351487Z"},
33
+ "transaction_number"=>"W683-224-2501",
34
+ "updated_at"=>"2014-05-15T00:40:04.899900Z"},
35
35
  @hyperlinks=
36
36
  {"customer"=>
37
- #<Proc:0x007fa93e8180c8/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007fa7d319a0c8/lib/balanced/utils.rb:6 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fa93e8270c8/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa7d31996f0/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fa93e825070/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa7d3193868/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fa93e8245d0/lib/balanced/utils.rb:6 (lambda)>,
43
+ #<Proc:0x007fa7d3192dc8/lib/balanced/utils.rb:6 (lambda)>,
44
44
  "refunds"=>
45
- #<Proc:0x007fa93e810e90/lib/balanced/utils.rb:6 (lambda)>,
45
+ #<Proc:0x007fa7d3190dc0/lib/balanced/utils.rb:6 (lambda)>,
46
46
  "source"=>
47
- #<Proc:0x007fa93e80aa90/lib/balanced/resources/resource.rb:60 (lambda)>}>
47
+ #<Proc:0x007fa7d318f3d0/lib/balanced/resources/resource.rb:60 (lambda)>}>
48
48
 
49
49
  % endif
@@ -2,39 +2,39 @@
2
2
  Balanced::Card.hold
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV')
5
+ Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
6
 
7
- card = Balanced::Card.fetch('/cards/CC4auQXiAWMBxJcEUIMYeZFj')
7
+ card = Balanced::Card.fetch('/cards/CC35aRYQB8XnL0CxtKGFG7d3')
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:0x007fa93b7e5ea0
13
+ #<Balanced::CardHold:0x007fa7d316d5a0
14
14
  @attributes=
15
15
  {"amount"=>5000,
16
- "created_at"=>"2014-04-25T20:09:48.990540Z",
16
+ "created_at"=>"2014-05-15T00:40:11.970823Z",
17
17
  "currency"=>"USD",
18
18
  "description"=>"Some descriptive text for the debit in the dashboard",
19
- "expires_at"=>"2014-05-02T20:09:49.096484Z",
19
+ "expires_at"=>"2014-05-22T00:40:17.141216Z",
20
20
  "failure_reason"=>nil,
21
21
  "failure_reason_code"=>nil,
22
- "href"=>"/card_holds/HL4joUazeM3BJE6emmv2Q8EF",
23
- "id"=>"HL4joUazeM3BJE6emmv2Q8EF",
24
- "links"=>{"card"=>"CC4auQXiAWMBxJcEUIMYeZFj", "debit"=>nil},
22
+ "href"=>"/card_holds/HL3GI4qAmsr7ZdOzUgVuzmOF",
23
+ "id"=>"HL3GI4qAmsr7ZdOzUgVuzmOF",
24
+ "links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
25
25
  "meta"=>{},
26
26
  "status"=>"succeeded",
27
- "transaction_number"=>"HL161-849-8610",
28
- "updated_at"=>"2014-04-25T20:09:49.228091Z",
27
+ "transaction_number"=>"HL069-470-2887",
28
+ "updated_at"=>"2014-05-15T00:40:24.943265Z",
29
29
  "voided_at"=>nil},
30
30
  @hyperlinks=
31
31
  {"card"=>
32
- #<Proc:0x007fa93b7e41e0/lib/balanced/resources/resource.rb:60 (lambda)>,
32
+ #<Proc:0x007fa7d3167a10/lib/balanced/resources/resource.rb:60 (lambda)>,
33
33
  "debit"=>
34
- #<Proc:0x007fa93b7df898/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fa7d3166fe8/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "debits"=>
36
- #<Proc:0x007fa93b7dd8e0/lib/balanced/utils.rb:6 (lambda)>,
36
+ #<Proc:0x007fa7d3164e28/lib/balanced/utils.rb:6 (lambda)>,
37
37
  "events"=>
38
- #<Proc:0x007fa93b7d78a0/lib/balanced/utils.rb:6 (lambda)>}>
38
+ #<Proc:0x007fa7d3162a10/lib/balanced/utils.rb:6 (lambda)>}>
39
39
 
40
40
  % endif