|
|
@@ -1,7 +1,5 @@ |
|
|
|
package card_pay |
|
|
|
|
|
|
|
import "time" |
|
|
|
|
|
|
|
//绑卡 |
|
|
|
func BindCard(keyArr, param map[string]string) (string, error) { |
|
|
|
//param = map[string]string{ |
|
|
@@ -46,52 +44,52 @@ func UnBindCard(keyArr, param map[string]string) (string, error) { |
|
|
|
return CardPaySend("api/txs/protocol/unBindCard", keyArr, param) |
|
|
|
} |
|
|
|
func Pay(keyArr map[string]string, param map[string]interface{}) (string, error) { |
|
|
|
memberId := "562902003186055" |
|
|
|
ordId := "11111114" |
|
|
|
amount := "100" |
|
|
|
param = map[string]interface{}{ |
|
|
|
"version": "2.0", |
|
|
|
"protocol": "p202306084666779900235", |
|
|
|
"outTradeNo": ordId, |
|
|
|
"transType": "01", |
|
|
|
"isSendSmsCode": "2", |
|
|
|
"payAmount": amount, |
|
|
|
"payCurrency": "CNY", |
|
|
|
"transactionStartTime": time.Now().Format("20060102150405"), |
|
|
|
"memberId": memberId, //分账模式(splitModel)为“1-普通分账”的,该值一律传商户自编的编号。 |
|
|
|
"notifyUrl": "https://inapi.izhyin.cn/api/v1/swipe/order/notify/123456", |
|
|
|
"splitNotifyUrl": "https://inapi.izhyin.cn/api/v1/swipe/order/split_notify/123456", |
|
|
|
} |
|
|
|
goodsList := []map[string]string{ |
|
|
|
{ |
|
|
|
"name": "充值", |
|
|
|
"number": "1", |
|
|
|
"amount": amount, |
|
|
|
}, |
|
|
|
} |
|
|
|
orderInfo := map[string]interface{}{ |
|
|
|
"Id": ordId, |
|
|
|
"businessType": "130003", |
|
|
|
"goodsList": goodsList, |
|
|
|
} |
|
|
|
param["orderInfo"] = orderInfo |
|
|
|
|
|
|
|
param["needSplit"] = true |
|
|
|
param["splitMain"] = param["memberId"] |
|
|
|
param["splitModel"] = "5" |
|
|
|
splitInfoList := []map[string]string{ |
|
|
|
{ |
|
|
|
"amount": "10", |
|
|
|
"customerCode": CustomerCode, |
|
|
|
"isProcedureCustomer": "3", |
|
|
|
}, |
|
|
|
{ |
|
|
|
"amount": "90", |
|
|
|
"customerCode": memberId, |
|
|
|
"isProcedureCustomer": "0", |
|
|
|
}, |
|
|
|
} |
|
|
|
param["splitInfoList"] = splitInfoList |
|
|
|
//memberId := "562902003186055" |
|
|
|
//ordId := "11111114" |
|
|
|
//amount := "100" |
|
|
|
//param = map[string]interface{}{ |
|
|
|
// "version": "2.0", |
|
|
|
// "protocol": "p202306084666779900235", |
|
|
|
// "outTradeNo": ordId, |
|
|
|
// "transType": "01", |
|
|
|
// "isSendSmsCode": "2", |
|
|
|
// "payAmount": amount, |
|
|
|
// "payCurrency": "CNY", |
|
|
|
// "transactionStartTime": time.Now().Format("20060102150405"), |
|
|
|
// "memberId": memberId, //分账模式(splitModel)为“1-普通分账”的,该值一律传商户自编的编号。 |
|
|
|
// "notifyUrl": "https://inapi.izhyin.cn/api/v1/swipe/order/notify/123456", |
|
|
|
// "splitNotifyUrl": "https://inapi.izhyin.cn/api/v1/swipe/order/split_notify/123456", |
|
|
|
//} |
|
|
|
//goodsList := []map[string]string{ |
|
|
|
// { |
|
|
|
// "name": "充值", |
|
|
|
// "number": "1", |
|
|
|
// "amount": amount, |
|
|
|
// }, |
|
|
|
//} |
|
|
|
//orderInfo := map[string]interface{}{ |
|
|
|
// "Id": ordId, |
|
|
|
// "businessType": "130003", |
|
|
|
// "goodsList": goodsList, |
|
|
|
//} |
|
|
|
//param["orderInfo"] = orderInfo |
|
|
|
// |
|
|
|
//param["needSplit"] = true |
|
|
|
//param["splitMain"] = param["memberId"] |
|
|
|
//param["splitModel"] = "5" |
|
|
|
//splitInfoList := []map[string]string{ |
|
|
|
// { |
|
|
|
// "amount": "10", |
|
|
|
// "customerCode": CustomerCode, |
|
|
|
// "isProcedureCustomer": "3", |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "amount": "90", |
|
|
|
// "customerCode": memberId, |
|
|
|
// "isProcedureCustomer": "0", |
|
|
|
// }, |
|
|
|
//} |
|
|
|
//param["splitInfoList"] = splitInfoList |
|
|
|
|
|
|
|
return CardPaySendSecond("api/txs/protocol/protocolPayPre", keyArr, param) |
|
|
|
} |
|
|
|