70 lines
2.0 KiB
Java
70 lines
2.0 KiB
Java
package com.kyzy.bazi.wxapi;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import com.kyzy.bazi.AppConfig;
|
|
import com.kyzy.bazi.EventMessage;
|
|
import com.kyzy.bazi.utils.show.ToastUtil;
|
|
//import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
|
//import com.tencent.mm.opensdk.modelbase.BaseReq;
|
|
//import com.tencent.mm.opensdk.modelbase.BaseResp;
|
|
//import com.tencent.mm.opensdk.openapi.IWXAPI;
|
|
//import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
|
|
//import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
|
|
|
import de.greenrobot.event.EventBus;
|
|
|
|
public class WXPayEntryActivity extends Activity {
|
|
|
|
// private IWXAPI api;
|
|
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
// 微信 SDK 依赖已移除
|
|
// api = WXAPIFactory.createWXAPI(this, AppConfig.WX_APPID);
|
|
// api.handleIntent(getIntent(), this);
|
|
finish();
|
|
}
|
|
|
|
/* 微信 SDK 依赖已移除
|
|
@Override
|
|
public void onReq(BaseReq baseReq) {
|
|
if(baseReq != null){
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onResp(BaseResp baseResp) {
|
|
if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
|
|
int code = baseResp.errCode;
|
|
switch (code){
|
|
case 0://支付成功
|
|
EventBus.getDefault().post(new EventMessage(EventMessage.WX_PAY_SUCCESS));
|
|
finish();
|
|
break;
|
|
case -2:
|
|
ToastUtil.showShort(WXPayEntryActivity.this,"取消支付");
|
|
finish();
|
|
break;
|
|
case -1:
|
|
ToastUtil.showShort(WXPayEntryActivity.this,"参数错误");
|
|
finish();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
@Override
|
|
protected void onNewIntent(Intent intent) {
|
|
super.onNewIntent(intent);
|
|
setIntent(intent);
|
|
// api.handleIntent(intent, this);
|
|
}
|
|
}
|