Class: Stripe::CustomerCashBalanceService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::CustomerCashBalanceService
- Defined in:
- lib/stripe/services/customer_cash_balance_service.rb
Instance Method Summary collapse
-
#retrieve(customer, params = {}, opts = {}) ⇒ Object
Retrieves a customer’s cash balance.
-
#serialize_batch_update(customer, params = {}, opts = {}) ⇒ Object
Serializes a CustomerCashBalance update request into a batch job JSONL line.
-
#update(customer, params = {}, opts = {}) ⇒ Object
Changes the settings on a customer’s cash balance.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#retrieve(customer, params = {}, opts = {}) ⇒ Object
Retrieves a customer’s cash balance.
7 8 9 10 11 12 13 14 15 |
# File 'lib/stripe/services/customer_cash_balance_service.rb', line 7 def retrieve(customer, params = {}, opts = {}) request( method: :get, path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }), params: params, opts: opts, base_address: :api ) end |
#serialize_batch_update(customer, params = {}, opts = {}) ⇒ Object
Serializes a CustomerCashBalance update request into a batch job JSONL line.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stripe/services/customer_cash_balance_service.rb', line 18 def serialize_batch_update(customer, params = {}, opts = {}) request_id = SecureRandom.uuid stripe_version = opts[:stripe_version] || Stripe.api_version request_body = { id: request_id, params: params, stripe_version: stripe_version, } request_body[:path_params] = { customer: customer } request_body[:context] = opts[:stripe_context] if opts[:stripe_context] JSON.generate(request_body) end |
#update(customer, params = {}, opts = {}) ⇒ Object
Changes the settings on a customer’s cash balance.
33 34 35 36 37 38 39 40 41 |
# File 'lib/stripe/services/customer_cash_balance_service.rb', line 33 def update(customer, params = {}, opts = {}) request( method: :post, path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }), params: params, opts: opts, base_address: :api ) end |