authorize

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

Documentation

Index

Constants

View Source
const Name = `authorize`

Variables

View Source
var SupportedCurrencies = []string{"USD"} // Authorize.Net 主要支持 USD

Functions

func MapRefundStatus

func MapRefundStatus(responseCode string) string

MapRefundStatus 映射退款响应码

func MappingStatus

func MappingStatus(responseCode string) string

MappingStatus 映射 Authorize.Net Response Code 状态文档: https://developer.authorize.com/api/reference/response-codes.html

func MoneyFeeToString

func MoneyFeeToString(moneyFee float64) string

MoneyFeeToString 金额转字符串

func New

func New() payment.Driver

Types

type Authorize

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

func (*Authorize) IsSupported

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

func (*Authorize) Pay

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

Pay 创建交易(Authorize.Net JSON API) 文档: https://developer.authorize.com/api/reference/index.html#payment-transactions Authorize.Net 通常配合前端表单收集卡号信息,这里返回必要参数

func (*Authorize) PayNotify

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

PayNotify 处理 Silent Post / Webhook 通知 文档: https://developer.authorize.com/api/reference/features/authentication.html#Silent_Post

func (*Authorize) PayQuery

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

PayQuery 查询交易状态 文档: https://developer.authorize.com/api/reference/index.html#get-transaction-details-request

func (*Authorize) Refund

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

Refund 发起退款 文档: https://developer.authorize.com/api/reference/index.html#refund-a-transaction

func (*Authorize) RefundNotify

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

RefundNotify 处理退款通知 (Silent Post / Webhook) 文档: https://developer.authorize.com/api/reference/features/authentication.html#Silent_Post 退款通知的 x_type 字段为 "credit" 或 "refund"

func (*Authorize) RefundQuery

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

RefundQuery 查询退款(通过查询原始交易获取退款信息)

func (*Authorize) SetAccount

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

func (*Authorize) SetNotifyCallback

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

func (*Authorize) VerifySign

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

VerifySign 验证签名(MD5 Hash方式已在PayNotify中处理)

Jump to

Keyboard shortcuts

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