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

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

Defined Under Namespace

Classes: CancelParams, CommitParams, CreateParams, ListParams, ReleaseReservationParams, ReserveParams, RetrieveParams

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.



387
388
389
390
391
392
393
394
395
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 387

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.



398
399
400
401
402
403
404
405
406
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 398

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.



409
410
411
412
413
414
415
416
417
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 409

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.



420
421
422
423
424
425
426
427
428
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 420

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.



431
432
433
434
435
436
437
438
439
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 431

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.



442
443
444
445
446
447
448
449
450
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 442

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.



453
454
455
456
457
458
459
460
461
# File 'lib/stripe/services/v2/billing/intent_service.rb', line 453

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