导航菜单

页面标题

页面副标题

Oolka v2.4.42 - CFUPIIntentCheckoutPayment.java 源代码

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

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


package com.cashfree.pg.ui.api.upi.intent;

import androidx.annotation.NonNull;
import com.cashfree.pg.core.api.CFSession;
import com.cashfree.pg.core.api.base.CFPayment;
import com.cashfree.pg.core.api.exception.CFInvalidArgumentException;
import com.cashfree.pg.core.api.utils.CFError;
import com.cashfree.pg.ui.api.upi.intent.CFIntentTheme;
import com.cashfree.pg.ui.api.upi.intent.CFUPIIntentCheckout;

public final class CFUPIIntentCheckoutPayment extends CFPayment {
    private final CFUPIIntentCheckout cfupiIntentCheckout;
    private final CFIntentTheme intentTheme;

    public static final class CFUPIIntentPaymentBuilder {
        private CFIntentTheme cfIntentTheme;
        private CFSession cfSession;
        private CFUPIIntentCheckout cfUPIIntentCheckout;

        public CFUPIIntentCheckoutPayment build() throws CFInvalidArgumentException {
            if (this.cfSession == null) {
                throw CFError.SESSION_OBJECT_MISSING.getException();
            }
            if (this.cfUPIIntentCheckout == null) {
                this.cfUPIIntentCheckout = new CFUPIIntentCheckout.CFUPIIntentBuilder().build();
            }
            if (this.cfIntentTheme == null) {
                this.cfIntentTheme = new CFIntentTheme.CFIntentThemeBuilder().build();
            }
            return new CFUPIIntentCheckoutPayment(this.cfSession, this.cfUPIIntentCheckout, this.cfIntentTheme);
        }

        public CFUPIIntentPaymentBuilder setCfIntentTheme(@NonNull CFIntentTheme cFIntentTheme) {
            this.cfIntentTheme = cFIntentTheme;
            return this;
        }

        public CFUPIIntentPaymentBuilder setCfUPIIntentCheckout(@NonNull CFUPIIntentCheckout cFUPIIntentCheckout) {
            this.cfUPIIntentCheckout = cFUPIIntentCheckout;
            return this;
        }

        public CFUPIIntentPaymentBuilder setSession(@NonNull CFSession cFSession) {
            this.cfSession = cFSession;
            return this;
        }
    }

    public CFUPIIntentCheckout getCfUPI() {
        return this.cfupiIntentCheckout;
    }

    @Override
    public String getDescription() {
        return "UPI Payment Details\n---------------\n" + getCfSession().getDescription() + "\n" + this.cfupiIntentCheckout.getDescription() + "\n---------------";
    }

    public CFIntentTheme getIntentTheme() {
        return this.intentTheme;
    }

    private CFUPIIntentCheckoutPayment(CFSession cFSession, CFUPIIntentCheckout cFUPIIntentCheckout, CFIntentTheme cFIntentTheme) {
        super(cFSession);
        this.cfupiIntentCheckout = cFUPIIntentCheckout;
        this.intentTheme = cFIntentTheme;
        setTheme(cFIntentTheme);
        setCfSDKFlavour(CFPayment.CFSDKFlavour.INTENT);
    }
}