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

com.konduto.sdk.adapters.KondutoCreditCardPaymentSerializer Maven / Gradle / Ivy

Go to download

Easily integrate with Konduto (https://konduto.com), a fraud prevention service.

There is a newer version: 2.17.4
Show newest version
package com.konduto.sdk.adapters;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.konduto.sdk.models.KondutoCreditCardPayment;

/**
 * Created by rsampaio on 9/8/16.
 *
 * Serializes a credit card payment.
 */
public class KondutoCreditCardPaymentSerializer extends KondutoPaymentSerializer {
    JsonElement completeSerialization(JsonObject paymentAsJson, KondutoCreditCardPayment creditCardPayment) {
        paymentAsJson.addProperty("status", creditCardPayment.getStatusAsString());
        paymentAsJson.addProperty("bin", creditCardPayment.getBin());
        paymentAsJson.addProperty("last4", creditCardPayment.getLast4());
        paymentAsJson.addProperty("expiration_date", creditCardPayment.getExpirationDate());
        return paymentAsJson;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy