Documentation ¶
Index ¶
- type AccountComponent
- func (m *AccountComponent) CreateAccountHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) CreateAccountRefreshUrlHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) CreateAccountReturnUrlHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) DeactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) GetMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) ReactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
- func (m *AccountComponent) UpdateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
- type AccountParams
- type CreateAccountRequest
- type CreateAccountResponse
- type DatabaseConnectionMetadataParams
- type GetMerchantAccountResponse
- type ServiceInterface
- type UpdateAccountRequest
- type UpdateMerchantAccountResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountComponent ¶
type AccountComponent struct { // Represents the logging entity which this component uses Logger *zap.Logger // Represents the database connection object this entity utilizes for storage purposes Db *database.Db // Represents the object used to interact with the stripe api StripeComponent *stripe.Component // Used to perform operations against the authentication service AuthenticationComponent *authentication_handler.AuthenticationComponent // Duration of any expected http call HttpTimeout time.Duration // Base Refresh url used as part of stripe onboarding process BaseRefreshUrl string // Base Return url use as part of stripe onboarding process BaseReturnUrl string // Coordinates distributed tx as a set of saga (compensating and non-compensating tx) SagaCoordinater *saga.SagaCoordinator }
AccountComponent encompasess the suite of merchant account features
func NewMerchantAccountComponent ¶
func NewMerchantAccountComponent(params *AccountParams) *AccountComponent
NewMerchantAccountComponent returns a new instance of the merchant account component
func (*AccountComponent) CreateAccountHandler ¶
func (m *AccountComponent) CreateAccountHandler(w http.ResponseWriter, r *http.Request)
CreateAccountHandler godoc @Summary Starts the first phase of the merchant account creation process @Description starts the merchant account creation flow for an end user @Tags HTTP API @Produce html @Router / [post] @Success 200 {string} string "OK"
func (*AccountComponent) CreateAccountRefreshUrlHandler ¶
func (m *AccountComponent) CreateAccountRefreshUrlHandler(w http.ResponseWriter, r *http.Request)
CreateAccountRefreshUrlHandler godoc @Summary Serves as the handler for the refresh url used throughout the merchant account onboarding process @Description resets the onboarding process for a given user @Tags HTTP API @Produce html @Router / [post] @Success 200 {string} string "OK"
func (*AccountComponent) CreateAccountReturnUrlHandler ¶
func (m *AccountComponent) CreateAccountReturnUrlHandler(w http.ResponseWriter, r *http.Request)
CreateAccountReturnUrlHandler godoc @Summary Starts the second phase of the merchant account creation process @Description starts the second the merchant account creation flow for an end user ... this phase is hit after return url @Tags HTTP API @Produce html @Router / [post] @Success 200 {string} string "OK"
func (*AccountComponent) DeactivateMerchantAccountHandler ¶
func (m *AccountComponent) DeactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
DeactivateMerchantAccountHandler godoc @Summary Deletes a merchant account @Description coordinates interactions across multiple services to delete a merchant account @Tags HTTP API @Produce html @Router / [delete] @Success 200 {string} string "OK"
func (*AccountComponent) GetMerchantAccountHandler ¶
func (m *AccountComponent) GetMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
GetMerchantAccountHandler godoc @Summary Gets a merchant account if it exists @Description returns a merchant account if it exists @Tags HTTP API @Produce html @Router / [delete] @Success 200 {string} string "OK"
func (*AccountComponent) ReactivateMerchantAccountHandler ¶
func (m *AccountComponent) ReactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
ReactivateMerchantAccountHandler godoc @Summary activates a merchant account @Description coordinates interactions across multiple services to activate a merchant account @Tags HTTP API @Produce html @Router / [post] @Success 200 {string} string "OK"
func (*AccountComponent) UpdateMerchantAccountHandler ¶
func (m *AccountComponent) UpdateMerchantAccountHandler(w http.ResponseWriter, r *http.Request)
UpdateMerchantAccountHandler godoc @Summary updares a merchant account @Description coordinates interactions across multiple services to update a merchant account @Tags HTTP API @Produce html @Router / [post] @Success 200 {string} string "OK"
type AccountParams ¶
type AccountParams struct { // Object enables operations against the authentication service AuthenticationComponent *authentication_handler.AuthenticationComponent // Parameters necessary to initiate a database connection DatabaseConnectionParams *helper.DatabaseConnectionParams // Parameters necessary to configure database connection retry logic DatabaseConnectionMetadataParams *DatabaseConnectionMetadataParams // Logging utility Logger *zap.Logger // Api key used to interact with stripe StripeApiKey *string // Refresh url used as part of the stripe onboarding process RefreshUrl *string // Return url used as part of the stripe onboarding process ReturnUrl *string // Maximum timeout value for all operations HttpTimeout time.Duration }
AccountParams encompasses necessary fields to boostrap the merchant account component
type CreateAccountRequest ¶
type CreateAccountRequest struct { MerchantAccount *models.MerchantAccount `json:"merchant_account"` Password string `json:"password"` ConfirmedPassword string `json:"confirmed_password"` }
type CreateAccountResponse ¶
type CreateAccountResponse struct {
MerchantAccount *models.MerchantAccount `json:"merchant_account"`
}
type DatabaseConnectionMetadataParams ¶
type DatabaseConnectionMetadataParams struct { // Max number of connection attempts to perform against the database on initial connection initiation MaxDatabaseConnectionAttempts int // Max number of retries per failed connection attempt MaxRetriesPerConnectionAttempt int // Max time for a retry to take RetryTimeout time.Duration // Max time to wait in between retry attempts RetrySleepInterval time.Duration }
DatabaseConnectionMetadataParams encompasses connection specific retries and all other associated parameters
type GetMerchantAccountResponse ¶
type GetMerchantAccountResponse struct {
MerchantAccount *models.MerchantAccount `json:"merchant_account"`
}
type ServiceInterface ¶
type ServiceInterface interface { CreateAccountHandler(w http.ResponseWriter, r *http.Request) CreateAccountRefreshUrlHandler(w http.ResponseWriter, r *http.Request) CreateAccountReturnUrlHandler(w http.ResponseWriter, r *http.Request) DeactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request) GetMerchantAccountHandler(w http.ResponseWriter, r *http.Request) UpdateMerchantAccountHandler(w http.ResponseWriter, r *http.Request) ReactivateMerchantAccountHandler(w http.ResponseWriter, r *http.Request) }
type UpdateAccountRequest ¶
type UpdateAccountRequest struct {
MerchantAccount *models.MerchantAccount `json:"merchant_account"`
}
type UpdateMerchantAccountResponse ¶
type UpdateMerchantAccountResponse struct {
MerchantAccount *models.MerchantAccount `json:"merchant_account"`
}