paddle

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Name = `paddle`

Variables

View Source
var SupportedCurrencies = []string{
	"USD", "EUR", "GBP", "AUD", "CAD", "CHF",
	"NOK", "SEK", "DKK", "JPY",
}

Functions

func MapRefundStatus

func MapRefundStatus(status string) string

MapRefundStatus 映射 Paddle 退款状态

func MappingStatus

func MappingStatus(status string) string

MappingStatus 映射 Paddle 交易状态 状态文档: https://developer.paddle.com/reference/transaction-statuses

func MoneyFeeToString

func MoneyFeeToString(moneyFee float64) string

MoneyFeeToString 金额转字符串

func New

func New() payment.Driver

Types

type Paddle

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

func (*Paddle) IsSupported

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

func (*Paddle) Pay

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

Pay 创建 Paddle Checkout (Price/Session) Paddle v2 使用 Price → Payment Link 流程 文档: https://developer.paddle.com/api-reference/checkouts/create-checkout

func (*Paddle) PayNotify

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

PayNotify 处理 Paddle Webhook 文档: https://developer.paddle.com/webhooks Paddle v2 使用 PWA (Paddle Webhook Agent) 或自托管验证

func (*Paddle) PayQuery

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

PayQuery 查询交易状态 文档: https://developer.paddle.com/api-reference/transactions/get-transaction

func (*Paddle) Refund

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

Refund 发起退款 文档: https://developer.paddle.com/api-reference/refunds/create-refund

func (*Paddle) RefundNotify

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

RefundNotify 通过 PayNotify 处理

func (*Paddle) RefundQuery

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

RefundQuery 查询退款状态 文档: https://developer.paddle.com/api-reference/refunds/get-refund

func (*Paddle) SetAccount

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

func (*Paddle) SetNotifyCallback

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

func (*Paddle) VerifySign

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

VerifySign 验证 Paddle Webhook 签名 文档: https://developer.paddle.com/webhooks/verify-webhooks Paddle v2 使用 HMAC-SHA256 签名,格式: ts={timestamp};h1={hash} secret key 存储在 account.WebhookID 中

Jump to

Keyboard shortcuts

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