appstripeentity

package
v1.0.0-beta.191 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIKeySecretKey  = "stripe_api_key"
	WebhookSecretKey = "stripe_webhook_secret"
)

Variables

View Source
var (
	StripeMarketplaceListing = app.MarketplaceListing{
		Type:        app.AppTypeStripe,
		Name:        "Stripe",
		Description: "Send invoices, calculate tax and collect payments.",
		Capabilities: []app.Capability{
			StripeCollectPaymentCapability,
			StripeCalculateTaxCapability,
			StripeInvoiceCustomerCapability,
		},
	}

	StripeCollectPaymentCapability = app.Capability{
		Type:        app.CapabilityTypeCollectPayments,
		Key:         "stripe_collect_payment",
		Name:        "Payment",
		Description: "Process payments",
	}

	StripeCalculateTaxCapability = app.Capability{
		Type:        app.CapabilityTypeCalculateTax,
		Key:         "stripe_calculate_tax",
		Name:        "Calculate Tax",
		Description: "Calculate tax for a payment",
	}

	StripeInvoiceCustomerCapability = app.Capability{
		Type:        app.CapabilityTypeInvoiceCustomers,
		Key:         "stripe_invoice_customer",
		Name:        "Invoice Customer",
		Description: "Invoice a customer",
	}
)

Functions

This section is empty.

Types

type AppBase

type AppBase struct {
	app.AppBase
	AppData
}

type AppData

type AppData struct {
	StripeAccountID string
	Livemode        bool
	APIKey          secretentity.SecretID
	StripeWebhookID string
	WebhookSecret   secretentity.SecretID
}

AppData represents the Stripe associated data for the app

func (AppData) Validate

func (d AppData) Validate() error

type CreateAppStripeInput

type CreateAppStripeInput struct {
	app.CreateAppInput

	StripeAccountID string
	Livemode        bool
	APIKey          secretentity.SecretID
	StripeWebhookID string
	WebhookSecret   secretentity.SecretID
}

func (CreateAppStripeInput) Validate

func (i CreateAppStripeInput) Validate() error

type CreateCheckoutSessionInput

type CreateCheckoutSessionInput struct {
	Namespace           string
	AppID               *app.AppID
	CreateCustomerInput *customer.CreateCustomerInput
	CustomerID          *customer.CustomerID
	CustomerKey         *string
	StripeCustomerID    *string
	Options             api.CreateStripeCheckoutSessionRequestOptions
}

func (CreateCheckoutSessionInput) Validate

func (i CreateCheckoutSessionInput) Validate() error

type CreateCheckoutSessionOutput

type CreateCheckoutSessionOutput struct {
	CustomerID       customer.CustomerID
	StripeCustomerID string

	SessionID     string
	SetupIntentID string
	URL           *string
	Mode          stripe.CheckoutSessionMode

	CancelURL  *string
	SuccessURL *string
	ReturnURL  *string
}

func (CreateCheckoutSessionOutput) Validate

func (o CreateCheckoutSessionOutput) Validate() error

type CreateStripeCustomerInput

type CreateStripeCustomerInput struct {
	AppID      app.AppID
	CustomerID customer.CustomerID

	Name  *string
	Email *string
}

func (CreateStripeCustomerInput) Validate

func (i CreateStripeCustomerInput) Validate() error

type CreateStripeCustomerOutput

type CreateStripeCustomerOutput struct {
	StripeCustomerID string
}

func (CreateStripeCustomerOutput) Validate

func (o CreateStripeCustomerOutput) Validate() error

type CustomerData

type CustomerData struct {
	StripeCustomerID             string
	StripeDefaultPaymentMethodID *string
}

func (CustomerData) Validate

func (d CustomerData) Validate() error

type DeleteStripeAppDataInput

type DeleteStripeAppDataInput struct {
	AppID app.AppID
}

func (DeleteStripeAppDataInput) Validate

func (i DeleteStripeAppDataInput) Validate() error

type DeleteStripeCustomerDataInput

type DeleteStripeCustomerDataInput struct {
	AppID      *app.AppID
	CustomerID *customer.CustomerID
}

