- 移动APP支付成功,返回商户之后,为什么没有调用onResp函数?
使用的SDK版本:api 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.0' Activity路径和包名: [图片] Activity代码: public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler { private IWXAPI api; private ElementNative unity; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); unity = new ElementNative(); unity.init(); unity.sendLog("wechat pay entry activity create"); api = WXAPIFactory.createWXAPI(this,getString(R.string.wechat_app_id)); api.handleIntent(getIntent(),this); } protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); api.handleIntent(intent,this); } @Override public void onReq(BaseReq baseReq) { } @Override public void onResp(BaseResp resp) { unity.sendLog("wechat pay response type: " + resp.getType()); if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) { try{ JSONObject data = new JSONObject(); data.put("code", resp.errCode); data.put("message", resp.errStr); data.put("transaction", resp.transaction); unity.sendJson("wechat_pay_result", data); } catch (JSONException e) { unity.sendLog("wechat pay response json:failed. " + e.getMessage()); } } finish(); } } Menifest.xml: <activity android:name=".wxapi.WXPayEntryActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:taskAffinity="net.sourceforge.simcpux" android:launchMode="singleTop" android:exported="true"/> 返回商户之后没有任何反应,在Oncreate里面写的打印log也没有打印。
01-12 - 在安卓手机端发起微信支付请求显示没有权限?
使用如下JAVA代码调起微信支付: com.tencent.mm.opensdk.modelpay.PayReq request = new com.tencent.mm.opensdk.modelpay.PayReq(); request.appId = getString(R.string.wechat_app_id); request.partnerId = getString(R.string.wechat_partner_id); request.prepayId = prepayId; request.packageValue = "Sign=WXPay"; request.nonceStr= nonce; request.timeStamp= timestamp; request.sign= sign; api.sendReq(request); 但是微信那边会出现一个弹框,显示“No permission for seller”。请问要如何解决,没有搜到相关的帖子。
01-11