All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.gopay.sdk.models.response.merchant.TransactionUserData Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
package jp.gopay.sdk.models.response.merchant;

import com.google.gson.annotations.SerializedName;
import jp.gopay.sdk.models.response.transactiontoken.PhoneNumber;
import jp.gopay.sdk.types.*;

import java.util.List;

public class TransactionUserData {
    @SerializedName("cardholder_name")
    private String cardHolderName;

    @SerializedName("card_brand")
    private CardBrand cardBrand;

    @SerializedName("gateway")
    private Gateway gateway;

    @SerializedName("cardholder_email_address")
    private String cardholderEmailAddress;

    @SerializedName("customer_name")
    private String customerName;

    @SerializedName("convenience_store")
    private Konbini convenienceStore;

    @SerializedName("cardholder_phone_number")
    private PhoneNumber cardholderPhoneNumber;

    @SerializedName("type")
    private TransactionType transactionType;

    @SerializedName("refunds")
    private List refunds;

    @SerializedName("reason")
    private RefundReason refundReason;

    private PaymentTransactionData paymentData;

    private TransactionTypeData transactionTypeData;

    public TransactionType getTransactionType() {
        return transactionType;
    }

    public CardTransactionData asCardTransactionData() {
        if (paymentData == null) {
            paymentData = new CardTransactionData(cardHolderName, cardBrand, gateway);
        }
        return (CardTransactionData) paymentData;
    }

    public ApplePayTransactionData asApplePayTransactionData() {
        if (paymentData == null) {
            paymentData = new ApplePayTransactionData(cardHolderName, cardBrand, gateway);
        }
        return (ApplePayTransactionData) paymentData;
    }

    public QRScanTransactionData asQRScanTransactionData() {
        if (paymentData == null) {
            paymentData = new QRScanTransactionData(cardholderEmailAddress, gateway);
        }
        return (QRScanTransactionData) paymentData;
    }

    public KonbiniTransactionData asKonbiniTransactionData() {
        if (paymentData == null) {
            paymentData = new KonbiniTransactionData(customerName, convenienceStore, gateway);
        }
        return (KonbiniTransactionData) paymentData;
    }

    public PaidyTransactionData asPaidyTransactionData() {
        if (paymentData == null) {
            paymentData = new PaidyTransactionData(cardholderEmailAddress, cardholderPhoneNumber, gateway);
        }
        return (PaidyTransactionData) paymentData;
    }

    public ChargeUserData asChargeUserData() {
        if (transactionTypeData == null) {
            transactionTypeData = new ChargeUserData(refunds);
        }
        return (ChargeUserData) transactionTypeData;
    }

    public RefundUserData asRefundUseData() {
        if (transactionTypeData == null) {
            transactionTypeData = new RefundUserData(refundReason);
        }
        return (RefundUserData) transactionTypeData;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy