本文整理汇总了Java中com.tencent.mm.opensdk.constants.ConstantsAPI.COMMAND_PAY_BY_WX属性的典型用法代码示例。如果您正苦于以下问题:Java ConstantsAPI.COMMAND_PAY_BY_WX属性的具体用法?Java ConstantsAPI.COMMAND_PAY_BY_WX怎么用?Java ConstantsAPI.COMMAND_PAY_BY_WX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.tencent.mm.opensdk.constants.ConstantsAPI
的用法示例。
在下文中一共展示了ConstantsAPI.COMMAND_PAY_BY_WX属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResp
@Override
public void onResp(BaseResp resp) {
Log.e(TAG, "transaction = " + resp.transaction + ", type = " + resp.getType() + ", errCode = " + resp.errCode + ", err = " + resp.errStr);
if (resp.errCode == BaseResp.ErrCode.ERR_OK) {
switch (resp.getType()) {
case ConstantsAPI.COMMAND_SENDAUTH:
onResultOk((SendAuth.Resp) resp);
break;
case ConstantsAPI.COMMAND_PAY_BY_WX:
onResultOk((PayResp) resp);
break;
case ConstantsAPI.COMMAND_SENDMESSAGE_TO_WX:
onResultOk((SendMessageToWX.Resp) resp);
break;
}
} else if (resp.errCode == BaseResp.ErrCode.ERR_USER_CANCEL) {
mCallback.onFailed(mActivity, ResultCode.RESULT_CANCELLED, toMessage(resp));
} else {
mCallback.onFailed(mActivity, ResultCode.RESULT_FAILED, toMessage(resp));
}
mCallback.onCompleted(mActivity);
}
示例2: onResp
@Override
public void onResp(BaseResp resp) {
Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
// builder.setTitle(R.string.app_tip);
// builder.setMessage(getString(R.string.pay_result_callback_msg, String.valueOf(resp.errCode)));
// builder.show();
if (resp.errCode == 0){
Log.e("WXPayEvent",resp.errCode+":"+WXPayEvent.PAY_Ok);
EventBus.getDefault().post(new WXPayEvent(WXPayEvent.PAY_Ok));
}else{
Log.e("WXPayEvent",resp.errCode+":"+WXPayEvent.PAY_ERR);
EventBus.getDefault().post(new WXPayEvent(WXPayEvent.PAY_ERR));
}
finish();
}
}
示例3: onResp
@Override
public void onResp(BaseResp resp) {
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
// resp.errCode == -1
// 原因:支付错误,可能的原因:签名错误、未注册APPID、项目设置APPID不正确、注册的APPID与设置的不匹配、其他异常等
// resp.errCode == -2 原因 用户取消,无需处理。发生场景:用户不支付了,点击取消,返回APP
if (resp.errCode == 0) {
ToastUtil.showToast(this, "微信支付成功");
if (JrmfClient.WX_PAY_TYPE == JrmfClient.WX_PAY_TYPE_RED_PACKET) {
// 发红包支付成功-需要关闭支付页面
JrmfRpClient.closePayAndSendRpPageWithResult();
} else if (JrmfClient.WX_PAY_TYPE == JrmfClient.WX_PAY_TYPE_WALLET_PAY) {
//关闭收银台支付页面并提示用户
// JrmfWalletPayClient.closePayPageWithResult();
}
} else {
ToastUtil.showToast(this, "取消" + resp.errCode + "test");
}
finish();
}
}
示例4: onResp
@Override
public void onResp(BaseResp resp) {
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
if(resp.errCode == 0)
{
Toast.makeText(this, "支付成功", Toast.LENGTH_LONG).show();
}
else if(resp.errCode == -1)
{
Toast.makeText(this, "支付出错:" + resp.errStr, Toast.LENGTH_LONG).show();
}
else if(resp.errCode == -2)
{
Toast.makeText(this, "取消支付", Toast.LENGTH_LONG).show();
}
}
finish();
}
示例5: onResp
@Override
public void onResp(BaseResp baseResp) {
if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
Wxpay.getInstance(this).onResp(baseResp);
finish();
}
}
示例6: onResp
@Override
public void onResp(BaseResp baseResp) {
if(baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
if(WxPay.getCurrentIns() != null) {
if(baseResp.errStr != null) {
Log.e("wxpay", "errstr=" + baseResp.errStr);
}
WxPay.getCurrentIns().onResp(baseResp.errCode);
}
finish();
}
}
示例7: onResp
@Override
public void onResp(BaseResp resp) {
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("提示");
String result = resp.errCode == 0 ? "成功" : resp.errCode == -1 ? "失败" : "取消";
builder.setMessage("微信支付结果:" + result);
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
finish();
}
});
builder.show();
if (resp.errCode == 0) {
if (PayActivity.instance != null) {
//1财神币 2微信 3支付宝 4银联 5积分
PayActivity.instance.finishPay(2);
}
if (TributePayActivity.instance != null) {
try {
TributePayActivity.instance.doNext();
} catch (Exception e) {
}
}
if (MyOrderDelegate.instance != null) {
MyOrderDelegate.instance.refreshData(1);
MyOrderDelegate.instance.refreshData(2);
}
if (MoneyHistoryActivity.instance != null) {
MoneyHistoryActivity.instance.reFreshHistory();
CenterFragment.instance.getMyInfo();
}
if (PayShopActivity.instance != null) {
PayShopActivity.instance.finish();
}
}
finish();
}
}