com.global.api.network.entities.emvpdl.EMVPDLTable60 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.network.entities.emvpdl;
import com.global.api.network.enums.nts.EMVPDLKeyStatus;
import com.global.api.utils.StringParser;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
@ToString
public class EMVPDLTable60 implements IEMVPDLTable {
@Getter
@Setter
private Integer emvPdlKeyCount;
@Getter
@Setter
private List emvPdlKeys;
@Override
public EMVPDLTable parseData(StringParser stringParser) {
this.setEmvPdlKeyCount(stringParser.readInt(2));
List keys = new ArrayList<>();
for (int index = 0; index < this.getEmvPdlKeyCount(); index++) {
EmvPdlKey key = new EmvPdlKey();
key.setEmvPdlRegisteredApplicationProviderIdentifier(stringParser.readString(10));
key.setEmvPdlCertificationAuthorityPublicKeyIndex(stringParser.readString(2));
key.setEmvPdlKeyStatus(stringParser.readStringConstant(1, EMVPDLKeyStatus.class));
if (key.getEmvPdlKeyStatus().equals(EMVPDLKeyStatus.Active)) {
key.setEmvPdlCertificationAuthorityPublicKeyModulusLength(stringParser.readInt(4));
key.setEmvPdlCertificationAuthorityPublicKeyModulus(stringParser.readString(key.getEmvPdlCertificationAuthorityPublicKeyModulusLength()));
key.setEmvPdlCertificationAuthorityPublicKeyExponent(stringParser.readString(2));
key.setEmvPdlCertificationAuthorityPublicKeyCheckSum(stringParser.readString(40));
}
keys.add(key);
}
this.setEmvPdlKeys(keys);
return new EMVPDLTable(this);
}
@ToString
public class EmvPdlKey {
@Getter
@Setter
private String emvPdlRegisteredApplicationProviderIdentifier;
@Getter
@Setter
private String emvPdlCertificationAuthorityPublicKeyIndex;
@Getter
@Setter
private EMVPDLKeyStatus emvPdlKeyStatus;
@Getter
@Setter
private Integer emvPdlCertificationAuthorityPublicKeyModulusLength;
@Getter
@Setter
private String emvPdlCertificationAuthorityPublicKeyModulus;
@Getter
@Setter
private String emvPdlCertificationAuthorityPublicKeyExponent;
@Getter
@Setter
private String emvPdlCertificationAuthorityPublicKeyCheckSum;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy