Documentation ¶
Index ¶
- Constants
- type OfflineWebCartPaymentGateway
- func (o *OfflineWebCartPaymentGateway) CancelOrderPayment(ctx context.Context, cartPayment *placeorder.Payment) error
- func (o *OfflineWebCartPaymentGateway) ConfirmResult(ctx context.Context, cart *cartDomain.Cart, cartPayment *placeorder.Payment) error
- func (o *OfflineWebCartPaymentGateway) FlowStatus(ctx context.Context, cart *cartDomain.Cart, correlationID string) (*domain.FlowStatus, error)
- func (o *OfflineWebCartPaymentGateway) Inject(responder *web.Responder, config ...)
- func (o *OfflineWebCartPaymentGateway) Methods() []domain.Method
- func (o *OfflineWebCartPaymentGateway) OrderPaymentFromFlow(ctx context.Context, currentCart *cartDomain.Cart, correlationID string) (*placeorder.Payment, error)
- func (o *OfflineWebCartPaymentGateway) StartFlow(ctx context.Context, currentCart *cartDomain.Cart, correlationID string, ...) (*domain.FlowResult, error)
- type WebCartPaymentGateway
- type WebCartPaymentGatewayProvider
Constants ¶
const (
// OfflineWebCartPaymentGatewayCode - the gateway code
OfflineWebCartPaymentGatewayCode = "offline"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OfflineWebCartPaymentGateway ¶
type OfflineWebCartPaymentGateway struct {
// contains filtered or unexported fields
}
OfflineWebCartPaymentGateway provides an offline payment integration
func (*OfflineWebCartPaymentGateway) CancelOrderPayment ¶
func (o *OfflineWebCartPaymentGateway) CancelOrderPayment(ctx context.Context, cartPayment *placeorder.Payment) error
CancelOrderPayment nothing to cancel for offline payment
func (*OfflineWebCartPaymentGateway) ConfirmResult ¶
func (o *OfflineWebCartPaymentGateway) ConfirmResult(ctx context.Context, cart *cartDomain.Cart, cartPayment *placeorder.Payment) error
ConfirmResult nothing to confirm for offline payment
func (*OfflineWebCartPaymentGateway) FlowStatus ¶
func (o *OfflineWebCartPaymentGateway) FlowStatus(ctx context.Context, cart *cartDomain.Cart, correlationID string) (*domain.FlowStatus, error)
FlowStatus for offline payment is always completed
func (*OfflineWebCartPaymentGateway) Inject ¶
func (o *OfflineWebCartPaymentGateway) Inject(responder *web.Responder, config *struct { Enabled bool `inject:"config:checkout.enableOfflinePaymentProvider,optional"` })
Inject for OfflineWebCartPaymentGateway
func (*OfflineWebCartPaymentGateway) Methods ¶
func (o *OfflineWebCartPaymentGateway) Methods() []domain.Method
Methods returns the Payment Providers available Payment Methods
func (*OfflineWebCartPaymentGateway) OrderPaymentFromFlow ¶
func (o *OfflineWebCartPaymentGateway) OrderPaymentFromFlow(ctx context.Context, currentCart *cartDomain.Cart, correlationID string) (*placeorder.Payment, error)
OrderPaymentFromFlow create the order payment from the current cart/flow
func (*OfflineWebCartPaymentGateway) StartFlow ¶
func (o *OfflineWebCartPaymentGateway) StartFlow(ctx context.Context, currentCart *cartDomain.Cart, correlationID string, returnURL *url.URL) (*domain.FlowResult, error)
StartFlow for offline payment and directly mark it as completed, since there is no online payment process
type WebCartPaymentGateway ¶
type WebCartPaymentGateway interface { // Methods returns the PaymentGateway available Payment Methods Methods() []domain.Method // StartFlow returns the data for a new flow StartFlow(ctx context.Context, cart *cart.Cart, correlationID string, returnURL *url.URL) (*domain.FlowResult, error) // FlowStatus returns the status of a previously started flow (see StartFlow()) FlowStatus(ctx context.Context, cart *cart.Cart, correlationID string) (*domain.FlowStatus, error) // ConfirmResult used to finally confirm the result ConfirmResult(ctx context.Context, cart *cart.Cart, cartPayment *placeorder.Payment) error // OrderPaymentFromFlow generates a place order payment for a previously created flow OrderPaymentFromFlow(ctx context.Context, cart *cart.Cart, correlationID string) (*placeorder.Payment, error) // CancelOrderPayment cancels the place order payment CancelOrderPayment(ctx context.Context, cartPayment *placeorder.Payment) error }
WebCartPaymentGateway is an interface offering (online) payment service - most probably against a external payment gateway API
type WebCartPaymentGatewayProvider ¶
type WebCartPaymentGatewayProvider func() map[string]WebCartPaymentGateway
WebCartPaymentGatewayProvider defines the map of providers for payment providers