payment

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// FakePaymentGateway gateway code
	FakePaymentGateway = "fake_payment_gateway"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeGateway

type FakeGateway struct {
	CartIsCompleted map[string]bool
}

FakeGateway used for testing all payment states

func (*FakeGateway) CancelOrderPayment

func (g *FakeGateway) CancelOrderPayment(ctx context.Context, cartPayment *placeorder.Payment) error

CancelOrderPayment does nothing

func (*FakeGateway) ConfirmResult

func (g *FakeGateway) ConfirmResult(ctx context.Context, cart *cart.Cart, cartPayment *placeorder.Payment) error

ConfirmResult mark payment as completed

func (*FakeGateway) FlowStatus

func (g *FakeGateway) FlowStatus(ctx context.Context, cart *cart.Cart, correlationID string) (*domain.FlowStatus, error)

FlowStatus returns a payment with a state depending on the supplied payment method

func (*FakeGateway) Inject

func (g *FakeGateway) Inject() *FakeGateway

Inject dependencies

func (*FakeGateway) Methods

func (g *FakeGateway) Methods() []domain.Method

Methods returns all payment gateway methods

func (*FakeGateway) OrderPaymentFromFlow

func (g *FakeGateway) OrderPaymentFromFlow(ctx context.Context, cart *cart.Cart, correlationID string) (*placeorder.Payment, error)

OrderPaymentFromFlow return fake payment

func (*FakeGateway) StartFlow

func (g *FakeGateway) StartFlow(ctx context.Context, cart *cart.Cart, correlationID string, returnURL *url.URL) (*domain.FlowResult, error)

StartFlow starts a new Payment flow

type Method

type Method struct {
	Title  string
	Status *domain.FlowStatus
}

Method ...

type Module

type Module struct{}

Module registers our fake payment profile

func (*Module) Configure

func (m *Module) Configure(injector *dingo.Injector)

Configure module

Jump to

Keyboard shortcuts

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