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

kh.gov.nbc.bakong_khqr.model.MerchantAccountInformationTemplate Maven / Gradle / Ivy

Go to download

The standardization of KHQR code specifications will help promote wider use of mobile retail payments in Cambodia and provide consistent user experience for merchants and consumers. It can enable interoperability in the payment industry. A common QR code would facilitate payments among different schemes, e-wallets and banks and would encourage small merchants to adopt KHQR code as payment method. KHQR is created for retail or remittance in Cambodia and Cross-Border. It only requires a single QR for receiving transactions from any payment provider through Bakong including Bakong App.

The newest version!
package kh.gov.nbc.bakong_khqr.model;

import kh.gov.nbc.bakong_khqr.core.TLV;
import kh.gov.nbc.bakong_khqr.utils.StringUtils;


public class MerchantAccountInformationTemplate implements TLV {

    private String tag;

    private MerchantAccountInformation value;

    public MerchantAccountInformationTemplate() {
        super();
    }

    public MerchantAccountInformationTemplate(final String tag) {
        this.setTag(tag);
    }

    public MerchantAccountInformationTemplate(final String tag, final String globallyUniqueIdentifier) {
        this.setTag(tag);
        this.setValue(new MerchantAccountInformation(globallyUniqueIdentifier));
    }

    public void addPaymentNetworkSpecific(final String tag, final String value) {
        if (this.getValue() == null) {
            this.setValue(new MerchantAccountInformation());
        } else {
            this.setValue(this.getValue());
        }
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public void setValue(MerchantAccountInformation value) {
        this.value = value;
    }

    @Override
    public String getTag() {
        return tag;
    }

    @Override
    public MerchantAccountInformation getValue() {
        return value;
    }

    @Override
    public String toString() {

        if (value == null) {
            return StringUtils.EMPTY;
        }

        final String string = value.toString();

        if (StringUtils.isBlank(string)) {
            return StringUtils.EMPTY;
        }

        return String.format("%s%02d%s", tag, string.length(), string);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy