CNH
商户从前端选择 系统账户(币种CNH),发起换汇,
// 提交结汇的账户 ,金额,等
http.post("",{
amount:10000.00,
fromAccountID:"66688", //来自到的账户
toAccountID:"2332", //转到的账户
TradeType:"swap"
})
orderSN:="charge".util.PayTool.GenOrderSn() //生成结汇单号 settlement202204221059590001
order := &entity.PaymentOoder{
MerchantID:mid,
FromCurrencyID:fromCurrencyID, //来自账户 币种如USD /EUR
ToCurrencyID:toCurrencyID ,//转到的账户 CNH
Amount:1000.00 , //金额
FromAccountID:22325222 ,//来自到的账户
ToAccountID:22325222 ,//转到的账户
OrderSN:orderSN,
TradeType:"settlement", //交易类型 结汇
TradeOrg:"settlement", //交易 机构指银行
OrderSN:orderSN,
// ......
}
accountID,err:=repo.PaymentOrderDao.Save(order) //保存订单
//日志
payLog:=&entity.PaymentOoderLog{
OrderSN:orderSN,
StepR:0 , //步骤
StepR:"order_create", //步骤 init
TradeType:"settlement", //交易类型 结汇
CallBack:"" //回调信息
}
err:=repo.PaymentOrderLogDao.Save(payLog) //保存订单日志
PaymentOrderLog
日志