Commit 84509c18a4f0d7ae2092550b32b94a2a896e24ee
1 parent
e845715e17
Exists in
master
v1.0.5
微信支付修改为web形式
Showing 8 changed files with 58 additions and 50 deletions Side-by-side Diff
- InlandSDKDemo/AndroidManifest.xml
- InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
- InlandSDKDemo/src/com/ninjaonline/wxapi/WXPayEntryActivity.java
- InlandSDKRelease/libs/InlandSDK_v1.0.4_proguard.jar
- InlandSDKRelease/libs/InlandSDK_v1.0.5_proguard.jar
- InlandSDKRelease/res/layout/pay_container.xml
- InlandSDKRelease/res/values/strings.xml
- IntegrationGuide.md
InlandSDKDemo/AndroidManifest.xml
... | ... | @@ -19,7 +19,6 @@ |
19 | 19 | <uses-permission android:name="android.permission.WRITE_SETTINGS" /> |
20 | 20 | <!-- 以下是银联支付专用 --> |
21 | 21 | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> |
22 | - | |
23 | 22 | |
24 | 23 | <application |
25 | 24 | android:allowBackup="true" |
... | ... | @@ -27,11 +26,12 @@ |
27 | 26 | android:label="@string/app_name" > |
28 | 27 | <activity |
29 | 28 | android:name="com.gump.inland.sdk.demo.MainActivity" |
30 | - android:screenOrientation="landscape" | |
31 | 29 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
32 | - android:label="@string/app_name" > | |
30 | + android:label="@string/app_name" | |
31 | + android:screenOrientation="landscape" > | |
33 | 32 | <intent-filter> |
34 | 33 | <action android:name="android.intent.action.MAIN" /> |
34 | + | |
35 | 35 | <category android:name="android.intent.category.LAUNCHER" /> |
36 | 36 | </intent-filter> |
37 | 37 | <intent-filter> |
... | ... | @@ -45,13 +45,14 @@ |
45 | 45 | <activity |
46 | 46 | android:name="com.gump.inland.gamesdk.PassportBaseActivity" |
47 | 47 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
48 | + android:launchMode="singleTask" | |
48 | 49 | android:theme="@style/Theme.TransparentWin" > |
49 | 50 | </activity> |
50 | 51 | <!-- wx callback --> |
51 | - <activity | |
52 | - android:name="com.ninjaonline.wxapi.WXPayEntryActivity" | |
53 | - android:exported="true" > | |
54 | - </activity> | |
52 | + <!-- <activity --> | |
53 | + <!-- android:name="com.ninjaonline.wxapi.WXPayEntryActivity" --> | |
54 | + <!-- android:exported="true" > --> | |
55 | + <!-- </activity> --> | |
55 | 56 | <!-- unionPay --> |
56 | 57 | <activity |
57 | 58 | android:name="com.unionpay.uppay.PayActivity" |
... | ... | @@ -60,7 +61,7 @@ |
60 | 61 | android:label="@string/app_name" |
61 | 62 | android:screenOrientation="portrait" |
62 | 63 | android:windowSoftInputMode="adjustResize" /> |
63 | - <!-- alipay sdk begin --> | |
64 | + <!-- alipay sdk begin --> | |
64 | 65 | <activity |
65 | 66 | android:name="com.alipay.sdk.app.H5PayActivity" |
66 | 67 | android:configChanges="orientation|keyboardHidden|navigation" |
... | ... | @@ -70,6 +71,13 @@ |
70 | 71 | </activity> |
71 | 72 | |
72 | 73 | <!-- alipay sdk end --> |
74 | + | |
75 | + <activity | |
76 | + android:name="com.gump.inland.gamesdk.PurchaseActivity" | |
77 | + android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" | |
78 | + android:launchMode="singleTask" | |
79 | + android:theme="@android:style/Theme.Translucent.NoTitleBar" > | |
80 | + </activity> | |
73 | 81 | </application> |
74 | 82 | |
75 | 83 | </manifest> |
76 | 84 | \ No newline at end of file |
InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
... | ... | @@ -81,21 +81,39 @@ public class MainActivity extends Activity { |
81 | 81 | InlandSDK.purchase(MainActivity.this, payRequest, new PurchaseCallback() { |
82 | 82 | |
83 | 83 | @Override |
84 | - public void onPurchaseError(Exception e) { | |
84 | + public void onPurchaseError(final Exception e) { | |
85 | 85 | Log.w(TAG, "purchase error:" + e.getMessage()); |
86 | - tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); | |
86 | + runOnUiThread(new Runnable() { | |
87 | + | |
88 | + @Override | |
89 | + public void run() { | |
90 | + tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); | |
91 | + } | |
92 | + }); | |
87 | 93 | } |
88 | 94 | |
89 | 95 | @Override |
90 | - public void onPurchaseSuccess(String gumpTransId, String extOrder) { | |
96 | + public void onPurchaseSuccess(final String gumpTransId, final String extOrder) { | |
91 | 97 | Log.d(TAG, "purchase success:" + gumpTransId + ",extorder:" + extOrder); |
92 | - tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); | |
98 | + runOnUiThread(new Runnable() { | |
99 | + | |
100 | + @Override | |
101 | + public void run() { | |
102 | + tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); | |
103 | + } | |
104 | + }); | |
93 | 105 | } |
94 | 106 | |
95 | 107 | @Override |
96 | 108 | public void onPurchaseCanceled() { |
97 | 109 | Log.d(TAG, "purchase be canceled"); |
98 | - tvPurchaseResult.setText("purchase be canceled"); | |
110 | + runOnUiThread(new Runnable() { | |
111 | + | |
112 | + @Override | |
113 | + public void run() { | |
114 | + tvPurchaseResult.setText("purchase be canceled"); | |
115 | + } | |
116 | + }); | |
99 | 117 | } |
100 | 118 | }); |
101 | 119 | } |
InlandSDKDemo/src/com/ninjaonline/wxapi/WXPayEntryActivity.java
InlandSDKRelease/libs/InlandSDK_v1.0.4_proguard.jar
No preview for this file type
InlandSDKRelease/libs/InlandSDK_v1.0.5_proguard.jar
No preview for this file type
InlandSDKRelease/res/layout/pay_container.xml
... | ... | @@ -5,22 +5,22 @@ |
5 | 5 | android:background="@color/payment_common_bg" |
6 | 6 | android:orientation="vertical" > |
7 | 7 | |
8 | - <Button | |
9 | - android:id="@+id/wx_pay" | |
8 | + <ProgressBar | |
9 | + android:id="@+id/loading_prog" | |
10 | + style="@android:style/Widget.ProgressBar.Horizontal" | |
10 | 11 | android:layout_width="match_parent" |
11 | - android:layout_height="wrap_content" | |
12 | - android:text="微信支付" /> | |
12 | + android:layout_height="2dp" /> | |
13 | 13 | |
14 | - <Button | |
15 | - android:id="@+id/ali_pay" | |
16 | - android:layout_width="match_parent" | |
17 | - android:layout_height="wrap_content" | |
18 | - android:text="支付宝" /> | |
14 | + <WebView | |
15 | + android:id="@+id/mycard_web" | |
16 | + android:layout_width="fill_parent" | |
17 | + android:layout_height="fill_parent" /> | |
19 | 18 | |
20 | - <Button | |
21 | - android:id="@+id/union_pay" | |
22 | - android:layout_width="match_parent" | |
23 | - android:layout_height="wrap_content" | |
24 | - android:text="银联支付" /> | |
19 | +<!-- <LinearLayout --> | |
20 | +<!-- android:id="@+id/container" --> | |
21 | +<!-- android:layout_width="match_parent" --> | |
22 | +<!-- android:layout_height="wrap_content" --> | |
23 | +<!-- android:orientation="vertical" > --> | |
24 | +<!-- </LinearLayout> --> | |
25 | 25 | |
26 | 26 | </LinearLayout> |
27 | 27 | \ No newline at end of file |
InlandSDKRelease/res/values/strings.xml
... | ... | @@ -25,11 +25,11 @@ |
25 | 25 | |
26 | 26 | <string-array name="payment_channel"> |
27 | 27 | <item>支付宝</item> |
28 | -<!-- <item>银联支付</item> --> | |
29 | -<!-- <item>微信支付</item> --> | |
28 | + <item>银联支付</item> | |
29 | + <item>微信支付</item> | |
30 | 30 | </string-array> |
31 | 31 | <string-array name="payment_channel_without_wx"> |
32 | 32 | <item>支付宝</item> |
33 | -<!-- <item>银联支付</item> --> | |
33 | + <item>银联支付</item> | |
34 | 34 | </string-array> |
35 | 35 | </resources> |
36 | 36 | \ No newline at end of file |
IntegrationGuide.md
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | <!-- 以下是银联支付专用 --> |
18 | 18 | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> |
19 | 19 | |
20 | -2)需要在application内增加如下内容,**微信回调activity必须是 "项目包名.wxapi.WXPayEntryActivity",不可更改,且此activity需继承com.gump.inland.gamesdk.WXPayEntryBaseActivity**: | |
20 | +2)需要在application内增加如下内容: | |
21 | 21 | |
22 | 22 | <activity |
23 | 23 | android:name="com.gump.inland.gamesdk.PassportBaseActivity" |
... | ... | @@ -28,11 +28,7 @@ |
28 | 28 | android:name="com.gump.inland.gamesdk.PaymentActivity" |
29 | 29 | android:theme="@android:style/Theme.Light.NoTitleBar" > |
30 | 30 | </activity> |
31 | - <!-- wx callback 需要根据规则配置,此处请勿直接拷贝--> | |
32 | - <activity | |
33 | - android:name="yourPackageName.wxapi.WXPayEntryActivity" | |
34 | - android:exported="true" > | |
35 | - </activity> | |
31 | + | |
36 | 32 | <!-- unionPay --> |
37 | 33 | <activity |
38 | 34 | android:name="com.unionpay.uppay.PayActivity" |
... | ... | @@ -51,15 +47,6 @@ |
51 | 47 | </activity> |
52 | 48 | <!-- alipay sdk end --> |
53 | 49 | |
54 | -3)入口activity增加**android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout"**属性,并增加以下Intent-filter,**data scheme配置为微信appid**: | |
55 | - | |
56 | - <intent-filter> | |
57 | - <action android:name="android.intent.action.VIEW" /> | |
58 | - | |
59 | - <category android:name="android.intent.category.DEFAULT" /> | |
60 | - <!-- 此处为微信的appid--> | |
61 | - <data android:scheme="wxdb562d299ac311e0" /> | |
62 | - </intent-filter> | |
63 | 50 | |
64 | 51 | 4.将InlandSDKRelease工程assets目录下的文件拷贝到游戏项目的assets目录下,此处为银联支付使用 |
65 | 52 | 5.代码接入: |