Documentation
¶
Index ¶
- Constants
- Variables
- func MapRefundStatus(status string) string
- func MappingStatus(status string) string
- func MoneyFeeToString(moneyFee float64) string
- func New() payment.Driver
- type Paddle
- func (a *Paddle) IsSupported(s config.Support) bool
- func (a *Paddle) Pay(ctx echo.Context, cfg *config.Pay) (*config.PayResponse, error)
- func (a *Paddle) PayNotify(ctx echo.Context) error
- func (a *Paddle) PayQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *Paddle) Refund(ctx echo.Context, cfg *config.Refund) (*config.Result, error)
- func (a *Paddle) RefundNotify(ctx echo.Context) error
- func (a *Paddle) RefundQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *Paddle) SetAccount(account *config.Account) payment.Driver
- func (a *Paddle) SetNotifyCallback(callback payment.NotifyCallback) payment.Driver
- func (a *Paddle) VerifySign(ctx echo.Context) error
Constants ¶
const Name = `paddle`
Variables ¶
var SupportedCurrencies = []string{
"USD", "EUR", "GBP", "AUD", "CAD", "CHF",
"NOK", "SEK", "DKK", "JPY",
}
Functions ¶
func MappingStatus ¶
MappingStatus 映射 Paddle 交易状态 状态文档: https://developer.paddle.com/reference/transaction-statuses
Types ¶
type Paddle ¶
type Paddle struct {
// contains filtered or unexported fields
}
func (*Paddle) Pay ¶
Pay 创建 Paddle Checkout (Price/Session) Paddle v2 使用 Price → Payment Link 流程 文档: https://developer.paddle.com/api-reference/checkouts/create-checkout
func (*Paddle) PayNotify ¶
PayNotify 处理 Paddle Webhook 文档: https://developer.paddle.com/webhooks Paddle v2 使用 PWA (Paddle Webhook Agent) 或自托管验证
func (*Paddle) PayQuery ¶
PayQuery 查询交易状态 文档: https://developer.paddle.com/api-reference/transactions/get-transaction
func (*Paddle) Refund ¶
Refund 发起退款 文档: https://developer.paddle.com/api-reference/refunds/create-refund
func (*Paddle) RefundNotify ¶
RefundNotify 通过 PayNotify 处理
func (*Paddle) RefundQuery ¶
RefundQuery 查询退款状态 文档: https://developer.paddle.com/api-reference/refunds/get-refund
func (*Paddle) SetNotifyCallback ¶
func (a *Paddle) SetNotifyCallback(callback payment.NotifyCallback) payment.Driver
func (*Paddle) VerifySign ¶
VerifySign 验证 Paddle Webhook 签名 文档: https://developer.paddle.com/webhooks/verify-webhooks Paddle v2 使用 HMAC-SHA256 签名,格式: ts={timestamp};h1={hash} secret key 存储在 account.WebhookID 中