strategy

package
v0.0.0-...-d111297 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PayBehavior

type PayBehavior interface {
	OrderPay(ctx *PayContext)
}

PayBehavior of abstract

type PayContext

type PayContext struct {
	// contains filtered or unexported fields
}

PayContext context of Pay

func NewPayContext

func NewPayContext(behavior PayBehavior) *PayContext

NewPayContext create a PayContext instance

func (*PayContext) Pay

func (ctx *PayContext) Pay()

Pay for order with different behavior

type ThirdPartyPay

type ThirdPartyPay struct{}

ThirdPartyPay pay by ThirdParty

func (*ThirdPartyPay) OrderPay

func (t *ThirdPartyPay) OrderPay(ctx *PayContext)

OrderPay of ThirdPartyPay

type WechatPay

type WechatPay struct{}

WechatPay pay by Wechat

func (*WechatPay) OrderPay

func (w *WechatPay) OrderPay(ctx *PayContext)

OrderPay of Wechat

Jump to

Keyboard shortcuts

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