导航菜单

页面标题

页面副标题

Oolka v2.4.42 - JuspayPaymentsServices.java 源代码

正在查看: Oolka v2.4.42 应用的 JuspayPaymentsServices.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package in.juspay.payments;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebViewClient;
import androidx.annotation.Keep;
import androidx.fragment.app.FragmentActivity;
import in.juspay.hyper.bridge.HyperBridge;
import in.juspay.hypersdk.core.MerchantViewType;
import in.juspay.hypersdk.core.PaymentConstants;
import in.juspay.hypersdk.ui.ActivityLaunchDelegate;
import in.juspay.hypersdk.ui.HyperPaymentsCallback;
import in.juspay.hypersdk.ui.IntentSenderDelegate;
import in.juspay.hypersdk.ui.RequestPermissionDelegate;
import in.juspay.services.HyperServices;
import in.juspay.services.TenantParams;
import java.util.ArrayList;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

@Keep
@Metadata
public final class JuspayPaymentsServices {

    @NotNull
    public static final Companion Companion = new Companion(null);

    @NotNull
    private static TenantParams tenantParams = new TenantParams() {
        @Override
        @NotNull
        public String getBootLoaderEndpoint() {
            return "https://%spayments.juspay.in/hyper/bundles/in.juspay.merchants/%s/android/%s/release-config.json?toss=%s";
        }

        @Override
        @NotNull
        public List<Class<? extends HyperBridge>> getBridgeClasses() {
            return new ArrayList();
        }

        @Override
        public JSONObject getLogsEndPoint() {
            return null;
        }

        @Override
        @NotNull
        public String getTenant() {
            return "juspay";
        }
    };

    @NotNull
    private HyperServices hyperServices;
    private boolean isServiceModified;

    @Metadata
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        @JvmStatic
        @Keep
        @NotNull
        public final JSONObject getVersions(@NotNull Context context) {
            Intrinsics.checkNotNullParameter(context, "context");
            return HyperServices.Companion.getVersions(context);
        }

