Javen205 / JPay

🔥对微信App支付、支付宝App支付、银联APP支付的二次封装,对外提供一个相对简单的接口以及支付结果的回调
http://javen.blog.csdn.net
426 stars 91 forks source link

微信支付没有回调 #2

Closed Javen205 closed 7 years ago

Javen205 commented 7 years ago

此问题是没有给mJPayListener赋值,下版本会修复,修改方法如下

 public void startWXPay(String appId,String partnerId,String prepayId,
                           String nonceStr,String timeStamp,String sign,JPayListener listener){
        mJPayListener = listener;
        init(appId);
        if (!checkWx()) {
            if(listener != null) {
                listener.onPayError(JPay.WEIXIN_VERSION_LOW,"未安装微信或者微信版本过低");
            }
            return;
        }
        PayReq request = new PayReq();
        request.appId = appId;
        request.partnerId = partnerId;
        request.prepayId= prepayId;
        request.packageValue = "Sign=WXPay";
        request.nonceStr=nonceStr;
        request.timeStamp= timeStamp;
        request.sign= sign;
        mIWXAPI.sendReq(request);
    }
Javen205 commented 7 years ago

问题已解决,请使用最新版本。