Commit e48f8025 authored by jiangjiantao's avatar jiangjiantao

支付接口调试

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