        @JvmStatic
        @Keep
        public final void preFetch(@NotNull Context context, @NotNull JSONObject payload) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(payload, "payload");
            HyperServices.Companion.preFetch(context, payload);
        }

        private Companion() {
        }
    }

    @Keep
    public JuspayPaymentsServices(@NotNull Context context, @NotNull String clientId) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(clientId, "clientId");
        this.hyperServices = new HyperServices(context, tenantParams, clientId);
    }

    private final HyperPaymentsCallback getHyperPaymentsCallback(final JuspayPaymentsCallback juspayPaymentsCallback) {
        return new HyperPaymentsCallback() {
            @Override
            public WebViewClient createJuspaySafeWebViewClient() {
                return JuspayPaymentsCallback.this.createJUSPAYSafeWebViewClient();
            }

            @Override
            public View getMerchantView(ViewGroup viewGroup, MerchantViewType merchantViewType) {
                String name;
                return JuspayPaymentsCallback.this.getMerchantView(viewGroup, (merchantViewType == null || (name = merchantViewType.name()) == null) ? null : JuspayPaymentsMerchantViewType.valueOf(name));
            }

            @Override
            public void onEvent(org.json.JSONObject r9, in.juspay.hypersdk.data.JuspayResponseHandler r10) {
                throw new UnsupportedOperationException("Method not decompiled: in.juspay.payments.JuspayPaymentsServices$getHyperPaymentsCallback$1.onEvent(org.json.JSONObject, in.juspay.hypersdk.data.JuspayResponseHandler):void");
            }

            @Override
            public void onStartWaitingDialogCreated(View view) {
                JuspayPaymentsCallback.this.onStartWaitingDialogCreated(view);
            }
        };
    }

    @JvmStatic
    @Keep
    @NotNull
    public static final JSONObject getVersions(@NotNull Context context) {
        return Companion.getVersions(context);
    }

    private final JSONObject modifyService(JSONObject jSONObject) {
        if (jSONObject.has(PaymentConstants.SERVICE)) {
            String service = jSONObject.optString(PaymentConstants.SERVICE, "");
            if (!Intrinsics.areEqual(service, "")) {
                Intrinsics.checkNotNullExpressionValue(service, "service");
                if (StringsKt__StringsJVMKt.startsWith$default(service, "in.juspay", false, 2, null)) {
                    this.isServiceModified = false;
                } else {
                    this.isServiceModified = true;
                    jSONObject.put(PaymentConstants.SERVICE, "in.juspay." + service);
                }
            }
        }
        return jSONObject;
    }

    @JvmStatic
    @Keep
    public static final void preFetch(@NotNull Context context, @NotNull JSONObject jSONObject) {
        Companion.preFetch(context, jSONObject);
    }

    @Keep
    public final void initiate(@NotNull FragmentActivity activity, @NotNull ViewGroup container, @NotNull JSONObject params, @NotNull JuspayPaymentsCallback callback) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(container, "container");
        Intrinsics.checkNotNullParameter(params, "params");
        Intrinsics.checkNotNullParameter(callback, "callback");
        this.hyperServices.initiate(activity, container, modifyService(params), getHyperPaymentsCallback(callback));
    }

    @Keep
    public final boolean isInitialised() {
        return this.hyperServices.isInitialised();
    }

    @Keep
    public final void onActivityResult(int i, int i2, Intent intent) {
        this.hyperServices.onActivityResult(i, i2, intent);
    }

    @Keep
    public final boolean onBackPressed() {
        return this.hyperServices.onBackPressed();
    }

    @Keep
    public final void onRequestPermissionsResult(int i, @NotNull String[] permissions, @NotNull int[] grantResults) {
        Intrinsics.checkNotNullParameter(permissions, "permissions");
        Intrinsics.checkNotNullParameter(grantResults, "grantResults");
        this.hyperServices.onRequestPermissionsResult(i, permissions, grantResults);
    }

    @Keep
    public final void process(@NotNull FragmentActivity activity, @NotNull JSONObject payload) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(payload, "payload");
        this.hyperServices.process(activity, modifyService(payload));
    }

    @Keep
    public final void resetActivity(@NotNull FragmentActivity activity) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        this.hyperServices.resetActivity(activity);
    }

    @Keep
    public final void setActivityLaunchDelegate(@NotNull ActivityLaunchDelegate activityLaunchDelegate) {
        Intrinsics.checkNotNullParameter(activityLaunchDelegate, "activityLaunchDelegate");
        this.hyperServices.setActivityLaunchDelegate(activityLaunchDelegate);
    }

    @Keep
    public final void setIntentSenderDelegate(@NotNull IntentSenderDelegate intentSenderDelegate) {
        Intrinsics.checkNotNullParameter(intentSenderDelegate, "intentSenderDelegate");
        this.hyperServices.setIntentSenderDelegate(intentSenderDelegate);
    }

    @Keep
    public final void setRequestPermissionDelegate(@NotNull RequestPermissionDelegate requestPermissionDelegate) {
        Intrinsics.checkNotNullParameter(requestPermissionDelegate, "requestPermissionDelegate");
        this.hyperServices.setRequestPermissionDelegate(requestPermissionDelegate);
    }

    @Keep
    public final void terminate(@NotNull JSONObject payload) {
        Intrinsics.checkNotNullParameter(payload, "payload");
        this.hyperServices.terminate(payload);
    }

    @Keep
    public final void initiate(@NotNull FragmentActivity activity, @NotNull JSONObject params, @NotNull JuspayPaymentsCallback callback) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(params, "params");
        Intrinsics.checkNotNullParameter(callback, "callback");
        this.hyperServices.initiate(activity, modifyService(params), getHyperPaymentsCallback(callback));
    }

    @Keep
    public final void process(@NotNull FragmentActivity activity, @NotNull ViewGroup viewGroup, @NotNull JSONObject payload) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(viewGroup, "viewGroup");
        Intrinsics.checkNotNullParameter(payload, "payload");
        this.hyperServices.process(activity, viewGroup, modifyService(payload));
    }

    @Keep
    public final void terminate() {
        this.hyperServices.terminate();
    }

    @Keep
    public JuspayPaymentsServices(@NotNull FragmentActivity activity, @NotNull String clientId) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(clientId, "clientId");
        this.hyperServices = new HyperServices(activity, null, tenantParams, clientId);
    }

    @Keep
    public final void initiate(@NotNull JSONObject params, @NotNull JuspayPaymentsCallback callback) {
        Intrinsics.checkNotNullParameter(params, "params");
        Intrinsics.checkNotNullParameter(callback, "callback");
        this.hyperServices.initiate(modifyService(params), getHyperPaymentsCallback(callback));
    }

    @Keep
    public final void process(@NotNull JSONObject payload) {
        Intrinsics.checkNotNullParameter(payload, "payload");
        this.hyperServices.process(modifyService(payload));
    }

    @Keep
    public JuspayPaymentsServices(@NotNull FragmentActivity activity, @NotNull ViewGroup container, @NotNull String clientId) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(container, "container");
        Intrinsics.checkNotNullParameter(clientId, "clientId");
        this.hyperServices = new HyperServices(activity, container, tenantParams, clientId);
    }
}