Class: Stripe::V2::Billing::IntentService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/v2/billing/intent_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ IntentService

Returns a new instance of IntentService.



10
11
12
13
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 10

def initialize(requestor)
  super
  @actions = Stripe::V2::Billing::Intents::ActionService.new(@requestor)
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



8
9
10
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 8

def actions
  @actions
end

Instance Method Details

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

Cancel a Billing Intent.



16
17
18
19
20
21
22
23
24
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 16

def cancel(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/billing/intents/%<id>s/cancel", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Commit a Billing Intent.



27
28
29
30
31
32
33
34
35
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 27

def commit(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/billing/intents/%<id>s/commit", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Create a Billing Intent.



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 38

def create(params = {}, opts = {})
  params = V2::Billing::IntentCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

  request(
    method: :post,
    path: "/v2/billing/intents",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

List Billing Intents.



51
52
53
54
55
56
57
58
59
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 51

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

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

Release a Billing Intent.



62
63
64
65
66
67
68
69
70
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 62

def release_reservation(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/billing/intents/%<id>s/release_reservation", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Reserve a Billing Intent.



73
74
75
76
77
78
79
80
81
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 73

def reserve(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/billing/intents/%<id>s/reserve", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Retrieve a Billing Intent.



84
85
86
87
88
89
90
91
92
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 84

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v2/billing/intents/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end