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
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 38

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

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

List Billing Intents.



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

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.



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

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.



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

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.



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

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