Documentation
¶
Overview ¶
Package mock provides a mock payment provider for testing.
Index ¶
- type Provider
- func (p *Provider) AttachPaymentMethod(ctx context.Context, customerID, paymentMethodID string) error
- func (p *Provider) CancelSubscription(ctx context.Context, subscriptionID string, immediate bool) error
- func (p *Provider) CreateCheckoutSession(ctx context.Context, req *types.CheckoutRequest) (*types.CheckoutSession, error)
- func (p *Provider) CreateCustomer(ctx context.Context, email, name string, metadata map[string]interface{}) (string, error)
- func (p *Provider) CreatePortalSession(ctx context.Context, customerID, returnURL string) (string, error)
- func (p *Provider) CreateSetupIntent(ctx context.Context, customerID string) (*core.SetupIntentResult, error)
- func (p *Provider) CreateSubscription(ctx context.Context, customerID, priceID string, quantity, trialDays int, ...) (string, error)
- func (p *Provider) DeleteCustomer(ctx context.Context, customerID string) error
- func (p *Provider) DetachPaymentMethod(ctx context.Context, paymentMethodID string) error
- func (p *Provider) GetInvoice(ctx context.Context, invoiceID string) (*types.ProviderInvoice, error)
- func (p *Provider) GetInvoicePDF(ctx context.Context, invoiceID string) (string, error)
- func (p *Provider) GetPaymentMethod(ctx context.Context, paymentMethodID string) (*core.PaymentMethod, error)
- func (p *Provider) GetProduct(ctx context.Context, productID string) (*types.ProviderProduct, error)
- func (p *Provider) GetSubscription(ctx context.Context, subscriptionID string) (*types.ProviderSubscription, error)
- func (p *Provider) HandleWebhook(ctx context.Context, payload []byte, signature string) (*types.WebhookEvent, error)
- func (p *Provider) ListPrices(ctx context.Context, productID string) ([]*types.ProviderPrice, error)
- func (p *Provider) ListProducts(ctx context.Context) ([]*types.ProviderProduct, error)
- func (p *Provider) Name() string
- func (p *Provider) PauseSubscription(ctx context.Context, subscriptionID string) error
- func (p *Provider) ReportUsage(ctx context.Context, subscriptionItemID string, records []*core.UsageRecord) (string, error)
- func (p *Provider) ResumeSubscription(ctx context.Context, subscriptionID string) error
- func (p *Provider) SetDefaultPaymentMethod(ctx context.Context, customerID, paymentMethodID string) error
- func (p *Provider) SyncAddOn(ctx context.Context, addon *core.AddOn) error
- func (p *Provider) SyncPlan(ctx context.Context, plan *core.Plan) error
- func (p *Provider) UpdateCustomer(ctx context.Context, customerID, email, name string, ...) error
- func (p *Provider) UpdateSubscription(ctx context.Context, subscriptionID, priceID string, quantity int) error
- func (p *Provider) VoidInvoice(ctx context.Context, invoiceID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements a mock payment provider for testing
func (*Provider) AttachPaymentMethod ¶
func (*Provider) CancelSubscription ¶
func (*Provider) CreateCheckoutSession ¶
func (p *Provider) CreateCheckoutSession(ctx context.Context, req *types.CheckoutRequest) (*types.CheckoutSession, error)
func (*Provider) CreateCustomer ¶
func (*Provider) CreatePortalSession ¶
func (*Provider) CreateSetupIntent ¶
func (*Provider) CreateSubscription ¶
func (*Provider) DeleteCustomer ¶
func (*Provider) DetachPaymentMethod ¶
func (*Provider) GetInvoice ¶
func (*Provider) GetInvoicePDF ¶
func (*Provider) GetPaymentMethod ¶
func (*Provider) GetProduct ¶
func (*Provider) GetSubscription ¶
func (*Provider) HandleWebhook ¶
func (*Provider) ListPrices ¶
func (*Provider) ListProducts ¶
func (*Provider) PauseSubscription ¶
func (*Provider) ReportUsage ¶
func (*Provider) ResumeSubscription ¶
func (*Provider) SetDefaultPaymentMethod ¶
func (*Provider) UpdateCustomer ¶
func (*Provider) UpdateSubscription ¶
Click to show internal directories.
Click to hide internal directories.