Class: Stripe::V2::Payments::SettlementAllocationIntentService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

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

#splitsObject (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

#list(params = {}, opts = {}) ⇒ Object

Lists all SettlementAllocationIntents.



38
39
40
41
42
43
44
45
46
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 38

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v2/payments/settlement_allocation_intents",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieve an existing SettlementAllocationIntent.



49
50
51
52
53
54
55
56
57
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 49

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.



60
61
62
63
64
65
66
67
68
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 60

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`.



71
72
73
74
75
76
77
78
79
# File 'lib/stripe/services/v2/payments/settlement_allocation_intent_service.rb', line 71

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