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

com.global.api.terminals.upa.builders.UpaTerminalManageBuilder Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
package com.global.api.terminals.upa.builders;

import java.math.BigDecimal;

import com.global.api.entities.enums.PaymentMethodType;
import com.global.api.entities.enums.TransactionType;
import com.global.api.terminals.builders.TerminalManageBuilder;

public class UpaTerminalManageBuilder extends TerminalManageBuilder {
    public UpaTerminalManageBuilder(TransactionType type, PaymentMethodType paymentType) {
        super(type, paymentType);
    }
    public UpaTerminalManageBuilder withAmount(BigDecimal value) {
        this.amount = value;
        return this;
    }

    @Override
    public void setupValidations() {
        this.validations.of(PaymentMethodType.Gift).check("currency").isNotNull();
        this.validations.of(TransactionType.Capture).check("terminalRefNumber").isNotNull();
        this.validations.of(TransactionType.Void).when("terminalRefNumber").isNull().check("transactionId").isNotNull();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy