-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
app/src/main/java/com/sdwfqin/quickseed/wxapi/WXPayEntryActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.sdwfqin.quickseed.wxapi; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
|
||
import com.blankj.utilcode.util.LogUtils; | ||
import com.sdwfqin.quicklib.base.Constants; | ||
import com.sdwfqin.quicklib.module.wechat.pay.WechatPay; | ||
import com.sdwfqin.quickseed.R; | ||
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; | ||
|
||
public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler { | ||
|
||
private IWXAPI api; | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.pay_result); | ||
|
||
api = WXAPIFactory.createWXAPI(this, Constants.APP_ID); | ||
api.handleIntent(getIntent(), this); | ||
} | ||
|
||
@Override | ||
protected void onNewIntent(Intent intent) { | ||
super.onNewIntent(intent); | ||
setIntent(intent); | ||
api.handleIntent(intent, this); | ||
} | ||
|
||
@Override | ||
public void onReq(BaseReq req) { | ||
} | ||
|
||
@Override | ||
public void onResp(BaseResp resp) { | ||
WechatPay.getInstance().onResp(resp.errCode); | ||
LogUtils.e("onPayFinish, errCode = " + resp.errCode); | ||
finish(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters