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

jp.gopay.sdk.models.response.transactiontoken.PaymentData Maven / Gradle / Ivy

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

import com.google.gson.annotations.SerializedName;
import jp.gopay.sdk.models.common.PaidyPaymentData;
import jp.gopay.sdk.models.common.PaidyShippingAddress;
import jp.gopay.sdk.models.common.PaidyToken;
import jp.gopay.sdk.types.Gateway;
import jp.gopay.sdk.types.Konbini;
import org.joda.time.Period;


public class PaymentData {

    @SerializedName("card")
    private TransactionTokenCardData card;

    @SerializedName("billing")
    private TransactionTokenBillingData billing;

    @SerializedName("customer_name")
    private String customerName;

    @SerializedName("convenience_store")
    private Konbini convenienceStore;

    @SerializedName("expiration_period")
    private Period expirationPeriod;

    @SerializedName("phone_number")
    private PhoneNumber phoneNumber;

    @SerializedName("paidy_token")
    private PaidyToken paidyToken;

    @SerializedName("shipping_address")
    private PaidyShippingAddress shippingAddress;

    @SerializedName("gateway")
    private Gateway gateway;

    public TransactionTokenCardData getCard() {
        return card;
    }

    public TransactionTokenBillingData getBilling() {
        return billing;
    }

    public String getCustomerName() {
        return customerName;
    }

    public Konbini getConvenienceStore() {
        return convenienceStore;
    }

    public Period getExpirationPeriod() {
        return expirationPeriod;
    }

    public PhoneNumber getPhoneNumber() {
        return phoneNumber;
    }

    public PaidyToken getPaidyToken() {
        return paidyToken;
    }

    public PaidyShippingAddress getShippingAddress() {
        return shippingAddress;
    }

    public CardPaymentData asCardPaymentData(){
        return new CardPaymentData(card, billing);
    }

    public KonbiniPaymentData asKonbiniPaymentData(){
        return new KonbiniPaymentData(customerName, convenienceStore, expirationPeriod, phoneNumber);
    }

    public PaidyPaymentData asPaidyPaymentData() {
        return new PaidyPaymentData(paidyToken, shippingAddress)
                .withPhoneNumber(phoneNumber);
    }

    public QrScanPaymentData asQrScanData(){
        return new QrScanPaymentData(gateway);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy