Class: BetterAuth::Stripe::ClientAdapter
- Inherits:
-
Object
- Object
- BetterAuth::Stripe::ClientAdapter
- Defined in:
- lib/better_auth/plugins/stripe.rb
Instance Attribute Summary collapse
-
#billing_portal ⇒ Object
readonly
Returns the value of attribute billing_portal.
-
#checkout ⇒ Object
readonly
Returns the value of attribute checkout.
-
#customers ⇒ Object
readonly
Returns the value of attribute customers.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#subscriptions ⇒ Object
readonly
Returns the value of attribute subscriptions.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
Instance Method Summary collapse
-
#initialize(api_key) ⇒ ClientAdapter
constructor
A new instance of ClientAdapter.
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_portal ⇒ Object (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 |
#checkout ⇒ Object (readonly)
Returns the value of attribute checkout.
9 10 11 |
# File 'lib/better_auth/plugins/stripe.rb', line 9 def checkout @checkout end |
#customers ⇒ Object (readonly)
Returns the value of attribute customers.
9 10 11 |
# File 'lib/better_auth/plugins/stripe.rb', line 9 def customers @customers end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
9 10 11 |
# File 'lib/better_auth/plugins/stripe.rb', line 9 def prices @prices end |
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
9 10 11 |
# File 'lib/better_auth/plugins/stripe.rb', line 9 def subscriptions @subscriptions end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
9 10 11 |
# File 'lib/better_auth/plugins/stripe.rb', line 9 def webhooks @webhooks end |