Commit e3d59db6 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :加入google支付某个环节断开连接重连机制
[实现方案] :
parent c4b96a04
PACKAGE_NAME=com.zhangxin.magicbox
VERSION_CODE=12
VERSION_NAME=1.0.3.4
\ No newline at end of file
VERSION_CODE=13
VERSION_NAME=1.0.3.5
\ No newline at end of file
......@@ -60,7 +60,18 @@ class GooglePayActivity : BaseActivity() {
}
// startConnection()
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() {
......
......@@ -35,8 +35,10 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.activity_member.*
import org.json.JSONObject
import java.util.*
/**
* Created by gaoleichao on 2021/8/30
*/
......@@ -83,9 +85,25 @@ class PayActivity : BaseActivity(), PayContract.View,
false,
false
)
mPresenter = PayPresenter(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 {
finish()
......@@ -139,7 +157,6 @@ class PayActivity : BaseActivity(), PayContract.View,
// setBootmPrice()
id_tv_my_yu_e?.text = SettingPreference.getUserCoinNum()
mPresenter = PayPresenter(this)
// mAdapter = PayAdapter(this,itemlayout)
// val data = VideoEntity()
......@@ -156,70 +173,13 @@ class PayActivity : BaseActivity(), PayContract.View,
}
mLoading?.setLoading("Loading")
mLoading?.show()
EventUtils.onEvent("pay_page_pay_btn", product?.cash + "")
if (ifChooseNeedPrice!!) {
if (pay_type == 1) {
mPresenter?.requestAliPay(
this,
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"
)
}
}
onEvent("pay_page_pay_btn", product?.cash + "")
if (pay_type == GOOGLE_PAY) {
googlePay(product?.goodsId ?: "")
} else if (pay_type == PAY_PAL_PAY) {
onEvent("pay_type_error", "暂不支持paypal")
} else {
if (pay_type == ALI_PAY) {
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"
)
}
}
onEvent("pay_type_error", "pay_type$pay_type")
}
}
......@@ -560,7 +520,7 @@ class PayActivity : BaseActivity(), PayContract.View,
}
mLoading?.setLoading(getString(R.string.wait_ing2))
mLoading?.show()
googlePay?.googlePay(goodsId,"6", object : GooglePayCallBack {
googlePay?.googlePay(goodsId, "6", object : GooglePayCallBack {
override fun onPaySuccess(purchase: GooglePayResult, googleJson: String) {
mPresenter?.verifyPay(googleJson, GOOGLE_PAY)
//mLoading?.setResult(true, "Pay for success", 1000)
......@@ -579,7 +539,7 @@ class PayActivity : BaseActivity(), PayContract.View,
runOnUiThread {
mLoading?.setResult(false, "pay error", 1000)
}
EventUtils.onEvent("GooglePayError",error)
EventUtils.onEvent("GooglePayError", error)
}
})
}
......
......@@ -269,7 +269,19 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
fun initPayConfig() {
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?.appInfo()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment