Class: Dodopayments::Resources::Customers::CustomerPortal

Inherits:
Object
  • Object
show all
Defined in:
lib/dodopayments/resources/customers/customer_portal.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CustomerPortal

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CustomerPortal.

Parameters:



32
33
34
# File 'lib/dodopayments/resources/customers/customer_portal.rb', line 32

def initialize(client:)
  @client = client
end

Instance Method Details

#create(customer_id, send_email: nil, request_options: {}) ⇒ Dodopayments::Models::CustomerPortalSession

Parameters:

  • customer_id (String)

    Customer Id

  • send_email (Boolean)

    If true, will send link to user.

  • request_options (Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



18
19
20
21
22
23
24
25
26
27
# File 'lib/dodopayments/resources/customers/customer_portal.rb', line 18

def create(customer_id, params = {})
  parsed, options = Dodopayments::Customers::CustomerPortalCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["customers/%1$s/customer-portal/session", customer_id],
    query: parsed,
    model: Dodopayments::CustomerPortalSession,
    options: options
  )
end