Documentation
¶
Index ¶
- Constants
- Variables
- func AmountToMinor(amount float64, currency string) int64
- func MapRefundStatus(resultCode string) string
- func MappingStatus(resultCode string) string
- func MinorToAmount(minor int64) float64
- func MoneyFeeToString(moneyFee float64) string
- func New() payment.Driver
- type Adyen
- func (a *Adyen) IsSupported(s config.Support) bool
- func (a *Adyen) Pay(ctx echo.Context, cfg *config.Pay) (*config.PayResponse, error)
- func (a *Adyen) PayNotify(ctx echo.Context) error
- func (a *Adyen) PayQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *Adyen) Refund(ctx echo.Context, cfg *config.Refund) (*config.Result, error)
- func (a *Adyen) RefundNotify(ctx echo.Context) error
- func (a *Adyen) RefundQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *Adyen) SetAccount(account *config.Account) payment.Driver
- func (a *Adyen) SetNotifyCallback(callback payment.NotifyCallback) payment.Driver
- func (a *Adyen) VerifySign(ctx echo.Context) error
Constants ¶
const Name = `adyen`
Variables ¶
var SupportedCurrencies = []string{
"USD", "EUR", "GBP", "AUD", "CAD", "CHF",
"CNY", "HKD", "JPY", "MXN", "SGD", "SEK",
"NOK", "DKK", "PLN", "INR", "BRL", "ZAR",
}
Functions ¶
func AmountToMinor ¶
AmountToMinor 将金额转为最小单位(Adyen要求整数,如100=1.00 USD)
func MapRefundStatus ¶
MapRefundStatus 映射 Adyen Refund 结果状态
func MappingStatus ¶
MappingStatus 映射 Adyen ResultCode 到项目状态 文档: https://docs.adyen.com/online-payments/result-codes/
Types ¶
type Adyen ¶
type Adyen struct {
// contains filtered or unexported fields
}
func (*Adyen) Pay ¶
Pay 创建 Adyen Checkout Session 文档: https://docs.adyen.com/api-explorer/Checkout/Session/post
func (*Adyen) PayNotify ¶
PayNotify 处理 Adyen Webhook/Notification 文档: https://docs.adyen.com/development-resources/webhooks/verify-notifications
func (*Adyen) PayQuery ¶
PayQuery 查询支付状态(通过 Payment API) 文档: https://docs.adyen.com/api-explorer/Payment/ThirdParty/post
func (*Adyen) Refund ¶
Refund 发起退款 文档: https://docs.adyen.com/api-explorer/Payment/modification/post-refund
func (*Adyen) RefundNotify ¶
RefundNotify 退款通知(通过统一 PayNotify 处理)
func (*Adyen) RefundQuery ¶
RefundQuery 查询退款状态
func (*Adyen) SetNotifyCallback ¶
func (a *Adyen) SetNotifyCallback(callback payment.NotifyCallback) payment.Driver
func (*Adyen) VerifySign ¶
VerifySign 验证 Adyen Webhook 签名(HMAC-SHA256) 文档: https://docs.adyen.com/development-resources/webhooks/signature-generation-and-verification