秦华影视 v1.0.0版本的 MD5 值为:90520322e40df4849cf4989ab6339524
以下内容为反编译后的 OrderPayModel.java 源代码,内容仅作参考
package com.payeasenet.wepay.ui.viewModel;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.view.View;
import androidx.databinding.ObservableField;
import com.alibaba.fastjson.JSON;
import com.ehking.sdk.wepay.interfaces.WalletPay;
import com.ehking.sdk.wepay.net.bean.AuthType;
import com.ehking.sdk.wepay.net.bean.AuthTypeName;
import com.ehking.sdk.wepay.net.bean.Status;
import com.ehking.sdk.wepay.utlis.LogUtil;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.payeasenet.service.sdk.ui.activity.ServicesWebActivity;
import com.payeasenet.wepay.constant.Constants;
import com.payeasenet.wepay.net.api.WepayApi;
import com.payeasenet.wepay.net.bean.ResponseBean;
import com.payeasenet.wepay.net.client.RetrofitClient;
import com.payeasenet.wepay.net.rxjava.FailedFlowable;
import com.payeasenet.wepay.ui.activity.EndingActivity;
import com.payeasenet.wepay.ui.activity.OrderPayActivity;
import com.payeasenet.wepay.utlis.NetUtils;
import com.payeasenet.wepay.utlis.ToastUtil;
import io.reactivex.android.schedulers.AndroidSchedulers;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import p.a.y.e.a.s.e.net.r5;
import p.a.y.e.a.s.e.net.ty2;
import p.a.y.e.a.s.e.net.yb3;
import p.a.y.e.a.s.e.net.zw2;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u001f\u001a\u00020\u001e¢\u0006\u0004\b'\u0010(J3\u0010\u0007\u001a\u00020\u00062\"\u0010\u0005\u001a\u001e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00030\u0002j\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u0003`\u0004H\u0002¢\u0006\u0004\b\u0007\u0010\bJ\u0015\u0010\u000b\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\t¢\u0006\u0004\b\u000b\u0010\fR\u001f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00030\r8\u0006@\u0006¢\u0006\f\n\u0004\b\u000e\u0010\u000f\u001a\u0004\b\u0010\u0010\u0011R\"\u0010\u0012\u001a\u00020\u00038\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b\u0012\u0010\u0013\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R\u001f\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\u00030\r8\u0006@\u0006¢\u0006\f\n\u0004\b\u0018\u0010\u000f\u001a\u0004\b\u0019\u0010\u0011R\u001f\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\u001a0\r8\u0006@\u0006¢\u0006\f\n\u0004\b\u001b\u0010\u000f\u001a\u0004\b\u001b\u0010\u0011R\u001f\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00030\r8\u0006@\u0006¢\u0006\f\n\u0004\b\u001c\u0010\u000f\u001a\u0004\b\u001d\u0010\u0011R\u0016\u0010\u001f\u001a\u00020\u001e8\u0002@\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001f\u0010 R\u0016\u0010\"\u001a\u00020!8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\"\u0010#R\u0016\u0010%\u001a\u00020$8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b%\u0010&¨\u0006)"}, d2 = {"Lcom/payeasenet/wepay/ui/viewModel/OrderPayModel;", "", "Ljava/util/HashMap;", "", "Lkotlin/collections/HashMap;", "map", "", "queryResult", "(Ljava/util/HashMap;)V", "Landroid/view/View;", "view", "sure", "(Landroid/view/View;)V", "Landroidx/databinding/ObservableField;", "description", "Landroidx/databinding/ObservableField;", "getDescription", "()Landroidx/databinding/ObservableField;", "source", "Ljava/lang/String;", "getSource", "()Ljava/lang/String;", "setSource", "(Ljava/lang/String;)V", "remark", "getRemark", "", "isClick", Constants.amount, "getAmount", "Lcom/payeasenet/wepay/ui/activity/OrderPayActivity;", "mActivity", "Lcom/payeasenet/wepay/ui/activity/OrderPayActivity;", "Landroid/os/Handler;", "handler", "Landroid/os/Handler;", "", "maxCount", "I", "<init>", "(Lcom/payeasenet/wepay/ui/activity/OrderPayActivity;)V", "module-wepay_release"}, k = 1, mv = {1, 4, 0})
public final class OrderPayModel {
@NotNull
private final ObservableField<String> amount;
@NotNull
private final ObservableField<String> description;
private Handler handler;
@NotNull
private final ObservableField<Boolean> isClick;
private final OrderPayActivity mActivity;
private int maxCount;
@NotNull
private final ObservableField<String> remark;
@NotNull
private String source;
public OrderPayModel(@NotNull OrderPayActivity mActivity) {
Intrinsics.checkParameterIsNotNull(mActivity, "mActivity");
this.mActivity = mActivity;
this.amount = new ObservableField<>("");
this.description = new ObservableField<>("");
this.remark = new ObservableField<>("");
this.source = AuthType.ONLINEPAY.name();
this.isClick = new ObservableField<>(Boolean.FALSE);
this.maxCount = 5;
this.handler = new Handler();
}
public final void queryResult(final HashMap<String, String> map) {
RetrofitClient companion = RetrofitClient.INSTANCE.getInstance();
Context applicationContext = this.mActivity.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext, "mActivity.applicationContext");
zw2<ResponseBean.RechargeQuery> h3 = ((WepayApi) companion.create(applicationContext, WepayApi.class)).onlinePayOrderQuery(map).h5(yb3.lite_for()).h3(AndroidSchedulers.mainThread());
ty2<ResponseBean.RechargeQuery> ty2Var = new ty2<ResponseBean.RechargeQuery>() {
@Override
public final void accept(ResponseBean.RechargeQuery rechargeQuery) {
OrderPayActivity orderPayActivity;
OrderPayActivity orderPayActivity2;
OrderPayActivity orderPayActivity3;
OrderPayActivity orderPayActivity4;
OrderPayActivity orderPayActivity5;
OrderPayActivity orderPayActivity6;
Handler handler;
String orderStatus = rechargeQuery.getOrderStatus();
int hashCode = orderStatus.hashCode();
if (hashCode != -1149187101) {
if (hashCode == 408463951 && orderStatus.equals("PROCESS")) {
handler = OrderPayModel.this.handler;
handler.postDelayed(new Runnable() {
@Override
public final void run() {
int i;
int i2;
OrderPayActivity orderPayActivity7;
OrderPayActivity orderPayActivity8;
OrderPayModel orderPayModel = OrderPayModel.this;
i = orderPayModel.maxCount;
orderPayModel.maxCount = i - 1;
i2 = OrderPayModel.this.maxCount;
if (i2 <= 0) {
orderPayActivity7 = OrderPayModel.this.mActivity;
orderPayActivity7.hideLoadingDialog();
ToastUtil toastUtil = ToastUtil.INSTANCE;
orderPayActivity8 = OrderPayModel.this.mActivity;
Context applicationContext2 = orderPayActivity8.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext2, "mActivity.applicationContext");
toastUtil.showToast(applicationContext2, "支付处理中");
return;
}
OrderPayModel$queryResult$1 orderPayModel$queryResult$1 = OrderPayModel$queryResult$1.this;
OrderPayModel.this.queryResult(map);
}
}, AdaptiveTrackSelection.DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS);
return;
}
} else if (orderStatus.equals("SUCCESS")) {
orderPayActivity = OrderPayModel.this.mActivity;
orderPayActivity.hideLoadingDialog();
orderPayActivity2 = OrderPayModel.this.mActivity;
orderPayActivity3 = OrderPayModel.this.mActivity;
Intent putExtra = new Intent(orderPayActivity3.getApplicationContext(), (Class<?>) EndingActivity.class).putExtra("type", 5).putExtra("description", String.valueOf(OrderPayModel.this.getDescription().get()));
StringBuilder b = r5.b("");
b.append(new BigDecimal(rechargeQuery.getAmount()).doubleValue() / 100);
orderPayActivity2.startActivity(putExtra.putExtra(Constants.amount, b.toString()));
orderPayActivity4 = OrderPayModel.this.mActivity;
orderPayActivity4.finish();
return;
}
orderPayActivity5 = OrderPayModel.this.mActivity;
orderPayActivity5.hideLoadingDialog();
OrderPayModel.this.isClick().set(Boolean.FALSE);
ToastUtil toastUtil = ToastUtil.INSTANCE;
orderPayActivity6 = OrderPayModel.this.mActivity;
Context applicationContext2 = orderPayActivity6.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext2, "mActivity.applicationContext");
toastUtil.showToast(applicationContext2, "支付失败");
}
};
final OrderPayActivity orderPayActivity = this.mActivity;
h3.c5(ty2Var, new FailedFlowable(orderPayActivity) {
@Override
public void accept(@NotNull Throwable e) {
Intrinsics.checkParameterIsNotNull(e, "e");
super.accept(e);
OrderPayModel.this.isClick().set(Boolean.FALSE);
}
});
}
@NotNull
public final ObservableField<String> getAmount() {
return this.amount;
}
@NotNull
public final ObservableField<String> getDescription() {
return this.description;
}
@NotNull
public final ObservableField<String> getRemark() {
return this.remark;
}
@NotNull
public final String getSource() {
return this.source;
}
@NotNull
public final ObservableField<Boolean> isClick() {
return this.isClick;
}
public final void setSource(@NotNull String str) {
Intrinsics.checkParameterIsNotNull(str, "<set-?>");
this.source = str;
}
public final void sure(@NotNull View view) {
Intrinsics.checkParameterIsNotNull(view, "view");
this.maxCount = 5;
final long currentTimeMillis = System.currentTimeMillis();
StringBuilder sb = new StringBuilder();
AuthType authType = AuthType.ONLINEPAY;
sb.append(AuthTypeName.valueOf(authType.name()).getCode());
sb.append("的业务开始时间:");
sb.append(currentTimeMillis);
LogUtil.d(sb.toString());
RetrofitClient companion = RetrofitClient.INSTANCE.getInstance();
Context applicationContext = this.mActivity.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext, "mActivity.applicationContext");
WepayApi wepayApi = (WepayApi) companion.create(applicationContext, WepayApi.class);
final WalletPay companion2 = WalletPay.INSTANCE.getInstance();
companion2.init(this.mActivity);
String str = this.source;
if (Intrinsics.areEqual(str, authType.name())) {
final HashMap hashMap = new HashMap();
new Thread(new Runnable() {
@Override
public final void run() {
HashMap hashMap2 = hashMap;
String netIp = NetUtils.getNetIp();
Intrinsics.checkExpressionValueIsNotNull(netIp, "NetUtils.getNetIp()");
hashMap2.put("requestIp", netIp);
}
}).start();
Thread.sleep(1000L);
this.isClick.set(Boolean.TRUE);
hashMap.put("version", Constants.version);
hashMap.put("requestId", "" + System.currentTimeMillis());
String str2 = Constants.merchantId;
Intrinsics.checkExpressionValueIsNotNull(str2, "Constants.merchantId");
hashMap.put(ServicesWebActivity.MERCHANT_ID, str2);
String str3 = Constants.walletId;
Intrinsics.checkExpressionValueIsNotNull(str3, "Constants.walletId");
hashMap.put("walletId", str3);
hashMap.put("timeout", "1440");
hashMap.put("productInfo", String.valueOf(this.description.get()));
hashMap.put("wakeUpModel", "SDK");
ResponseBean.Product product = new ResponseBean.Product(null, null, null, null, null, 31, null);
ArrayList arrayList = new ArrayList();
arrayList.add(product);
String jSONString = JSON.toJSONString(arrayList);
Intrinsics.checkExpressionValueIsNotNull(jSONString, "JSON.toJSONString(products)");
hashMap.put("hiddenPD", jSONString);
LogUtil.d(JSON.toJSONString(product));
hashMap.put("currency", Constants.currency);
StringBuilder sb2 = new StringBuilder();
sb2.append("");
BigDecimal multiply = new BigDecimal(String.valueOf(this.amount.get())).multiply(new BigDecimal(100));
Intrinsics.checkExpressionValueIsNotNull(multiply, "this.multiply(other)");
sb2.append(multiply.intValue());
hashMap.put(Constants.amount, sb2.toString());
hashMap.put("notifyUrl", Constants.BASE_URL + Constants.onlinePayOrderNotify);
companion2.setWalletPayCallback(new WalletPay.WalletPayCallback() {
@Override
public void callback(@Nullable String source, @Nullable String status, @Nullable String errorMessage) {
OrderPayActivity orderPayActivity;
int hashCode;
OrderPayActivity orderPayActivity2;
LogUtil.d("status:" + status);
if (status != null && ((hashCode = status.hashCode()) == -1149187101 ? status.equals("SUCCESS") : !(hashCode != 408463951 || !status.equals("PROCESS")))) {
orderPayActivity2 = OrderPayModel.this.mActivity;
orderPayActivity2.showLoadingDialog();
OrderPayModel.this.queryResult(hashMap);
return;
}
OrderPayModel.this.isClick().set(Boolean.FALSE);
ToastUtil toastUtil = ToastUtil.INSTANCE;
orderPayActivity = OrderPayModel.this.mActivity;
Context applicationContext2 = orderPayActivity.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext2, "mActivity.applicationContext");
toastUtil.showToast(applicationContext2, "" + errorMessage);
}
});
this.mActivity.showLoadingDialog();
zw2<ResponseBean.Token> h3 = wepayApi.onlinePayOrder(hashMap).h5(yb3.lite_for()).h3(AndroidSchedulers.mainThread());
ty2<ResponseBean.Token> ty2Var = new ty2<ResponseBean.Token>() {
@Override
public final void accept(ResponseBean.Token token) {
OrderPayActivity orderPayActivity;
orderPayActivity = OrderPayModel.this.mActivity;
orderPayActivity.hideLoadingDialog();
OrderPayModel.this.isClick().set(Boolean.FALSE);
LogUtil.d(AuthTypeName.valueOf(AuthType.ONLINEPAY.name()).getCode() + "的业务预下单的总时间:" + (System.currentTimeMillis() - currentTimeMillis));
WalletPay walletPay = companion2;
String str4 = Constants.merchantId;
Intrinsics.checkExpressionValueIsNotNull(str4, "Constants.merchantId");
String str5 = Constants.walletId;
Intrinsics.checkExpressionValueIsNotNull(str5, "Constants.walletId");
WalletPay.evoke$default(walletPay, str4, str5, token.getToken(), OrderPayModel.this.getSource(), null, null, null, 112, null);
}
};
final OrderPayActivity orderPayActivity = this.mActivity;
h3.c5(ty2Var, new FailedFlowable(orderPayActivity) {
@Override
public void accept(@NotNull Throwable e) {
Intrinsics.checkParameterIsNotNull(e, "e");
super.accept(e);
OrderPayModel.this.isClick().set(Boolean.FALSE);
}
});
return;
}
if (Intrinsics.areEqual(str, AuthType.APP_PAY.name())) {
final HashMap hashMap2 = new HashMap();
new Thread(new Runnable() {
@Override
public final void run() {
HashMap hashMap3 = hashMap2;
String netIp = NetUtils.getNetIp();
Intrinsics.checkExpressionValueIsNotNull(netIp, "NetUtils.getNetIp()");
hashMap3.put("requestIp", netIp);
}
}).start();
Thread.sleep(1000L);
this.isClick.set(Boolean.TRUE);
hashMap2.put("version", Constants.version);
hashMap2.put("requestId", "" + System.currentTimeMillis());
String str4 = Constants.merchantId;
Intrinsics.checkExpressionValueIsNotNull(str4, "Constants.merchantId");
hashMap2.put(ServicesWebActivity.MERCHANT_ID, str4);
hashMap2.put("timeout", "1440");
hashMap2.put("productInfo", String.valueOf(this.description.get()));
hashMap2.put("remark", String.valueOf(this.remark.get()));
hashMap2.put("paymentModeCode", "WEBOX-APP_PAY-P2P");
String str5 = Constants.walletId;
Intrinsics.checkExpressionValueIsNotNull(str5, "Constants.walletId");
hashMap2.put(ServicesWebActivity.OPEN_ID, str5);
hashMap2.put("callbackUrl", "https://dev-sdk.ehking.com/callback");
hashMap2.put("notifyUrl", "https://dev-sdk.ehking.com/onlinepay/notify_V3");
ResponseBean.Product product2 = new ResponseBean.Product(null, null, null, null, null, 31, null);
ArrayList arrayList2 = new ArrayList();
arrayList2.add(product2);
String jSONString2 = JSON.toJSONString(arrayList2);
Intrinsics.checkExpressionValueIsNotNull(jSONString2, "JSON.toJSONString(products)");
hashMap2.put("hiddenPD", jSONString2);
LogUtil.d(JSON.toJSONString(product2));
hashMap2.put("orderCurrency", Constants.currency);
StringBuilder sb3 = new StringBuilder();
sb3.append("");
BigDecimal multiply2 = new BigDecimal(String.valueOf(this.amount.get())).multiply(new BigDecimal(100));
Intrinsics.checkExpressionValueIsNotNull(multiply2, "this.multiply(other)");
sb3.append(multiply2.intValue());
hashMap2.put("orderAmount", sb3.toString());
hashMap2.put("notifyUrl", Constants.BASE_URL + Constants.onlinePayOrderNotify);
companion2.setWalletPayCallback(new WalletPay.WalletPayCallback() {
@Override
public void callback(@Nullable String source, @Nullable String status, @Nullable String errorMessage) {
OrderPayActivity orderPayActivity2;
OrderPayActivity orderPayActivity3;
OrderPayActivity orderPayActivity4;
if (Intrinsics.areEqual(status, Status.SUCCESS.name())) {
ToastUtil toastUtil = ToastUtil.INSTANCE;
orderPayActivity4 = OrderPayModel.this.mActivity;
Context applicationContext2 = orderPayActivity4.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext2, "mActivity.applicationContext");
toastUtil.showToast(applicationContext2, "支付成功");
return;
}
if (Intrinsics.areEqual(status, Status.FAIL.name())) {
ToastUtil toastUtil2 = ToastUtil.INSTANCE;
orderPayActivity3 = OrderPayModel.this.mActivity;
Context applicationContext3 = orderPayActivity3.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext3, "mActivity.applicationContext");
toastUtil2.showToast(applicationContext3, "支付失败,原因" + errorMessage);
return;
}
if (Intrinsics.areEqual(status, Status.CANCEL.name())) {
ToastUtil toastUtil3 = ToastUtil.INSTANCE;
orderPayActivity2 = OrderPayModel.this.mActivity;
Context applicationContext4 = orderPayActivity2.getApplicationContext();
Intrinsics.checkExpressionValueIsNotNull(applicationContext4, "mActivity.applicationContext");
toastUtil3.showToast(applicationContext4, "取消支付");
}
}
});
this.mActivity.showLoadingDialog();
zw2<ResponseBean.Token> h32 = wepayApi.appPayCreateOrder(hashMap2).h5(yb3.lite_for()).h3(AndroidSchedulers.mainThread());
ty2<ResponseBean.Token> ty2Var2 = new ty2<ResponseBean.Token>() {
@Override
public final void accept(ResponseBean.Token token) {
OrderPayActivity orderPayActivity2;
orderPayActivity2 = OrderPayModel.this.mActivity;
orderPayActivity2.hideLoadingDialog();
OrderPayModel.this.isClick().set(Boolean.FALSE);
LogUtil.d(AuthTypeName.valueOf(AuthType.ONLINEPAY.name()).getCode() + "的业务预下单的总时间:" + (System.currentTimeMillis() - currentTimeMillis));
WalletPay walletPay = companion2;
String str6 = Constants.merchantId;
Intrinsics.checkExpressionValueIsNotNull(str6, "Constants.merchantId");
String str7 = Constants.walletId;
Intrinsics.checkExpressionValueIsNotNull(str7, "Constants.walletId");
WalletPay.evoke$default(walletPay, str6, str7, token.getToken(), OrderPayModel.this.getSource(), null, null, null, 112, null);
}
};
final OrderPayActivity orderPayActivity2 = this.mActivity;
h32.c5(ty2Var2, new FailedFlowable(orderPayActivity2) {
@Override
public void accept(@NotNull Throwable e) {
Intrinsics.checkParameterIsNotNull(e, "e");
super.accept(e);
OrderPayModel.this.isClick().set(Boolean.FALSE);
}
});
}
}
}