Class: MockChargebee::Models::PortalSession

Inherits:
Base
  • Object
show all
Defined in:
lib/mock_chargebee/models/portal_session.rb

Constant Summary collapse

RESOURCE_ID_PREFIX =
'portal'

Class Method Summary collapse

Methods inherited from Base

already_exists!, load_fixtures, repositories, unique_id

Class Method Details

.create(params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/mock_chargebee/models/portal_session.rb', line 10

def self.create(params)
  Validations::PortalSessions::CreateParams.validate_required(params)

  params['id'] ||= unique_id
  params['customer_id'] = params.dig(:customer, :id)
  portal_session = portal_session_fixture.merge(params)
  repositories.portal_sessions.store(portal_session['id'], portal_session)

  portal_session
end