Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
magicbox
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
magicbox
Commits
2c2232f5
Commit
2c2232f5
authored
Mar 15, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :加入googlePay工具类 [实现方案] :加入loading
parent
87632f7b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
65 deletions
+154
-65
GooglePayActivity.kt
...src/main/java/com/zxhl/cms/googlepay/GooglePayActivity.kt
+12
-1
GooglePayHelper.kt
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
+129
-62
IUserInfoApi.java
cms/src/main/java/com/zxhl/cms/net/api/IUserInfoApi.java
+3
-2
AnyEntity.java
...src/main/java/com/zxhl/cms/net/model/other/AnyEntity.java
+9
-0
strings.xml
cms/src/main/res/values/strings.xml
+1
-0
No files found.
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayActivity.kt
View file @
2c2232f5
...
@@ -8,6 +8,7 @@ import com.ishin.google.bean.GooglePayResult
...
@@ -8,6 +8,7 @@ import com.ishin.google.bean.GooglePayResult
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.R
import
com.zxhl.cms.R
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.widget.LoadingDialog
import
kotlinx.android.synthetic.main.activity_google_pay.*
import
kotlinx.android.synthetic.main.activity_google_pay.*
...
@@ -33,20 +34,30 @@ class GooglePayActivity : BaseActivity() {
...
@@ -33,20 +34,30 @@ class GooglePayActivity : BaseActivity() {
override
fun
layoutID
():
Int
{
override
fun
layoutID
():
Int
{
return
R
.
layout
.
activity_google_pay
return
R
.
layout
.
activity_google_pay
}
}
private
var
mLoading
:
LoadingDialog
?
=
null
override
fun
init
()
{
override
fun
init
()
{
mLoading
=
LoadingDialog
.
getLoadingDialog
(
this
,
getString
(
R
.
string
.
wait_ing2
),
false
,
false
)
id_btn_google_pay
.
setOnClickListener
{
id_btn_google_pay
.
setOnClickListener
{
mLoading
?.
show
()
googlePay
?.
googlePay
(
"0.1"
,
object
:
GooglePayCallBack
{
googlePay
?.
googlePay
(
"0.1"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
)
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
)
{
showToast
(
"success"
+
purchase
.
orderId
)
showToast
(
"success"
+
purchase
.
orderId
)
mLoading
?.
setResult
(
true
,
"pay success"
,
1000
)
}
}
override
fun
onCancel
()
{
override
fun
onCancel
()
{
showToast
(
"onCancel"
)
showToast
(
"onCancel"
)
mLoading
?.
setResult
(
true
,
"pay cancel"
,
1000
)
}
}
override
fun
onError
(
error
:
String
)
{
override
fun
onError
(
error
:
String
)
{
showToast
(
"onError$error"
)
showToast
(
"onError$error"
)
mLoading
?.
setResult
(
true
,
"pay error"
,
1000
)
}
}
})
})
}
}
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
View file @
2c2232f5
This diff is collapsed.
Click to expand it.
cms/src/main/java/com/zxhl/cms/net/api/IUserInfoApi.java
View file @
2c2232f5
...
@@ -2,6 +2,7 @@ package com.zxhl.cms.net.api;
...
@@ -2,6 +2,7 @@ package com.zxhl.cms.net.api;
import
com.zxhl.cms.ad.upload.model.Response
;
import
com.zxhl.cms.ad.upload.model.Response
;
import
com.zxhl.cms.common.NetConfig
;
import
com.zxhl.cms.common.NetConfig
;
import
com.zxhl.cms.net.model.other.AnyEntity
;
import
com.zxhl.cms.net.model.uc.AliPayEntity
;
import
com.zxhl.cms.net.model.uc.AliPayEntity
;
import
com.zxhl.cms.net.model.uc.GooglePayEntity
;
import
com.zxhl.cms.net.model.uc.GooglePayEntity
;
import
com.zxhl.cms.net.model.uc.PayMinEntity
;
import
com.zxhl.cms.net.model.uc.PayMinEntity
;
...
@@ -90,10 +91,10 @@ public interface IUserInfoApi {
...
@@ -90,10 +91,10 @@ public interface IUserInfoApi {
Observable
<
Response
<
GooglePayEntity
>>
googlePay
(
@Query
(
"goodsId"
)
String
goodsId
,
@Query
(
"payType"
)
String
payType
,
@Query
(
"voucherId"
)
String
voucherId
,
@Query
(
"appId"
)
String
appId
,
@Query
(
"payMode"
)
String
payMode
);
Observable
<
Response
<
GooglePayEntity
>>
googlePay
(
@Query
(
"goodsId"
)
String
goodsId
,
@Query
(
"payType"
)
String
payType
,
@Query
(
"voucherId"
)
String
voucherId
,
@Query
(
"appId"
)
String
appId
,
@Query
(
"payMode"
)
String
payMode
);
/**
/**
* google支付成功后 通知后台
更新会员状态
* google支付成功后 通知后台
*/
*/
@POST
(
NetConfig
.
User
.
URL_GOOGLE_NOTIFY
)
@POST
(
NetConfig
.
User
.
URL_GOOGLE_NOTIFY
)
Observable
<
Response
<
A
liPa
yEntity
>>
googlePaySuccess
(
Observable
<
Response
<
A
n
yEntity
>>
googlePaySuccess
(
@Query
(
"packageName"
)
String
packageName
,
@Query
(
"packageName"
)
String
packageName
,
@Query
(
"orderId"
)
String
orderId
,
@Query
(
"orderId"
)
String
orderId
,
@Query
(
"productId"
)
String
productId
,
@Query
(
"productId"
)
String
productId
,
...
...
cms/src/main/java/com/zxhl/cms/net/model/other/AnyEntity.java
0 → 100644
View file @
2c2232f5
package
com
.
zxhl
.
cms
.
net
.
model
.
other
;
/**
* @author (wangXuewei)
* @datetime 2022-03-15 10:25 GMT+8
* @detail :
*/
public
class
AnyEntity
{
}
cms/src/main/res/values/strings.xml
View file @
2c2232f5
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<string
name=
"auth_ing"
>
授权中
</string>
<string
name=
"auth_ing"
>
授权中
</string>
<string
name=
"upload_ing"
>
上传中,请稍后
</string>
<string
name=
"upload_ing"
>
上传中,请稍后
</string>
<string
name=
"wait_ing"
>
请稍后
</string>
<string
name=
"wait_ing"
>
请稍后
</string>
<string
name=
"wait_ing2"
>
Loading
</string>
<string
name=
"get_sms_code_success"
>
验证码已发送
</string>
<string
name=
"get_sms_code_success"
>
验证码已发送
</string>
<string
name=
"nav_back_again_finish"
>
再按一次退出程序
</string>
<string
name=
"nav_back_again_finish"
>
再按一次退出程序
</string>
<string
name=
"album_not_available"
>
请检查系统相册是否可用
</string>
<string
name=
"album_not_available"
>
请检查系统相册是否可用
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment