Documentation
¶
Index ¶
- type AlipayConfig
- type CaptureRequest
- type CaptureResult
- type CardConfig
- type ClientAction
- type ClientActionKind
- type CloseRequest
- type CombinedCreateRequest
- type CombinedSubOrder
- type NotifyEvent
- type PayChannel
- type PayDriver
- type PayIntent
- type PayScene
- type PayerInfo
- type PaymentError
- type ProfitShareReceiver
- type ProfitShareRequest
- type ProfitShareResult
- type QueryRequest
- type RefundRequest
- type RefundResult
- type SplitInfo
- type Transaction
- type TransactionStatus
- type WechatConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlipayConfig ¶
type CaptureRequest ¶
type CaptureResult ¶
type CardConfig ¶
type ClientAction ¶
type ClientAction struct {
Kind ClientActionKind `json:"kind"`
Data map[string]string `json:"data"`
}
type ClientActionKind ¶
type ClientActionKind string
const ( ActionRedirect ClientActionKind = "redirect" ActionQRCode ClientActionKind = "qrcode" ActionInvokeSDK ClientActionKind = "invokeSDK" ActionDeepLink ClientActionKind = "deeplink" ActionMiniParams ClientActionKind = "miniProgramParams" )
type CombinedCreateRequest ¶
type CombinedCreateRequest struct {
CombineOutTradeNo string `json:"combine_out_trade_no"`
Scene PayScene `json:"scene"`
SubOrders []CombinedSubOrder `json:"sub_orders"`
NotifyURL string `json:"notify_url"`
}
type CombinedSubOrder ¶
type NotifyEvent ¶
type NotifyEvent struct {
EventType string `json:"event_type"`
Transaction *Transaction `json:"transaction"`
Refund *RefundResult `json:"refund"`
IdempotencyKey string `json:"idempotency_key"`
}
type PayChannel ¶
type PayChannel string
const ( ChannelAlipay PayChannel = "ALIPAY" ChannelWechat PayChannel = "WECHAT" ChannelCard PayChannel = "CARD" )
type PayDriver ¶
type PayDriver interface {
Create(ctx context.Context, intent *PayIntent) (*ClientAction, *Transaction, error)
Query(ctx context.Context, req *QueryRequest) (*Transaction, error)
Close(ctx context.Context, req *CloseRequest) error
Refund(ctx context.Context, req *RefundRequest) (*RefundResult, error)
Capture(ctx context.Context, req *CaptureRequest) (*CaptureResult, error)
ParseNotify(ctx context.Context, headers map[string]string, body []byte) (*NotifyEvent, error)
CreateCombined(ctx context.Context, req *CombinedCreateRequest) (*ClientAction, error)
}
type PayIntent ¶
type PayIntent struct {
OutTradeNo string `json:"out_trade_no"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Subject string `json:"subject"`
Description string `json:"description"`
Scene PayScene `json:"scene"`
Channel PayChannel `json:"channel"`
NotifyURL string `json:"notify_url"`
ReturnURL string `json:"return_url"`
ExpireAt time.Time `json:"expire_at"`
Payer PayerInfo `json:"payer"`
Attach map[string]string `json:"attach"`
Extra map[string]string `json:"extra"`
Split []SplitInfo `json:"split"`
}
type PayerInfo ¶
type PaymentError ¶
func (*PaymentError) Error ¶
func (e *PaymentError) Error() string
type ProfitShareReceiver ¶
type ProfitShareReceiver struct {
}
type ProfitShareRequest ¶
type ProfitShareRequest struct {
}
type ProfitShareResult ¶
type ProfitShareResult struct {
}
type QueryRequest ¶
type RefundRequest ¶
type RefundResult ¶
type SplitInfo ¶
type Transaction ¶
type Transaction struct {
Status TransactionStatus `json:"status"`
Provider string `json:"provider"`
Channel PayChannel `json:"channel"`
Scene PayScene `json:"scene"`
OutTradeNo string `json:"out_trade_no"`
ProviderTxnId string `json:"provider_txn_id"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Payer PayerInfo `json:"payer"`
Raw map[string]any `json:"raw"`
}
type TransactionStatus ¶
type TransactionStatus string
const ( TxCreated TransactionStatus = "CREATED" TxPending TransactionStatus = "PENDING" TxPaid TransactionStatus = "PAID" TxAuthorized TransactionStatus = "AUTHORIZED" TxCaptured TransactionStatus = "CAPTURED" TxClosed TransactionStatus = "CLOSED" TxRefunded TransactionStatus = "REFUNDED" TxPartiallyRefunded TransactionStatus = "PARTIALLY_REFUNDED" TxFailed TransactionStatus = "FAILED" TxExpired TransactionStatus = "EXPIRED" )
type WechatConfig ¶
Source Files
¶
- config.go
- types.go
Click to show internal directories.
Click to hide internal directories.