mock

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	CreateRequests      []payment.CreatePaymentRequest
	QueryRequests       []payment.QueryPaymentRequest
	CloseRequests       []payment.ClosePaymentRequest
	RefundRequests      []payment.RefundRequest
	QueryRefundRequests []payment.QueryRefundRequest
	NotifyRequests      []payment.NotifyRequest
	// contains filtered or unexported fields
}

func New

func New(provider payment.Provider, opts ...Option) *Adapter

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() payment.Capabilities

func (*Adapter) ClosePayment

func (a *Adapter) ClosePayment(ctx context.Context, req payment.ClosePaymentRequest) error

func (*Adapter) CreatePayment

func (*Adapter) Name

func (a *Adapter) Name() payment.Provider

func (*Adapter) ParseNotify

func (a *Adapter) ParseNotify(ctx context.Context, req payment.NotifyRequest) (*payment.NotifyResult, error)

func (*Adapter) QueryPayment

func (*Adapter) QueryRefund

func (*Adapter) Refund

func (*Adapter) Snapshot

func (a *Adapter) Snapshot() Snapshot

type Option

type Option func(*Adapter)

func WithAction

func WithAction(action payment.PaymentAction) Option

func WithActions

func WithActions(actions ...payment.ActionType) Option

func WithAllCoreCapabilities

func WithAllCoreCapabilities() Option

func WithCapabilities

func WithCapabilities(caps payment.Capabilities) Option

func WithChannels

func WithChannels(channels ...payment.Channel) Option

func WithClosePayment

func WithClosePayment(fn func(context.Context, payment.ClosePaymentRequest) error) Option

func WithCurrencies

func WithCurrencies(currencies ...string) Option

type Snapshot

type Snapshot struct {
	CreateRequests      []payment.CreatePaymentRequest
	QueryRequests       []payment.QueryPaymentRequest
	CloseRequests       []payment.ClosePaymentRequest
	RefundRequests      []payment.RefundRequest
	QueryRefundRequests []payment.QueryRefundRequest
	NotifyRequests      []payment.NotifyRequest
}

Jump to

Keyboard shortcuts

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