flutter对接微信支付(fluwx)

在这里插入图片描述

后台调用微信预支付接口获取prepay_id和nonce_str供前段唤醒微信使用。需二次签名,不可直接使用返回值中的sign。

private SfwDataOut wXPayInit(String ip, String order_id, String description, String tradeType, int totalFee) throws Exception {
   
        SfwDataOut sfwOut = new SfwDataOut();
        Map<String, String> paramMap = new HashMap<String, String>();
        String key = "4E5D171E22BF2B975ED7F410EC54EF75";
        String appId = "wx066b1f5851da7dd5";
        String mchId = "1610832735";

        paramMap.put("appid", appId); // 商家平台ID
        paramMap.put("body", description); // 商家名称-销售商品类目、String(128)
        paramMap.put("mch_id", mchId); // 商户ID
        paramMap.put("nonce_str", WXPayUtil.generateNonceStr()); // UUID
        paramMap.put("out_trade_no", order_id);// 订单号,每次都不同
        paramMap.put("spbill_create_ip", ip);
        paramMap.put("total_fee", "1"); // 支付金额,单位分
        paramMap.put("notify_url", "http://www.zoni8.cn/app/wx/callback");// 此路径是微信服务器调用支付结果通知路径随意写
        paramMap.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值