Class: BetterAuth::Stripe::ClientAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/better_auth/stripe/client_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ ClientAdapter

Returns a new instance of ClientAdapter.



10
11
12
13
14
15
16
17
18
19
# File 'lib/better_auth/stripe/client_adapter.rb', line 10

def initialize(api_key)
  client = ::Stripe::StripeClient.new(api_key)
  @customers = ResourceAdapter.new(client.v1.customers)
  @checkout = NamespaceAdapter.new(sessions: ResourceAdapter.new(client.v1.checkout.sessions))
  @billing_portal = NamespaceAdapter.new(sessions: ResourceAdapter.new(client.v1.billing_portal.sessions))
  @subscriptions = ResourceAdapter.new(client.v1.subscriptions)
  @prices = ResourceAdapter.new(client.v1.prices)
  @subscription_schedules = ResourceAdapter.new(client.v1.subscription_schedules)
  @webhooks = WebhooksAdapter.new
end

Instance Attribute Details

#billing_portalObject (readonly)

Returns the value of attribute billing_portal.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def billing_portal
  @billing_portal
end

#checkoutObject (readonly)

Returns the value of attribute checkout.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def checkout
  @checkout
end

#customersObject (readonly)

Returns the value of attribute customers.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def customers
  @customers
end

#pricesObject (readonly)

Returns the value of attribute prices.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def prices
  @prices
end

#subscription_schedulesObject (readonly)

Returns the value of attribute subscription_schedules.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def subscription_schedules
  @subscription_schedules
end

#subscriptionsObject (readonly)

Returns the value of attribute subscriptions.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def subscriptions
  @subscriptions
end

#webhooksObject (readonly)

Returns the value of attribute webhooks.



8
9
10
# File 'lib/better_auth/stripe/client_adapter.rb', line 8

def webhooks
  @webhooks
end