adyen

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Name = `adyen`

Variables

View Source
var SupportedCurrencies = []string{
	"USD", "EUR", "GBP", "AUD", "CAD", "CHF",
	"CNY", "HKD", "JPY", "MXN", "SGD", "SEK",
	"NOK", "DKK", "PLN", "INR", "BRL", "ZAR",
}

Functions

func AmountToMinor

func AmountToMinor(amount float64, currency string) int64

AmountToMinor 将金额转为最小单位(Adyen要求整数,如100=1.00 USD)

func MapRefundStatus

func MapRefundStatus(resultCode string) string

MapRefundStatus 映射 Adyen Refund 结果状态

func MappingStatus

func MappingStatus(resultCode string) string

MappingStatus 映射 Adyen ResultCode 到项目状态 文档: https://docs.adyen.com/online-payments/result-codes/

func MinorToAmount

func MinorToAmount(minor int64) float64

MinorToAmount 最小单位转金额

func MoneyFeeToString

func MoneyFeeToString(moneyFee float64) string

MoneyFeeToString 金额转字符串

func New

func New() payment.Driver

Types

type Adyen

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

func (*Adyen) IsSupported

func (a *Adyen) IsSupported(s config.Support) bool

func (*Adyen) Pay

func (a *Adyen) Pay(ctx echo.Context, cfg *config.Pay) (*config.PayResponse, error)

Pay 创建 Adyen Checkout Session 文档: https://docs.adyen.com/api-explorer/Checkout/Session/post

func (*Adyen) PayNotify

func (a *Adyen) PayNotify(ctx echo.Context) error

PayNotify 处理 Adyen Webhook/Notification 文档: https://docs.adyen.com/development-resources/webhooks/verify-notifications

func (*Adyen) PayQuery

func (a *Adyen) PayQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)

PayQuery 查询支付状态(通过 Payment API) 文档: https://docs.adyen.com/api-explorer/Payment/ThirdParty/post

func (*Adyen) Refund

func (a *Adyen) Refund(ctx echo.Context, cfg *config.Refund) (*config.Result, error)

Refund 发起退款 文档: https://docs.adyen.com/api-explorer/Payment/modification/post-refund

func (*Adyen) RefundNotify

func (a *Adyen) RefundNotify(ctx echo.Context) error

RefundNotify 退款通知(通过统一 PayNotify 处理)

func (*Adyen) RefundQuery

func (a *Adyen) RefundQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)

RefundQuery 查询退款状态

func (*Adyen) SetAccount

func (a *Adyen) SetAccount(account *config.Account) payment.Driver

func (*Adyen) SetNotifyCallback

func (a *Adyen) SetNotifyCallback(callback payment.NotifyCallback) payment.Driver

func (*Adyen) VerifySign

func (a *Adyen) VerifySign(ctx echo.Context) error

VerifySign 验证 Adyen Webhook 签名(HMAC-SHA256) 文档: https://docs.adyen.com/development-resources/webhooks/signature-generation-and-verification

Jump to

Keyboard shortcuts

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