Class: Stripe::V2::Billing::IntentService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::V2::Billing::IntentService
- Defined in:
- lib/stripe/services/v2/billing/intent_service.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
Instance Method Summary collapse
-
#cancel(id, params = {}, opts = {}) ⇒ Object
Cancel a Billing Intent.
-
#commit(id, params = {}, opts = {}) ⇒ Object
Commit a Billing Intent.
-
#create(params = {}, opts = {}) ⇒ Object
Create a Billing Intent.
-
#initialize(requestor) ⇒ IntentService
constructor
A new instance of IntentService.
-
#list(params = {}, opts = {}) ⇒ Object
List Billing Intents.
-
#release_reservation(id, params = {}, opts = {}) ⇒ Object
Release a Billing Intent.
-
#reserve(id, params = {}, opts = {}) ⇒ Object
Reserve a Billing Intent.
-
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieve a Billing Intent.
Methods inherited from StripeService
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
#actions ⇒ Object (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 49 50 |
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 38 def create(params = {}, opts = {}) unless params.is_a?(Stripe::RequestParams) params = ::Stripe::V2::Billing::IntentCreateParams.coerce_params(params) end request( method: :post, path: "/v2/billing/intents", params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
List Billing Intents.
53 54 55 56 57 58 59 60 61 |
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 53 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.
64 65 66 67 68 69 70 71 72 |
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 64 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.
75 76 77 78 79 80 81 82 83 |
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 75 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.
86 87 88 89 90 91 92 93 94 |
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 86 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 |