Class: Stripe::V2::Payments::SettlementAllocationIntentService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::V2::Payments::SettlementAllocationIntentService
- Defined in:
- lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb
Instance Attribute Summary collapse
-
#splits ⇒ Object
readonly
Returns the value of attribute splits.
Instance Method Summary collapse
-
#cancel(id, params = {}, opts = {}) ⇒ Object
Cancels an existing SettlementAllocationIntent.
-
#create(params = {}, opts = {}) ⇒ Object
Create a new SettlementAllocationIntent.
-
#initialize(requestor) ⇒ SettlementAllocationIntentService
constructor
A new instance of SettlementAllocationIntentService.
-
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieve an existing SettlementAllocationIntent.
-
#submit(id, params = {}, opts = {}) ⇒ Object
Submits a SettlementAllocationIntent.
-
#update(id, params = {}, opts = {}) ⇒ Object
Updates SettlementAllocationIntent.
Methods inherited from StripeService
Constructor Details
#initialize(requestor) ⇒ SettlementAllocationIntentService
Returns a new instance of SettlementAllocationIntentService.
10 11 12 13 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 10 def initialize(requestor) super @splits = Stripe::V2::Payments::SettlementAllocationIntents::SplitService.new(@requestor) end |
Instance Attribute Details
#splits ⇒ Object (readonly)
Returns the value of attribute splits.
8 9 10 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 8 def splits @splits end |
Instance Method Details
#cancel(id, params = {}, opts = {}) ⇒ Object
Cancels an existing SettlementAllocationIntent. Only SettlementAllocationIntent with status ‘pending`, `submitted` and `errored` can be `canceled`.
16 17 18 19 20 21 22 23 24 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 16 def cancel(id, params = {}, opts = {}) request( method: :post, path: format("/v2/payments/settlement_allocation_intents/%<id>s/cancel", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |
#create(params = {}, opts = {}) ⇒ Object
Create a new SettlementAllocationIntent.
27 28 29 30 31 32 33 34 35 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 27 def create(params = {}, opts = {}) request( method: :post, path: "/v2/payments/settlement_allocation_intents", params: params, opts: opts, base_address: :api ) end |
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieve an existing SettlementAllocationIntent.
38 39 40 41 42 43 44 45 46 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 38 def retrieve(id, params = {}, opts = {}) request( method: :get, path: format("/v2/payments/settlement_allocation_intents/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |
#submit(id, params = {}, opts = {}) ⇒ Object
Submits a SettlementAllocationIntent. Only SettlementAllocationIntent with status ‘pending` can be `submitted`. The net sum of SettlementAllocationIntentSplit amount must be equal to SettlementAllocationIntent amount to be eligible to be submitted.
49 50 51 52 53 54 55 56 57 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 49 def submit(id, params = {}, opts = {}) request( method: :post, path: format("/v2/payments/settlement_allocation_intents/%<id>s/submit", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |
#update(id, params = {}, opts = {}) ⇒ Object
Updates SettlementAllocationIntent. Only SettlementAllocationIntent with status ‘pending`, `submitted` and `errored` can be updated. Only amount and reference fields can be updated for a SettlementAllocationIntent and at least one must be present. Updating an `amount` moves the SettlementAllocationIntent `pending` status and updating the `reference` for `errored` SettlementAllocationIntent moves it to `submitted`.
60 61 62 63 64 65 66 67 68 |
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 60 def update(id, params = {}, opts = {}) request( method: :post, path: format("/v2/payments/settlement_allocation_intents/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |