|
|
@@ -12,14 +12,17 @@ import com.ipaynow.plugin.manager.route.dto.ResponseParams;
|
|
|
import com.ipaynow.plugin.manager.route.impl.ReceivePayResult;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
+import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.entity.WebParams;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.Constant;
|
|
|
+import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.QQUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.Config;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
|
|
import com.tencent.mm.opensdk.modelpay.PayResp;
|
|
|
|
|
|
@@ -78,8 +81,27 @@ public class ActPay extends BaseActivity {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private String checkToken() {
|
|
|
+ if (TextUtils.isEmpty(token)) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ String tokenPrev = DataUtil.getInstance().getUserId() + "@";
|
|
|
+ if (token.startsWith(tokenPrev)) {
|
|
|
+ return SpUtils.getToken(this);
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void initData() {
|
|
|
+ UserEntity user = DataUtil.getInstance().getUserEntity();
|
|
|
+ if (user == null) {
|
|
|
+ Jump2View.getInstance().goRechargeResult(this, "9001", from_package, null, "请先登录");
|
|
|
+ finish();
|
|
|
+ return;
|
|
|
+ }
|
|
|
Intent intent = getIntent();
|
|
|
Bundle bundle = intent.getExtras();
|
|
|
if (bundle != null) {
|
|
|
@@ -87,6 +109,14 @@ public class ActPay extends BaseActivity {
|
|
|
pay_type = bundle.getString("pay_type");
|
|
|
from_package = bundle.getString("from_package");
|
|
|
token = bundle.getString("token");
|
|
|
+ String tokenPrev = user.getId() + "@";
|
|
|
+ if (token.startsWith(tokenPrev)) {
|
|
|
+ token = SpUtils.getToken(this);
|
|
|
+ } else {
|
|
|
+ Jump2View.getInstance().goRechargeResult(this, "9001", from_package, null, "游戏与小绵羊用户信息不一致");
|
|
|
+ finish();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (TextUtils.isEmpty(pay_type) || PAY_TYPE_COIN.equals(pay_type)) {
|
|
|
String url = Config.getUrlByPath(Config.PATH_DIRECTIONAL_PAY + "?authorization=" + token + "&order=" + order_no + "&ssnocache=1");
|
|
|
WebParams webParams = new WebParams(url, "支付").setShowTitle(false).setForResult(true).setAction(Constant.INTENT_PAY);
|