Class: BetterAuth::Stripe::ClientAdapter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ ClientAdapter

Returns a new instance of ClientAdapter.



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

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)
  @webhooks = WebhooksAdapter.new
end

Instance Attribute Details

#billing_portalObject (readonly)

Returns the value of attribute billing_portal.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def billing_portal
  @billing_portal
end

#checkoutObject (readonly)

Returns the value of attribute checkout.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def checkout
  @checkout
end

#customersObject (readonly)

Returns the value of attribute customers.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def customers
  @customers
end

#pricesObject (readonly)

Returns the value of attribute prices.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def prices
  @prices
end

#subscriptionsObject (readonly)

Returns the value of attribute subscriptions.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def subscriptions
  @subscriptions
end

#webhooksObject (readonly)

Returns the value of attribute webhooks.



9
10
11
# File 'lib/better_auth/plugins/stripe.rb', line 9

def webhooks
  @webhooks
end