com.global.api.entities.enums.PaymentMethodName 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.entities.enums;
import java.util.HashMap;
public enum PaymentMethodName implements IMappedConstant {
APM(new HashMap() {{
put(Target.GP_API, "APM");
}}),
DigitalWallet(new HashMap() {{
put(Target.GP_API, "DIGITAL WALLET");
}}),
Card(new HashMap() {{
put(Target.GP_API, "CARD");
}}),
BankTransfer(new HashMap() {{
put(Target.GP_API, "BANK TRANSFER");
}}),
BankPayment(new HashMap() {{
put(Target.Realex, "BANK PAYMENT");
put(Target.GP_API, "BANK PAYMENT");
}}),
BNPL(new HashMap() {{
put(Target.GP_API, "BNPL");
}});
HashMap value;
PaymentMethodName(HashMap value){
this.value = value;
}
public byte[] getBytes(Target target) {
if(value.containsKey(target)) {
return this.value.get(target).getBytes();
}
return null;
}
public String getValue(Target target) {
if(value.containsKey(target)) {
return this.value.get(target);
}
return null;
}
public static PaymentMethodName fromString(String value, Target target) {
for (PaymentMethodName currentEnum : PaymentMethodName.values()) {
if (currentEnum.getValue(target).equalsIgnoreCase(value)) {
return currentEnum;
}
}
return null;
}
}