支付宝拼接URL的&notify_url显示不正常

本文记录了在调试支付宝在线支付接口过程中遇到的问题:返回URL中的notify_url参数在jsoneditor中显示异常,最终通过修改jsoneditor的视图为text模式解决了显示问题。
昨天调试支付宝在线支付,返回的URL中拼接的参数有notify_url,然后用项目组的网页测试工具测试支付接口时,在json editor里面,&not被转义,显示成了﹁,也就是数学符号“非”。
后来,通过修改json editor的视图为text才显示正常,其他的tree视图,view视图显示都不正常,原以为是自己写的接口有错,这个是个坑啊。
在鸿蒙开发中,后端给我返回了支付的接口_input_charset=\"UTF-8\"&body=\"购买2026护士-精品班-A班\"&notify_url=\"http://api.ahuxueshu.com/payment/AliNotify\"&out_trade_no=\"AH2025032512280910129APP\"&partner=\"2088041180060833\"&payment_type=\"1\"&seller_id=\"pumcwch@dingtalk.com\"&service=\"mobile.securitypay.pay\"&subject=\"2026护士-精品班-A班\"&total_fee=\"99.00\"&sign=\"TTvIaF4xAAjqfncj33coOPCeAI9VKm%2BZghQj6lFPd6fGPwup3uoeyQsyFODXhYzr3SeX4XfwcmycEAWUE2L8gGClrGkdOvO99Zo4bXU0uL7yTu%2BBMgMNFVTqh5DCJik8uNlbroZxtHo5ClrWHPiVhcKvNmoBz75Zd9TiQYOfAzY%3D\"&sign_type=\"RSA\"" 。 以下是我的代码:import NavBar from '../../../view/global/NavBar' import { router } from '@kit.ArkUI' import { GetPrepay, GetPrepayReq, payStatus, payStatusReq } from '../../../api/prePay' import { AxiosResponse } from '@ohos/axios' import { GoodsInfo } from '../../../apiMode/prePay' import { HomeSectionHeadView } from '../../comment/HomeSectionHeadView' import { common } from '@kit.AbilityKit' import { bundleManager } from '@kit.MDMKit' import { Order } from '../../../apiMode/responseModel/order/OrderCreate' import { JSON } from '@kit.ArkTS' @Entry @Component struct OrderPay { @State aliPayUrl : string = '' // 支付宝支付链接 @State payInfo : GoodsInfo = new GoodsInfo() // 商品支付信息 @State selectedPay : string = 'wechat' // 当前选中的支付方式 @State paystatus : string = '' // 支付状态 @State price : number = 0 // 支付金额 @State orderId : number = 0; // 订单ID @State payment : string = ''; // 支付宝: alipay 微信:wxpay 学习币:balancepay ,0元支付:zeropay @State expireTime:number = 0; // 订单过期时间 // 获取支付信息方法 getPrepay() { let reqData: GetPrepayReq = { orderId:this.orderId, // 订单ID号 payment:this.payment // 支付方式 } GetPrepay(reqData).then((res: AxiosResponse) => { this.payInfo = res.data.goodsInfo // 商品信息 this.aliPayUrl = res.data.alipay.urlStr // 支付宝支付链接 console.info('商品信息' , JSON.stringify(res.data.goodsInfo)) console.info('支付宝支付网站' , JSON.stringify(this.aliPayUrl))为什么拉起支付宝展示空白页
03-26
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值