refund

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package refund 执行退款操作

p := pay.New(...)
r := refund.Refund{
    Pay: p,
    OpUserID: "10001",
    SignType: pay.SignTypeMD5,
}

// 执行退款操作
r.OutTradeNO(...)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Refund

type Refund struct {
	Pay           *pay.Pay
	DeviceInfo    string // 设备信息
	SignType      string // 签名类型
	RefundFeeType string // 货币类型
	OpUserID      string // 操作员帐号, 默认为商户号
	RefundAccount string // 退款资金来源
}

Refund 退款数据

func (*Refund) OutTradeNO

func (r *Refund) OutTradeNO(outRefundNO, outTradeNO string, totalFee, refundFee int) (*Return, error)

OutTradeNO 通过 outTradeNO 执行退款操作

func (*Refund) TransactionID

func (r *Refund) TransactionID(outRefundNO, transactionID string, totalFee, refundFee int) (*Return, error)

TransactionID 通过 transcationID 执行退款操作

type Return

type Return struct {
	DeviceInfo          string `xml:"device_info"`           // 设备号
	TransactionID       string `xml:"transaction_id"`        // 微信订单号
	OutTradeNO          string `xml:"out_trade_no"`          // 商户订单号
	OutRefundNO         string `xml:"out_refund_no"`         // 商户退款单号
	RefundID            string `xml:"refund_id"`             // 微信退款单号
	RefundChannel       string `xml:"refund_channel"`        // 退款渠道
	RefundFee           int    `xml:"refund_fee"`            // 退款金额
	SettlementRefundFee int    `xml:"settlement_refund_fee"` // 应结退款金额
	TotalFee            int    `xml:"total_fee"`             // 订单总金额
	SettlementTotalFee  int    `xml:"settlement_total_fee"`  // 应结订单金额
	FeeType             string `xml:"fee_type"`              // 订单金额货币类型
	CashFee             int    `xml:"cash_fee"`              // 现金支付金额
	CashFeeType         string `xml:"cash_fee_type"`         // 现金支付币种
	CashRefundFee       int    `xml:"cash_refund_fee"`       // 现金退款金额
	CouponRefundFee     int    `xml:"coupon_refund_fee"`     // 代金券退款总金额
	CouponRefundCount   int    `xml:"coupon_refund_count"`   // 退款代金券使用数量

	Coupons []*pay.Coupon
}

Return 退款的申请的返回值

Jump to

Keyboard shortcuts

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