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

com.safecharge.util.CardUtils Maven / Gradle / Ivy

Go to download

SafeCharge’s REST API SDK for Java provides developer tools for accessing Safecharge's REST API. SafeCharge’s REST API is a simple, easy to use, secure and stateless API, which enables online merchants and service providers to process consumer payments through SafeCharge’s payment gateway. The API supports merchants of all levels of PCI certification, from their online and mobile merchant applications, and is compatible with a large variety of payment options, i.e. payment cards, alternative payment methods, etc.

There is a newer version: 1.7.11
Show newest version
package com.safecharge.util;

import com.safecharge.model.CardData;

/**
 * Copyright (C) 2007-2020 SafeCharge International Group Limited.
 *
 * @author Anton Antonov
 * @since 25.09.2017 г.
 */
public class CardUtils {

    private CardUtils() {
    }

    /**
     * Static factory method to create new {@link CardData} object based on the passed params.
     *
     * @param cardNumber      the number printed on the card
     * @param cardHolderName  the name of the card's holder as printed on the card
     * @param expirationMonth the card's expiration month as printed on the card
     * @param expirationYear  the card's expiration year as printed on the card
     * @param cardToken       this token can be provided instead of the above parameters
     * @param cvv             the CVV code printed on the back of the card
     * @return new {@link CardData} object created from the passed params
     */
    public static CardData createCardDataFromParams(String cardNumber, String cardHolderName, String expirationMonth,
                                                    String expirationYear, String cardToken, String cvv) {

        CardData cardData = new CardData();
        cardData.setCardNumber(cardNumber);
        cardData.setCardHolderName(cardHolderName);
        cardData.setExpirationMonth(expirationMonth);
        cardData.setExpirationYear(expirationYear);
        cardData.setCcTempToken(cardToken);
        cardData.setCVV(cvv);

        return cardData;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy