balanced 0.7.5 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.rbenv-version +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -0
  6. data/balanced.gemspec +2 -2
  7. data/examples/bank_account_debits.rb +2 -1
  8. data/examples/customers.rb +8 -4
  9. data/examples/events_and_callbacks.rb +2 -1
  10. data/examples/examples.rb +6 -5
  11. data/examples/exception_handling.rb +2 -1
  12. data/lib/balanced/client.rb +3 -3
  13. data/lib/balanced/resources/account.rb +5 -3
  14. data/lib/balanced/resources/card.rb +3 -1
  15. data/lib/balanced/resources/credit.rb +12 -13
  16. data/lib/balanced/resources/customer.rb +1 -1
  17. data/lib/balanced/resources/debit.rb +1 -1
  18. data/lib/balanced/resources/resource.rb +83 -93
  19. data/lib/balanced/utils.rb +13 -4
  20. data/lib/balanced/version.rb +1 -1
  21. data/scenario.cache +299 -380
  22. data/scenarios/account_add_card/ruby.mako +3 -3
  23. data/scenarios/account_capture_hold/request.rb +1 -1
  24. data/scenarios/account_capture_hold/ruby.mako +1 -1
  25. data/scenarios/account_create/ruby.mako +1 -1
  26. data/scenarios/account_create_buyer/ruby.mako +2 -2
  27. data/scenarios/account_create_debit/request.rb +1 -1
  28. data/scenarios/account_create_debit/ruby.mako +1 -1
  29. data/scenarios/account_create_hold/request.rb +1 -1
  30. data/scenarios/account_create_hold/ruby.mako +1 -1
  31. data/scenarios/account_create_merchant/ruby.mako +3 -3
  32. data/scenarios/account_underwrite_business/ruby.mako +1 -1
  33. data/scenarios/account_underwrite_person/request.rb +1 -1
  34. data/scenarios/account_underwrite_person/ruby.mako +7 -7
  35. data/scenarios/bank_account_create/request.rb +1 -1
  36. data/scenarios/bank_account_create/ruby.mako +5 -5
  37. data/scenarios/bank_account_delete/ruby.mako +2 -2
  38. data/scenarios/bank_account_invalid_routing_number/ruby.mako +2 -8
  39. data/scenarios/bank_account_list/ruby.mako +1 -1
  40. data/scenarios/bank_account_show/ruby.mako +2 -2
  41. data/scenarios/bank_account_verification_create/ruby.mako +2 -2
  42. data/scenarios/bank_account_verification_show/ruby.mako +2 -2
  43. data/scenarios/bank_account_verification_update/ruby.mako +2 -2
  44. data/scenarios/callback_create/definition.rb +1 -1
  45. data/scenarios/callback_create/request.rb +1 -1
  46. data/scenarios/callback_create/ruby.mako +0 -11
  47. data/scenarios/callback_delete/definition.rb +1 -1
  48. data/scenarios/callback_delete/request.rb +1 -1
  49. data/scenarios/callback_delete/ruby.mako +0 -10
  50. data/scenarios/callback_list/definition.rb +1 -1
  51. data/scenarios/callback_list/ruby.mako +0 -10
  52. data/scenarios/callback_show/definition.rb +1 -1
  53. data/scenarios/callback_show/ruby.mako +0 -9
  54. data/scenarios/card_create/request.rb +2 -1
  55. data/scenarios/card_create/ruby.mako +6 -5
  56. data/scenarios/card_delete/ruby.mako +2 -2
  57. data/scenarios/card_invalidate/ruby.mako +2 -2
  58. data/scenarios/card_list/ruby.mako +1 -1
  59. data/scenarios/card_show/ruby.mako +2 -2
  60. data/scenarios/card_update/ruby.mako +2 -2
  61. data/scenarios/credit_bank_account_list/ruby.mako +2 -2
  62. data/scenarios/credit_create_existing_bank_account/ruby.mako +3 -3
  63. data/scenarios/credit_customer_list/ruby.mako +2 -2
  64. data/scenarios/credit_failed_state/request.rb +2 -2
  65. data/scenarios/credit_failed_state/ruby.mako +2 -5
  66. data/scenarios/credit_list/ruby.mako +1 -1
  67. data/scenarios/credit_paid_state/request.rb +2 -2
  68. data/scenarios/credit_paid_state/ruby.mako +2 -5
  69. data/scenarios/credit_pending_state/request.rb +2 -2
  70. data/scenarios/credit_pending_state/ruby.mako +2 -5
  71. data/scenarios/credit_show/ruby.mako +2 -2
  72. data/scenarios/customer_add_bank_account/ruby.mako +3 -3
  73. data/scenarios/customer_add_card/ruby.mako +3 -3
  74. data/scenarios/customer_capture_hold/request.rb +1 -1
  75. data/scenarios/customer_create/ruby.mako +1 -1
  76. data/scenarios/customer_create_debit/request.rb +1 -1
  77. data/scenarios/customer_create_debit/ruby.mako +3 -3
  78. data/scenarios/customer_create_hold/request.rb +1 -1
  79. data/scenarios/customer_create_hold/ruby.mako +1 -1
  80. data/scenarios/customer_credit/request.rb +1 -1
  81. data/scenarios/customer_credit/ruby.mako +2 -2
  82. data/scenarios/customer_delete/ruby.mako +1 -1
  83. data/scenarios/debit_create/ruby.mako +3 -3
  84. data/scenarios/debit_customer_list/ruby.mako +2 -2
  85. data/scenarios/debit_list/ruby.mako +1 -1
  86. data/scenarios/debit_refund/ruby.mako +2 -2
  87. data/scenarios/debit_show/ruby.mako +2 -2
  88. data/scenarios/debit_update/ruby.mako +2 -2
  89. data/scenarios/event_list/ruby.mako +1 -1
  90. data/scenarios/event_show/ruby.mako +2 -2
  91. data/scenarios/helpers.rb +1 -5
  92. data/scenarios/hold_capture/ruby.mako +4 -3
  93. data/scenarios/hold_create/request.rb +2 -2
  94. data/scenarios/hold_create/ruby.mako +6 -6
  95. data/scenarios/hold_customer_list/ruby.mako +2 -2
  96. data/scenarios/hold_list/ruby.mako +1 -1
  97. data/scenarios/hold_show/ruby.mako +2 -2
  98. data/scenarios/hold_update/ruby.mako +2 -2
  99. data/scenarios/hold_void/ruby.mako +2 -2
  100. data/scenarios/refund_create/ruby.mako +2 -2
  101. data/scenarios/refund_customer_list/ruby.mako +2 -2
  102. data/scenarios/refund_list/ruby.mako +1 -1
  103. data/scenarios/refund_show/ruby.mako +2 -2
  104. data/scenarios/refund_update/ruby.mako +2 -2
  105. data/scenarios/render.rb +1 -1
  106. data/scenarios/render_mako.rb +0 -1
  107. data/spec/balanced/error_spec.rb +4 -4
  108. data/spec/balanced/pager_spec.rb +7 -7
  109. data/spec/balanced/resources/account_spec.rb +51 -30
  110. data/spec/balanced/resources/bank_account_spec.rb +2 -2
  111. data/spec/balanced/resources/card_spec.rb +8 -8
  112. data/spec/balanced/resources/customer_spec.rb +11 -11
  113. data/spec/balanced/resources/hold_spec.rb +1 -1
  114. data/spec/balanced/resources/marketplace_spec.rb +12 -10
  115. data/spec/balanced/resources/resource_spec.rb +1 -1
  116. data/spec/scenarios_spec.rb +1 -1
  117. data/spec/spec_helper.rb +1 -1
  118. metadata +16 -15
  119. data/examples/customers-with-meta-example.rb +0 -141
@@ -3,9 +3,9 @@ Balanced::Account.add_card
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- account = Balanced::Account.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/accounts/CU4WT2fC14gzGQIEcMKs5gm3')
9
- response = account.add_card('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC4Zor9L2DEKXy0LJJ8PtkMM')
8
+ account = Balanced::Account.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ')
9
+ response = account.add_card('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC4Y12fGIP0HQ1jhcDgE9cFi')
10
10
 
11
11
  % endif
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  account = Balanced::Account.find('<%=request['uri']%>')
3
- account.debit(:amount => <%=payload['amount']%>, :hold_uri => '<%=payload['hold_uri']%>')
3
+ account.debit(:amount => '<%=payload['amount']%>', :hold_uri => '<%=payload['hold_uri']%>')
@@ -6,6 +6,6 @@ require 'balanced'
6
6
  Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
9
- account.debit(:amount => 1000, :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
9
+ account.debit(:amount => '1000', :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
10
10
 
11
11
  % endif
@@ -3,7 +3,7 @@ Balanced::Account.new
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  account = Balanced::Marketplace.my_marketplace.create_account
9
9
 
@@ -3,11 +3,11 @@ Balanced::Marketplace.create_buyer
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
 
9
9
  buyer = Balanced::Marketplace.my_marketplace.create_buyer(
10
- :card_uri => '/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC4WeeR0OUiQh9vvqNQvMl1o'
10
+ :card_uri => '/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC4KUcbT2dmJRIYoG0hBpO6S'
11
11
  )
12
12
 
13
13
  % endif
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  account = Balanced::Account.find('<%=request['uri']%>')
3
- account.debit(:amount => <%=payload['amount']%>)
3
+ account.debit(:amount => '<%=payload['amount']%>')
@@ -6,6 +6,6 @@ require 'balanced'
6
6
  Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
9
- account.debit(:amount => 1000)
9
+ account.debit(:amount => '1000')
10
10
 
11
11
  % endif
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  account = Balanced::Account.find('<%=request['account_uri']%>')
3
- account.hold(:amount => <%=payload['amount']%>)
3
+ account.hold(:amount => '<%=payload['amount']%>')
@@ -6,6 +6,6 @@ require 'balanced'
6
6
  Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX')
9
- account.hold(:amount => 1000)
9
+ account.hold(:amount => '1000')
10
10
 
11
11
  % endif
@@ -3,9 +3,9 @@ Balanced::Account.add_bank_account
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- account = Balanced::Account.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/accounts/CU4WT2fC14gzGQIEcMKs5gm3')
9
- account.add_bank_account("/v1/bank_accounts/BA53NVwHAXYx7fo98SdK41dg")
8
+ account = Balanced::Account.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ')
9
+ account.add_bank_account("/v1/bank_accounts/BA5hNwwQFEWByAcdf1U5D5ok")
10
10
 
11
11
  % endif
@@ -3,7 +3,7 @@ Balanced::Account.promote_to_merchant
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
 
9
9
  merchant_data = {
@@ -2,7 +2,7 @@
2
2
  marketplace = Balanced::Marketplace.my_marketplace
3
3
 
4
4
  merchant_data = {
5
- <%= params_to_hash.call(payload['merchant']).indent(2) %>
5
+ <%= params_to_hash.call(payload['merchant']) %>
6
6
  }
7
7
 
8
8
  account = Balanced::Marketplace.my_marketplace.create_account
@@ -3,17 +3,17 @@ Balanced::Account.promote_to_merchant
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
10
  merchant_data = {
11
- :dob => '1989-12',
12
- :name => 'Timmy Q. CopyPasta',
13
- :phone_number => '+14089999999',
14
- :postal_code => '94110',
15
- :street_address => '121 Skriptkid Row',
16
- :type => 'person'
11
+ :dob => '1989-12',
12
+ :name => 'Timmy Q. CopyPasta',
13
+ :phone_number => '+14089999999',
14
+ :postal_code => '94110',
15
+ :street_address => '121 Skriptkid Row',
16
+ :type => 'person'
17
17
  }
18
18
 
19
19
  account = Balanced::Marketplace.my_marketplace.create_account
@@ -1,4 +1,4 @@
1
1
  <%= boiler_plate %>
2
2
  bank_account = Balanced::BankAccount.new(
3
- <%= params_to_hash.call(payload).indent(2) %>
3
+ <%= params_to_hash.call(payload) %>
4
4
  ).save
@@ -3,13 +3,13 @@ Balanced::BankAccount.save
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  bank_account = Balanced::BankAccount.new(
9
- :account_number => '9900000001',
10
- :name => 'Johann Bernoulli',
11
- :routing_number => '121000358',
12
- :type => 'checking'
9
+ :account_number => '9900000001',
10
+ :name => 'Johann Bernoulli',
11
+ :routing_number => '121000358',
12
+ :type => 'checking'
13
13
  ).save
14
14
 
15
15
  % endif
@@ -3,9 +3,9 @@ Balanced::BankAccount.unstore
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5uvDqG8xk4bGmwX3JTbIee')
8
+ bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5LOM1tiKeY4HOVU9XqOpHi')
9
9
  bank_account.unstore
10
10
 
11
11
  % endif
@@ -3,15 +3,9 @@ Balanced::BadRequest
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
6
+ Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
- bank_account = Balanced::BankAccount.new(
9
- :uri => '/v1/marketplaces/TEST-MP5FKPQwyjvVgTDt7EiRw3Kq/bank_accounts',
10
- :account_number => '9900000001',
11
- :name => 'Johann Bernoulli',
12
- :routing_number => '100000007',
13
- :type => 'checking'
14
- )
8
+ bank_account = Balanced::BankAccount.new( :uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/bank_accounts', :account_number => '9900000001',:name => 'Johann Bernoulli',:routing_number => '100000007',:type => 'checking')
15
9
 
16
10
  begin
17
11
  bank_account.save
@@ -3,7 +3,7 @@ Balanced::BankAccount.all
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  Balanced::BankAccount.all
9
9
 
@@ -3,8 +3,8 @@ Balanced::BankAccount.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
8
+ bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5S3reJdyJBbAYKepbneBe2')
9
9
 
10
10
  % endif
@@ -3,9 +3,9 @@
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5gy1b8X8dIGaBWFuoWvkxO')
8
+ bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5BveXWeSilJaZGTX3P6g9x')
9
9
  verification = bank_account.verify
10
10
 
11
11
  % endif
@@ -3,8 +3,8 @@ Balanced::Verification.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- verification = Balanced::Verification.find('/v1/bank_accounts/BA5nW8SMsXjaU3GVWdhR9d60/verifications/BZ5rcuNvebC49kZyTGAaJu2A')
8
+ verification = Balanced::Verification.find('/v1/bank_accounts/BA5Frg9td6vFAzSIwx9aShjW/verifications/BZ5IyyZBbFCVWMaNzHwiq5bx')
9
9
 
10
10
  % endif
@@ -3,9 +3,9 @@ Balanced::Verification.save
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- verification = Balanced::Verification.find('/v1/bank_accounts/BA5uvDqG8xk4bGmwX3JTbIee/verifications/BZ5wpXXDTZxqLCHiX6V4XXvA')
8
+ verification = Balanced::Verification.find('/v1/bank_accounts/BA5LOM1tiKeY4HOVU9XqOpHi/verifications/BZ5OeVKxqc8c1ne4qZzi9LJl')
9
9
 
10
10
  verification.amount_1 = 1
11
11
 
@@ -1 +1 @@
1
- Balanced::Callback.new
1
+ Balanced::Callback.save
@@ -1,4 +1,4 @@
1
1
  <%= boiler_plate %>
2
2
  callback = Balanced::Callback.new(
3
3
  <%= params_to_hash.call(payload) %>
4
- ).save
4
+ ).save
@@ -1,11 +0,0 @@
1
- % if mode == 'definition':
2
- Balanced::Callback.new
3
- % else:
4
- require 'balanced'
5
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
-
7
- callback = Balanced::Callback.new(
8
- :url => 'http://www.example.com/callback'
9
- ).save
10
-
11
- % endif
@@ -1 +1 @@
1
- Balanced::Callback.unstore
1
+ Balanced::Callback.destroy
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  callback = Balanced::Callback.find('<%=request['uri']%>')
3
- callback.unstore
3
+ callback.destroy
@@ -1,10 +0,0 @@
1
- % if mode == 'definition':
2
- Balanced::Callback.unstore
3
-
4
- % else:
5
- require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
-
8
- callback = Balanced::Callback.find('/v1/callbacks/CB5GFgGfugkhbKueLUJL6hAa')
9
- callback.unstore
10
- % endif
@@ -1 +1 @@
1
- Balanced::Callback.all
1
+ Balanced::Callback.all
@@ -1,10 +0,0 @@
1
- % if mode == 'definition':
2
- Balanced::Callback.all
3
-
4
- % else:
5
- require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
-
8
- marketplace = Balanced::Marketplace.my_marketplace
9
- callbacks = Balanced::Callback.all(:limit => 2)
10
- % endif
@@ -1 +1 @@
1
- Balanced::Callback.find
1
+ Balanced::Callback.find()
@@ -1,9 +0,0 @@
1
- % if mode == 'definition':
2
- Balanced::Callback.find
3
-
4
- % else:
5
- require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
-
8
- callback = Balanced::Callback.find('/v1/callbacks/CB5GFgGfugkhbKueLUJL6hAa')
9
- % endif
@@ -1,4 +1,5 @@
1
1
  <%= boiler_plate %>
2
2
  card = Balanced::Card.new(
3
- <%= params_to_hash.call(payload).indent(2) %>
3
+ :uri => '<%= request['uri']%>',
4
+ <%= params_to_hash.call(payload) %>
4
5
  ).save
@@ -3,13 +3,14 @@ Balanced::Card.new
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  card = Balanced::Card.new(
9
- :card_number => '5105105105105100',
10
- :expiration_month => '12',
11
- :expiration_year => '2020',
12
- :security_code => '123'
9
+ :uri => '/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards',
10
+ :card_number => '5105105105105100',
11
+ :expiration_month => '12',
12
+ :expiration_year => '2020',
13
+ :security_code => '123'
13
14
  ).save
14
15
 
15
16
  % endif
@@ -3,9 +3,9 @@ Balanced::Card.unstore
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
8
+ card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ/cards/CC4Y12fGIP0HQ1jhcDgE9cFi')
9
9
  card.unstore
10
10
 
11
11
  % endif
@@ -3,8 +3,8 @@ Balanced::Card.invalidate()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
8
+ card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
9
9
  card.invalidate
10
10
  % endif
@@ -3,7 +3,7 @@ Balanced::Marketplace.cards
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  cards = Balanced::Marketplace.my_marketplace.cards
9
9
  % endif
@@ -3,7 +3,7 @@ Balanced::Card.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
8
+ card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
9
9
  % endif
@@ -3,9 +3,9 @@ Balanced::Card.save()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
8
+ card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
9
9
  card.meta = {
10
10
  'facebook.user_id' => '0192837465',
11
11
  'my-own-customer-id' => '12345',
@@ -3,10 +3,10 @@ Balanced::BankAccount.credits
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
- bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
10
+ bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5S3reJdyJBbAYKepbneBe2')
11
11
  credits = bank_account.credits
12
12
  % endif