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

com.global.api.services.PayByLinkService Maven / Gradle / Ivy

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

import com.global.api.builders.AuthorizationBuilder;
import com.global.api.builders.ManagementBuilder;
import com.global.api.builders.TransactionReportBuilder;
import com.global.api.entities.PayByLinkData;
import com.global.api.entities.enums.ReportType;
import com.global.api.entities.enums.TransactionType;
import com.global.api.entities.reporting.PayByLinkSummary;
import com.global.api.entities.reporting.PayByLinkSummaryPaged;

import java.math.BigDecimal;

public class PayByLinkService {

    public static AuthorizationBuilder create(PayByLinkData payByLink, BigDecimal amount) {
        return
                new AuthorizationBuilder(TransactionType.Create)
                        .withAmount(amount)
                        .withPayByLinkData(payByLink);
    }

    public static ManagementBuilder edit(String payByLinkId) {
        return
                new ManagementBuilder(TransactionType.PayByLinkUpdate)
                        .withPaymentLinkId(payByLinkId);
    }

    public static TransactionReportBuilder payByLinkDetail(String payByLinkId) {
        return
                new TransactionReportBuilder<>(ReportType.PayByLinkDetail, PayByLinkSummary.class)
                        .withPayByLinkId(payByLinkId);
    }

    public static TransactionReportBuilder findPayByLink(int page, int pageSize) {
        return
                new TransactionReportBuilder<>(ReportType.FindPayByLinkPaged, PayByLinkSummaryPaged.class)
                        .withPaging(page, pageSize);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy