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

com.global.api.paymentMethods.EBTCardData Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
package com.global.api.paymentMethods;

import com.global.api.entities.enums.CvnPresenceIndicator;
import com.global.api.entities.enums.EbtCardType;
import com.global.api.entities.enums.ManualEntryMethod;
import com.global.api.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;

@Getter @Setter
public class EBTCardData extends EBT implements ICardData {
    private String approvalCode;
    private boolean cardPresent;
    private String cvn;
    private CvnPresenceIndicator cvnPresenceIndicator;
    private Integer expMonth;
    private Integer expYear;
    private String number;
    private boolean readerPresent;
    private String serialNumber;
    public ManualEntryMethod entryMethod;
    private String tokenizationData;

    @Override
    public String getCardType() {
        return ebtCardType.toString();
    }

    @Override
    public void setCardType(String cardType) {
        ebtCardType = EbtCardType.valueOf(cardType);
    }

    public String getShortExpiry() {
        if(expMonth != null && expYear != null) {
            return StringUtils.padLeft(expMonth.toString(), 2, '0') + expYear.toString().substring(2, 4);
        }
        return null;
    }

    public EBTCardData() {}
    public EBTCardData(EbtCardType cardType) {
        ebtCardType = cardType;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy