balanced 0.8.2 → 1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rbenv-version +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +7 -3
- data/README.md +2 -10
- data/Rakefile +4 -18
- data/balanced.gemspec +8 -10
- data/lib/balanced.rb +28 -28
- data/lib/balanced/client.rb +15 -6
- data/lib/balanced/error.rb +21 -12
- data/lib/balanced/pager.rb +66 -25
- data/lib/balanced/resources.rb +18 -17
- data/lib/balanced/resources/api_key.rb +4 -0
- data/lib/balanced/resources/bank_account.rb +26 -75
- data/lib/balanced/resources/callback.rb +2 -0
- data/lib/balanced/resources/card.rb +15 -65
- data/lib/balanced/resources/card_hold.rb +38 -0
- data/lib/balanced/resources/credit.rb +6 -50
- data/lib/balanced/resources/customer.rb +33 -71
- data/lib/balanced/resources/debit.rb +6 -14
- data/lib/balanced/resources/event.rb +6 -0
- data/lib/balanced/resources/funding_instrument.rb +11 -0
- data/lib/balanced/resources/hypermedia.rb +28 -0
- data/lib/balanced/resources/marketplace.rb +5 -203
- data/lib/balanced/resources/order.rb +71 -0
- data/lib/balanced/resources/refund.rb +2 -7
- data/lib/balanced/resources/resource.rb +169 -106
- data/lib/balanced/resources/reversal.rb +2 -8
- data/lib/balanced/resources/transfer.rb +11 -0
- data/lib/balanced/response/balanced_exception_middleware.rb +2 -2
- data/lib/balanced/utils.rb +47 -14
- data/lib/balanced/version.rb +1 -1
- data/scenario.cache +526 -380
- data/scenarios/api_key_create/definition.rb +1 -0
- data/scenarios/api_key_create/request.rb +2 -0
- data/scenarios/api_key_create/ruby.mako +21 -0
- data/scenarios/api_key_delete/definition.rb +1 -0
- data/scenarios/api_key_delete/request.rb +3 -0
- data/scenarios/api_key_delete/ruby.mako +12 -0
- data/scenarios/api_key_list/definition.rb +1 -0
- data/scenarios/api_key_list/request.rb +2 -0
- data/scenarios/api_key_list/ruby.mako +28 -0
- data/scenarios/api_key_show/definition.rb +1 -0
- data/scenarios/api_key_show/request.rb +2 -0
- data/scenarios/api_key_show/ruby.mako +18 -0
- data/scenarios/{customer_add_bank_account → bank_account_associate_to_customer}/definition.rb +0 -0
- data/scenarios/bank_account_associate_to_customer/request.rb +3 -0
- data/scenarios/bank_account_associate_to_customer/ruby.mako +49 -0
- data/scenarios/bank_account_create/definition.rb +1 -1
- data/scenarios/bank_account_create/request.rb +1 -1
- data/scenarios/bank_account_create/ruby.mako +44 -7
- data/scenarios/{credit_create_existing_bank_account → bank_account_credit}/definition.rb +0 -0
- data/scenarios/bank_account_credit/request.rb +3 -0
- data/scenarios/bank_account_credit/ruby.mako +42 -0
- data/scenarios/bank_account_debit/definition.rb +1 -0
- data/scenarios/bank_account_debit/request.rb +5 -0
- data/scenarios/bank_account_debit/ruby.mako +50 -0
- data/scenarios/bank_account_delete/request.rb +1 -1
- data/scenarios/bank_account_delete/ruby.mako +5 -3
- data/scenarios/bank_account_list/ruby.mako +76 -2
- data/scenarios/bank_account_show/definition.rb +1 -1
- data/scenarios/bank_account_show/request.rb +1 -1
- data/scenarios/bank_account_show/ruby.mako +41 -5
- data/scenarios/bank_account_update/definition.rb +1 -0
- data/scenarios/bank_account_update/request.rb +6 -0
- data/scenarios/bank_account_update/ruby.mako +56 -0
- data/scenarios/bank_account_verification_create/request.rb +1 -1
- data/scenarios/bank_account_verification_create/ruby.mako +20 -3
- data/scenarios/bank_account_verification_show/definition.rb +1 -1
- data/scenarios/bank_account_verification_show/request.rb +1 -1
- data/scenarios/bank_account_verification_show/ruby.mako +21 -4
- data/scenarios/bank_account_verification_update/definition.rb +1 -1
- data/scenarios/bank_account_verification_update/request.rb +5 -5
- data/scenarios/bank_account_verification_update/ruby.mako +24 -8
- data/scenarios/callback_create/definition.rb +1 -1
- data/scenarios/callback_create/request.rb +2 -2
- data/scenarios/callback_create/ruby.mako +22 -0
- data/scenarios/callback_delete/definition.rb +1 -1
- data/scenarios/callback_delete/request.rb +2 -2
- data/scenarios/callback_delete/ruby.mako +12 -0
- data/scenarios/callback_list/definition.rb +1 -1
- data/scenarios/callback_list/request.rb +1 -2
- data/scenarios/callback_list/ruby.mako +20 -0
- data/scenarios/callback_show/definition.rb +1 -1
- data/scenarios/callback_show/request.rb +1 -1
- data/scenarios/callback_show/ruby.mako +20 -0
- data/scenarios/{customer_add_card → card_associate_to_customer}/definition.rb +0 -0
- data/scenarios/card_associate_to_customer/request.rb +3 -0
- data/scenarios/card_associate_to_customer/ruby.mako +49 -0
- data/scenarios/card_create/request.rb +1 -2
- data/scenarios/card_create/ruby.mako +44 -7
- data/scenarios/card_debit/definition.rb +1 -0
- data/scenarios/card_debit/request.rb +5 -0
- data/scenarios/card_debit/ruby.mako +49 -0
- data/scenarios/card_delete/request.rb +1 -1
- data/scenarios/card_delete/ruby.mako +5 -3
- data/scenarios/card_hold_capture/definition.rb +1 -0
- data/scenarios/card_hold_capture/request.rb +5 -0
- data/scenarios/card_hold_capture/ruby.mako +49 -0
- data/scenarios/card_hold_create/definition.rb +1 -0
- data/scenarios/card_hold_create/request.rb +5 -0
- data/scenarios/card_hold_create/ruby.mako +38 -0
- data/scenarios/card_hold_list/definition.rb +1 -0
- data/scenarios/card_hold_list/request.rb +2 -0
- data/scenarios/card_hold_list/ruby.mako +60 -0
- data/scenarios/card_hold_show/definition.rb +1 -0
- data/scenarios/card_hold_show/request.rb +2 -0
- data/scenarios/card_hold_show/ruby.mako +36 -0
- data/scenarios/card_hold_update/definition.rb +1 -0
- data/scenarios/card_hold_update/request.rb +7 -0
- data/scenarios/card_hold_update/ruby.mako +42 -0
- data/scenarios/card_hold_void/definition.rb +1 -0
- data/scenarios/card_hold_void/request.rb +3 -0
- data/scenarios/card_hold_void/ruby.mako +36 -0
- data/scenarios/card_list/definition.rb +1 -1
- data/scenarios/card_list/request.rb +1 -1
- data/scenarios/card_list/ruby.mako +78 -5
- data/scenarios/card_show/definition.rb +1 -1
- data/scenarios/card_show/request.rb +1 -1
- data/scenarios/card_show/ruby.mako +42 -4
- data/scenarios/card_update/definition.rb +1 -1
- data/scenarios/card_update/request.rb +1 -1
- data/scenarios/card_update/ruby.mako +45 -4
- data/scenarios/credit_list/request.rb +1 -3
- data/scenarios/credit_list/ruby.mako +34 -4
- data/scenarios/{credit_bank_account_list → credit_list_bank_account}/definition.rb +0 -0
- data/scenarios/credit_list_bank_account/request.rb +3 -0
- data/scenarios/credit_list_bank_account/ruby.mako +13 -0
- data/scenarios/credit_show/definition.rb +1 -1
- data/scenarios/credit_show/request.rb +1 -3
- data/scenarios/credit_show/ruby.mako +35 -5
- data/scenarios/{credit_create_new_bank_account → credit_update}/definition.rb +0 -0
- data/scenarios/credit_update/request.rb +7 -0
- data/scenarios/credit_update/ruby.mako +48 -0
- data/scenarios/customer_create/request.rb +4 -1
- data/scenarios/customer_create/ruby.mako +60 -3
- data/scenarios/customer_delete/request.rb +1 -1
- data/scenarios/customer_delete/ruby.mako +4 -2
- data/scenarios/customer_list/definition.rb +1 -0
- data/scenarios/customer_list/request.rb +2 -0
- data/scenarios/customer_list/ruby.mako +105 -0
- data/scenarios/customer_show/definition.rb +1 -0
- data/scenarios/customer_show/request.rb +2 -0
- data/scenarios/customer_show/ruby.mako +58 -0
- data/scenarios/customer_update/definition.rb +1 -0
- data/scenarios/customer_update/request.rb +7 -0
- data/scenarios/customer_update/ruby.mako +64 -0
- data/scenarios/debit_list/request.rb +1 -3
- data/scenarios/debit_list/ruby.mako +70 -4
- data/scenarios/debit_show/definition.rb +1 -1
- data/scenarios/debit_show/request.rb +1 -1
- data/scenarios/debit_show/ruby.mako +39 -4
- data/scenarios/debit_update/definition.rb +1 -1
- data/scenarios/debit_update/request.rb +1 -1
- data/scenarios/debit_update/ruby.mako +39 -4
- data/scenarios/event_list/definition.rb +1 -1
- data/scenarios/event_list/request.rb +1 -2
- data/scenarios/event_list/ruby.mako +54 -5
- data/scenarios/event_show/definition.rb +1 -1
- data/scenarios/event_show/request.rb +1 -1
- data/scenarios/event_show/ruby.mako +54 -4
- data/scenarios/helpers.rb +29 -2
- data/scenarios/order_create/definition.rb +1 -0
- data/scenarios/order_create/request.rb +5 -0
- data/scenarios/order_create/ruby.mako +46 -0
- data/scenarios/order_list/definition.rb +1 -0
- data/scenarios/order_list/request.rb +2 -0
- data/scenarios/order_list/ruby.mako +42 -0
- data/scenarios/order_show/definition.rb +1 -0
- data/scenarios/order_show/request.rb +2 -0
- data/scenarios/order_show/ruby.mako +44 -0
- data/scenarios/order_update/definition.rb +1 -0
- data/scenarios/order_update/request.rb +7 -0
- data/scenarios/order_update/ruby.mako +50 -0
- data/scenarios/refund_create/definition.rb +1 -1
- data/scenarios/refund_create/request.rb +2 -1
- data/scenarios/refund_create/ruby.mako +33 -5
- data/scenarios/refund_list/request.rb +1 -3
- data/scenarios/refund_list/ruby.mako +30 -4
- data/scenarios/refund_show/definition.rb +1 -1
- data/scenarios/refund_show/request.rb +1 -1
- data/scenarios/refund_show/ruby.mako +32 -4
- data/scenarios/refund_update/definition.rb +1 -1
- data/scenarios/refund_update/request.rb +1 -1
- data/scenarios/refund_update/ruby.mako +32 -4
- data/scenarios/render_mako.rb +59 -4
- data/scenarios/reversal_create/definition.rb +1 -0
- data/scenarios/reversal_create/request.rb +9 -0
- data/scenarios/reversal_create/ruby.mako +45 -0
- data/scenarios/reversal_list/definition.rb +1 -0
- data/scenarios/reversal_list/request.rb +2 -0
- data/scenarios/reversal_list/ruby.mako +36 -0
- data/scenarios/reversal_show/definition.rb +1 -0
- data/scenarios/reversal_show/request.rb +2 -0
- data/scenarios/reversal_show/ruby.mako +37 -0
- data/scenarios/reversal_update/definition.rb +1 -0
- data/scenarios/reversal_update/request.rb +7 -0
- data/scenarios/reversal_update/ruby.mako +44 -0
- data/spec/balanced/error_spec.rb +7 -7
- data/spec/balanced/pager_spec.rb +10 -10
- data/spec/balanced/resources/api_key_spec.rb +6 -35
- data/spec/balanced/resources/bank_account_spec.rb +123 -218
- data/spec/balanced/resources/callback_spec.rb +12 -13
- data/spec/balanced/resources/card_hold_spec.rb +103 -0
- data/spec/balanced/resources/card_spec.rb +101 -27
- data/spec/balanced/resources/credit_spec.rb +69 -35
- data/spec/balanced/resources/customer_spec.rb +91 -271
- data/spec/balanced/resources/debit_spec.rb +95 -0
- data/spec/balanced/resources/marketplace_spec.rb +17 -170
- data/spec/balanced/resources/order_spec.rb +364 -0
- data/spec/balanced/resources/resource_spec.rb +25 -32
- data/spec/balanced_spec.rb +18 -36
- data/spec/client_spec.rb +7 -7
- data/spec/spec_helper.rb +19 -18
- data/spec/utils_spec.rb +5 -5
- metadata +123 -165
- data/examples/bank_account_debits.rb +0 -57
- data/examples/customers.rb +0 -114
- data/examples/events_and_callbacks.rb +0 -81
- data/examples/examples.rb +0 -162
- data/examples/exception_handling.rb +0 -44
- data/lib/balanced/resources/account.rb +0 -179
- data/lib/balanced/resources/hold.rb +0 -61
- data/lib/balanced/resources/invoice.rb +0 -11
- data/lib/balanced/resources/merchant.rb +0 -21
- data/lib/balanced/resources/transaction.rb +0 -17
- data/scenarios/account_add_card/definition.rb +0 -1
- data/scenarios/account_add_card/request.rb +0 -3
- data/scenarios/account_add_card/ruby.mako +0 -11
- data/scenarios/account_capture_hold/definition.rb +0 -1
- data/scenarios/account_capture_hold/request.rb +0 -3
- data/scenarios/account_capture_hold/ruby.mako +0 -11
- data/scenarios/account_create/definition.rb +0 -1
- data/scenarios/account_create/request.rb +0 -2
- data/scenarios/account_create/ruby.mako +0 -10
- data/scenarios/account_create_buyer/definition.rb +0 -1
- data/scenarios/account_create_buyer/request.rb +0 -5
- data/scenarios/account_create_buyer/ruby.mako +0 -13
- data/scenarios/account_create_debit/definition.rb +0 -1
- data/scenarios/account_create_debit/request.rb +0 -3
- data/scenarios/account_create_debit/ruby.mako +0 -11
- data/scenarios/account_create_hold/definition.rb +0 -1
- data/scenarios/account_create_hold/request.rb +0 -3
- data/scenarios/account_create_hold/ruby.mako +0 -11
- data/scenarios/account_create_merchant/definition.rb +0 -1
- data/scenarios/account_create_merchant/request.rb +0 -3
- data/scenarios/account_create_merchant/ruby.mako +0 -11
- data/scenarios/account_underwrite_business/definition.rb +0 -1
- data/scenarios/account_underwrite_business/request.rb +0 -17
- data/scenarios/account_underwrite_business/ruby.mako +0 -37
- data/scenarios/account_underwrite_person/definition.rb +0 -1
- data/scenarios/account_underwrite_person/request.rb +0 -18
- data/scenarios/account_underwrite_person/ruby.mako +0 -31
- data/scenarios/bank_account_find_and_credit/definition.rb +0 -1
- data/scenarios/bank_account_find_and_credit/request.rb +0 -5
- data/scenarios/bank_account_find_and_credit/ruby.mako +0 -13
- data/scenarios/bank_account_find_and_delete/definition.rb +0 -1
- data/scenarios/bank_account_find_and_delete/request.rb +0 -3
- data/scenarios/bank_account_find_and_delete/ruby.mako +0 -10
- data/scenarios/bank_account_invalid_routing_number/definition.rb +0 -1
- data/scenarios/bank_account_invalid_routing_number/request.rb +0 -11
- data/scenarios/bank_account_invalid_routing_number/ruby.mako +0 -16
- data/scenarios/card_invalidate/definition.rb +0 -1
- data/scenarios/card_invalidate/request.rb +0 -3
- data/scenarios/card_invalidate/ruby.mako +0 -10
- data/scenarios/credit_account_list/definition.rb +0 -1
- data/scenarios/credit_account_list/request.rb +0 -3
- data/scenarios/credit_account_list/ruby.mako +0 -10
- data/scenarios/credit_account_merchant_create/definition.rb +0 -1
- data/scenarios/credit_account_merchant_create/request.rb +0 -5
- data/scenarios/credit_account_merchant_create/ruby.mako +0 -12
- data/scenarios/credit_bank_account_list/request.rb +0 -5
- data/scenarios/credit_bank_account_list/ruby.mako +0 -12
- data/scenarios/credit_create_existing_bank_account/request.rb +0 -5
- data/scenarios/credit_create_existing_bank_account/ruby.mako +0 -12
- data/scenarios/credit_create_new_bank_account/request.rb +0 -10
- data/scenarios/credit_create_new_bank_account/ruby.mako +0 -21
- data/scenarios/credit_customer_list/definition.rb +0 -1
- data/scenarios/credit_customer_list/request.rb +0 -4
- data/scenarios/credit_customer_list/ruby.mako +0 -12
- data/scenarios/credit_failed_state/definition.rb +0 -1
- data/scenarios/credit_failed_state/request.rb +0 -10
- data/scenarios/credit_failed_state/ruby.mako +0 -18
- data/scenarios/credit_paid_state/definition.rb +0 -1
- data/scenarios/credit_paid_state/request.rb +0 -11
- data/scenarios/credit_paid_state/ruby.mako +0 -19
- data/scenarios/credit_pending_state/definition.rb +0 -1
- data/scenarios/credit_pending_state/request.rb +0 -9
- data/scenarios/credit_pending_state/ruby.mako +0 -17
- data/scenarios/customer_add_bank_account/request.rb +0 -3
- data/scenarios/customer_add_bank_account/ruby.mako +0 -11
- data/scenarios/customer_add_card/request.rb +0 -3
- data/scenarios/customer_add_card/ruby.mako +0 -11
- data/scenarios/customer_capture_hold/definition.rb +0 -1
- data/scenarios/customer_capture_hold/request.rb +0 -3
- data/scenarios/customer_capture_hold/ruby.mako +0 -0
- data/scenarios/customer_create_debit/definition.rb +0 -1
- data/scenarios/customer_create_debit/request.rb +0 -3
- data/scenarios/customer_create_debit/ruby.mako +0 -11
- data/scenarios/customer_create_hold/definition.rb +0 -1
- data/scenarios/customer_create_hold/request.rb +0 -3
- data/scenarios/customer_create_hold/ruby.mako +0 -11
- data/scenarios/customer_credit/definition.rb +0 -1
- data/scenarios/customer_credit/request.rb +0 -2
- data/scenarios/customer_credit/ruby.mako +0 -8
- data/scenarios/debit_account_list/definition.rb +0 -1
- data/scenarios/debit_account_list/request.rb +0 -3
- data/scenarios/debit_account_list/ruby.mako +0 -10
- data/scenarios/debit_create/definition.rb +0 -1
- data/scenarios/debit_create/request.rb +0 -5
- data/scenarios/debit_create/ruby.mako +0 -15
- data/scenarios/debit_customer_list/definition.rb +0 -1
- data/scenarios/debit_customer_list/request.rb +0 -4
- data/scenarios/debit_customer_list/ruby.mako +0 -12
- data/scenarios/debit_refund/definition.rb +0 -1
- data/scenarios/debit_refund/request.rb +0 -3
- data/scenarios/debit_refund/ruby.mako +0 -10
- data/scenarios/delete.rb +0 -7
- data/scenarios/event_replay/definition.rb +0 -0
- data/scenarios/event_replay/request.rb +0 -1
- data/scenarios/event_replay/ruby.mako +0 -0
- data/scenarios/execute.rb +0 -27
- data/scenarios/hold_account_list/definition.rb +0 -1
- data/scenarios/hold_account_list/request.rb +0 -3
- data/scenarios/hold_account_list/ruby.mako +0 -10
- data/scenarios/hold_capture/definition.rb +0 -1
- data/scenarios/hold_capture/request.rb +0 -5
- data/scenarios/hold_capture/ruby.mako +0 -15
- data/scenarios/hold_create/definition.rb +0 -1
- data/scenarios/hold_create/request.rb +0 -5
- data/scenarios/hold_create/ruby.mako +0 -14
- data/scenarios/hold_customer_list/definition.rb +0 -1
- data/scenarios/hold_customer_list/request.rb +0 -3
- data/scenarios/hold_customer_list/ruby.mako +0 -11
- data/scenarios/hold_list/definition.rb +0 -1
- data/scenarios/hold_list/request.rb +0 -4
- data/scenarios/hold_list/ruby.mako +0 -11
- data/scenarios/hold_show/definition.rb +0 -1
- data/scenarios/hold_show/request.rb +0 -2
- data/scenarios/hold_show/ruby.mako +0 -10
- data/scenarios/hold_update/definition.rb +0 -1
- data/scenarios/hold_update/request.rb +0 -7
- data/scenarios/hold_update/ruby.mako +0 -16
- data/scenarios/hold_void/definition.rb +0 -1
- data/scenarios/hold_void/request.rb +0 -3
- data/scenarios/hold_void/ruby.mako +0 -10
- data/scenarios/refund_account_list/definition.rb +0 -1
- data/scenarios/refund_account_list/request.rb +0 -3
- data/scenarios/refund_account_list/ruby.mako +0 -10
- data/scenarios/refund_customer_list/definition.rb +0 -1
- data/scenarios/refund_customer_list/request.rb +0 -3
- data/scenarios/refund_customer_list/ruby.mako +0 -11
- data/scenarios/render.rb +0 -32
- data/scenarios/render_one.rb +0 -32
- data/spec/balanced/resources/account_spec.rb +0 -636
- data/spec/balanced/resources/hold_spec.rb +0 -48
- data/spec/balanced/resources/merchant_spec.rb +0 -6
- data/spec/scenarios_spec.rb +0 -39
- data/upload_docs.rb +0 -40
@@ -1,10 +1,67 @@
|
|
1
1
|
% if mode == 'definition':
|
2
2
|
Balanced::Customer.new
|
3
3
|
|
4
|
-
%
|
4
|
+
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
|
7
7
|
|
8
|
-
customer = Balanced::Customer.new
|
8
|
+
customer = Balanced::Customer.new(
|
9
|
+
:address => {
|
10
|
+
:postal_code => '48120'
|
11
|
+
},
|
12
|
+
:dob_month => 7,
|
13
|
+
:dob_year => 1963,
|
14
|
+
:name => 'Henry Ford'
|
15
|
+
)
|
16
|
+
customer.save
|
17
|
+
|
18
|
+
% elif mode == 'response':
|
19
|
+
#<Balanced::Customer:0x007fdc9e816a78
|
20
|
+
@attributes=
|
21
|
+
{"address"=>
|
22
|
+
{"city"=>nil,
|
23
|
+
"country_code"=>nil,
|
24
|
+
"line1"=>nil,
|
25
|
+
"line2"=>nil,
|
26
|
+
"postal_code"=>"48120",
|
27
|
+
"state"=>nil},
|
28
|
+
"business_name"=>nil,
|
29
|
+
"created_at"=>"2014-01-27T22:57:36.586782Z",
|
30
|
+
"dob_month"=>7,
|
31
|
+
"dob_year"=>1963,
|
32
|
+
"ein"=>nil,
|
33
|
+
"email"=>nil,
|
34
|
+
"href"=>"/customers/CU3eeasZ9yQ86uzzIYZkrPGg",
|
35
|
+
"id"=>"CU3eeasZ9yQ86uzzIYZkrPGg",
|
36
|
+
"links"=>{"destination"=>nil, "source"=>nil},
|
37
|
+
"merchant_status"=>"underwritten",
|
38
|
+
"meta"=>{},
|
39
|
+
"name"=>"Henry Ford",
|
40
|
+
"phone"=>nil,
|
41
|
+
"ssn_last4"=>nil,
|
42
|
+
"updated_at"=>"2014-01-27T22:57:37.740442Z"},
|
43
|
+
@hyperlinks=
|
44
|
+
{"bank_accounts"=>
|
45
|
+
#<Proc:0x007fdc9e815830/lib/balanced/utils.rb:6 (lambda)>,
|
46
|
+
"card_holds"=>
|
47
|
+
#<Proc:0x007fdc9e80e7b0/lib/balanced/utils.rb:6 (lambda)>,
|
48
|
+
"cards"=>
|
49
|
+
#<Proc:0x007fdc9e80dbd0/lib/balanced/utils.rb:6 (lambda)>,
|
50
|
+
"credits"=>
|
51
|
+
#<Proc:0x007fdc9e807820/lib/balanced/utils.rb:6 (lambda)>,
|
52
|
+
"debits"=>
|
53
|
+
#<Proc:0x007fdc9e8055c0/lib/balanced/utils.rb:6 (lambda)>,
|
54
|
+
"destination"=>
|
55
|
+
#<Proc:0x007fdc9e804bc0/lib/balanced/utils.rb:6 (lambda)>,
|
56
|
+
"orders"=>
|
57
|
+
#<Proc:0x007fdc9c34b310/lib/balanced/utils.rb:6 (lambda)>,
|
58
|
+
"refunds"=>
|
59
|
+
#<Proc:0x007fdc9c348f70/lib/balanced/utils.rb:6 (lambda)>,
|
60
|
+
"reversals"=>
|
61
|
+
#<Proc:0x007fdc9c3436d8/lib/balanced/utils.rb:6 (lambda)>,
|
62
|
+
"source"=>
|
63
|
+
#<Proc:0x007fdc9c342b20/lib/balanced/utils.rb:6 (lambda)>,
|
64
|
+
"transactions"=>
|
65
|
+
#<Proc:0x007fdc9c340758/lib/balanced/utils.rb:6 (lambda)>}>
|
9
66
|
|
10
67
|
% endif
|
@@ -1,2 +1,2 @@
|
|
1
|
-
customer = Balanced::Customer.
|
1
|
+
customer = Balanced::Customer.fetch('<%=request['uri']%>')
|
2
2
|
customer.unstore
|
@@ -1,8 +1,10 @@
|
|
1
1
|
% if mode == 'definition':
|
2
2
|
Balanced::Customer.unstore
|
3
3
|
|
4
|
-
%
|
5
|
-
customer = Balanced::Customer.
|
4
|
+
% elif mode == 'request':
|
5
|
+
customer = Balanced::Customer.fetch('/customers/CU3eeasZ9yQ86uzzIYZkrPGg')
|
6
6
|
customer.unstore
|
7
7
|
|
8
|
+
% elif mode == 'response':
|
9
|
+
|
8
10
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Customer.all
|
@@ -0,0 +1,105 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Customer.all
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
|
7
|
+
|
8
|
+
customers = Balanced::Customer.all
|
9
|
+
% elif mode == 'response':
|
10
|
+
[#<Balanced::Customer:0x007fdc9c30b530
|
11
|
+
@attributes=
|
12
|
+
{"address"=>
|
13
|
+
{"city"=>nil,
|
14
|
+
"country_code"=>nil,
|
15
|
+
"line1"=>nil,
|
16
|
+
"line2"=>nil,
|
17
|
+
"postal_code"=>"48120",
|
18
|
+
"state"=>nil},
|
19
|
+
"business_name"=>nil,
|
20
|
+
"created_at"=>"2014-01-27T22:57:27.459187Z",
|
21
|
+
"dob_month"=>7,
|
22
|
+
"dob_year"=>1963,
|
23
|
+
"ein"=>nil,
|
24
|
+
"email"=>nil,
|
25
|
+
"href"=>"/customers/CU33Y4cut21qu1d1lGYDBseQ",
|
26
|
+
"id"=>"CU33Y4cut21qu1d1lGYDBseQ",
|
27
|
+
"links"=>{"destination"=>nil, "source"=>nil},
|
28
|
+
"merchant_status"=>"underwritten",
|
29
|
+
"meta"=>{},
|
30
|
+
"name"=>"Henry Ford",
|
31
|
+
"phone"=>nil,
|
32
|
+
"ssn_last4"=>nil,
|
33
|
+
"updated_at"=>"2014-01-27T22:57:29.488272Z"},
|
34
|
+
@hyperlinks=
|
35
|
+
{"bank_accounts"=>
|
36
|
+
#<Proc:0x007fdc9c308ab0/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"card_holds"=>
|
38
|
+
#<Proc:0x007fdc9c303178/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"cards"=>
|
40
|
+
#<Proc:0x007fdc9c300d88/lib/balanced/utils.rb:6 (lambda)>,
|
41
|
+
"credits"=>
|
42
|
+
#<Proc:0x007fdc9c2fb9f0/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"debits"=>
|
44
|
+
#<Proc:0x007fdc9c2f92e0/lib/balanced/utils.rb:6 (lambda)>,
|
45
|
+
"destination"=>
|
46
|
+
#<Proc:0x007fdc9c2f8908/lib/balanced/utils.rb:6 (lambda)>,
|
47
|
+
"orders"=>
|
48
|
+
#<Proc:0x007fdc9c2f27d8/lib/balanced/utils.rb:6 (lambda)>,
|
49
|
+
"refunds"=>
|
50
|
+
#<Proc:0x007fdc9c2f0730/lib/balanced/utils.rb:6 (lambda)>,
|
51
|
+
"reversals"=>
|
52
|
+
#<Proc:0x007fdc9c2eadf8/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"source"=>
|
54
|
+
#<Proc:0x007fdc9c2ea1f0/lib/balanced/utils.rb:6 (lambda)>,
|
55
|
+
"transactions"=>
|
56
|
+
#<Proc:0x007fdc9c2e0998/lib/balanced/utils.rb:6 (lambda)>}>,
|
57
|
+
#<Balanced::Customer:0x007fdc9c2e09e8
|
58
|
+
@attributes=
|
59
|
+
{"address"=>
|
60
|
+
{"city"=>nil,
|
61
|
+
"country_code"=>nil,
|
62
|
+
"line1"=>nil,
|
63
|
+
"line2"=>nil,
|
64
|
+
"postal_code"=>"48120",
|
65
|
+
"state"=>nil},
|
66
|
+
"business_name"=>nil,
|
67
|
+
"created_at"=>"2014-01-27T22:57:12.447565Z",
|
68
|
+
"dob_month"=>7,
|
69
|
+
"dob_year"=>1963,
|
70
|
+
"ein"=>nil,
|
71
|
+
"email"=>nil,
|
72
|
+
"href"=>"/customers/CU2N5goX8AQJE0CCPeapHUsM",
|
73
|
+
"id"=>"CU2N5goX8AQJE0CCPeapHUsM",
|
74
|
+
"links"=>{"destination"=>nil, "source"=>nil},
|
75
|
+
"merchant_status"=>"underwritten",
|
76
|
+
"meta"=>{},
|
77
|
+
"name"=>"Henry Ford",
|
78
|
+
"phone"=>nil,
|
79
|
+
"ssn_last4"=>nil,
|
80
|
+
"updated_at"=>"2014-01-27T22:57:13.581358Z"},
|
81
|
+
@hyperlinks=
|
82
|
+
{"bank_accounts"=>
|
83
|
+
#<Proc:0x007fdc9c2e1dc0/lib/balanced/utils.rb:6 (lambda)>,
|
84
|
+
"card_holds"=>
|
85
|
+
#<Proc:0x007fdc9c2d9cd8/lib/balanced/utils.rb:6 (lambda)>,
|
86
|
+
"cards"=>
|
87
|
+
#<Proc:0x007fdc9c2da160/lib/balanced/utils.rb:6 (lambda)>,
|
88
|
+
"credits"=>
|
89
|
+
#<Proc:0x007fdc9c2d0cf0/lib/balanced/utils.rb:6 (lambda)>,
|
90
|
+
"debits"=>
|
91
|
+
#<Proc:0x007fdc9c2d24d8/lib/balanced/utils.rb:6 (lambda)>,
|
92
|
+
"destination"=>
|
93
|
+
#<Proc:0x007fdc9c2d1948/lib/balanced/utils.rb:6 (lambda)>,
|
94
|
+
"orders"=>
|
95
|
+
#<Proc:0x007fdc9c2caa58/lib/balanced/utils.rb:6 (lambda)>,
|
96
|
+
"refunds"=>
|
97
|
+
#<Proc:0x007fdc9c2c9fe0/lib/balanced/utils.rb:6 (lambda)>,
|
98
|
+
"reversals"=>
|
99
|
+
#<Proc:0x007fdc9c2c3aa0/lib/balanced/utils.rb:6 (lambda)>,
|
100
|
+
"source"=>
|
101
|
+
#<Proc:0x007fdc9c2c3500/lib/balanced/utils.rb:6 (lambda)>,
|
102
|
+
"transactions"=>
|
103
|
+
#<Proc:0x007fdc9c2c11b0/lib/balanced/utils.rb:6 (lambda)>}>]
|
104
|
+
|
105
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Customer.fetch
|
@@ -0,0 +1,58 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Customer.fetch
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
|
7
|
+
|
8
|
+
customer = Balanced::Customer.fetch('/customers/CU33Y4cut21qu1d1lGYDBseQ')
|
9
|
+
% elif mode == 'response':
|
10
|
+
#<Balanced::Customer:0x007fdc9c278fc8
|
11
|
+
@attributes=
|
12
|
+
{"address"=>
|
13
|
+
{"city"=>nil,
|
14
|
+
"country_code"=>nil,
|
15
|
+
"line1"=>nil,
|
16
|
+
"line2"=>nil,
|
17
|
+
"postal_code"=>"48120",
|
18
|
+
"state"=>nil},
|
19
|
+
"business_name"=>nil,
|
20
|
+
"created_at"=>"2014-01-27T22:57:27.459187Z",
|
21
|
+
"dob_month"=>7,
|
22
|
+
"dob_year"=>1963,
|
23
|
+
"ein"=>nil,
|
24
|
+
"email"=>nil,
|
25
|
+
"href"=>"/customers/CU33Y4cut21qu1d1lGYDBseQ",
|
26
|
+
"id"=>"CU33Y4cut21qu1d1lGYDBseQ",
|
27
|
+
"links"=>{"destination"=>nil, "source"=>nil},
|
28
|
+
"merchant_status"=>"underwritten",
|
29
|
+
"meta"=>{},
|
30
|
+
"name"=>"Henry Ford",
|
31
|
+
"phone"=>nil,
|
32
|
+
"ssn_last4"=>nil,
|
33
|
+
"updated_at"=>"2014-01-27T22:57:29.488272Z"},
|
34
|
+
@hyperlinks=
|
35
|
+
{"bank_accounts"=>
|
36
|
+
#<Proc:0x007fdc9c2729c0/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"card_holds"=>
|
38
|
+
#<Proc:0x007fdc9c2705d0/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"cards"=>
|
40
|
+
#<Proc:0x007fdc9c26a8d8/lib/balanced/utils.rb:6 (lambda)>,
|
41
|
+
"credits"=>
|
42
|
+
#<Proc:0x007fdc9c2687b8/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"debits"=>
|
44
|
+
#<Proc:0x007fdc9c262f70/lib/balanced/utils.rb:6 (lambda)>,
|
45
|
+
"destination"=>
|
46
|
+
#<Proc:0x007fdc9c262368/lib/balanced/utils.rb:6 (lambda)>,
|
47
|
+
"orders"=>
|
48
|
+
#<Proc:0x007fdc9c25bf90/lib/balanced/utils.rb:6 (lambda)>,
|
49
|
+
"refunds"=>
|
50
|
+
#<Proc:0x007fdc9c25a5a0/lib/balanced/utils.rb:6 (lambda)>,
|
51
|
+
"reversals"=>
|
52
|
+
#<Proc:0x007fdc9c258250/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"source"=>
|
54
|
+
#<Proc:0x007fdc9c07cbe8/lib/balanced/utils.rb:6 (lambda)>,
|
55
|
+
"transactions"=>
|
56
|
+
#<Proc:0x007fdc9c07e240/lib/balanced/utils.rb:6 (lambda)>}>
|
57
|
+
|
58
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Customer.save
|
@@ -0,0 +1,64 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Customer.save
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
|
7
|
+
|
8
|
+
customer = Balanced::Customer.fetch('/customers/CU33Y4cut21qu1d1lGYDBseQ')
|
9
|
+
customer.email = 'email@newdomain.com'
|
10
|
+
customer.meta = {
|
11
|
+
'shipping-preference' => 'ground'
|
12
|
+
}
|
13
|
+
customer.save
|
14
|
+
|
15
|
+
% elif mode == 'response':
|
16
|
+
#<Balanced::Customer:0x007fdc9d2cd360
|
17
|
+
@attributes=
|
18
|
+
{"address"=>
|
19
|
+
{"city"=>nil,
|
20
|
+
"country_code"=>nil,
|
21
|
+
"line1"=>nil,
|
22
|
+
"line2"=>nil,
|
23
|
+
"postal_code"=>"48120",
|
24
|
+
"state"=>nil},
|
25
|
+
"business_name"=>nil,
|
26
|
+
"created_at"=>"2014-01-27T22:57:27.459187Z",
|
27
|
+
"dob_month"=>7,
|
28
|
+
"dob_year"=>1963,
|
29
|
+
"ein"=>nil,
|
30
|
+
"email"=>"email@newdomain.com",
|
31
|
+
"href"=>"/customers/CU33Y4cut21qu1d1lGYDBseQ",
|
32
|
+
"id"=>"CU33Y4cut21qu1d1lGYDBseQ",
|
33
|
+
"links"=>{"destination"=>nil, "source"=>nil},
|
34
|
+
"merchant_status"=>"underwritten",
|
35
|
+
"meta"=>{"shipping-preference"=>"ground"},
|
36
|
+
"name"=>"Henry Ford",
|
37
|
+
"phone"=>nil,
|
38
|
+
"ssn_last4"=>nil,
|
39
|
+
"updated_at"=>"2014-01-27T22:57:34.512310Z"},
|
40
|
+
@hyperlinks=
|
41
|
+
{"bank_accounts"=>
|
42
|
+
#<Proc:0x007fdc9d2c74d8/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"card_holds"=>
|
44
|
+
#<Proc:0x007fdc9d2c5480/lib/balanced/utils.rb:6 (lambda)>,
|
45
|
+
"cards"=>
|
46
|
+
#<Proc:0x007fdc9d2bf260/lib/balanced/utils.rb:6 (lambda)>,
|
47
|
+
"credits"=>
|
48
|
+
#<Proc:0x007fdc9d2bd2d0/lib/balanced/utils.rb:6 (lambda)>,
|
49
|
+
"debits"=>
|
50
|
+
#<Proc:0x007fdc9d28f8f8/lib/balanced/utils.rb:6 (lambda)>,
|
51
|
+
"destination"=>
|
52
|
+
#<Proc:0x007fdc9d28ed40/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"orders"=>
|
54
|
+
#<Proc:0x007fdc9d28c978/lib/balanced/utils.rb:6 (lambda)>,
|
55
|
+
"refunds"=>
|
56
|
+
#<Proc:0x007fdc9d289ea8/lib/balanced/utils.rb:6 (lambda)>,
|
57
|
+
"reversals"=>
|
58
|
+
#<Proc:0x007fdc9d287748/lib/balanced/utils.rb:6 (lambda)>,
|
59
|
+
"source"=>
|
60
|
+
#<Proc:0x007fdc9d285740/lib/balanced/utils.rb:6 (lambda)>,
|
61
|
+
"transactions"=>
|
62
|
+
#<Proc:0x007fdc9d2b4608/lib/balanced/utils.rb:6 (lambda)>}>
|
63
|
+
|
64
|
+
% endif
|
@@ -1,11 +1,77 @@
|
|
1
1
|
% if mode == 'definition':
|
2
2
|
Balanced::Debit.all
|
3
3
|
|
4
|
-
%
|
4
|
+
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
|
7
7
|
|
8
|
-
|
8
|
+
debits = Balanced::Debit.all
|
9
|
+
% elif mode == 'response':
|
10
|
+
[#<Balanced::Debit:0x007fdc9d24a140
|
11
|
+
@attributes=
|
12
|
+
{"amount"=>5000,
|
13
|
+
"appears_on_statement_as"=>"BAL*Statement text",
|
14
|
+
"created_at"=>"2014-01-27T22:57:05.511023Z",
|
15
|
+
"currency"=>"USD",
|
16
|
+
"description"=>"Some descriptive text for the debit in the dashboard",
|
17
|
+
"failure_reason"=>nil,
|
18
|
+
"failure_reason_code"=>nil,
|
19
|
+
"href"=>"/debits/WD2Fd3jVcMZEWyXHtG3U1LRM",
|
20
|
+
"id"=>"WD2Fd3jVcMZEWyXHtG3U1LRM",
|
21
|
+
"links"=>
|
22
|
+
{"customer"=>nil,
|
23
|
+
"dispute"=>nil,
|
24
|
+
"order"=>nil,
|
25
|
+
"source"=>"CC2uc8iPDjgyxOXHVtnZloyI"},
|
26
|
+
"meta"=>{},
|
27
|
+
"status"=>"succeeded",
|
28
|
+
"transaction_number"=>"W906-153-1439",
|
29
|
+
"updated_at"=>"2014-01-27T22:57:10.153696Z"},
|
30
|
+
@hyperlinks=
|
31
|
+
{"customer"=>
|
32
|
+
#<Proc:0x007fdc9d248f70/lib/balanced/utils.rb:6 (lambda)>,
|
33
|
+
"dispute"=>
|
34
|
+
#<Proc:0x007fdc9d240410/lib/balanced/utils.rb:6 (lambda)>,
|
35
|
+
"events"=>
|
36
|
+
#<Proc:0x007fdc9d242058/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"order"=>
|
38
|
+
#<Proc:0x007fdc9d2413d8/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"refunds"=>
|
40
|
+
#<Proc:0x007fdc9d23bb68/lib/balanced/utils.rb:6 (lambda)>,
|
41
|
+
"source"=>
|
42
|
+
#<Proc:0x007fdc9d2391d8/lib/balanced/resources/resource.rb:60 (lambda)>}>,
|
43
|
+
#<Balanced::Debit:0x007fdc9d239188
|
44
|
+
@attributes=
|
45
|
+
{"amount"=>5000,
|
46
|
+
"appears_on_statement_as"=>"BAL*ShowsUpOnStmt",
|
47
|
+
"created_at"=>"2014-01-27T22:56:45.623268Z",
|
48
|
+
"currency"=>"USD",
|
49
|
+
"description"=>"Some descriptive text for the debit in the dashboard",
|
50
|
+
"failure_reason"=>nil,
|
51
|
+
"failure_reason_code"=>nil,
|
52
|
+
"href"=>"/debits/WD2iSCukjXyeRdkvX3cW0PmC",
|
53
|
+
"id"=>"WD2iSCukjXyeRdkvX3cW0PmC",
|
54
|
+
"links"=>
|
55
|
+
{"customer"=>"CU1f8Ygc4t0F2FKNcw235x9I",
|
56
|
+
"dispute"=>nil,
|
57
|
+
"order"=>nil,
|
58
|
+
"source"=>"CC2abDOQVm5aNFhHpcRvWS02"},
|
59
|
+
"meta"=>{"holding.for"=>"user1", "meaningful.key"=>"some.value"},
|
60
|
+
"status"=>"succeeded",
|
61
|
+
"transaction_number"=>"W744-719-1832",
|
62
|
+
"updated_at"=>"2014-01-27T22:56:47.926021Z"},
|
63
|
+
@hyperlinks=
|
64
|
+
{"customer"=>
|
65
|
+
#<Proc:0x007fdc9d233120/lib/balanced/resources/resource.rb:60 (lambda)>,
|
66
|
+
"dispute"=>
|
67
|
+
#<Proc:0x007fdc9d231a00/lib/balanced/utils.rb:6 (lambda)>,
|
68
|
+
"events"=>
|
69
|
+
#<Proc:0x007fdc9d22b380/lib/balanced/utils.rb:6 (lambda)>,
|
70
|
+
"order"=>
|
71
|
+
#<Proc:0x007fdc9d22a930/lib/balanced/utils.rb:6 (lambda)>,
|
72
|
+
"refunds"=>
|
73
|
+
#<Proc:0x007fdc9d222488/lib/balanced/utils.rb:6 (lambda)>,
|
74
|
+
"source"=>
|
75
|
+
#<Proc:0x007fdc9d222550/lib/balanced/resources/resource.rb:60 (lambda)>}>]
|
9
76
|
|
10
|
-
debits = Balanced::Debit.all(:limit => 2)
|
11
77
|
% endif
|