Documentation
¶
Index ¶
- Constants
- Variables
- type AppHandlerTestSuite
- func (s *AppHandlerTestSuite) TestCreate(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestCreateCheckoutSession(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestCreatePortalSession(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestCustomerData(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestCustomerValidate(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestGet(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestUninstall(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestUpdate(ctx context.Context, t *testing.T)
- func (s *AppHandlerTestSuite) TestUpdateAPIKey(ctx context.Context, t *testing.T)
- type Fixture
- type MockSecretService
- func (s *MockSecretService) CreateAppSecret(ctx context.Context, input secretentity.CreateAppSecretInput) (secretentity.SecretID, error)
- func (s *MockSecretService) DeleteAppSecret(ctx context.Context, input secretentity.DeleteAppSecretInput) error
- func (s *MockSecretService) DisableMock()
- func (s *MockSecretService) EnableMock()
- func (s *MockSecretService) GetAppSecret(ctx context.Context, input secretentity.GetAppSecretInput) (secretentity.Secret, error)
- func (s *MockSecretService) UpdateAppSecret(ctx context.Context, input secretentity.UpdateAppSecretInput) (secretentity.SecretID, error)
- type StripeAppClientMock
- func (c *StripeAppClientMock) AddInvoiceLines(ctx context.Context, input stripeclient.AddInvoiceLinesInput) ([]stripeclient.StripeInvoiceItemWithLineID, error)
- func (c *StripeAppClientMock) CreateCheckoutSession(ctx context.Context, input stripeclient.CreateCheckoutSessionInput) (stripeclient.StripeCheckoutSession, error)
- func (c *StripeAppClientMock) CreateCustomer(ctx context.Context, input stripeclient.CreateStripeCustomerInput) (stripeclient.StripeCustomer, error)
- func (c *StripeAppClientMock) CreateInvoice(ctx context.Context, input stripeclient.CreateInvoiceInput) (*stripe.Invoice, error)
- func (c *StripeAppClientMock) CreatePortalSession(ctx context.Context, input stripeclient.CreatePortalSessionInput) (stripeclient.PortalSession, error)
- func (c *StripeAppClientMock) DeleteInvoice(ctx context.Context, input stripeclient.DeleteInvoiceInput) error
- func (c *StripeAppClientMock) DeleteWebhook(ctx context.Context, input stripeclient.DeleteWebhookInput) error
- func (c *StripeAppClientMock) FinalizeInvoice(ctx context.Context, input stripeclient.FinalizeInvoiceInput) (*stripe.Invoice, error)
- func (c *StripeAppClientMock) GetAccount(ctx context.Context) (stripeclient.StripeAccount, error)
- func (c *StripeAppClientMock) GetCustomer(ctx context.Context, stripeCustomerID string) (stripeclient.StripeCustomer, error)
- func (c *StripeAppClientMock) GetInvoice(ctx context.Context, input stripeclient.GetInvoiceInput) (*stripe.Invoice, error)
- func (c *StripeAppClientMock) GetPaymentMethod(ctx context.Context, paymentMethodID string) (stripeclient.StripePaymentMethod, error)
- func (c *StripeAppClientMock) ListInvoiceLineItems(ctx context.Context, stripeInvoiceID string) ([]*stripe.InvoiceLineItem, error)
- func (c *StripeAppClientMock) RemoveInvoiceLines(ctx context.Context, input stripeclient.RemoveInvoiceLinesInput) error
- func (c *StripeAppClientMock) Restore()
- func (c *StripeAppClientMock) StableSortInvoiceItemParams(input []*stripe.InvoiceItemParams)
- func (c *StripeAppClientMock) StableSortStripeInvoiceItemWithID(lines []*stripeclient.StripeInvoiceItemWithID)
- func (c *StripeAppClientMock) UpdateInvoice(ctx context.Context, input stripeclient.UpdateInvoiceInput) (*stripe.Invoice, error)
- func (c *StripeAppClientMock) UpdateInvoiceLines(ctx context.Context, input stripeclient.UpdateInvoiceLinesInput) ([]*stripe.InvoiceItem, error)
- type StripeClientMock
- type TestEnv
Constants ¶
View Source
const (
DefaultPostgresHost = "127.0.0.1"
)
View Source
const (
PostgresURLTemplate = "postgres://postgres:postgres@%s:5432/postgres?sslmode=disable"
)
Variables ¶
View Source
var TestStripeAPIKey = "test_stripe_api_key"
Functions ¶
This section is empty.
Types ¶
type AppHandlerTestSuite ¶
type AppHandlerTestSuite struct {
Env TestEnv
// contains filtered or unexported fields
}
func (*AppHandlerTestSuite) TestCreate ¶
func (s *AppHandlerTestSuite) TestCreate(ctx context.Context, t *testing.T)
TestCreate tests to create a new stripe app
func (*AppHandlerTestSuite) TestCreateCheckoutSession ¶
func (s *AppHandlerTestSuite) TestCreateCheckoutSession(ctx context.Context, t *testing.T)
TestCreateCheckoutSession tests stripe app behavior when creating a new checkout session
func (*AppHandlerTestSuite) TestCreatePortalSession ¶
func (s *AppHandlerTestSuite) TestCreatePortalSession(ctx context.Context, t *testing.T)
TestCreatePortalSession tests stripe app behavior when creating a new checkout session
func (*AppHandlerTestSuite) TestCustomerData ¶
func (s *AppHandlerTestSuite) TestCustomerData(ctx context.Context, t *testing.T)
TestCustomerData tests stripe app behavior when adding customer data
func (*AppHandlerTestSuite) TestCustomerValidate ¶
func (s *AppHandlerTestSuite) TestCustomerValidate(ctx context.Context, t *testing.T)
TestCustomerValidate tests stripe app behavior when validating a customer
func (*AppHandlerTestSuite) TestGet ¶
func (s *AppHandlerTestSuite) TestGet(ctx context.Context, t *testing.T)
TestGet tests getting a stripe app
func (*AppHandlerTestSuite) TestUninstall ¶
func (s *AppHandlerTestSuite) TestUninstall(ctx context.Context, t *testing.T)
TestUninstall tests uninstalling a stripe app
func (*AppHandlerTestSuite) TestUpdate ¶
func (s *AppHandlerTestSuite) TestUpdate(ctx context.Context, t *testing.T)
TestUpdate tests updating an app
func (*AppHandlerTestSuite) TestUpdateAPIKey ¶
func (s *AppHandlerTestSuite) TestUpdateAPIKey(ctx context.Context, t *testing.T)
TestUpdateAPIKey tests stripe app behavior when updating the API key
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
func NewFixture ¶
func NewFixture( app app.Service, customer customer.Service, stripeClient *StripeClientMock, stripeAppClient *StripeAppClientMock, ) *Fixture
type MockSecretService ¶
func NewMockSecretService ¶
func NewMockSecretService() (*MockSecretService, error)
func (*MockSecretService) CreateAppSecret ¶
func (s *MockSecretService) CreateAppSecret(ctx context.Context, input secretentity.CreateAppSecretInput) (secretentity.SecretID, error)
func (*MockSecretService) DeleteAppSecret ¶
func (s *MockSecretService) DeleteAppSecret(ctx context.Context, input secretentity.DeleteAppSecretInput) error
func (*MockSecretService) DisableMock ¶
func (s *MockSecretService) DisableMock()
func (*MockSecretService) EnableMock ¶
func (s *MockSecretService) EnableMock()
func (*MockSecretService) GetAppSecret ¶
func (s *MockSecretService) GetAppSecret(ctx context.Context, input secretentity.GetAppSecretInput) (secretentity.Secret, error)
func (*MockSecretService) UpdateAppSecret ¶
func (s *MockSecretService) UpdateAppSecret(ctx context.Context, input secretentity.UpdateAppSecretInput) (secretentity.SecretID, error)
type StripeAppClientMock ¶
func (*StripeAppClientMock) AddInvoiceLines ¶
func (c *StripeAppClientMock) AddInvoiceLines(ctx context.Context, input stripeclient.AddInvoiceLinesInput) ([]stripeclient.StripeInvoiceItemWithLineID, error)
func (*StripeAppClientMock) CreateCheckoutSession ¶
func (c *StripeAppClientMock) CreateCheckoutSession(ctx context.Context, input stripeclient.CreateCheckoutSessionInput) (stripeclient.StripeCheckoutSession, error)
func (*StripeAppClientMock) CreateCustomer ¶
func (c *StripeAppClientMock) CreateCustomer(ctx context.Context, input stripeclient.CreateStripeCustomerInput) (stripeclient.StripeCustomer, error)
func (*StripeAppClientMock) CreateInvoice ¶
func (c *StripeAppClientMock) CreateInvoice(ctx context.Context, input stripeclient.CreateInvoiceInput) (*stripe.Invoice, error)
func (*StripeAppClientMock) CreatePortalSession ¶
func (c *StripeAppClientMock) CreatePortalSession(ctx context.Context, input stripeclient.CreatePortalSessionInput) (stripeclient.PortalSession, error)
Portal
func (*StripeAppClientMock) DeleteInvoice ¶
func (c *StripeAppClientMock) DeleteInvoice(ctx context.Context, input stripeclient.DeleteInvoiceInput) error
func (*StripeAppClientMock) DeleteWebhook ¶
func (c *StripeAppClientMock) DeleteWebhook(ctx context.Context, input stripeclient.DeleteWebhookInput) error
func (*StripeAppClientMock) FinalizeInvoice ¶
func (c *StripeAppClientMock) FinalizeInvoice(ctx context.Context, input stripeclient.FinalizeInvoiceInput) (*stripe.Invoice, error)
func (*StripeAppClientMock) GetAccount ¶
func (c *StripeAppClientMock) GetAccount(ctx context.Context) (stripeclient.StripeAccount, error)
func (*StripeAppClientMock) GetCustomer ¶
func (c *StripeAppClientMock) GetCustomer(ctx context.Context, stripeCustomerID string) (stripeclient.StripeCustomer, error)
func (*StripeAppClientMock) GetInvoice ¶
func (c *StripeAppClientMock) GetInvoice(ctx context.Context, input stripeclient.GetInvoiceInput) (*stripe.Invoice, error)
func (*StripeAppClientMock) GetPaymentMethod ¶
func (c *StripeAppClientMock) GetPaymentMethod(ctx context.Context, paymentMethodID string) (stripeclient.StripePaymentMethod, error)
func (*StripeAppClientMock) ListInvoiceLineItems ¶
func (c *StripeAppClientMock) ListInvoiceLineItems(ctx context.Context, stripeInvoiceID string) ([]*stripe.InvoiceLineItem, error)
Invoice Lines
func (*StripeAppClientMock) RemoveInvoiceLines ¶
func (c *StripeAppClientMock) RemoveInvoiceLines(ctx context.Context, input stripeclient.RemoveInvoiceLinesInput) error
func (*StripeAppClientMock) Restore ¶
func (c *StripeAppClientMock) Restore()
func (*StripeAppClientMock) StableSortInvoiceItemParams ¶
func (c *StripeAppClientMock) StableSortInvoiceItemParams(input []*stripe.InvoiceItemParams)
func (*StripeAppClientMock) StableSortStripeInvoiceItemWithID ¶
func (c *StripeAppClientMock) StableSortStripeInvoiceItemWithID(lines []*stripeclient.StripeInvoiceItemWithID)
func (*StripeAppClientMock) UpdateInvoice ¶
func (c *StripeAppClientMock) UpdateInvoice(ctx context.Context, input stripeclient.UpdateInvoiceInput) (*stripe.Invoice, error)
func (*StripeAppClientMock) UpdateInvoiceLines ¶
func (c *StripeAppClientMock) UpdateInvoiceLines(ctx context.Context, input stripeclient.UpdateInvoiceLinesInput) ([]*stripe.InvoiceItem, error)
type StripeClientMock ¶
func (*StripeClientMock) GetAccount ¶
func (c *StripeClientMock) GetAccount(ctx context.Context) (stripeclient.StripeAccount, error)
func (*StripeClientMock) Restore ¶
func (c *StripeClientMock) Restore()
func (*StripeClientMock) SetupWebhook ¶
func (c *StripeClientMock) SetupWebhook(ctx context.Context, input stripeclient.SetupWebhookInput) (stripeclient.StripeWebhookEndpoint, error)
type TestEnv ¶
type TestEnv interface {
App() app.Service
AppStripe() appstripe.Service
Billing() billing.Service
Customer() customer.Service
Fixture() *Fixture
Secret() *MockSecretService
StripeClient() *StripeClientMock
StripeAppClient() *StripeAppClientMock
Close() error
}
Click to show internal directories.
Click to hide internal directories.