Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158

以下内容为反编译后的 RcPayCreateRequest.java 源代码,内容仅作参考


package com.free.vpn.proxy.hotspot.data.model.billing.rcpay;

import androidx.autofill.HintConstants;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.free.vpn.proxy.hotspot.an1;
import com.free.vpn.proxy.hotspot.data.model.analytics.AnalyticsKeysKt;
import com.free.vpn.proxy.hotspot.data.model.billing.Order;
import com.free.vpn.proxy.hotspot.data.model.billing.common.Currencies;
import com.free.vpn.proxy.hotspot.data.model.config.ProcessingEntity;
import com.free.vpn.proxy.hotspot.ex0;
import com.free.vpn.proxy.hotspot.n05;
import com.free.vpn.proxy.hotspot.ne2;
import com.free.vpn.proxy.hotspot.t00;
import com.free.vpn.proxy.hotspot.ui.billing.subscription.base.BaseSubscriptionFragment;
import com.free.vpn.proxy.hotspot.zm2;
import com.free.vpn.proxy.hotspot.zs4;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import kotlin.Metadata;
import kotlin.TuplesKt;

@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u001a\n\u0002\u0010%\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0007\u0018\u0000 /2\u00020\u0001:\u0001/B)\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\b\u001a\u0004\u0018\u00010\u0007¢\u0006\u0002\u0010\tJ\b\u0010+\u001a\u00020\u0007H\u0002J\b\u0010,\u001a\u00020\u0007H\u0002J\u0006\u0010-\u001a\u00020.R\u0016\u0010\n\u001a\u00020\u000b8\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0016\u0010\u000e\u001a\u00020\u00078\u0006X\u0087D¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0016\u0010\u0011\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0012\u0010\u0010R\u0013\u0010\u0006\u001a\u0004\u0018\u00010\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0010R\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0014\u0010\u0015R\u0011\u0010\u0016\u001a\u00020\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0017\u0010\u0010R\u0016\u0010\u0018\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0019\u0010\u0010R\u0016\u0010\u001a\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u001b\u0010\u0010R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u001c\u0010\u001dR\u0016\u0010\u001e\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u001f\u0010\u0010R\u0013\u0010\b\u001a\u0004\u0018\u00010\u0007¢\u0006\b\n\u0000\u001a\u0004\b \u0010\u0010R\u0011\u0010!\u001a\u00020\u00078F¢\u0006\u0006\u001a\u0004\b\"\u0010\u0010R\u0016\u0010#\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b$\u0010\u0010R \u0010%\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u00070&8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b'\u0010(R\u0016\u0010)\u001a\u00020\u00078\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b*\u0010\u0010¨\u00060"}, d2 = {"Lcom/free/vpn/proxy/hotspot/data/model/billing/rcpay/RcPayCreateRequest;", "", BaseSubscriptionFragment.KEY_ORDER, "Lcom/free/vpn/proxy/hotspot/data/model/billing/Order;", "entity", "Lcom/free/vpn/proxy/hotspot/data/model/config/ProcessingEntity;", "email", "", HintConstants.AUTOFILL_HINT_PHONE, "(Lcom/free/vpn/proxy/hotspot/data/model/billing/Order;Lcom/free/vpn/proxy/hotspot/data/model/config/ProcessingEntity;Ljava/lang/String;Ljava/lang/String;)V", "amount", "", "getAmount", "()F", "channelCode", "getChannelCode", "()Ljava/lang/String;", RcPayCreateRequest.K_CURRENCY, "getCurrency", "getEmail", "getEntity", "()Lcom/free/vpn/proxy/hotspot/data/model/config/ProcessingEntity;", "logString", "getLogString", "note", "getNote", "notifyUrl", "getNotifyUrl", "getOrder", "()Lcom/free/vpn/proxy/hotspot/data/model/billing/Order;", AnalyticsKeysKt.KEY_ORDER_ID, "getOrderRef", "getPhone", "requestUrl", "getRequestUrl", "sign", "getSign", "signParams", "", "getSignParams", "()Ljava/util/Map;", "username", "getUsername", "createCallbackUrl", "createSign", "requestBody", "Lcom/google/gson/JsonElement;", "Companion", "app_chinaSeoDirectBlackRelease"}, k = 1, mv = {1, 8, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public final class RcPayCreateRequest {
    private static final String DEFAULT_CALLBACK_URL = "https://purchase.fancyphotomaker.net/ipn/rcpay";
    private static final String DEFAULT_CREATE_URL = "https://api.rcpays.com/api/v1/third-party/deposits/json";
    private static final String K_AMOUNT = "amount";
    private static final String K_CHANNEL_CODE = "channel_code";
    private static final String K_CURRENCY = "currency";
    private static final String K_NOTE = "note";
    private static final String K_NOTIFY_URL = "notify_url";
    private static final String K_ORDER_REF = "order_number";
    private static final String K_SIGN = "sign";
    private static final String K_USERNAME = "username";

    @SerializedName("amount")
    @Expose
    private final float amount;

    @SerializedName(K_CHANNEL_CODE)
    @Expose
    private final String channelCode;

    @SerializedName(K_CURRENCY)
    @Expose
    private final String currency;
    private final String email;
    private final ProcessingEntity entity;
    private final String logString;

    @SerializedName("note")
    @Expose
    private final String note;

    @SerializedName(K_NOTIFY_URL)
    @Expose
    private final String notifyUrl;
    private final Order order;

    @SerializedName(K_ORDER_REF)
    @Expose
    private final String orderRef;
    private final String phone;

    @SerializedName("sign")
    @Expose
    private final String sign;

    @SerializedName("username")
    @Expose
    private final String username;
    public static final int $stable = 8;

    public RcPayCreateRequest(Order order, ProcessingEntity processingEntity, String str, String str2) {
        zs4.o(order, BaseSubscriptionFragment.KEY_ORDER);
        zs4.o(processingEntity, "entity");
        this.order = order;
        this.entity = processingEntity;
        this.email = str;
        this.phone = str2;
        this.channelCode = "USDT-TRC20";
        this.username = processingEntity.getKey();
        this.amount = ex0.e0(order.getProcessingAmount(), 2);
        this.orderRef = order.getOrderRef();
        String currency = order.getCurrency();
        this.currency = currency == null ? Currencies.USDT : currency;
        this.note = order.getProductId();
        this.notifyUrl = createCallbackUrl();
        this.sign = createSign();
        this.logString = ex0.F(this, true, false, 6);
    }

    private final String createCallbackUrl() {
        String str;
        String callbackUrl = this.entity.getCallbackUrl();
        if (callbackUrl == null) {
            callbackUrl = DEFAULT_CALLBACK_URL;
        }
        StringBuilder sb = new StringBuilder(callbackUrl);
        sb.append("?action=Callback&payment=rcpay&orderRef=" + this.orderRef + "&payMethod=usdt&amount=" + this.amount);
        n05.y("&period=", this.note, "&platformoriginal=Android", sb);
        sb.append("&logic=" + this.order.getLogic());
        String str2 = this.email;
        if (str2 != null) {
            str = "&email=";
        } else {
            str2 = this.phone;
            if (str2 != null) {
                str = "&phone=";
            }
            String sb2 = sb.toString();
            zs4.n(sb2, "sb.toString()");
            return sb2;
        }
        sb.append(str.concat(str2));
        String sb22 = sb.toString();
        zs4.n(sb22, "sb.toString()");
        return sb22;
    }

    private final String createSign() {
        StringBuilder sb = new StringBuilder();
        int i = 0;
        for (Object obj : t00.A1(getSignParams().entrySet(), new Comparator() {
            @Override
            public final int compare(T t, T t2) {
                return an1.i((String) ((Map.Entry) t).getKey(), (String) ((Map.Entry) t2).getKey());
            }
        })) {
            int i2 = i + 1;
            if (i < 0) {
                zm2.w0();
                throw null;
            }
            Map.Entry entry = (Map.Entry) obj;
            if (i != 0) {
                sb.append("&");
            }
            sb.append(entry.getKey() + "=" + entry.getValue());
            i = i2;
        }
        sb.append("&secret_key=" + this.entity.getToken());
        String sb2 = sb.toString();
        zs4.n(sb2, "toString(...)");
        String lowerCase = ex0.G(sb2).toLowerCase(Locale.ROOT);
        zs4.n(lowerCase, "toLowerCase(...)");
        return lowerCase;
    }

    private final Map<String, String> getSignParams() {
        return ne2.e0(TuplesKt.to(K_CHANNEL_CODE, this.channelCode), TuplesKt.to("username", this.username), TuplesKt.to("amount", String.valueOf(this.amount)), TuplesKt.to(K_ORDER_REF, this.orderRef), TuplesKt.to(K_CURRENCY, this.currency), TuplesKt.to("note", this.note), TuplesKt.to(K_NOTIFY_URL, this.notifyUrl));
    }

    public final float getAmount() {
        return this.amount;
    }

    public final String getChannelCode() {
        return this.channelCode;
    }

    public final String getCurrency() {
        return this.currency;
    }

    public final String getEmail() {
        return this.email;
    }

    public final ProcessingEntity getEntity() {
        return this.entity;
    }

    public final String getLogString() {
        return this.logString;
    }

    public final String getNote() {
        return this.note;
    }

    public final String getNotifyUrl() {
        return this.notifyUrl;
    }

    public final Order getOrder() {
        return this.order;
    }

    public final String getOrderRef() {
        return this.orderRef;
    }

    public final String getPhone() {
        return this.phone;
    }

    public final String getRequestUrl() {
        String createOrderUrl = this.entity.getCreateOrderUrl();
        return createOrderUrl == null ? DEFAULT_CREATE_URL : createOrderUrl;
    }

    public final String getSign() {
        return this.sign;
    }

    public final String getUsername() {
        return this.username;
    }

    public final JsonElement requestBody() {
        JsonObject jsonObject = new JsonObject();
        Iterator<T> it = getSignParams().entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            jsonObject.addProperty((String) entry.getKey(), (String) entry.getValue());
        }
        jsonObject.addProperty("sign", createSign());
        return jsonObject;
    }
}