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
e3d59db6
Commit
e3d59db6
authored
Apr 01, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :加入google支付某个环节断开连接重连机制 [实现方案] :
parent
c4b96a04
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
236 additions
and
120 deletions
+236
-120
version.properties
app/version.properties
+2
-2
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
+182
-49
PayActivity.kt
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
+27
-67
OrderDetailActivity.kt
...n/java/com/zxhl/main/page/activity/OrderDetailActivity.kt
+13
-1
No files found.
app/version.properties
View file @
e3d59db6
PACKAGE_NAME
=
com.zhangxin.magicbox
PACKAGE_NAME
=
com.zhangxin.magicbox
VERSION_CODE
=
12
VERSION_CODE
=
13
VERSION_NAME
=
1.0.3.4
VERSION_NAME
=
1.0.3.5
\ No newline at end of file
\ No newline at end of file
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayActivity.kt
View file @
e3d59db6
...
@@ -60,7 +60,18 @@ class GooglePayActivity : BaseActivity() {
...
@@ -60,7 +60,18 @@ class GooglePayActivity : BaseActivity() {
}
}
// startConnection()
// startConnection()
googlePay
=
GooglePayHelper
(
this
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
googlePay
?.
init
(
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
}
override
fun
onCancel
()
{
}
override
fun
onError
(
error
:
String
)
{
}
})
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
View file @
e3d59db6
This diff is collapsed.
Click to expand it.
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
View file @
e3d59db6
...
@@ -35,8 +35,10 @@ import io.reactivex.Observable
...
@@ -35,8 +35,10 @@ import io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
import
kotlinx.android.synthetic.main.activity_member.*
import
kotlinx.android.synthetic.main.activity_member.*
import
org.json.JSONObject
import
java.util.*
import
java.util.*
/**
/**
* Created by gaoleichao on 2021/8/30
* Created by gaoleichao on 2021/8/30
*/
*/
...
@@ -83,9 +85,25 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -83,9 +85,25 @@ class PayActivity : BaseActivity(), PayContract.View,
false
,
false
,
false
false
)
)
mPresenter
=
PayPresenter
(
this
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
googlePay
?.
init
(
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
//mLoading?.setResult(true, "Pay for success", 1000)
EventUtils
.
onEvent
(
"GooglePaySuccess_bd"
)
}
override
fun
onCancel
()
{
EventUtils
.
onEvent
(
"GooglePayCancel_bd"
)
}
override
fun
onError
(
error
:
String
)
{
Log
.
d
(
"wxw"
,
"补单PayError:$error"
)
EventUtils
.
onEvent
(
"GooglePayError_bd"
,
error
)
}
})
id_img_back
?.
setOnClickListener
{
id_img_back
?.
setOnClickListener
{
finish
()
finish
()
...
@@ -139,7 +157,6 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -139,7 +157,6 @@ class PayActivity : BaseActivity(), PayContract.View,
// setBootmPrice()
// setBootmPrice()
id_tv_my_yu_e
?.
text
=
SettingPreference
.
getUserCoinNum
()
id_tv_my_yu_e
?.
text
=
SettingPreference
.
getUserCoinNum
()
mPresenter
=
PayPresenter
(
this
)
// mAdapter = PayAdapter(this,itemlayout)
// mAdapter = PayAdapter(this,itemlayout)
// val data = VideoEntity()
// val data = VideoEntity()
...
@@ -156,70 +173,13 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -156,70 +173,13 @@ class PayActivity : BaseActivity(), PayContract.View,
}
}
mLoading
?.
setLoading
(
"Loading"
)
mLoading
?.
setLoading
(
"Loading"
)
mLoading
?.
show
()
mLoading
?.
show
()
EventUtils
.
onEvent
(
"pay_page_pay_btn"
,
product
?.
cash
+
""
)
onEvent
(
"pay_page_pay_btn"
,
product
?.
cash
+
""
)
if
(
ifChooseNeedPrice
!!
)
{
if
(
pay_type
==
GOOGLE_PAY
)
{
if
(
pay_type
==
1
)
{
googlePay
(
product
?.
goodsId
?:
""
)
mPresenter
?.
requestAliPay
(
}
else
if
(
pay_type
==
PAY_PAL_PAY
)
{
this
,
onEvent
(
"pay_type_error"
,
"暂不支持paypal"
)
id_tv_need_price
.
text
.
toString
(),
pay_type
.
toString
(),
"6"
)
}
else
{
if
(
pay_type
==
2
)
{
Log
.
e
(
"MXL"
,
"微信原生支付"
)
mPresenter
?.
requestWechatPayOrder
(
""
,
pay_type
.
toString
())
}
else
if
(
pay_type
==
11
)
{
Log
.
e
(
"MXL"
,
"微信连连支付"
)
mPresenter
?.
requestWechatPayOrder
(
""
,
pay_type
.
toString
())
}
else
{
Log
.
e
(
"MXL"
,
"微信敏支付"
)
mPresenter
?.
requestMiniProgrom
(
id_tv_need_price
.
text
.
toString
(),
pay_type
.
toString
(),
"6"
)
}
}
}
else
{
}
else
{
if
(
pay_type
==
ALI_PAY
)
{
onEvent
(
"pay_type_error"
,
"pay_type$pay_type"
)
mPresenter
?.
requestAliPay
(
this
,
product
?.
goodsId
?:
""
,
pay_type
.
toString
(),
"6"
)
}
else
if
(
pay_type
==
GOOGLE_PAY
)
{
googlePay
(
product
?.
goodsId
?:
""
)
}
else
if
(
pay_type
==
PAY_PAL_PAY
)
{
}
else
{
if
(
pay_type
==
2
)
{
Log
.
e
(
"MXL"
,
"2微信原生支付"
)
mPresenter
?.
requestWechatPayOrder
(
product
?.
goodsId
?:
""
,
pay_type
.
toString
()
)
}
else
if
(
pay_type
==
11
)
{
Log
.
e
(
"MXL"
,
"2微信连连支付"
)
mPresenter
?.
requestWechatPayOrder
(
product
?.
goodsId
?:
""
,
pay_type
.
toString
()
)
}
else
{
Log
.
e
(
"MXL"
,
"2微信敏支付"
)
mPresenter
?.
requestMiniProgrom
(
product
?.
goodsId
?:
""
,
pay_type
.
toString
(),
"6"
)
}
}
}
}
}
}
...
@@ -560,7 +520,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -560,7 +520,7 @@ class PayActivity : BaseActivity(), PayContract.View,
}
}
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
show
()
mLoading
?.
show
()
googlePay
?.
googlePay
(
goodsId
,
"6"
,
object
:
GooglePayCallBack
{
googlePay
?.
googlePay
(
goodsId
,
"6"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
//mLoading?.setResult(true, "Pay for success", 1000)
//mLoading?.setResult(true, "Pay for success", 1000)
...
@@ -579,7 +539,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -579,7 +539,7 @@ class PayActivity : BaseActivity(), PayContract.View,
runOnUiThread
{
runOnUiThread
{
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
}
}
EventUtils
.
onEvent
(
"GooglePayError"
,
error
)
EventUtils
.
onEvent
(
"GooglePayError"
,
error
)
}
}
})
})
}
}
...
...
moduleMain/src/main/java/com/zxhl/main/page/activity/OrderDetailActivity.kt
View file @
e3d59db6
...
@@ -269,7 +269,19 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -269,7 +269,19 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
fun
initPayConfig
()
{
fun
initPayConfig
()
{
googlePay
=
GooglePayHelper
(
this
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
googlePay
?.
init
(
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
}
override
fun
onCancel
()
{
}
override
fun
onError
(
error
:
String
)
{
}
})
mPayresenter
=
PayPresenter
(
this
)
mPayresenter
=
PayPresenter
(
this
)
mPayresenter
?.
appInfo
()
mPayresenter
?.
appInfo
()
...
...
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