|
@@ -1,6 +1,5 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
|
|
-import android.content.ComponentName;
|
|
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
@@ -14,25 +13,21 @@ import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.greendao.DDProviderHelper;
|
|
import com.sheep.gamegroup.greendao.DDProviderHelper;
|
|
|
import com.sheep.gamegroup.greendao.download.SdkLoginUser;
|
|
import com.sheep.gamegroup.greendao.download.SdkLoginUser;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
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.entity.WebParams;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.Constant;
|
|
import com.sheep.gamegroup.util.Constant;
|
|
|
-import com.sheep.gamegroup.util.DataUtil;
|
|
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.LogUtil;
|
|
import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.QQUtil;
|
|
import com.sheep.gamegroup.util.QQUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.Config;
|
|
import com.sheep.jiuyan.samllsheep.Config;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.wxutil.WXAPIUtil;
|
|
|
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
|
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
|
|
import com.tencent.mm.opensdk.modelpay.PayResp;
|
|
import com.tencent.mm.opensdk.modelpay.PayResp;
|
|
|
|
|
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-
|
|
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
|
|
|
|
@@ -146,27 +141,19 @@ public class ActPay extends BaseActivity {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if (PAY_TYPE_MINI.equals(pay_type)) {
|
|
} else if (PAY_TYPE_MINI.equals(pay_type)) {
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().sdkFindOrder(token, order_no)
|
|
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
- Intent intent = new Intent();
|
|
|
|
|
- intent.putExtra(EXTRA_NAME_ORDERNO, order_no);
|
|
|
|
|
- intent.putExtra(EXTRA_NAME_STATUS, STATUS_PAY_ORDER_ERROR);
|
|
|
|
|
- setResult(RESULT_CODE, intent);
|
|
|
|
|
- finish();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- tryMiniOrder();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+// tryMiniOrder();
|
|
|
|
|
+ tryWXMiniPay();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void tryWXMiniPay() {
|
|
|
|
|
+ WXAPIUtil.launchWXMinipay(this, token, order_no);
|
|
|
|
|
+ QQUtil.saveWxPayFrom(SheepApp.getInstance(), order_no, from_package);
|
|
|
|
|
+ QQUtil.saveWxPayOrderNo(SheepApp.getInstance(), order_no, order_no);
|
|
|
|
|
+ QQUtil.saveWxPayOrient(SheepApp.getInstance(), order_no, from_orient);
|
|
|
|
|
+ finish();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void tryWxOrder() {
|
|
public void tryWxOrder() {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getPayWxParams(token, order_no)
|
|
SheepApp.getInstance().getNetComponent().getApiService().getPayWxParams(token, order_no)
|
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribeOn(Schedulers.io())
|
|
@@ -208,12 +195,12 @@ public class ActPay extends BaseActivity {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
- launchMini(baseMessage.getData().toString());
|
|
|
|
|
|
|
+ tryIPaynow(baseMessage.getData().toString());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void launchMini(String payInfo) {
|
|
|
|
|
|
|
+ private void tryIPaynow(String payInfo) {
|
|
|
Log.i("ActPay", "启动小程序支付");
|
|
Log.i("ActPay", "启动小程序支付");
|
|
|
IpaynowPlugin.getInstance()
|
|
IpaynowPlugin.getInstance()
|
|
|
.setMiniProgramEnv(0)
|
|
.setMiniProgramEnv(0)
|