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

io.paymenthighway.formBuilders.PivoParametersBuilder Maven / Gradle / Ivy

There is a newer version: 2.1.1.1
Show newest version
package io.paymenthighway.formBuilders;

public class PivoParametersBuilder
    extends GenericPaymentParametersBuilder
    implements PivoParametersInterface {

    public PivoParametersBuilder(
        String method,
        String signatureKeyId,
        String signatureSecret,
        String account,
        String merchant,
        String baseUrl,
        String successUrl,
        String failureUrl,
        String cancelUrl,
        Long amount,
        String orderId,
        String description
    ) {
        super(
            method,
            signatureKeyId,
            signatureSecret,
            account,
            merchant,
            baseUrl,
            successUrl,
            failureUrl,
            cancelUrl,
            amount.toString(),
            "EUR",
            orderId,
            description
        );
        serviceUri = "/form/view/pivo";
    }

    /**
     * @param phoneNumber User’s phone number. Will be suggested (pre-filled) for User on desktop browser payments. The phone number needs to be in international format (e.g. +358401234567).
     * @return PivoParametersInterface
     */
    public PivoParametersBuilder phoneNumber(String phoneNumber) {
        addNameValuePair(FormBuilderConstants.SPH_PHONE_NUMBER, phoneNumber);
        return this;
    }

    /**
     * Reference number
     *
     * @param referenceNumber Reference number
     * @return PivoParametersInterface
     */
    public PivoParametersBuilder referenceNumber(String referenceNumber) {
        addNameValuePair(FormBuilderConstants.SPH_REFERENCE_NUMBER, referenceNumber);
        return this;
    }

    /**
     * When used, Pivo tries to open application with this url
     *
     * @param appUrl App url
     * @return Form builder
     */
    public PivoParametersInterface appUrl(String appUrl) {
        addNameValuePair(FormBuilderConstants.SPH_APP_URL, appUrl);
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy