paddle

package
v0.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package paddle provides a stub implementation of the PaymentProvider interface for Paddle. This is a placeholder for future implementation.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("paddle provider: not implemented")

ErrNotImplemented is returned when a method is not yet implemented.

Functions

This section is empty.

Types

type Config

type Config struct {
	VendorID       string `json:"vendorId"`
	VendorAuthCode string `json:"vendorAuthCode"`
	PublicKey      string `json:"publicKey"`
	WebhookSecret  string `json:"webhookSecret"`
	Sandbox        bool   `json:"sandbox"` // Use sandbox environment
}

Config holds Paddle-specific configuration.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the PaymentProvider interface for Paddle This is a stub implementation - methods return ErrNotImplemented.

func NewPaddleProvider

func NewPaddleProvider(config Config) (*Provider, error)

NewPaddleProvider creates a new Paddle provider.

func (*Provider) AttachPaymentMethod

func (p *Provider) AttachPaymentMethod(ctx context.Context, customerID, paymentMethodID string) error

AttachPaymentMethod attaches a payment method.

func (*Provider) CancelSubscription

func (p *Provider) CancelSubscription(ctx context.Context, subscriptionID string, immediately bool) error

CancelSubscription cancels a subscription in Paddle.

func (*Provider) CreateBillingPortalSession

func (p *Provider) CreateBillingPortalSession(ctx context.Context, customerID, returnURL string) (string, error)

CreateBillingPortalSession creates a customer portal session Paddle has a different approach to customer management.

func (*Provider) CreateCheckoutSession

func (p *Provider) CreateCheckoutSession(ctx context.Context, req *types.CheckoutRequest) (*types.CheckoutSession, error)

CreateCheckoutSession creates a Paddle checkout session.

func (*Provider) CreateCustomer

func (p *Provider) CreateCustomer(ctx context.Context, email, name string, metadata map[string]any) (string, error)

CreateCustomer creates a customer in Paddle Note: Paddle doesn't have explicit customer creation - customers are created on first purchase.

func (*Provider) CreatePrice

func (p *Provider) CreatePrice(ctx context.Context, plan *core.Plan) (string, error)

CreatePrice creates a price in Paddle.

func (*Provider) CreateProduct

func (p *Provider) CreateProduct(ctx context.Context, name, description string) (string, error)

CreateProduct creates a product in Paddle.

func (*Provider) CreateSetupIntent

func (p *Provider) CreateSetupIntent(ctx context.Context, customerID string) (string, string, error)

CreateSetupIntent creates a setup intent (not directly applicable to Paddle).

func (*Provider) CreateSubscription

func (p *Provider) CreateSubscription(ctx context.Context, customerID, priceID string, quantity, trialDays int, metadata map[string]any) (string, error)

CreateSubscription creates a subscription in Paddle Note: Paddle subscriptions are created via checkout.

func (*Provider) DetachPaymentMethod

func (p *Provider) DetachPaymentMethod(ctx context.Context, paymentMethodID string) error

DetachPaymentMethod detaches a payment method.

func (p *Provider) GeneratePayLink(ctx context.Context, productID string, prices map[string]float64, customerEmail string, passthrough map[string]any) (string, error)

GeneratePayLink generates a Paddle pay link for checkout.

func (*Provider) GetCustomer

func (p *Provider) GetCustomer(ctx context.Context, customerID string) (any, error)

GetCustomer retrieves a customer from Paddle.

func (*Provider) GetInvoice

func (p *Provider) GetInvoice(ctx context.Context, invoiceID string) (*types.ProviderInvoice, error)

GetInvoice retrieves an invoice from Paddle.

func (*Provider) GetProduct

func (p *Provider) GetProduct(ctx context.Context, productID string) (*types.ProviderProduct, error)

GetProduct retrieves a single product from Paddle.

func (*Provider) GetSubscription

func (p *Provider) GetSubscription(ctx context.Context, subscriptionID string) (*types.ProviderSubscription, error)

GetSubscription retrieves a subscription from Paddle.

func (*Provider) GetSubscriptionPayments

func (p *Provider) GetSubscriptionPayments(ctx context.Context, subscriptionID string) ([]any, error)

GetSubscriptionPayments retrieves payments for a subscription.

func (*Provider) GetSubscriptionUsers

func (p *Provider) GetSubscriptionUsers(ctx context.Context, subscriptionID string) ([]any, error)

GetSubscriptionUsers lists users for a subscription.

func (*Provider) HandleWebhook

func (p *Provider) HandleWebhook(ctx context.Context, payload []byte, signature string) (*types.WebhookEvent, error)

HandleWebhook handles a Paddle webhook.

func (*Provider) ListInvoices

func (p *Provider) ListInvoices(ctx context.Context, customerID string, limit int) ([]*types.ProviderInvoice, error)

ListInvoices lists invoices for a customer.

func (*Provider) ListPaymentMethods

func (p *Provider) ListPaymentMethods(ctx context.Context, customerID string) ([]any, error)

ListPaymentMethods lists payment methods for a customer.

func (*Provider) ListPrices

func (p *Provider) ListPrices(ctx context.Context, productID string) ([]*types.ProviderPrice, error)

ListPrices lists all prices for a product from Paddle.

func (*Provider) ListProducts

func (p *Provider) ListProducts(ctx context.Context) ([]*types.ProviderProduct, error)

ListProducts lists all products from Paddle.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) PauseSubscription

func (p *Provider) PauseSubscription(ctx context.Context, subscriptionID string) error

PauseSubscription pauses a subscription in Paddle.

func (*Provider) ReportUsage

func (p *Provider) ReportUsage(ctx context.Context, subscriptionID, metricKey string, quantity int64, timestamp time.Time, idempotencyKey string) error

ReportUsage reports usage to Paddle.

func (*Provider) ResumeSubscription

func (p *Provider) ResumeSubscription(ctx context.Context, subscriptionID string) error

ResumeSubscription resumes a subscription in Paddle.

func (*Provider) SetDefaultPaymentMethod

func (p *Provider) SetDefaultPaymentMethod(ctx context.Context, customerID, paymentMethodID string) error

SetDefaultPaymentMethod sets the default payment method.

func (*Provider) UpdateCustomer

func (p *Provider) UpdateCustomer(ctx context.Context, customerID string, updates map[string]any) error

UpdateCustomer updates a customer in Paddle.

func (*Provider) UpdatePrice

func (p *Provider) UpdatePrice(ctx context.Context, priceID string, updates map[string]any) error

UpdatePrice updates a price in Paddle.

func (*Provider) UpdateSubscription

func (p *Provider) UpdateSubscription(ctx context.Context, subscriptionID string, updates map[string]any) error

UpdateSubscription updates a subscription in Paddle.

func (*Provider) UpdateSubscriptionQuantity

func (p *Provider) UpdateSubscriptionQuantity(ctx context.Context, subscriptionID string, quantity int) error

UpdateSubscriptionQuantity updates the quantity of a subscription.

func (*Provider) VerifyWebhookSignature

func (p *Provider) VerifyWebhookSignature(payload []byte, signature string) bool

VerifyWebhookSignature verifies a Paddle webhook signature.

func (*Provider) VoidInvoice

func (p *Provider) VoidInvoice(ctx context.Context, invoiceID string) error

VoidInvoice voids an invoice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL