Commit 107e7758 authored by mengcuiguang2's avatar mengcuiguang2

删除支付宝sdk

parent 01bdbbe7
......@@ -228,7 +228,7 @@ dependencies {
// 支付
api project(':rxpay')
api project(':wxpay')
api project(':alipay')
// api project(':alipay')
api project(':oaid')
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
// bugly
......
......@@ -8,8 +8,8 @@ import android.os.Looper
import android.text.TextUtils
import android.view.KeyEvent
import android.view.View
import com.jobo.alipay.AliPay
import com.jobo.alipay.AlipayInfoImpl
//import com.jobo.alipay.AliPay
//import com.jobo.alipay.AlipayInfoImpl
import com.jobo.rxpay.RxPay
import com.jobo.rxpay.callback.IPayCallback
import com.duben.xixiplaylet.R
......@@ -123,29 +123,29 @@ class NinePayActivity : BaseActivity(), View.OnClickListener, NinePayView {
}
//实例化支付宝支付策略
val aliPay = AliPay()
//构造支付宝订单实体。一般都是由服务端直接返回。
val alipayInfoImpl = AlipayInfoImpl()
alipayInfoImpl.setOrderInfo(wxParanBean.params.params)
//策略场景类调起支付方法开始支付,以及接收回调。
RxPay.pay(aliPay, this, alipayInfoImpl, object : IPayCallback {
override fun success() {
UserManager.getInstance().vipFlag = true
ninePayPresenter?.queryVipOrder(wxParanBean.tid.toString(), true)
}
override fun failed(code: Int, message: String?) {
ninePayPresenter?.payError(code)
if (!TextUtils.isEmpty(message)) {
showToast(message)
}
}
override fun cancel() {
ninePayPresenter?.queryVipOrder(wxParanBean.tid.toString(), false)
}
})
// val aliPay = AliPay()
// //构造支付宝订单实体。一般都是由服务端直接返回。
// val alipayInfoImpl = AlipayInfoImpl()
// alipayInfoImpl.setOrderInfo(wxParanBean.params.params)
// //策略场景类调起支付方法开始支付,以及接收回调。
// RxPay.pay(aliPay, this, alipayInfoImpl, object : IPayCallback {
// override fun success() {
// UserManager.getInstance().vipFlag = true
// ninePayPresenter?.queryVipOrder(wxParanBean.tid.toString(), true)
// }
//
// override fun failed(code: Int, message: String?) {
// ninePayPresenter?.payError(code)
// if (!TextUtils.isEmpty(message)) {
// showToast(message)
// }
// }
//
// override fun cancel() {
// ninePayPresenter?.queryVipOrder(wxParanBean.tid.toString(), false)
//
// }
// })
}
/**
......
......@@ -14,8 +14,8 @@ import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.jobo.alipay.AliPay
import com.jobo.alipay.AlipayInfoImpl
//import com.jobo.alipay.AliPay
//import com.jobo.alipay.AlipayInfoImpl
import com.jobo.rxpay.RxPay
import com.jobo.rxpay.callback.IPayCallback
import com.jobo.wxpay.WXPay
......@@ -133,22 +133,38 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
* 设置content样式
*/
private fun setVipContent(bean: VipBean.ListBean) {
if (bean.isAlipay && bean.isWeixin) {
ll_vip_alipay.visibility = View.VISIBLE
if (bean.trial == 0) {
//0-没签约 无0.01
ll_vip_alipay.visibility = View.GONE
ll_vip_wx.visibility = View.VISIBLE
} else if (bean.isAlipay && !bean.isWeixin) {
payType = WEIXIN_PAY
iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
}else{
ll_vip_alipay.visibility = View.VISIBLE
ll_vip_wx.visibility = View.GONE
payType = ALIPAY
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
} else if (!bean.isAlipay && bean.isWeixin) {
ll_vip_alipay.visibility = View.GONE
ll_vip_wx.visibility = View.VISIBLE
payType = WEIXIN_PAY
iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
}
// if (bean.isAlipay && bean.isWeixin) {
// ll_vip_alipay.visibility = View.VISIBLE
// ll_vip_wx.visibility = View.VISIBLE
// } else if (bean.isAlipay && !bean.isWeixin) {
// ll_vip_alipay.visibility = View.VISIBLE
// ll_vip_wx.visibility = View.GONE
// payType = ALIPAY
// iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
// iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
// } else if (!bean.isAlipay && bean.isWeixin) {
// ll_vip_alipay.visibility = View.GONE
// ll_vip_wx.visibility = View.VISIBLE
// payType = WEIXIN_PAY
// iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
// iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
// }
if (!TextUtils.isEmpty(bean.remarks)) {
......@@ -278,6 +294,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
vipBean.pid, isAliPayInstalled()
)
} else if (TextUtils.equals(payType, ALIPAY)) {
if(!isAliPayInstalled()){
showToast("请安装支付宝")
return
}
vipPresenter.getVipPayParams(
"ALIPAY",
vipBean.pid, isAliPayInstalled()
......@@ -390,37 +411,36 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
// 自动签约付费
if (wxParanBean.params.isSign) {
openAutoAlipay(wxParanBean.params.params)
return
}
} catch (e: Exception) {
e.printStackTrace()
}
//实例化支付宝支付策略
val aliPay = AliPay()
//构造支付宝订单实体。一般都是由服务端直接返回。
val alipayInfoImpl = AlipayInfoImpl()
alipayInfoImpl.setOrderInfo(wxParanBean.params.params)
//策略场景类调起支付方法开始支付,以及接收回调。
RxPay.pay(aliPay, this, alipayInfoImpl, object : IPayCallback {
override fun success() {
UserManager.getInstance().vipFlag = true
vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), true)
}
override fun failed(code: Int, message: String?) {
vipPresenter?.payError(code)
if (!TextUtils.isEmpty(message)) {
showToast(message)
}
}
override fun cancel() {
vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), false)
}
})
// //实例化支付宝支付策略
// val aliPay = AliPay()
// //构造支付宝订单实体。一般都是由服务端直接返回。
// val alipayInfoImpl = AlipayInfoImpl()
// alipayInfoImpl.setOrderInfo(wxParanBean.params.params)
// //策略场景类调起支付方法开始支付,以及接收回调。
// RxPay.pay(aliPay, this, alipayInfoImpl, object : IPayCallback {
// override fun success() {
// UserManager.getInstance().vipFlag = true
// vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), true)
// }
//
// override fun failed(code: Int, message: String?) {
// vipPresenter?.payError(code)
// if (!TextUtils.isEmpty(message)) {
// showToast(message)
// }
// }
//
// override fun cancel() {
// vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), false)
//
// }
// })
}
/**
......@@ -480,6 +500,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
vipBean.pid, isAliPayInstalled()
)
} else if (TextUtils.equals(payType, ALIPAY)) {
if(!isAliPayInstalled()){
showToast("请安装支付宝")
return
}
vipPresenter.getVipPayParams(
"ALIPAY",
vipBean.pid, isAliPayInstalled()
......@@ -533,6 +558,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
vipBean.pid, isAliPayInstalled()
)
} else if (TextUtils.equals(payType, ALIPAY)) {
if(!isAliPayInstalled()){
showToast("请安装支付宝")
return
}
vipPresenter.getVipPayParams(
"ALIPAY",
vipBean.pid, isAliPayInstalled()
......@@ -582,6 +612,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
vipBean.pid, isAliPayInstalled()
)
} else if (TextUtils.equals(payType, ALIPAY)) {
if(!isAliPayInstalled()){
showToast("请安装支付宝")
return
}
vipPresenter.getVipPayParams(
"ALIPAY",
vipBean.pid, isAliPayInstalled()
......
include ':app'
include ':oaid'
include ':rxpay'
include ':alipay'
//include ':alipay'
include ':wxpay'
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