Commit e48f8025 authored by jiangjiantao's avatar jiangjiantao

支付接口调试

支付接口调试
parent 187cc156
...@@ -11,6 +11,6 @@ App({ ...@@ -11,6 +11,6 @@ App({
version: "1.0.6.20200310", version: "1.0.6.20200310",
BASE_URL: "https://hhms.miyapay.com/", BASE_URL: "https://hhms.miyapay.com/",
localAccountInfo:null, localAccountInfo:null,
useTestPayInfo:true useTestPayInfo:false
} }
}) })
\ No newline at end of file
...@@ -35,7 +35,7 @@ Page({ ...@@ -35,7 +35,7 @@ Page({
var localAccountInfo = getApp().globalData.localAccountInfo; var localAccountInfo = getApp().globalData.localAccountInfo;
console.info("localAccountInfo==>" + JSON.stringify(localAccountInfo)); console.info("localAccountInfo==>" + JSON.stringify(localAccountInfo));
if (localAccountInfo.success == true && localAccountInfo.data != null) { if (localAccountInfo.code == 200 && localAccountInfo.data != null) {
this.data.saasid = localAccountInfo.data.store.saasid; this.data.saasid = localAccountInfo.data.store.saasid;
if (localAccountInfo.data.store.marketid != null) { if (localAccountInfo.data.store.marketid != null) {
this.data.marketId = localAccountInfo.data.store.marketid; this.data.marketId = localAccountInfo.data.store.marketid;
...@@ -45,8 +45,9 @@ Page({ ...@@ -45,8 +45,9 @@ Page({
this.data.posId = localAccountInfo.data.store.posId; this.data.posId = localAccountInfo.data.store.posId;
this.data.cashierCode = localAccountInfo.data.store.operatorId; this.data.cashierCode = localAccountInfo.data.store.operatorId;
this.data.signKey = localAccountInfo.data.store.miyaPayPlatformSignKey; this.data.signKey = localAccountInfo.data.store.miyaPayPlatformSignKey;
this.data.baseUrl = localAccountInfo.data.store.miyaPayPlatformUrl + ""; this.data.baseUrl = localAccountInfo.data.store.miyaPayPlatformUrl + "miya/miyapay_response.action";
this.data.apiVersion = localAccountInfo.data.store.miyaPayApiVersion; this.data.apiVersion = localAccountInfo.data.store.miyaPayApiVersion;
console.log('1112')
if (getApp().globalData.useTestPayInfo == true) { if (getApp().globalData.useTestPayInfo == true) {
//just for test //just for test
this.data.signKey = "nbz9ww27sx4ou6dkr61mf63tth3s6e2d"; this.data.signKey = "nbz9ww27sx4ou6dkr61mf63tth3s6e2d";
...@@ -64,10 +65,17 @@ Page({ ...@@ -64,10 +65,17 @@ Page({
/** /**
* 刷脸支付 * 刷脸支付
*/ */
facePay:function(){ facePay: function () {
var that = this;
this.doPay("23444764646446464644646446") // 只允许从相机扫码
wx.scanCode({
onlyFromCamera: true,
success(res) {
if(null != res && res.result != null && res.result!== ''){
that.doPay(res.result)
}
}
})
}, },
/** /**
...@@ -99,7 +107,8 @@ Page({ ...@@ -99,7 +107,8 @@ Page({
version: "1.5", version: "1.5",
orderNo: orderNo, orderNo: orderNo,
token: payCode, token: payCode,
payPrice:miyapay.fen2Yuan(parseInt(this.data.payPriceYuan)), payPrice:"1",
// payPrice:miyapay.yuan2Fen(this.data.payPriceYuan),
signKey: this.data.signKey, signKey: this.data.signKey,
callback: (res) => { callback: (res) => {
...@@ -137,21 +146,17 @@ Page({ ...@@ -137,21 +146,17 @@ Page({
*/ */
payFail(msg) { payFail(msg) {
wx.redirectTo({ if (this.data.show) {
url: '/pages/pay_result/pay_result?payPriceYuan='+this.data.payPriceYuan+"&description=支付成功", this.setData({
}) scanPayError: msg
})
// if (this.data.show) { } else {
// this.setData({ wx.showToast({
// scanPayError: msg title: msg,
// }) icon: 'none',
// } else { duration: 2000
// wx.showToast({ })
// title: msg, }
// icon: 'none',
// duration: 2000
// })
// }
} }
......
...@@ -365,7 +365,7 @@ function requestPay({ baseUrl, type, saasid, marketId, posId, cashierCode, versi ...@@ -365,7 +365,7 @@ function requestPay({ baseUrl, type, saasid, marketId, posId, cashierCode, versi
payRequest.data.B2 = token; payRequest.data.B2 = token;
} }
//B3 描述信息 //B3 描述信息
payRequest.data.B3 = "蜻蜓IOT支付"; payRequest.data.B3 = "青蛙IOT支付";
//B4 支付金额,分 //B4 支付金额,分
if (payPrice != null) { if (payPrice != null) {
...@@ -388,7 +388,7 @@ function requestPay({ baseUrl, type, saasid, marketId, posId, cashierCode, versi ...@@ -388,7 +388,7 @@ function requestPay({ baseUrl, type, saasid, marketId, posId, cashierCode, versi
console.log("payRequestXmlStr==>" + payRequestXmlStr); console.log("payRequestXmlStr==>" + payRequestXmlStr);
wx.request({ wx.request({
headers: { headers: {
'content-type': 'application/xml' 'content-type': 'text/xml'
}, },
method: 'POST', method: 'POST',
url: baseUrl, url: baseUrl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment