Documentation ¶
Index ¶
- type Client
- func (c *Client) GetSubscriptions(customerId string) SubscriptionIter
- func (c *Client) NewBillingPortalSession(customerId, accountSlug string) (*stripe.BillingPortalSession, error)
- func (c *Client) NewCheckoutSession(customerId, accountSlug, userId string, logger *slog.Logger) (*stripe.CheckoutSession, error)
- func (c *Client) NewCustomer(req *CustomerRequest) (*stripe.Customer, error)
- func (c *Client) NewMeterEvent(req *MeterEventRequest) (*stripe.BillingMeterEvent, error)
- type Config
- type CustomerRequest
- type Interface
- type MeterEventRequest
- type MockInterface
- func (_m *MockInterface) EXPECT() *MockInterface_Expecter
- func (_m *MockInterface) GetSubscriptions(customerId string) SubscriptionIter
- func (_m *MockInterface) NewBillingPortalSession(customerId string, accountSlug string) (*stripe.BillingPortalSession, error)
- func (_m *MockInterface) NewCheckoutSession(customerId string, accountSlug string, userId string, logger *slog.Logger) (*stripe.CheckoutSession, error)
- func (_m *MockInterface) NewCustomer(req *CustomerRequest) (*stripe.Customer, error)
- func (_m *MockInterface) NewMeterEvent(req *MeterEventRequest) (*stripe.BillingMeterEvent, error)
- type MockInterface_Expecter
- func (_e *MockInterface_Expecter) GetSubscriptions(customerId interface{}) *MockInterface_GetSubscriptions_Call
- func (_e *MockInterface_Expecter) NewBillingPortalSession(customerId interface{}, accountSlug interface{}) *MockInterface_NewBillingPortalSession_Call
- func (_e *MockInterface_Expecter) NewCheckoutSession(customerId interface{}, accountSlug interface{}, userId interface{}, ...) *MockInterface_NewCheckoutSession_Call
- func (_e *MockInterface_Expecter) NewCustomer(req interface{}) *MockInterface_NewCustomer_Call
- func (_e *MockInterface_Expecter) NewMeterEvent(req interface{}) *MockInterface_NewMeterEvent_Call
- type MockInterface_GetSubscriptions_Call
- func (_c *MockInterface_GetSubscriptions_Call) Return(_a0 SubscriptionIter) *MockInterface_GetSubscriptions_Call
- func (_c *MockInterface_GetSubscriptions_Call) Run(run func(customerId string)) *MockInterface_GetSubscriptions_Call
- func (_c *MockInterface_GetSubscriptions_Call) RunAndReturn(run func(string) SubscriptionIter) *MockInterface_GetSubscriptions_Call
- type MockInterface_NewBillingPortalSession_Call
- func (_c *MockInterface_NewBillingPortalSession_Call) Return(_a0 *stripe.BillingPortalSession, _a1 error) *MockInterface_NewBillingPortalSession_Call
- func (_c *MockInterface_NewBillingPortalSession_Call) Run(run func(customerId string, accountSlug string)) *MockInterface_NewBillingPortalSession_Call
- func (_c *MockInterface_NewBillingPortalSession_Call) RunAndReturn(run func(string, string) (*stripe.BillingPortalSession, error)) *MockInterface_NewBillingPortalSession_Call
- type MockInterface_NewCheckoutSession_Call
- func (_c *MockInterface_NewCheckoutSession_Call) Return(_a0 *stripe.CheckoutSession, _a1 error) *MockInterface_NewCheckoutSession_Call
- func (_c *MockInterface_NewCheckoutSession_Call) Run(...) *MockInterface_NewCheckoutSession_Call
- func (_c *MockInterface_NewCheckoutSession_Call) RunAndReturn(...) *MockInterface_NewCheckoutSession_Call
- type MockInterface_NewCustomer_Call
- func (_c *MockInterface_NewCustomer_Call) Return(_a0 *stripe.Customer, _a1 error) *MockInterface_NewCustomer_Call
- func (_c *MockInterface_NewCustomer_Call) Run(run func(req *CustomerRequest)) *MockInterface_NewCustomer_Call
- func (_c *MockInterface_NewCustomer_Call) RunAndReturn(run func(*CustomerRequest) (*stripe.Customer, error)) *MockInterface_NewCustomer_Call
- type MockInterface_NewMeterEvent_Call
- func (_c *MockInterface_NewMeterEvent_Call) Return(_a0 *stripe.BillingMeterEvent, _a1 error) *MockInterface_NewMeterEvent_Call
- func (_c *MockInterface_NewMeterEvent_Call) Run(run func(req *MeterEventRequest)) *MockInterface_NewMeterEvent_Call
- func (_c *MockInterface_NewMeterEvent_Call) RunAndReturn(run func(*MeterEventRequest) (*stripe.BillingMeterEvent, error)) *MockInterface_NewMeterEvent_Call
- type PriceQuantity
- type SubscriptionIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetSubscriptions ¶
func (c *Client) GetSubscriptions(customerId string) SubscriptionIter
func (*Client) NewBillingPortalSession ¶
func (*Client) NewCheckoutSession ¶
func (*Client) NewCustomer ¶
func (c *Client) NewCustomer(req *CustomerRequest) (*stripe.Customer, error)
func (*Client) NewMeterEvent ¶ added in v0.4.71
func (c *Client) NewMeterEvent(req *MeterEventRequest) (*stripe.BillingMeterEvent, error)
type Config ¶
type Config struct { AppBaseUrl string PriceLookups PriceQuantity }
type CustomerRequest ¶
type Interface ¶
type Interface interface { NewCustomer(req *CustomerRequest) (*stripe.Customer, error) NewBillingPortalSession(customerId, accountSlug string) (*stripe.BillingPortalSession, error) NewCheckoutSession(customerId, accountSlug, userId string, logger *slog.Logger) (*stripe.CheckoutSession, error) GetSubscriptions(customerId string) SubscriptionIter NewMeterEvent(req *MeterEventRequest) (*stripe.BillingMeterEvent, error) }
type MeterEventRequest ¶ added in v0.4.71
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t interface { mock.TestingT Cleanup(func()) }) *MockInterface
NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockInterface) EXPECT ¶
func (_m *MockInterface) EXPECT() *MockInterface_Expecter
func (*MockInterface) GetSubscriptions ¶
func (_m *MockInterface) GetSubscriptions(customerId string) SubscriptionIter
GetSubscriptions provides a mock function with given fields: customerId
func (*MockInterface) NewBillingPortalSession ¶
func (_m *MockInterface) NewBillingPortalSession(customerId string, accountSlug string) (*stripe.BillingPortalSession, error)
NewBillingPortalSession provides a mock function with given fields: customerId, accountSlug
func (*MockInterface) NewCheckoutSession ¶
func (_m *MockInterface) NewCheckoutSession(customerId string, accountSlug string, userId string, logger *slog.Logger) (*stripe.CheckoutSession, error)
NewCheckoutSession provides a mock function with given fields: customerId, accountSlug, userId, logger
func (*MockInterface) NewCustomer ¶
func (_m *MockInterface) NewCustomer(req *CustomerRequest) (*stripe.Customer, error)
NewCustomer provides a mock function with given fields: req
func (*MockInterface) NewMeterEvent ¶ added in v0.4.71
func (_m *MockInterface) NewMeterEvent(req *MeterEventRequest) (*stripe.BillingMeterEvent, error)
NewMeterEvent provides a mock function with given fields: req
type MockInterface_Expecter ¶
type MockInterface_Expecter struct {
// contains filtered or unexported fields
}
func (*MockInterface_Expecter) GetSubscriptions ¶
func (_e *MockInterface_Expecter) GetSubscriptions(customerId interface{}) *MockInterface_GetSubscriptions_Call
GetSubscriptions is a helper method to define mock.On call
- customerId string
func (*MockInterface_Expecter) NewBillingPortalSession ¶
func (_e *MockInterface_Expecter) NewBillingPortalSession(customerId interface{}, accountSlug interface{}) *MockInterface_NewBillingPortalSession_Call
NewBillingPortalSession is a helper method to define mock.On call
- customerId string
- accountSlug string
func (*MockInterface_Expecter) NewCheckoutSession ¶
func (_e *MockInterface_Expecter) NewCheckoutSession(customerId interface{}, accountSlug interface{}, userId interface{}, logger interface{}) *MockInterface_NewCheckoutSession_Call
NewCheckoutSession is a helper method to define mock.On call
- customerId string
- accountSlug string
- userId string
- logger *slog.Logger
func (*MockInterface_Expecter) NewCustomer ¶
func (_e *MockInterface_Expecter) NewCustomer(req interface{}) *MockInterface_NewCustomer_Call
NewCustomer is a helper method to define mock.On call
- req *CustomerRequest
func (*MockInterface_Expecter) NewMeterEvent ¶ added in v0.4.71
func (_e *MockInterface_Expecter) NewMeterEvent(req interface{}) *MockInterface_NewMeterEvent_Call
NewMeterEvent is a helper method to define mock.On call
- req *MeterEventRequest
type MockInterface_GetSubscriptions_Call ¶
MockInterface_GetSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriptions'
func (*MockInterface_GetSubscriptions_Call) Return ¶
func (_c *MockInterface_GetSubscriptions_Call) Return(_a0 SubscriptionIter) *MockInterface_GetSubscriptions_Call
func (*MockInterface_GetSubscriptions_Call) Run ¶
func (_c *MockInterface_GetSubscriptions_Call) Run(run func(customerId string)) *MockInterface_GetSubscriptions_Call
func (*MockInterface_GetSubscriptions_Call) RunAndReturn ¶
func (_c *MockInterface_GetSubscriptions_Call) RunAndReturn(run func(string) SubscriptionIter) *MockInterface_GetSubscriptions_Call
type MockInterface_NewBillingPortalSession_Call ¶
MockInterface_NewBillingPortalSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBillingPortalSession'
func (*MockInterface_NewBillingPortalSession_Call) Return ¶
func (_c *MockInterface_NewBillingPortalSession_Call) Return(_a0 *stripe.BillingPortalSession, _a1 error) *MockInterface_NewBillingPortalSession_Call
func (*MockInterface_NewBillingPortalSession_Call) Run ¶
func (_c *MockInterface_NewBillingPortalSession_Call) Run(run func(customerId string, accountSlug string)) *MockInterface_NewBillingPortalSession_Call
func (*MockInterface_NewBillingPortalSession_Call) RunAndReturn ¶
func (_c *MockInterface_NewBillingPortalSession_Call) RunAndReturn(run func(string, string) (*stripe.BillingPortalSession, error)) *MockInterface_NewBillingPortalSession_Call
type MockInterface_NewCheckoutSession_Call ¶
MockInterface_NewCheckoutSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCheckoutSession'
func (*MockInterface_NewCheckoutSession_Call) Return ¶
func (_c *MockInterface_NewCheckoutSession_Call) Return(_a0 *stripe.CheckoutSession, _a1 error) *MockInterface_NewCheckoutSession_Call
func (*MockInterface_NewCheckoutSession_Call) Run ¶
func (_c *MockInterface_NewCheckoutSession_Call) Run(run func(customerId string, accountSlug string, userId string, logger *slog.Logger)) *MockInterface_NewCheckoutSession_Call
func (*MockInterface_NewCheckoutSession_Call) RunAndReturn ¶
func (_c *MockInterface_NewCheckoutSession_Call) RunAndReturn(run func(string, string, string, *slog.Logger) (*stripe.CheckoutSession, error)) *MockInterface_NewCheckoutSession_Call
type MockInterface_NewCustomer_Call ¶
MockInterface_NewCustomer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCustomer'
func (*MockInterface_NewCustomer_Call) Return ¶
func (_c *MockInterface_NewCustomer_Call) Return(_a0 *stripe.Customer, _a1 error) *MockInterface_NewCustomer_Call
func (*MockInterface_NewCustomer_Call) Run ¶
func (_c *MockInterface_NewCustomer_Call) Run(run func(req *CustomerRequest)) *MockInterface_NewCustomer_Call
func (*MockInterface_NewCustomer_Call) RunAndReturn ¶
func (_c *MockInterface_NewCustomer_Call) RunAndReturn(run func(*CustomerRequest) (*stripe.Customer, error)) *MockInterface_NewCustomer_Call
type MockInterface_NewMeterEvent_Call ¶ added in v0.4.71
MockInterface_NewMeterEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewMeterEvent'
func (*MockInterface_NewMeterEvent_Call) Return ¶ added in v0.4.71
func (_c *MockInterface_NewMeterEvent_Call) Return(_a0 *stripe.BillingMeterEvent, _a1 error) *MockInterface_NewMeterEvent_Call
func (*MockInterface_NewMeterEvent_Call) Run ¶ added in v0.4.71
func (_c *MockInterface_NewMeterEvent_Call) Run(run func(req *MeterEventRequest)) *MockInterface_NewMeterEvent_Call
func (*MockInterface_NewMeterEvent_Call) RunAndReturn ¶ added in v0.4.71
func (_c *MockInterface_NewMeterEvent_Call) RunAndReturn(run func(*MeterEventRequest) (*stripe.BillingMeterEvent, error)) *MockInterface_NewMeterEvent_Call