Skip to content

Commit

Permalink
Merge pull request #92 from cobain/feature/add_profit_sharing_for_uni…
Browse files Browse the repository at this point in the history
…fy_order

add_profit_sharing_for_unify_order
  • Loading branch information
royalrick authored Mar 2, 2023
2 parents 6263c2f + aa6fca7 commit 5e8edc9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions payment/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ type Order struct {
OutTradeNo string `xml:"out_trade_no"` // 商户订单号

// 选填 ...
IP string `xml:"spbill_create_ip,omitempty"` // 终端IP
NoCredit bool `xml:"-"` // 上传此参数 no_credit 可限制用户不能使用信用卡支付
StartedAt time.Time `xml:"-"` // 交易起始时间 格式为yyyyMMddHHmmss
ExpiredAt time.Time `xml:"-"` // 交易结束时间 订单失效时间 格式为yyyyMMddHHmmss
Tag string `xml:"goods_tag,omitempty"` // 订单优惠标记,使用代金券或立减优惠功能时需要的参数,
Detail string `xml:"detail,omitempty"` // 商品详情
Attach string `xml:"attach,omitempty"` // 附加数据
IP string `xml:"spbill_create_ip,omitempty"` // 终端IP
NoCredit bool `xml:"-"` // 上传此参数 no_credit 可限制用户不能使用信用卡支付
StartedAt time.Time `xml:"-"` // 交易起始时间 格式为yyyyMMddHHmmss
ExpiredAt time.Time `xml:"-"` // 交易结束时间 订单失效时间 格式为yyyyMMddHHmmss
Tag string `xml:"goods_tag,omitempty"` // 订单优惠标记,使用代金券或立减优惠功能时需要的参数,
Detail string `xml:"detail,omitempty"` // 商品详情
Attach string `xml:"attach,omitempty"` // 附加数据
ProfitSharing string `xml:"profit_sharing,omitempty"` // 是否需要分账 Y-是,需要分账 N-否,不分账 字母要求大写,不传默认不分账
}

// 下单所需所有数据
Expand Down Expand Up @@ -127,6 +128,10 @@ func (o *Order) prepare(key string) (order, error) {
signData["limit_pay"] = od.NoCredit
}

if o.ProfitSharing != "" {
od.ProfitSharing = o.ProfitSharing
}

sign, err := util.SignByMD5(signData, key)
if err != nil {
return od, err
Expand Down

0 comments on commit 5e8edc9

Please sign in to comment.