func (DeleteStripeCustomerDataInput) Validate

func (i DeleteStripeCustomerDataInput) Validate() error

type GetAppInput

type GetAppInput = app.AppID

type GetStripeAppDataInput

type GetStripeAppDataInput struct {
	AppID app.AppID
}

func (GetStripeAppDataInput) Validate

func (i GetStripeAppDataInput) Validate() error

type GetStripeCustomerDataInput

type GetStripeCustomerDataInput struct {
	AppID      app.AppID
	CustomerID customer.CustomerID
}

func (GetStripeCustomerDataInput) Validate

func (i GetStripeCustomerDataInput) Validate() error

type GetStripeInvoiceInput

type GetStripeInvoiceInput struct {
	AppID           app.AppID
	StripeInvoiceID string
}

func (GetStripeInvoiceInput) Validate

func (i GetStripeInvoiceInput) Validate() error

type GetSupplierContactInput

type GetSupplierContactInput struct {
	AppID app.AppID
}

GetSupplierContactInput to get the default supplier

func (GetSupplierContactInput) Validate

func (i GetSupplierContactInput) Validate() error

type GetWebhookSecretInput

type GetWebhookSecretInput struct {
	AppID string
}

func (GetWebhookSecretInput) Validate

func (i GetWebhookSecretInput) Validate() error

type GetWebhookSecretOutput

type GetWebhookSecretOutput = secretentity.Secret

type HandleInvoiceSentEventInput

type HandleInvoiceSentEventInput struct {
	AppID   app.AppID
	Invoice stripe.Invoice
	SentAt  int64
}

func (HandleInvoiceSentEventInput) Validate

func (i HandleInvoiceSentEventInput) Validate() error

type HandleInvoiceStateTransitionInput

type HandleInvoiceStateTransitionInput struct {
	AppID   app.AppID
	Invoice stripe.Invoice

	// Trigger is the state machine trigger that will be used to transition the invoice
	Trigger billing.InvoiceTrigger
	// TargetStatus specifies the expected status of the invoice after the transition, needed to filter
	// for duplicate events as the state machine doesn't allow transition into the same state
	TargetStatuses []billing.InvoiceStatus

	// IgnoreInvoiceInStatus is a list of invoice statuses. If the invoice is in this status we ignore the event
	// this allows to filter for out of order events.
	IgnoreInvoiceInStatus []billing.InvoiceStatusMatcher
	// ShouldTriggerOnEvent gets the *current* stripe invoice and returns true if the state machine should be triggered
	// useful for filtering late events based on the current state (optional)
	ShouldTriggerOnEvent func(*stripe.Invoice) (bool, error)

	// Validation errors
	// GetValidationErrors is invoked with the current stripe invoice and returns the validation errors if any
	GetValidationErrors func(*stripe.Invoice) (*ValidationErrorsInput, error)
}

func (HandleInvoiceStateTransitionInput) Validate

type SetCustomerDefaultPaymentMethodInput

type SetCustomerDefaultPaymentMethodInput struct {
	AppID            app.AppID
	StripeCustomerID string
	PaymentMethodID  string
}

func (SetCustomerDefaultPaymentMethodInput) Validate

type SetCustomerDefaultPaymentMethodOutput

type SetCustomerDefaultPaymentMethodOutput struct {
	CustomerID customer.CustomerID
}

type UpdateAPIKeyInput

type UpdateAPIKeyInput struct {
	AppID  app.AppID
	APIKey string
}

func (UpdateAPIKeyInput) Validate

func (i UpdateAPIKeyInput) Validate() error

type UpsertStripeCustomerDataInput

type UpsertStripeCustomerDataInput struct {
	AppID                        app.AppID
	CustomerID                   customer.CustomerID
	StripeCustomerID             string
	StripeDefaultPaymentMethodID *string
}

func (UpsertStripeCustomerDataInput) Validate

func (i UpsertStripeCustomerDataInput) Validate() error

type ValidationErrorsInput

type ValidationErrorsInput struct {
	Op     billing.InvoiceOperation
	Errors []*stripe.Error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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