sessionListeners = new LinkedHashSet<>();
- private SessionContentObserver sessionContentObserver = null;
- private ContentObserver propertyContentObserver;
-
- @WorkerThread
- public CFPSessionConnector(Context context) {
- this.contextWeakReference = new WeakReference<>(context);
- connect();
- }
-
- private Context getContext() {
- return (null != contextWeakReference) ? contextWeakReference.get() : null;
- }
-
- @WorkerThread
- public boolean connect() {
- Context context = getContext();
- if (sessionContentProviderClient == null && null != context) {
- sessionContentProviderClient = context.getContentResolver().acquireUnstableContentProviderClient(CFPSessionContract.AUTHORITY);
- }
- return sessionContentProviderClient != null;
- }
-
- public void disconnect() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && sessionContentProviderClient != null) {
- sessionContentProviderClient.close();
- }
- sessionContentProviderClient = null;
- if (sessionContentObserver != null && getContext() != null) {
- unregisterContentObserver(getContext(), sessionContentObserver);
- }
- sessionContentObserver = null;
- }
-
- @WorkerThread
- public void addSessionListener(CFPSessionListener listener) {
- Context context = getContext();
- if (sessionListeners.isEmpty() && null == sessionContentObserver && null != context) {
- sessionContentObserver = new SessionContentObserver(this);
- registerContentObserver(context, sessionContentObserver);
- }
- sessionListeners.add(listener);
- }
-
- @WorkerThread
- public UUID registerForUpdates(PendingIntent pi, UUID uuid) {
- Bundle bundle = new Bundle();
- bundle.putParcelable("PENDING_INTENT", pi);
- bundle.putSerializable("uuid", uuid);
- try {
- if (connect()) {
- Bundle result = sessionContentProviderClient.call("registerForUpdates", null, bundle);
- if (result != null) {
- return (UUID)result.getSerializable("uuid");
- }
- }
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- @WorkerThread
- public PendingIntent unregisterForUpdates(UUID uuid) {
- Bundle bundle = new Bundle();
- bundle.putSerializable("uuid", uuid);
- try {
- if (connect()) {
- Bundle result = sessionContentProviderClient.call("unregisterForUpdates", null, bundle);
- if (result != null) {
- return result.getParcelable("PENDING_INTENT");
- }
- }
- } catch (RemoteException e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- @WorkerThread
- public boolean removeSessionListener(CFPSessionListener listener) {
- Context context = getContext();
- boolean result = sessionListeners.remove(listener);
- if (sessionListeners.isEmpty() && null != context) {
- unregisterContentObserver(context, sessionContentObserver);
- sessionContentObserver = null;
- }
- return result;
- }
-
- /*
- Clears all data elements and properties associated with the current customer
- order/payment transaction or interaction.
- */
- @WorkerThread
- public boolean clear() {
- try {
- if (connect()) {
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_CLEAR_SESSION, null, null);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return true;
- }
-
- /*
- Similar to clearSession with the exception that this will only clear
- the DisplayOrder, Transaction and Message data. It leaves any CustomerInfo
- or properties in place, so that they can be utilized if needed for follow-on
- orders or payments. Primarily, this is intended to aid with loyalty customers
- who might be logged/checked-in, but the merchant has interrupted the order build
- process and doesn't want the customer to be forced to check-in again to continue
- or start a new order.
- */
- @WorkerThread
- public boolean pauseSession() {
- try {
- if (connect()) {
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_PAUSE_SESSION, null, null);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return true;
- }
-
- protected ContentProviderClient getSessionContentProviderClient() {
- return sessionContentProviderClient;
- }
-
- @WorkerThread
- public CustomerInfo getCustomerInfo() {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- CustomerInfo customerInfo = null;
- try {
- if (connect()) {
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.SESSION_CUSTOMER_URI, null, null, null, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- String custInfo = cursor.getString(0);
- if (custInfo != null) {
- customerInfo = new CustomerInfo(custInfo);
- }
- }
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
-
- return customerInfo;
- }
-
- @WorkerThread
- public void setCustomerInfo(CustomerInfo customerInfo) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- try {
- if (connect()) {
- Bundle bundle = new Bundle();
- bundle.putParcelable(CFPSessionContract.COLUMN_CUSTOMER_INFO, customerInfo);
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_SET_CUSTOMER_INFO, null, bundle);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
-
- @WorkerThread
- public DisplayOrder getDisplayOrder() {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- DisplayOrder displayOrder = null;
- try {
- if (connect()) {
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.SESSION_DISPLAY_ORDER_URI, null, null, null, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- String dispOrder = cursor.getString(0);
- if (dispOrder != null) {
- displayOrder = new DisplayOrder(dispOrder);
- }
- }
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return displayOrder;
- }
-
- @WorkerThread
- public void setDisplayOrder(DisplayOrder displayOrder, boolean isOrderModificationSupported) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- try {
- if (connect()) {
- Bundle bundle = new Bundle();
- bundle.putParcelable(CFPSessionContract.COLUMN_DISPLAY_ORDER, displayOrder);
- bundle.putBoolean(CFPSessionContract.COLUMN_DISPLAY_ORDER_MODIFICATION_SUPPORTED, isOrderModificationSupported);
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_SET_ORDER, null, bundle);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
-
- /**
- * Used to send data from the customer device/screen to a POS device/service. If the message can be sent
- * remotely, it will be send to the POS/MFD and local listeners will NOT be notified. If there isn't a
- * remote message conduit, then listeners on the current device will be notified. This allows the same
- * call and listener to be used in both a tethered, and non-tethered, scenario.
- * @param value - A string payload of the data.
- *
- * setPOSProperty? -> fires on the POS device, either remote or local?
- * setCustomerProperty?
- */
- @WorkerThread
- public void setRemoteProperty(String key, String value) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- setInternalProperty(key, value, CFPSessionContract.CALL_METHOD_SET_REMOTE_PROPERTY);
- }
-
- @WorkerThread
- public void setProperty(String key, String value) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- setInternalProperty(key, value, CFPSessionContract.CALL_METHOD_SET_PROPERTY);
- }
-
-
- private void setInternalProperty(String key, String value, String callMethod) {
- try {
- if (connect()) {
- Bundle bundle = new Bundle();
- bundle.putString(CFPSessionContract.COLUMN_KEY, key);
- bundle.putString(CFPSessionContract.COLUMN_VALUE, value);
- bundle.putString(CFPSessionContract.COLUMN_SRC, EXTERNAL);
- messageUuid = UUID.randomUUID().toString();
- bundle.putString("messageUuid", messageUuid);
- sessionContentProviderClient.call(callMethod, null, bundle);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
-
- @WorkerThread
- public String getProperty(String key) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- try {
- if (!connect()) return null;
- String selectionClause = CFPSessionContract.COLUMN_KEY + " = ?";
- String[] selectionArgs = {key};
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.PROPERTIES_URI, null, selectionClause, selectionArgs, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- return cursor.getString(1); // 0=Key, 1=Value
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- private JSONObject getPropertyWithSrc(String key) {
- try {
- if (!connect()) return null;
- String selectionClause = CFPSessionContract.COLUMN_KEY + " = ?";
- String[] selectionArgs = {key};
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.PROPERTIES_URI, null, selectionClause, selectionArgs, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- JSONObject JSONObject = new JSONObject();
- JSONObject.put("value", cursor.getString(1));
- JSONObject.put("src", cursor.getString(2));
- return JSONObject;
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- @WorkerThread
- public void removeProperty(String key) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- try {
- if (!connect()) return;
- String selectionClause = CFPSessionContract.COLUMN_KEY + " = ?";
- String[] selectionArgs = {key};
- sessionContentProviderClient.delete(CFPSessionContract.PROPERTIES_URI, selectionClause, selectionArgs);
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
-
- @WorkerThread
- public Transaction getTransaction() {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- Transaction transaction = null;
- try {
- if (connect()) {
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.SESSION_TRANSACTION_URI, null, null, null, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- String trans = cursor.getString(0);
- if (trans != null) {
- transaction = new Transaction(trans);
- }
- return transaction;
- }
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- @WorkerThread
- public void setTransaction(Transaction transaction) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- if (connect()) {
- try {
- Bundle bundle = new Bundle();
- bundle.putParcelable(BUNDLE_KEY_TRANSACTION, transaction);
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_SET_TRANSACTION, null, bundle);
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
- }
-
- @WorkerThread
- public CFPMessage getMessage() {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- CFPMessage cfpMessage = null;
- try {
- if (connect()) {
- try (Cursor cursor = sessionContentProviderClient.query(CFPSessionContract.SESSION_MESSAGE_URI, null, null, null, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- String msg = cursor.getString(0);
- if (msg != null) {
- cfpMessage = new CFPMessage(msg);
- }
- return cfpMessage;
- }
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return null;
- }
-
- @WorkerThread
- public void setMessage(CFPMessage cfpMessage) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- if (connect()) {
- try {
- Bundle bundle = new Bundle();
- bundle.putParcelable(BUNDLE_KEY_MESSAGE, cfpMessage);
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_SET_MESSAGE, null, bundle);
- Log.d(TAG, "Just inserted the CFPMessage object for the session");
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
- }
-
-@WorkerThread
- public void sendSessionEvent(String eventType, String data) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- Bundle bundle = new Bundle();
- bundle.putString(BUNDLE_KEY_TYPE, eventType);
- bundle.putString(BUNDLE_KEY_DATA, data);
- try {
- if (connect()) {
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_ON_EVENT, null, bundle);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
-
- @WorkerThread
- public void sendRemoteSessionEvent(String eventType, String data) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING);
- }
- Bundle bundle = new Bundle();
- bundle.putString(BUNDLE_KEY_TYPE, eventType);
- bundle.putString(BUNDLE_KEY_DATA, data);
- try {
- if (connect()) {
- sessionContentProviderClient.call(CFPSessionContract.CALL_METHOD_ON_REMOTE_EVENT, null, bundle);
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
- @Override
- public void onSessionDataChanged(String type, Object data) {
- String listenerSource = contextWeakReference.get().getPackageName();
- for (CFPSessionListener listener : sessionListeners) {
- Log.d(this.getClass().getSimpleName(), "onSessionDataChanged called with type = " + type + " for " + listenerSource + " with listener " + listener.getClass().getSimpleName());
- listener.onSessionDataChanged(type, data);
- }
- }
-
- @Override
- public void onSessionEvent(String type, String data) {
- for (CFPSessionListener listener : sessionListeners) {
- listener.onSessionEvent(type, data);
- }
- }
-
- private static void registerContentObserver(Context context, SessionContentObserver sessionContentObserver) {
- if (null == context || null == sessionContentObserver) return;
-
- // Intentionally, not registering for SessionContract.PROPERTIES_URI and SessionContract.SESSION_URI because it triggers two event notifications
- // for every change.
- context.getContentResolver().registerContentObserver(CFPSessionContract.PROPERTIES_KEY_URI, true, sessionContentObserver);
- context.getContentResolver().registerContentObserver(CFPSessionContract.EVENT_URI, true, sessionContentObserver);
- context.getContentResolver().registerContentObserver(CFPSessionContract.SESSION_TRANSACTION_URI, true, sessionContentObserver);
- context.getContentResolver().registerContentObserver(CFPSessionContract.SESSION_CUSTOMER_URI, true, sessionContentObserver);
- context.getContentResolver().registerContentObserver(CFPSessionContract.SESSION_DISPLAY_ORDER_URI, true, sessionContentObserver);
- context.getContentResolver().registerContentObserver(CFPSessionContract.SESSION_MESSAGE_URI, true, sessionContentObserver);
- }
-
- private static void unregisterContentObserver(Context context, SessionContentObserver sessionContentObserver) {
- if (null != context && null != sessionContentObserver) {
- context.getContentResolver().unregisterContentObserver(sessionContentObserver);
- }
-
- if (null != sessionContentObserver) {
- sessionContentObserver.cleanupSessionConnector();
- }
- }
-
- /**
- * Maps method calls on the ContentObserver to the SessionConnector.
- */
- static class SessionContentObserver extends ContentObserver {
- private CFPSessionConnector connector;
- final private ReentrantLock connectorLock = new ReentrantLock();
- private String lastUuid="";
-
- SessionContentObserver(CFPSessionConnector connector) {
- super(new Handler(Looper.getMainLooper()));
- connectorLock.lock();
- try {
- this.connector = connector;
- } finally {
- connectorLock.unlock();
- }
- }
-
- void cleanupSessionConnector() {
- connectorLock.lock();
- try {
- connector = null;
- } finally {
- connectorLock.unlock();
- }
- }
-
- @Override
- public void onChange(boolean selfChange) {
- super.onChange(selfChange);
- }
-
- @Override
- public void onChange(boolean selfChange, Uri uri) {
- String messageUuid = uri != null ? uri.getQueryParameter("messageUuid") : null; //this ID is to determine if this instance was the one to set the property
- //If the message has the same id, then we don't want duplicate notifications
- if ((messageUuid == null || !messageUuid.equals(lastUuid))) {
- lastUuid = messageUuid;
- CFPSessionConnector localConnector = connector; //copy the reference to avoid NPE
- try {
- if (localConnector != null) {
- switch (CFPSessionContract.matcher.match(uri)) {
- case CFPSessionContract.SESSION:
- localConnector.onSessionDataChanged(SESSION, null);
- break;
- case CFPSessionContract.SESSION_CUSTOMER_INFO:
- CustomerInfo customerInfo = localConnector.getCustomerInfo();
- localConnector.onSessionDataChanged(CUSTOMER_INFO, customerInfo);
- break;
- case CFPSessionContract.SESSION_DISPLAY_ORDER:
- localConnector.onSessionDataChanged(DISPLAY_ORDER, localConnector.getDisplayOrder());
- break;
- case CFPSessionContract.PROPERTIES:
- localConnector.onSessionDataChanged(PROPERTIES, null);
- break;
- case CFPSessionContract.PROPERTIES_KEY:
- //We don't want to send a notification to the instance that set the property
- if (messageUuid == null || !messageUuid.equals(localConnector.messageUuid)) {
- String key = uri.getLastPathSegment();
- JSONObject property = localConnector.getPropertyWithSrc(key);
- String value = null;
- if (property != null && property.has("value")) {
- try {
- value = property.get("value").toString();
- } catch (JSONException e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
- String src = null;
- if (property != null && property.has("src")) {
- try {
- src = property.get("src").toString();
- } catch (JSONException e) {
- Log.e(TAG, e.getMessage(), e);
- }
- }
- //We don't want to send internally sourced notifications
- if (src == null || !src.equals(INTERNAL)) {
- JSONObject obj = new JSONObject();
- try {
- obj.put(QUERY_PARAMETER_NAME, key);
- obj.put(QUERY_PARAMETER_VALUE, value);
- } catch (JSONException e) {
- throw new RuntimeException(e);
- }
- localConnector.onSessionDataChanged(PROPERTIES, obj);
- }
- }
- break;
- case CFPSessionContract.SESSION_TRANSACTION:
- localConnector.onSessionDataChanged(TRANSACTION, localConnector.getTransaction());
- break;
- case CFPSessionContract.SESSION_MESSAGE:
- localConnector.onSessionDataChanged(MESSAGE, localConnector.getMessage());
- break;
- case CFPSessionContract.EVENT:
- String type = uri.getLastPathSegment();
- String payload = uri.getQueryParameter(QUERY_PARAMETER_VALUE);
- localConnector.onSessionEvent(type, payload);
- break;
- default:
- Log.d(TAG, "Unknown URI - Changed: --> " + uri);
- return;
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- } else {
- Log.d(TAG, "onChange not processed for uri " + uri);
- }
- super.onChange(selfChange, uri);
- }
- }
-}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.kt b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.kt
new file mode 100644
index 0000000000..862c4a7585
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.kt
@@ -0,0 +1,1100 @@
+package com.clover.sdk.cfp.connector.session
+
+import android.app.PendingIntent
+import android.content.ContentProviderClient
+import android.content.Context
+import android.database.ContentObserver
+import android.net.Uri
+import android.os.Build
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.os.RemoteException
+import android.os.SharedMemory
+import android.util.Log
+import androidx.annotation.WorkerThread
+import com.clover.sdk.cfp.connector.session.CFPSessionContract.CONTACTLESS_PAYMENTS_CONFIG_PROPERTY
+import com.clover.sdk.cfp.connector.session.CFPSessionContract.IS_KIOSK_PAY_FOR_ORDER_PROPERTY
+import com.clover.sdk.v3.customers.CustomerInfo
+import com.clover.sdk.v3.order.DisplayOrder
+import com.clover.sdk.v3.payments.Transaction
+import com.google.gson.GsonBuilder
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.asCoroutineDispatcher
+import kotlinx.coroutines.launch
+import org.json.JSONException
+import org.json.JSONObject
+import java.io.Serializable
+import java.lang.ref.WeakReference
+import java.nio.charset.StandardCharsets
+import java.util.UUID
+import java.util.concurrent.Executors
+import java.util.concurrent.locks.ReentrantLock
+import kotlin.math.max
+
+/*
+ This connector exposes session data used by Remote Pay during the processing
+ of idle states, payment flows and custom activities. It wraps the key data
+ elements involved in the above states/flows and also allows integrators to inject
+ their own key/value properties into the session object, which trigger change events
+ and allow retrieval during a "session". For general purposes, a session represents
+ any interaction with a single customer. The key data objects stored by default in
+ the session are:
+
+ CustomerInfo
+ DisplayOrder
+ Transaction
+ CFPMessage
+
+*/
+@Suppress("unused")
+open class CFPSessionConnector @WorkerThread constructor(context: Context?) : Serializable,
+ CFPSessionListener {
+ @JvmField
+ var messageUuid: String? = null
+
+ open var sessionContentProviderClient: ContentProviderClient? = null
+ private val contextWeakReference: WeakReference = WeakReference(context)
+ var sessionListeners: MutableSet = LinkedHashSet()
+ private var sessionContentObserver: SessionContentObserver? = null
+ private val propertyContentObserver: ContentObserver? = null
+ private var sessionData: SessionData? = SessionData()
+ private var sharedMemory: SharedMemory? = null
+ private val lock = Any()
+ private val gson = GsonBuilder().setLenient().create()
+ private val cfpSessionConnectorExecutor = Executors.newSingleThreadExecutor { r: Runnable? ->
+ Thread(
+ r,
+ "CFPSessionConnector-executor"
+ )
+ }.asCoroutineDispatcher()
+
+ private val executorScope = CoroutineScope(cfpSessionConnectorExecutor)
+ class SessionData {
+ // Session table columns
+ var customerInfo: String? = null
+ var displayOrder: String? = null
+ var displayOrderModificationSupported: String? = null
+ var transaction: String? = null
+ var message: String? = null
+
+ // Properties table
+ var properties: MutableMap = HashMap()
+ }
+
+ class Property internal constructor(var value: String?, var src: String?)
+
+ /*
+ Helper function to ensure background work is done on a background thread.
+ We don't want to spin off a background thread if we are already on one, so
+ only use the executorScope if we are running on the UI thread.
+ */
+ private fun runWork(block: suspend CoroutineScope.() -> Unit) {
+ try {
+ executorScope.launch {
+ block()
+ }
+ } catch (e: InterruptedException) {
+ Log.d(TAG, "runWork interrupted: " + e.message)
+ // This exception could happen if the current background thread
+ // is interrupted for any reason. If this happens, just restore
+ // the interrupted state and move on.
+ Thread.currentThread().interrupt()
+ } catch (e: Exception) {
+ Log.e(TAG, "runWork exception: " + e.message)
+ }
+ }
+ private fun writeToSharedMemory() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ try {
+ val json = gson.toJson(sessionData)
+ val bytes = json.toByteArray(StandardCharsets.UTF_8)
+ val length = bytes.size
+ val totalLength = bytes.size + 4
+
+ Log.d(TAG, "Writing to shared memory: $json, size: $length, totalLength: $totalLength")
+
+ if (sharedMemory == null) {
+ sharedMemory = SharedMemory.create(
+ BUNDLE_KEY_SHARED_MEMORY, max(
+ INITIAL_SHARED_MEMORY_SIZE, bytes.size * 2
+ )
+ )
+ } else if ((sharedMemory?.getSize() ?: 0) < totalLength) {
+ sharedMemory?.close()
+ // Create new slightly larger to avoid frequent resizing
+ sharedMemory = SharedMemory.create(
+ BUNDLE_KEY_SHARED_MEMORY, max(
+ INITIAL_SHARED_MEMORY_SIZE, bytes.size * 2
+ )
+ )
+ }
+ val buffer = sharedMemory?.mapReadWrite()
+ buffer?.let {
+ it.putInt(bytes.size) // Write the 4-byte length prefix
+ it.put(bytes)
+ SharedMemory.unmap(it)
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, "Error writing to shared memory", e)
+ }
+ }
+ }
+
+ init {
+ connect()
+ }
+
+ private val context: Context?
+ get() = contextWeakReference.get()
+
+ @WorkerThread
+ open fun connect(): Boolean {
+ val context: Context? = this.context
+ if (sessionContentProviderClient == null && null != context) {
+ if (getCFPSessionContentProviderClient() != null) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ Log.d(TAG, "Calling getSharedMemory")
+ try {
+ val bundle = getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_GET_SHARED_MEMORY,
+ null,
+ null
+ )
+ if (bundle != null) {
+ synchronized(lock) {
+ this.sharedMemory = bundle.getParcelable(
+ BUNDLE_KEY_SHARED_MEMORY
+ )
+ refreshDataFromSharedMemory()
+ }
+ } else {
+ Log.d(TAG, "getSharedMemory returned null bundle")
+ }
+ } catch (e: RemoteException) {
+ throw RuntimeException(e)
+ }
+ }
+ } else {
+ Log.d(TAG, "acquireUnstableContentProviderClient returned null")
+ }
+ } else {
+ synchronized(lock) {
+ refreshDataFromSharedMemory()
+ }
+ }
+ return sessionContentProviderClient != null
+ }
+
+ private fun getCFPSessionContentProviderClient(): ContentProviderClient? {
+ if (sessionContentProviderClient == null && null != context) {
+ sessionContentProviderClient = context?.contentResolver
+ ?.acquireUnstableContentProviderClient(CFPSessionContract.AUTHORITY)
+ }
+ return sessionContentProviderClient
+ }
+
+ private fun refreshDataFromSharedMemory() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ synchronized(lock) {
+ if (sharedMemory != null) {
+ //Log.d(TAG, "sharedMemory exists, so we will try to read from it")
+ try {
+ // Map the memory as read-only to avoid accidental corruption
+ val buffer = sharedMemory?.mapReadOnly()
+ buffer?.let {
+ val length = buffer.getInt()
+ val totalLength = sharedMemory?.getSize() ?: 0
+ if (length > 0 && length <= totalLength - 4) {
+ val bytes = ByteArray(length)
+ buffer.get(bytes)
+ // Convert to string and trim any trailing nulls or whitespace
+ val json = String(bytes, StandardCharsets.UTF_8).trim { it <= ' ' }
+ //Log.d(TAG, "Refreshing data from shared memory: $json")
+ // Deserialize back to the in-memory object
+ // This replaces the existing sessionData instance
+ val newData = gson.fromJson(json, SessionData::class.java)
+ if (newData != null) {
+ Log.d(
+ TAG,
+ "Refreshing SessionData from shared memory. newData: " + gson.toJson(newData)
+ )
+ // Update your local state
+ this.sessionData = newData
+ }
+ }
+ SharedMemory.unmap(buffer)
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, "Error reading from shared memory", e)
+ }
+ } else {
+ Log.w(
+ TAG,
+ "SharedMemory is null after attempting initialization from provider, so exiting"
+ )
+ }
+ }
+ }
+ }
+
+ fun disconnect() {
+ Log.d(TAG, "disconnecting and cleaning up the sessionContentProviderClient for context: $context")
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && sessionContentProviderClient != null) {
+ getCFPSessionContentProviderClient()?.close()
+ }
+ sessionContentProviderClient = null
+ if (sessionContentObserver != null && this.context != null) {
+ unregisterContentObserver(this.context, sessionContentObserver)
+ }
+ sessionContentObserver = null
+ }
+
+ @WorkerThread
+ fun addSessionListener(listener: CFPSessionListener?) {
+ val context: Context? = this.context
+ if (sessionListeners.isEmpty() && null == sessionContentObserver && null != context) {
+ sessionContentObserver = SessionContentObserver(this)
+ registerContentObserver(context, sessionContentObserver)
+ }
+ sessionListeners.add(listener!!)
+ }
+
+ @WorkerThread
+ fun registerForUpdates(pi: PendingIntent?, uuid: UUID?): UUID? {
+ val bundle = Bundle()
+ bundle.putParcelable("PENDING_INTENT", pi)
+ bundle.putSerializable("uuid", uuid)
+ try {
+ if (connect()) {
+ val result = getCFPSessionContentProviderClient()?.call("registerForUpdates", null, bundle)
+ if (result != null) {
+ return result.getSerializable("uuid") as UUID?
+ }
+ }
+ } catch (e: RemoteException) {
+ Log.e(TAG, e.message, e)
+ }
+ return null
+ }
+
+ @WorkerThread
+ fun unregisterForUpdates(uuid: UUID?): PendingIntent? {
+ val bundle = Bundle()
+ bundle.putSerializable("uuid", uuid)
+ try {
+ if (connect()) {
+ val result = getCFPSessionContentProviderClient()?.call("unregisterForUpdates", null, bundle)
+ if (result != null) {
+ return result.getParcelable("PENDING_INTENT")
+ }
+ }
+ } catch (e: RemoteException) {
+ Log.e(TAG, e.message, e)
+ }
+ return null
+ }
+
+ fun removeSessionListener(listener: CFPSessionListener?): Boolean {
+ val context: Context? = this.context
+ val result = sessionListeners.remove(listener)
+ if (sessionListeners.isEmpty() && null != context) {
+ unregisterContentObserver(context, sessionContentObserver)
+ sessionContentObserver = null
+ }
+ return result
+ }
+
+ /*
+ Clears all data elements and properties associated with the current customer
+ order/payment transaction or interaction, with the exception of protected properties.
+ */
+ @WorkerThread
+ fun clear(): Boolean {
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.displayOrder = null
+ sessionData?.transaction = null
+ sessionData?.message = null
+ sessionData?.customerInfo = null
+ sessionData?.displayOrderModificationSupported = null
+ // Save protected properties before clearing and then restore.
+ val kioskPayForOrderProperty = sessionData?.properties[IS_KIOSK_PAY_FOR_ORDER_PROPERTY]
+ val contactlessPaymentsConfigProperty =
+ sessionData?.properties[CONTACTLESS_PAYMENTS_CONFIG_PROPERTY]
+ sessionData?.properties?.clear()
+ sessionData?.properties[IS_KIOSK_PAY_FOR_ORDER_PROPERTY] = kioskPayForOrderProperty
+ sessionData?.properties[CONTACTLESS_PAYMENTS_CONFIG_PROPERTY] =
+ contactlessPaymentsConfigProperty
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_CLEAR_SESSION,
+ null,
+ null
+ )
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return true
+ }
+
+ /*
+ Similar to clearSession with the exception that this will only clear
+ the DisplayOrder, Transaction and Message data. It leaves any CustomerInfo
+ or properties in place, so that they can be utilized if needed for follow-on
+ orders or payments. Primarily, this is intended to aid with loyalty customers
+ who might be logged/checked-in, but the merchant has interrupted the order build
+ process and doesn't want the customer to be forced to check-in again to continue
+ or start a new order.
+ */
+ @WorkerThread
+ fun pauseSession(): Boolean {
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.displayOrder = null
+ sessionData?.transaction = null
+ sessionData?.message = null
+ sessionData?.displayOrderModificationSupported = null
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_PAUSE_SESSION,
+ null,
+ null
+ )
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return true
+ }
+
+ val displayOrderModificationSupported: Boolean
+ get() {
+ var orderModificationSupportedBoolean = false
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ orderModificationSupportedBoolean =
+ (if (this.sessionData == null || sessionData?.displayOrderModificationSupported == null) false else
+ this.sessionData?.displayOrderModificationSupported) as Boolean
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return orderModificationSupportedBoolean
+ }
+
+ var customerInfo: CustomerInfo?
+ get() {
+ var customerInfo: CustomerInfo? = null
+ try {
+ if (connect()) {
+ customerInfo = getCustomerInfoData()
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return customerInfo
+ }
+ @WorkerThread
+ set(customerInfo) {
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.customerInfo = customerInfo?.jsonObject?.toString()
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ val bundle = Bundle()
+ bundle.putParcelable(CFPSessionContract.COLUMN_CUSTOMER_INFO, customerInfo)
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_SET_CUSTOMER_INFO,
+ null,
+ bundle
+ )
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ private fun getCustomerInfoData(): CustomerInfo? {
+ if (sessionData == null) return getCustomerInfoFromProvider()
+ synchronized(lock) {
+ val customerInfo = sessionData?.customerInfo ?: return null
+ return CustomerInfo(customerInfo)
+ }
+ }
+ private fun getCustomerInfoFromProvider(): CustomerInfo? {
+ var customerInfo: CustomerInfo? = null
+ getCFPSessionContentProviderClient()?.query(
+ CFPSessionContract.SESSION_DISPLAY_ORDER_URI,
+ null,
+ null,
+ null,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ val custInfo = cursor.getString(0)
+ if (custInfo != null) {
+ customerInfo = CustomerInfo(custInfo)
+ }
+ }
+ }
+ return customerInfo
+ }
+
+ val displayOrder: DisplayOrder?
+ get() {
+ var displayOrder: DisplayOrder? = null
+ try {
+ if (connect()) {
+ displayOrder = getDisplayOrderData()
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return displayOrder
+ }
+
+ private fun getDisplayOrderData(): DisplayOrder? {
+ if (sessionData == null) return getDisplayOrderFromProvider()
+ synchronized(lock) {
+ val displayOrder = sessionData?.displayOrder ?: return null
+ return DisplayOrder(displayOrder)
+ }
+ }
+
+ private fun getDisplayOrderFromProvider(): DisplayOrder? {
+ var displayOrder: DisplayOrder? = null
+ getCFPSessionContentProviderClient()?.query(
+ CFPSessionContract.SESSION_DISPLAY_ORDER_URI,
+ null,
+ null,
+ null,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ val dispOrder = cursor.getString(0)
+ if (dispOrder != null) {
+ displayOrder = DisplayOrder(dispOrder)
+ }
+ }
+ }
+ return displayOrder
+ }
+
+ @WorkerThread
+ fun setDisplayOrder(displayOrder: DisplayOrder?, isOrderModificationSupported: Boolean) {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING)
+ }
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.displayOrder = displayOrder?.jsonObject?.toString()
+ sessionData?.displayOrderModificationSupported = isOrderModificationSupported.toString()
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ val bundle = Bundle()
+ bundle.putParcelable(CFPSessionContract.COLUMN_DISPLAY_ORDER, displayOrder)
+ bundle.putBoolean(
+ CFPSessionContract.COLUMN_DISPLAY_ORDER_MODIFICATION_SUPPORTED,
+ isOrderModificationSupported
+ )
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_SET_ORDER,
+ null,
+ bundle
+ )
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ /**
+ * Used to send data from the customer device/screen to a POS device/service. If the message can be sent
+ * remotely, it will be send to the POS/MFD and local listeners will NOT be notified. If there isn't a
+ * remote message conduit, then listeners on the current device will be notified. This allows the same
+ * call and listener to be used in both a tethered, and non-tethered, scenario.
+ * @param value - A string payload of the data.
+ *
+ *
+ * setPOSProperty? -> fires on the POS device, either remote or local?
+ * setCustomerProperty?
+ */
+ @WorkerThread
+ fun setRemoteProperty(key: String?, value: String?) {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING)
+ }
+ setPropertyProtected(key, value, EXTERNAL, CFPSessionContract.CALL_METHOD_SET_REMOTE_PROPERTY)
+ }
+
+ @WorkerThread
+ open fun setProperty(key: String?, value: String?) {
+ setPropertyProtected(key, value, EXTERNAL, CFPSessionContract.CALL_METHOD_SET_PROPERTY)
+ }
+
+ protected fun setPropertyProtected(key: String?, value: String?, src: String, callMethod: String) {
+ try {
+ if (connect()) {
+ if (callMethod == CFPSessionContract.CALL_METHOD_SET_PROPERTY) {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ val sessionProperties = sessionData?.properties
+ sessionProperties?.set(key, Property(value, src))
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ }
+
+ runWork {
+ val bundle = Bundle()
+ bundle.putString(CFPSessionContract.COLUMN_KEY, key)
+ bundle.putString(CFPSessionContract.COLUMN_VALUE, value)
+ bundle.putString(CFPSessionContract.COLUMN_SRC, src)
+ messageUuid = UUID.randomUUID().toString()
+ bundle.putString("messageUuid", messageUuid)
+ sessionContentProviderClient?.call(callMethod, null, bundle)
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ @WorkerThread
+ fun getProperty(key: String?): String? {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING)
+ }
+ try {
+ if (connect()) {
+ return getPropertyData(key)
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return null
+ }
+
+ private fun getPropertyData(key: String?): String? {
+ if (sessionData == null) return getPropertyValueFromProvider(key)
+ synchronized(lock) {
+ return sessionData?.properties[key]?.value
+ }
+ }
+
+ private fun getPropertyValueFromProvider(key: String?): String? {
+ try {
+ val selectionClause = CFPSessionContract.COLUMN_KEY + " = ?"
+ val selectionArgs = arrayOf(key)
+ getCFPSessionContentProviderClient()?.query(
+ CFPSessionContract.PROPERTIES_URI,
+ null,
+ selectionClause,
+ selectionArgs,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ return cursor.getString(1) // 0=Key, 1=Value
+ }
+ }
+ } catch (e: java.lang.Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return null
+ }
+
+ private fun getPropertyWithSrc(key: String?): JSONObject? {
+ try {
+ if (connect()) {
+ return getPropertyWithSrcData(key)
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return null
+ }
+
+ private fun getPropertyWithSrcData(key: String?): JSONObject? {
+ val localSessionData = sessionData
+ val property = if (localSessionData == null) getPropertyValueWithSrcFromProvider(key) else localSessionData.properties[key]
+ if (property != null) {
+ val jsonObject = JSONObject()
+ jsonObject.put("value", property.value)
+ jsonObject.put("src", property.src)
+ return jsonObject
+ }
+ return null
+ }
+ private fun getPropertyValueWithSrcFromProvider(key: String?): Property? {
+ try {
+ val selectionClause = CFPSessionContract.COLUMN_KEY + " = ?"
+ val selectionArgs = arrayOf(key)
+ sessionContentProviderClient?.query(
+ CFPSessionContract.PROPERTIES_URI,
+ null,
+ selectionClause,
+ selectionArgs,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ val property = Property(cursor.getString(1), cursor.getString(2) )
+ return property
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e);
+ }
+ return null
+
+ }
+ fun removeProperty(key: String?) {
+ try {
+ if (connect()) {
+ synchronized(lock) {
+ if (sessionData != null) {
+ sessionData?.properties?.remove(key)
+ writeToSharedMemory()
+ }
+ }
+ runWork {
+ val selectionClause = CFPSessionContract.COLUMN_KEY + " = ?"
+ val selectionArgs = arrayOf(key)
+ getCFPSessionContentProviderClient()?.delete(
+ CFPSessionContract.PROPERTIES_URI,
+ selectionClause,
+ selectionArgs
+ )
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ @set:WorkerThread
+ var transaction: Transaction?
+ get() {
+ var transaction: Transaction? = null
+ try {
+ if (connect()) {
+ transaction = getTransactionData()
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return transaction
+ }
+
+ set(transaction) {
+ if (connect()) {
+ try {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.transaction = transaction?.jsonObject?.toString()
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ val bundle = Bundle()
+ bundle.putParcelable(BUNDLE_KEY_TRANSACTION, transaction)
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_SET_TRANSACTION,
+ null,
+ bundle
+ )
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+ }
+
+ private fun getTransactionData(): Transaction? {
+ if (sessionData == null) return getTransactionFromProvider()
+ synchronized(lock) {
+ val transaction = sessionData?.transaction ?: return null
+ return Transaction(transaction)
+ }
+ }
+ private fun getTransactionFromProvider(): Transaction? {
+ var transaction: Transaction? = null
+ getCFPSessionContentProviderClient()?.query(
+ CFPSessionContract.SESSION_TRANSACTION_URI,
+ null,
+ null,
+ null,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ val trans = cursor.getString(0)
+ if (trans != null) {
+ transaction = Transaction(trans)
+ }
+ }
+ }
+ return transaction
+ }
+
+ @set:WorkerThread
+ var message: CFPMessage?
+ get() {
+ var cfpMessage: CFPMessage? = null
+ try {
+ if (connect()) {
+ cfpMessage = getCFPMessageData()
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ return cfpMessage
+ }
+ set(cfpMessage) {
+ if (connect()) {
+ try {
+ synchronized(lock) {
+ if (sharedMemory != null && sessionData != null) {
+ sessionData?.message = cfpMessage?.jsonObject?.toString()
+ writeToSharedMemory()
+ } else {
+ Log.w(TAG, "SharedMemory not initialized from provider, so can't save data to it")
+ }
+ }
+ runWork {
+ val bundle = Bundle()
+ bundle.putParcelable(BUNDLE_KEY_MESSAGE, cfpMessage)
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_SET_MESSAGE,
+ null,
+ bundle
+ )
+ }
+ Log.d(TAG, "Just inserted the CFPMessage object for the session")
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+ }
+
+ private fun getCFPMessageData(): CFPMessage? {
+ val localSessionData = sessionData ?: return getCFPMessageFromProvider()
+ synchronized(lock) {
+ val cfpMessage = sessionData?.message ?: return null
+ return CFPMessage(cfpMessage)
+ }
+ }
+ private fun getCFPMessageFromProvider(): CFPMessage? {
+ var cfpMessage: CFPMessage? = null
+ getCFPSessionContentProviderClient()?.query(
+ CFPSessionContract.SESSION_TRANSACTION_URI,
+ null,
+ null,
+ null,
+ null
+ ).use { cursor ->
+ if (null != cursor && cursor.moveToFirst()) {
+ val message = cursor.getString(0)
+ if (message != null) {
+ cfpMessage = CFPMessage(message)
+ }
+ }
+ }
+ return cfpMessage
+ }
+
+ @WorkerThread
+ fun sendSessionEvent(eventType: String?, data: String?) {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING)
+ }
+ val bundle = Bundle()
+ bundle.putString(BUNDLE_KEY_TYPE, eventType)
+ bundle.putString(BUNDLE_KEY_DATA, data)
+ try {
+ if (connect()) {
+ getCFPSessionContentProviderClient()?.call(CFPSessionContract.CALL_METHOD_ON_EVENT, null, bundle)
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ @WorkerThread
+ fun sendRemoteSessionEvent(eventType: String?, data: String?) {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ Log.d(TAG, CONNECTOR_ON_MAIN_THREAD_WARNING)
+ }
+ val bundle = Bundle()
+ bundle.putString(BUNDLE_KEY_TYPE, eventType)
+ bundle.putString(BUNDLE_KEY_DATA, data)
+ try {
+ if (connect()) {
+ getCFPSessionContentProviderClient()?.call(
+ CFPSessionContract.CALL_METHOD_ON_REMOTE_EVENT,
+ null,
+ bundle
+ )
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+
+ override fun onSessionDataChanged(type: String?, data: Any?) {
+ val listenerSource = contextWeakReference.get()?.packageName
+ for (listener in sessionListeners) {
+ Log.d(
+ this.javaClass.getSimpleName(),
+ "onSessionDataChanged called with type = " + type + " for " + listenerSource + " with listener " + listener.javaClass.getSimpleName()
+ )
+ listener.onSessionDataChanged(type, data)
+ }
+ }
+
+ override fun onSessionEvent(type: String?, data: String?) {
+ for (listener in sessionListeners) {
+ listener.onSessionEvent(type, data)
+ }
+ }
+
+ /**
+ * Maps method calls on the ContentObserver to the SessionConnector.
+ */
+ internal class SessionContentObserver(connector: CFPSessionConnector?) : ContentObserver(
+ Handler(Looper.getMainLooper())
+ ) {
+ private var connector: CFPSessionConnector? = null
+ private val connectorLock = ReentrantLock()
+ private var lastUuid: String? = ""
+
+ init {
+ connectorLock.lock()
+ try {
+ this.connector = connector
+ } finally {
+ connectorLock.unlock()
+ }
+ }
+
+ fun cleanupSessionConnector() {
+ connectorLock.lock()
+ try {
+ connector = null
+ } finally {
+ connectorLock.unlock()
+ }
+ }
+
+ override fun onChange(selfChange: Boolean, uri: Uri?) {
+ val messageUuid =
+ uri?.getQueryParameter("messageUuid") //this ID is to determine if this instance was the one to set the property
+ //If the message has the same id, then we don't want duplicate notifications
+ if ((messageUuid == null || messageUuid != lastUuid)) {
+ lastUuid = messageUuid
+ val localConnector = connector //copy the reference to avoid NPE
+ try {
+ if (localConnector != null) {
+ when (CFPSessionContract.matcher.match(uri)) {
+ CFPSessionContract.SESSION -> localConnector.onSessionDataChanged(
+ SESSION, null
+ )
+
+ CFPSessionContract.SESSION_CUSTOMER_INFO -> {
+ val customerInfo: CustomerInfo? =
+ localConnector.customerInfo
+ localConnector.onSessionDataChanged(CUSTOMER_INFO, customerInfo)
+ }
+
+ CFPSessionContract.SESSION_DISPLAY_ORDER -> localConnector.onSessionDataChanged(
+ DISPLAY_ORDER,
+ localConnector.displayOrder
+ )
+
+ CFPSessionContract.PROPERTIES -> localConnector.onSessionDataChanged(
+ PROPERTIES, null
+ )
+
+ CFPSessionContract.PROPERTIES_KEY -> //We don't want to send a notification to the instance that set the property
+ if (messageUuid == null || messageUuid != localConnector.messageUuid) {
+ val key = uri?.lastPathSegment
+ val property = localConnector.getPropertyWithSrc(key)
+ var value: String? = null
+ if (property != null && property.has("value")) {
+ try {
+ value = property.get("value").toString()
+ } catch (e: JSONException) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+ var src: String? = null
+ if (property != null && property.has("src")) {
+ try {
+ src = property.get("src").toString()
+ } catch (e: JSONException) {
+ Log.e(TAG, e.message, e)
+ }
+ }
+ //We don't want to send internally sourced notifications
+ if (src == null || src != INTERNAL) {
+ val obj = JSONObject()
+ try {
+ obj.put(QUERY_PARAMETER_NAME, key)
+ obj.put(QUERY_PARAMETER_VALUE, value)
+ } catch (e: JSONException) {
+ throw RuntimeException(e)
+ }
+ localConnector.onSessionDataChanged(PROPERTIES, obj)
+ }
+ }
+
+ CFPSessionContract.SESSION_TRANSACTION -> localConnector.onSessionDataChanged(
+ TRANSACTION,
+ localConnector.transaction
+ )
+
+ CFPSessionContract.SESSION_MESSAGE -> localConnector.onSessionDataChanged(
+ MESSAGE,
+ localConnector.message
+ )
+
+ CFPSessionContract.EVENT -> {
+ val type = uri?.lastPathSegment
+ val payload = uri?.getQueryParameter(QUERY_PARAMETER_VALUE)
+ localConnector.onSessionEvent(type, payload)
+ }
+
+ else -> {
+ Log.d(TAG, "Unknown URI - Changed: --> $uri")
+ return
+ }
+ }
+ }
+ } catch (e: Exception) {
+ Log.e(TAG, e.message, e)
+ }
+ } else {
+ Log.d(TAG, "onChange not processed for uri $uri")
+ }
+ super.onChange(selfChange, uri)
+ }
+ }
+
+ companion object {
+ const val DISPLAY_ORDER: String = "com.clover.extra.DISPLAY_ORDER"
+ const val CUSTOMER_INFO: String = "com.clover.extra.CUSTOMER_INFO"
+ const val CUSTOMER_PROVIDED_DATA: String = "com.clover.extra.CUSTOMER_PROVIDED_DATA"
+ const val SESSION: String = "SESSION"
+ const val PROPERTIES: String = "PROPERTIES"
+ const val TRANSACTION: String = "TRANSACTION"
+ const val MESSAGE: String = "MESSAGE"
+ const val MESSAGE_DURATION: String = "MESSAGE_DURATION"
+ const val PROPERTY_KEY: String = "PROPERTY_KEY"
+ const val PROPERTY_VALUE: String = "PROPERTY_VALUE"
+
+ const val QUERY_PARAMETER_VALUE: String = "value"
+ const val QUERY_PARAMETER_NAME: String = "name"
+ const val QUERY_PARAMETER_SRC: String = "src"
+ const val BUNDLE_KEY_TYPE: String = "TYPE"
+ const val BUNDLE_KEY_DATA: String = "DATA"
+ const val BUNDLE_KEY_MESSAGE: String = "MESSAGE"
+ const val BUNDLE_KEY_DURATION: String = "DURATION"
+ const val BUNDLE_KEY_TRANSACTION: String = "TRANSACTION"
+ const val BUNDLE_KEY_CUSTOMER_INFO: String = "CUSTOMER_INFO"
+ const val BUNDLE_KEY_DISPLAY_ORDER: String = "DISPLAY_ORDER"
+
+ const val BUNDLE_KEY_SHARED_MEMORY: String = "SHARED_MEMORY"
+
+ private const val EXTERNAL = "EXTERNAL"
+ private const val INTERNAL = "INTERNAL"
+ private const val CUSTOMER = "CUSTOMER"
+ private const val TAG = "CFPSessionConnector"
+ private const val CONNECTOR_ON_MAIN_THREAD_WARNING =
+ "Connector is being invoked on the main UI thread, which might result in slow processing"
+
+ private const val INITIAL_SHARED_MEMORY_SIZE = 1024 * 1024 // 1MB
+ private fun registerContentObserver(
+ context: Context?,
+ sessionContentObserver: SessionContentObserver?
+ ) {
+ if (null == context || null == sessionContentObserver) return
+
+ // Intentionally, not registering for SessionContract.PROPERTIES_URI and SessionContract.SESSION_URI because it triggers two event notifications
+ // for every change.
+ context.contentResolver.registerContentObserver(
+ CFPSessionContract.PROPERTIES_KEY_URI,
+ true,
+ sessionContentObserver
+ )
+ context.contentResolver
+ .registerContentObserver(CFPSessionContract.EVENT_URI, true, sessionContentObserver)
+ context.contentResolver.registerContentObserver(
+ CFPSessionContract.SESSION_TRANSACTION_URI,
+ true,
+ sessionContentObserver
+ )
+ context.contentResolver.registerContentObserver(
+ CFPSessionContract.SESSION_CUSTOMER_URI,
+ true,
+ sessionContentObserver
+ )
+ context.contentResolver.registerContentObserver(
+ CFPSessionContract.SESSION_DISPLAY_ORDER_URI,
+ true,
+ sessionContentObserver
+ )
+ context.contentResolver.registerContentObserver(
+ CFPSessionContract.SESSION_MESSAGE_URI,
+ true,
+ sessionContentObserver
+ )
+ }
+
+ private fun unregisterContentObserver(
+ context: Context?,
+ sessionContentObserver: SessionContentObserver?
+ ) {
+ if (null != context && null != sessionContentObserver) {
+ context.contentResolver.unregisterContentObserver(sessionContentObserver)
+ }
+
+ sessionContentObserver?.cleanupSessionConnector()
+ }
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.java
deleted file mode 100644
index 057290dc9d..0000000000
--- a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.clover.sdk.cfp.connector.session;
-
-import android.content.UriMatcher;
-import android.net.Uri;
-
-/**
- A contract class is a public final class that contains constant definitions for the URIs,
- column names, MIME types, and other meta-data that related to the provider.
- The class establishes a contract between the provider and other applications by ensuring that the provider
- can be correctly accessed even if there are changes to the actual values of URIs, column names, and so forth.
- */
-
-public class CFPSessionContract {
- public static final int SESSION = 10;
- public static final int SESSION_CUSTOMER_INFO = 20;
- public static final int SESSION_DISPLAY_ORDER = 30;
- public static final int SESSION_TRANSACTION = 40;
- public static final int SESSION_MESSAGE = 45;
- public static final int PROPERTIES = 50;
- public static final int PROPERTIES_KEY = 60;
- public static final int EVENT = 70;
-
- // Session table/column definitions
- public static final String SESSION_TABLE_NAME = "SESSION";
- public static final String COLUMN_ID = "_ID";
- public static final String COLUMN_CUSTOMER_INFO = "CUSTOMER_INFO";
- public static final String COLUMN_DISPLAY_ORDER = "DISPLAY_ORDER";
- public static final String COLUMN_DISPLAY_ORDER_MODIFICATION_SUPPORTED = "DISPLAY_ORDER_MODIFICATION_SUPPORTED";
- public static final String COLUMN_TRANSACTION = "TX";
- public static final String COLUMN_MESSAGE = "CFP_MESSAGE";
- // Session property table/column definition
- public static final String PROPERTIES_TABLE_NAME = "SESSION_PROPERTY";
- public static final String COLUMN_KEY = "KEY";
- public static final String COLUMN_VALUE = "VALUE";
- public static final String COLUMN_SRC = "SRC";
- // Session event
- public static final String SESSION_EVENT = "SESSION_EVENT";
-
- //Authority is unique string for the app.
- public static String AUTHORITY = "com.clover.engine.providers.cfp.session";
-
- public static Uri SESSION_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_TABLE_NAME);
- public static Uri SESSION_CUSTOMER_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_TABLE_NAME + "/" + COLUMN_CUSTOMER_INFO);
- public static Uri SESSION_DISPLAY_ORDER_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_TABLE_NAME + "/" + COLUMN_DISPLAY_ORDER);
- public static Uri SESSION_TRANSACTION_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_TABLE_NAME + "/" + COLUMN_TRANSACTION);
- public static Uri SESSION_MESSAGE_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_TABLE_NAME + "/" + COLUMN_MESSAGE);
- public static Uri PROPERTIES_URI = Uri.parse("content://" + AUTHORITY + "/" + PROPERTIES_TABLE_NAME);
- public static Uri PROPERTIES_KEY_URI = Uri.parse("content://" + AUTHORITY + "/" + PROPERTIES_TABLE_NAME+ "/" + COLUMN_KEY);
- public static Uri EVENT_URI = Uri.parse("content://" + AUTHORITY + "/" + SESSION_EVENT);
-
- // These should match the Uri definitions above
- public static final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
- static {
- // Session Data
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_TABLE_NAME, CFPSessionContract.SESSION);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_TABLE_NAME + "/" + CFPSessionContract.COLUMN_CUSTOMER_INFO, CFPSessionContract.SESSION_CUSTOMER_INFO);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_TABLE_NAME + "/" + CFPSessionContract.COLUMN_DISPLAY_ORDER, CFPSessionContract.SESSION_DISPLAY_ORDER);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_TABLE_NAME + "/" + CFPSessionContract.COLUMN_TRANSACTION, CFPSessionContract.SESSION_TRANSACTION);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_TABLE_NAME + "/" + CFPSessionContract.COLUMN_MESSAGE, CFPSessionContract.SESSION_MESSAGE);
-
- // Session Properties
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.PROPERTIES_TABLE_NAME, CFPSessionContract.PROPERTIES);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.PROPERTIES_TABLE_NAME + "/" + CFPSessionContract.COLUMN_KEY, CFPSessionContract.PROPERTIES_KEY);
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.PROPERTIES_TABLE_NAME + "/" + CFPSessionContract.COLUMN_KEY + "/*", CFPSessionContract.PROPERTIES_KEY);
-
- // Session Events
- matcher.addURI(CFPSessionContract.AUTHORITY, CFPSessionContract.SESSION_EVENT + "/*", CFPSessionContract.EVENT);
- }
-
- public static final String CALL_METHOD_ON_EVENT = "onEvent";
- public static final String CALL_METHOD_ON_REMOTE_EVENT = "onRemoteEvent";
- /*
- Clears all session data and non-protected properties. Normally
- used as part of doing a reset on the CFD.
- */
- public static final String CALL_METHOD_CLEAR_SESSION = "clearSession";
- /*
- Clears the DisplayOrder, Message & Transaction data from the current session.
- This allows CustomerInfo and potential associated properties to survive,
- should there be a need to retain/revive order association when
- processing pauses between application switching and then restarts.
- */
- public static final String CALL_METHOD_PAUSE_SESSION = "pauseSession";
- public static final String CALL_METHOD_SET_ORDER = "setOrder";
- public static final String CALL_METHOD_SET_CUSTOMER_INFO = "setCustomerInfo";
- public static final String CALL_METHOD_SET_PROPERTY = "setProperty";
- public static final String CALL_METHOD_SET_REMOTE_PROPERTY = "setRemoteProperty";
- public static final String CALL_METHOD_SET_TRANSACTION = "setTransaction";
- public static final String CALL_METHOD_SET_MESSAGE = "setMessage";
-}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.kt b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.kt
new file mode 100644
index 0000000000..86d24cedfc
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.kt
@@ -0,0 +1,121 @@
+package com.clover.sdk.cfp.connector.session
+
+import android.content.UriMatcher
+import android.net.Uri
+
+/**
+ * A contract class is a public final class that contains constant definitions for the URIs,
+ * column names, MIME types, and other meta-data that related to the provider.
+ * The class establishes a contract between the provider and other applications by ensuring that the provider
+ * can be correctly accessed even if there are changes to the actual values of URIs, column names, and so forth.
+ */
+object CFPSessionContract {
+ const val SESSION: Int = 10
+ const val SESSION_CUSTOMER_INFO: Int = 20
+ const val SESSION_DISPLAY_ORDER: Int = 30
+ const val SESSION_TRANSACTION: Int = 40
+ const val SESSION_MESSAGE: Int = 45
+ const val PROPERTIES: Int = 50
+ const val PROPERTIES_KEY: Int = 60
+ const val EVENT: Int = 70
+
+ // Session table/column definitions
+ const val SESSION_TABLE_NAME: String = "SESSION"
+ const val COLUMN_ID: String = "_ID"
+ const val COLUMN_CUSTOMER_INFO: String = "CUSTOMER_INFO"
+ const val COLUMN_DISPLAY_ORDER: String = "DISPLAY_ORDER"
+ const val COLUMN_DISPLAY_ORDER_MODIFICATION_SUPPORTED: String =
+ "DISPLAY_ORDER_MODIFICATION_SUPPORTED"
+ const val COLUMN_TRANSACTION: String = "TX"
+ const val COLUMN_MESSAGE: String = "CFP_MESSAGE"
+
+ // Session property table/column definition
+ const val PROPERTIES_TABLE_NAME: String = "SESSION_PROPERTY"
+ const val COLUMN_KEY: String = "KEY"
+ const val COLUMN_VALUE: String = "VALUE"
+ const val COLUMN_SRC: String = "SRC"
+ const val IS_KIOSK_PAY_FOR_ORDER_PROPERTY: String =
+ "com.clover.remote.IS_KIOSK_PAY_FOR_ORDER_PROPERTY"
+ const val CONTACTLESS_PAYMENTS_CONFIG_PROPERTY: String = "CONTACTLESS_PAYMENTS_CONFIG_PROPERTY"
+
+ // Session event
+ const val SESSION_EVENT: String = "SESSION_EVENT"
+
+ //Authority is unique string for the app.
+ @JvmField
+ var AUTHORITY: String = "com.clover.engine.providers.cfp.session"
+ @JvmField
+ var SESSION_URI: Uri = Uri.parse("content://$AUTHORITY/$SESSION_TABLE_NAME")
+ @JvmField
+ var SESSION_CUSTOMER_URI: Uri =
+ Uri.parse("content://$AUTHORITY/$SESSION_TABLE_NAME/$COLUMN_CUSTOMER_INFO")
+ @JvmField
+ var SESSION_DISPLAY_ORDER_URI: Uri =
+ Uri.parse("content://$AUTHORITY/$SESSION_TABLE_NAME/$COLUMN_DISPLAY_ORDER")
+ @JvmField
+ var SESSION_TRANSACTION_URI: Uri =
+ Uri.parse("content://$AUTHORITY/$SESSION_TABLE_NAME/$COLUMN_TRANSACTION")
+ @JvmField
+ var SESSION_MESSAGE_URI: Uri =
+ Uri.parse("content://$AUTHORITY/$SESSION_TABLE_NAME/$COLUMN_MESSAGE")
+ @JvmField
+ var PROPERTIES_URI: Uri = Uri.parse("content://$AUTHORITY/$PROPERTIES_TABLE_NAME")
+ @JvmField
+ var PROPERTIES_KEY_URI: Uri =
+ Uri.parse("content://$AUTHORITY/$PROPERTIES_TABLE_NAME/$COLUMN_KEY")
+ @JvmField
+ var EVENT_URI: Uri = Uri.parse("content://$AUTHORITY/$SESSION_EVENT")
+
+ // These should match the Uri definitions above
+ @JvmField
+ val matcher: UriMatcher = UriMatcher(UriMatcher.NO_MATCH)
+
+ init {
+ // Session Data
+ matcher.addURI(AUTHORITY, SESSION_TABLE_NAME, SESSION)
+ matcher.addURI(
+ AUTHORITY,
+ "$SESSION_TABLE_NAME/$COLUMN_CUSTOMER_INFO",
+ SESSION_CUSTOMER_INFO
+ )
+ matcher.addURI(
+ AUTHORITY,
+ "$SESSION_TABLE_NAME/$COLUMN_DISPLAY_ORDER",
+ SESSION_DISPLAY_ORDER
+ )
+ matcher.addURI(AUTHORITY, "$SESSION_TABLE_NAME/$COLUMN_TRANSACTION", SESSION_TRANSACTION)
+ matcher.addURI(AUTHORITY, "$SESSION_TABLE_NAME/$COLUMN_MESSAGE", SESSION_MESSAGE)
+
+ // Session Properties
+ matcher.addURI(AUTHORITY, PROPERTIES_TABLE_NAME, PROPERTIES)
+ matcher.addURI(AUTHORITY, "$PROPERTIES_TABLE_NAME/$COLUMN_KEY", PROPERTIES_KEY)
+ matcher.addURI(AUTHORITY, "$PROPERTIES_TABLE_NAME/$COLUMN_KEY/*", PROPERTIES_KEY)
+
+ // Session Events
+ matcher.addURI(AUTHORITY, "$SESSION_EVENT/*", EVENT)
+ }
+
+ const val CALL_METHOD_ON_EVENT: String = "onEvent"
+ const val CALL_METHOD_ON_REMOTE_EVENT: String = "onRemoteEvent"
+
+ /*
+ Clears all session data and non-protected properties. Normally
+ used as part of doing a reset on the CFD.
+ */
+ const val CALL_METHOD_CLEAR_SESSION: String = "clearSession"
+
+ /*
+ Clears the DisplayOrder, Message & Transaction data from the current session.
+ This allows CustomerInfo and potential associated properties to survive,
+ should there be a need to retain/revive order association when
+ processing pauses between application switching and then restarts.
+ */
+ const val CALL_METHOD_PAUSE_SESSION: String = "pauseSession"
+ const val CALL_METHOD_SET_ORDER: String = "setOrder"
+ const val CALL_METHOD_SET_CUSTOMER_INFO: String = "setCustomerInfo"
+ const val CALL_METHOD_SET_PROPERTY: String = "setProperty"
+ const val CALL_METHOD_SET_REMOTE_PROPERTY: String = "setRemoteProperty"
+ const val CALL_METHOD_SET_TRANSACTION: String = "setTransaction"
+ const val CALL_METHOD_SET_MESSAGE: String = "setMessage"
+ const val CALL_METHOD_GET_SHARED_MEMORY: String = "getSharedMemory"
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/fragment/ReturnToMerchantDialogFragment.java b/clover-android-sdk/src/main/java/com/clover/sdk/fragment/ReturnToMerchantDialogFragment.java
index a629147ef5..d2720108a0 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/fragment/ReturnToMerchantDialogFragment.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/fragment/ReturnToMerchantDialogFragment.java
@@ -22,11 +22,16 @@
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+
import com.clover.android.sdk.R;
public class ReturnToMerchantDialogFragment extends DialogFragment {
@@ -108,6 +113,15 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
}
return true;
}
+
+ @Override
+ public boolean onKeyUp(int keyCode, @NonNull KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_ESCAPE || keyCode == KeyEvent.KEYCODE_ENTER) {
+ onBackPressed();
+ return true;
+ }
+ return super.onKeyUp(keyCode, event);
+ }
};
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/Intents.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/Intents.java
index 80dacea8f5..aceba66353 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/Intents.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/Intents.java
@@ -1356,6 +1356,9 @@ public enum RemoteViewSize {
/** {@link String}, Is the customer phone number associated with Kiosk order */
public static final String EXTRA_KIOSK_FULFILLMENT_INFO_PHONE_NUMBER = "clover.intent.extra.KIOSK_FULFILLMENT_INFO_PHONE_NUMBER";
+ /** {@link String}, Is the customer chosen kiosk app locale associated with Kiosk order */
+ public static final String EXTRA_KIOSK_FULFILLMENT_INFO_LOCALE = "clover.intent.extra.KIOSK_FULFILLMENT_INFO_LOCALE";
+
/** {@link String}, elv transaction type for Germany */
public static final String EXTRA_GERMAN_ELV = "clover.intent.extra.GERMAN_ELV";
/** A value for {@link #EXTRA_GERMAN_ELV} */
@@ -1570,6 +1573,12 @@ public enum RemoteViewSize {
/** {@link int}, A drawable resource ID, the image to be displayed on the customer-facing tender button */
public static final String META_CUSTOMER_TENDER_IMAGE = "clover.intent.meta.CUSTOMER_TENDER_IMAGE";
+ /** {@link int}, A priority, to display the tender button on customer facing display. Priority 1, places the button outside of More Options */
+ public static final String META_CUSTOMER_TENDER_PRIORITY = "clover.intent.meta.CUSTOMER_TENDER_PRIORITY";
+
+ /** {@link int}, This flag enables/disables the visibility of the tender logos on the customer facing screen */
+ public static final String META_CUSTOMER_TENDER_LOGO_ENABLED = "clover.intent.meta.CUSTOMER_TENDER_LOGO_ENABLED";
+
/** {@link int}, A drawable resource ID, the image to be displayed on the merchant-facing tender button*/
public static final String META_MERCHANT_TENDER_IMAGE = "clover.intent.meta.MERCHANT_TENDER_IMAGE";
@@ -1582,6 +1591,9 @@ public enum RemoteViewSize {
/** {@link String} Indicates name of theme to be used in station-pay/secure-pay*/
public static final String EXTRA_THEME_NAME = "clover.intent.extra_THEME_NAME";
+ /**{@link String} Used for Android Payments API Service callback*/
+ public static final String EXTRA_RESULT_RECEIVER = "clover.intent.extra.EXTRA_RESULT_RECEIVER";
+
/** {@link Boolean} flag Indicates if the secure pay app should send the transaction result when the transaction is complete.
* Usually the result is sent when spa finishes, but this flag indicates, that the result shall be sent as soon as the
* transaction result is available
@@ -1884,4 +1896,7 @@ public static class PAYMENT_TOKEN_TYPE {
public static final String EXTRA_TERMINAL_SETTINGS = "clover.intent.extra.TERMINAL_SETTINGS";
public static final String EXTRA_REQUEST_TYPE = "clover.intent.extra.EXTRA_REQUEST_TYPE";
+
+ public static final String EXTRA_DYNAMIC_TIP_SELECTION = "clover.intent.extra.EXTRA_DYNAMIC_TIP_SELECTION";
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/merchant/Module.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/merchant/Module.java
index 075a10d9b1..89a73467e4 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/merchant/Module.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/merchant/Module.java
@@ -90,7 +90,13 @@ public enum Module implements Parcelable {
*/
OLO_MENUS,
APP_MARKET_PAY_PER_USE,
- ESTIMATE;
+ ESTIMATE,
+ ADP_PAYROLL,
+ CLOVER_VAULT,
+ MULTI_LOCATION,
+ PAYBILLS,
+ HB_TIMESHEETS,
+ ALLERGY_MANAGEMENT;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AdditionalFeeDetails.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AdditionalFeeDetails.java
new file mode 100644
index 0000000000..ed1e964b2b
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AdditionalFeeDetails.java
@@ -0,0 +1,338 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.billing;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Additional fees associated with the charge for eg: usvi charges
+ *
+ *
Fields
+ *
+ * - {@link #getId id}
+ * - {@link #getChargeId chargeId}
+ * - {@link #getAmount amount}
+ * - {@link #getCreatedTime createdTime}
+ * - {@link #getModifiedTime modifiedTime}
+ *
+ */
+@SuppressWarnings("all")
+public class AdditionalFeeDetails extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getId() {
+ return genClient.cacheGet(CacheKey.id);
+ }
+
+ public java.lang.Long getChargeId() {
+ return genClient.cacheGet(CacheKey.chargeId);
+ }
+
+ public java.lang.String getAmount() {
+ return genClient.cacheGet(CacheKey.amount);
+ }
+
+ public java.lang.Long getCreatedTime() {
+ return genClient.cacheGet(CacheKey.createdTime);
+ }
+
+ public java.lang.Long getModifiedTime() {
+ return genClient.cacheGet(CacheKey.modifiedTime);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ id
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ chargeId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ createdTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ modifiedTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public AdditionalFeeDetails() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected AdditionalFeeDetails(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public AdditionalFeeDetails(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public AdditionalFeeDetails(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public AdditionalFeeDetails(AdditionalFeeDetails src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ genClient.validateCloverId(CacheKey.id, getId());
+
+ genClient.validateNotNull(CacheKey.chargeId, getChargeId());
+
+ genClient.validateNotNull(CacheKey.amount, getAmount());
+ }
+
+ /** Checks whether the 'id' field is set and is not null */
+ public boolean isNotNullId() {
+ return genClient.cacheValueIsNotNull(CacheKey.id);
+ }
+
+ /** Checks whether the 'chargeId' field is set and is not null */
+ public boolean isNotNullChargeId() {
+ return genClient.cacheValueIsNotNull(CacheKey.chargeId);
+ }
+
+ /** Checks whether the 'amount' field is set and is not null */
+ public boolean isNotNullAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.amount);
+ }
+
+ /** Checks whether the 'createdTime' field is set and is not null */
+ public boolean isNotNullCreatedTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.createdTime);
+ }
+
+ /** Checks whether the 'modifiedTime' field is set and is not null */
+ public boolean isNotNullModifiedTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.modifiedTime);
+ }
+
+
+
+ /** Checks whether the 'id' field has been set, however the value could be null */
+ public boolean hasId() {
+ return genClient.cacheHasKey(CacheKey.id);
+ }
+
+ /** Checks whether the 'chargeId' field has been set, however the value could be null */
+ public boolean hasChargeId() {
+ return genClient.cacheHasKey(CacheKey.chargeId);
+ }
+
+ /** Checks whether the 'amount' field has been set, however the value could be null */
+ public boolean hasAmount() {
+ return genClient.cacheHasKey(CacheKey.amount);
+ }
+
+ /** Checks whether the 'createdTime' field has been set, however the value could be null */
+ public boolean hasCreatedTime() {
+ return genClient.cacheHasKey(CacheKey.createdTime);
+ }
+
+ /** Checks whether the 'modifiedTime' field has been set, however the value could be null */
+ public boolean hasModifiedTime() {
+ return genClient.cacheHasKey(CacheKey.modifiedTime);
+ }
+
+
+ /**
+ * Sets the field 'id'.
+ */
+ public AdditionalFeeDetails setId(java.lang.String id) {
+ return genClient.setOther(id, CacheKey.id);
+ }
+
+ /**
+ * Sets the field 'chargeId'.
+ */
+ public AdditionalFeeDetails setChargeId(java.lang.Long chargeId) {
+ return genClient.setOther(chargeId, CacheKey.chargeId);
+ }
+
+ /**
+ * Sets the field 'amount'.
+ */
+ public AdditionalFeeDetails setAmount(java.lang.String amount) {
+ return genClient.setOther(amount, CacheKey.amount);
+ }
+
+ /**
+ * Sets the field 'createdTime'.
+ */
+ public AdditionalFeeDetails setCreatedTime(java.lang.Long createdTime) {
+ return genClient.setOther(createdTime, CacheKey.createdTime);
+ }
+
+ /**
+ * Sets the field 'modifiedTime'.
+ */
+ public AdditionalFeeDetails setModifiedTime(java.lang.Long modifiedTime) {
+ return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
+ }
+
+
+ /** Clears the 'id' field, the 'has' method for this field will now return false */
+ public void clearId() {
+ genClient.clear(CacheKey.id);
+ }
+ /** Clears the 'chargeId' field, the 'has' method for this field will now return false */
+ public void clearChargeId() {
+ genClient.clear(CacheKey.chargeId);
+ }
+ /** Clears the 'amount' field, the 'has' method for this field will now return false */
+ public void clearAmount() {
+ genClient.clear(CacheKey.amount);
+ }
+ /** Clears the 'createdTime' field, the 'has' method for this field will now return false */
+ public void clearCreatedTime() {
+ genClient.clear(CacheKey.createdTime);
+ }
+ /** Clears the 'modifiedTime' field, the 'has' method for this field will now return false */
+ public void clearModifiedTime() {
+ genClient.clear(CacheKey.modifiedTime);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public AdditionalFeeDetails copyChanges() {
+ AdditionalFeeDetails copy = new AdditionalFeeDetails();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(AdditionalFeeDetails src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new AdditionalFeeDetails(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public AdditionalFeeDetails createFromParcel(android.os.Parcel in) {
+ AdditionalFeeDetails instance = new AdditionalFeeDetails(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public AdditionalFeeDetails[] newArray(int size) {
+ return new AdditionalFeeDetails[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return AdditionalFeeDetails.class;
+ }
+
+ @Override
+ public AdditionalFeeDetails create(org.json.JSONObject jsonObject) {
+ return new AdditionalFeeDetails(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ID_IS_REQUIRED = false;
+ public static final long ID_MAX_LEN = 13;
+ public static final boolean CHARGEID_IS_REQUIRED = true;
+ public static final boolean AMOUNT_IS_REQUIRED = true;
+ public static final boolean CREATEDTIME_IS_REQUIRED = false;
+ public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AppMeteredEvent.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AppMeteredEvent.java
index c5f0d33c34..ad0c59e7fa 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AppMeteredEvent.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/AppMeteredEvent.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/BillingMethod.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/BillingMethod.java
new file mode 100644
index 0000000000..054c873d66
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/BillingMethod.java
@@ -0,0 +1,57 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.billing;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum BillingMethod implements Parcelable {
+ LEGACY, EBB;
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(final Parcel dest, final int flags) {
+ dest.writeString(name());
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public BillingMethod createFromParcel(final Parcel source) {
+ return BillingMethod.valueOf(source.readString());
+ }
+
+ @Override
+ public BillingMethod[] newArray(final int size) {
+ return new BillingMethod[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Charge.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Charge.java
index f29523eb5d..86b72be704 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Charge.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Charge.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
@@ -32,6 +33,7 @@
*
* - {@link #getId id}
* - {@link #getCurrency currency}
+ * - {@link #getCountry country}
* - {@link #getAmount amount}
* - {@link #getTax tax}
* - {@link #getDeveloperPortion developerPortion}
@@ -40,12 +42,18 @@
* - {@link #getTaxClassificationCode taxClassificationCode}
* - {@link #getStartDate startDate}
* - {@link #getEndDate endDate}
+ * - {@link #getStmtMonth stmtMonth}
* - {@link #getExportMonth exportMonth}
* - {@link #getCreatedTime createdTime}
* - {@link #getModifiedTime modifiedTime}
+ * - {@link #getStatusModifiedTime statusModifiedTime}
* - {@link #getMerchantAppCharge merchantAppCharge}
+ * - {@link #getDeveloperApp developerApp}
+ * - {@link #getDeveloper developer}
* - {@link #getMerchantPlanCharge merchantPlanCharge}
* - {@link #getInfoleaseChargeAttempts infoleaseChargeAttempts}
+ * - {@link #getPartialCharge partialCharge}
+ * - {@link #getAdditionalFeeDetails additionalFeeDetails}
*
*/
@SuppressWarnings("all")
@@ -59,6 +67,13 @@ public java.lang.String getCurrency() {
return genClient.cacheGet(CacheKey.currency);
}
+ /**
+ * Country this charge is associated with
+ */
+ public java.lang.String getCountry() {
+ return genClient.cacheGet(CacheKey.country);
+ }
+
public java.lang.Long getAmount() {
return genClient.cacheGet(CacheKey.amount);
}
@@ -91,6 +106,16 @@ public java.lang.Long getEndDate() {
return genClient.cacheGet(CacheKey.endDate);
}
+ /**
+ * Statement month that the merchant was invoiced for the charge
+ */
+ public java.lang.Long getStmtMonth() {
+ return genClient.cacheGet(CacheKey.stmtMonth);
+ }
+
+ /**
+ * Month that the charge was exported to be collected from merchant
+ */
public java.lang.Long getExportMonth() {
return genClient.cacheGet(CacheKey.exportMonth);
}
@@ -103,6 +128,10 @@ public java.lang.Long getModifiedTime() {
return genClient.cacheGet(CacheKey.modifiedTime);
}
+ public java.lang.Long getStatusModifiedTime() {
+ return genClient.cacheGet(CacheKey.statusModifiedTime);
+ }
+
/**
* Object which includes the charge object and some details regarding the app charge
*/
@@ -110,6 +139,20 @@ public com.clover.sdk.v3.base.Reference getMerchantAppCharge() {
return genClient.cacheGet(CacheKey.merchantAppCharge);
}
+ /**
+ * DeveloperApp involved in the charge
+ */
+ public com.clover.sdk.v3.apps.App getDeveloperApp() {
+ return genClient.cacheGet(CacheKey.developerApp);
+ }
+
+ /**
+ * Developer involved in the charge
+ */
+ public com.clover.sdk.v3.developer.Developer getDeveloper() {
+ return genClient.cacheGet(CacheKey.developer);
+ }
+
/**
* Object which includes the charge object and some details regarding the plan charge
*/
@@ -124,6 +167,20 @@ public java.util.List getInfol
return genClient.cacheGet(CacheKey.infoleaseChargeAttempts);
}
+ /**
+ * Partial Charges of the charge.
+ */
+ public java.util.List getPartialCharge() {
+ return genClient.cacheGet(CacheKey.partialCharge);
+ }
+
+ /**
+ * Additional fees details associated with the charge for eg: usvi charges
+ */
+ public java.util.List getAdditionalFeeDetails() {
+ return genClient.cacheGet(CacheKey.additionalFeeDetails);
+ }
+
@@ -132,6 +189,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
currency
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ country
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
amount
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
tax
@@ -148,18 +207,30 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
endDate
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ stmtMonth
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
exportMonth
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
createdTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
modifiedTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ statusModifiedTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
merchantAppCharge
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
+ developerApp
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.apps.App.JSON_CREATOR)),
+ developer
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.developer.Developer.JSON_CREATOR)),
merchantPlanCharge
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
infoleaseChargeAttempts
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.billing.InfoleaseChargeAttempt.JSON_CREATOR)),
+ partialCharge
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.billing.PartialCharge.JSON_CREATOR)),
+ additionalFeeDetails
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.billing.AdditionalFeeDetails.JSON_CREATOR)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -236,6 +307,8 @@ public void validate() {
genClient.validateLength(CacheKey.currency, getCurrency(), 3);
+ genClient.validateLength(CacheKey.country, getCountry(), 127);
+
genClient.validateNotNull(CacheKey.amount, getAmount());
genClient.validateNotNull(CacheKey.status, getStatus());
@@ -255,6 +328,11 @@ public boolean isNotNullCurrency() {
return genClient.cacheValueIsNotNull(CacheKey.currency);
}
+ /** Checks whether the 'country' field is set and is not null */
+ public boolean isNotNullCountry() {
+ return genClient.cacheValueIsNotNull(CacheKey.country);
+ }
+
/** Checks whether the 'amount' field is set and is not null */
public boolean isNotNullAmount() {
return genClient.cacheValueIsNotNull(CacheKey.amount);
@@ -295,6 +373,11 @@ public boolean isNotNullEndDate() {
return genClient.cacheValueIsNotNull(CacheKey.endDate);
}
+ /** Checks whether the 'stmtMonth' field is set and is not null */
+ public boolean isNotNullStmtMonth() {
+ return genClient.cacheValueIsNotNull(CacheKey.stmtMonth);
+ }
+
/** Checks whether the 'exportMonth' field is set and is not null */
public boolean isNotNullExportMonth() {
return genClient.cacheValueIsNotNull(CacheKey.exportMonth);
@@ -310,11 +393,26 @@ public boolean isNotNullModifiedTime() {
return genClient.cacheValueIsNotNull(CacheKey.modifiedTime);
}
+ /** Checks whether the 'statusModifiedTime' field is set and is not null */
+ public boolean isNotNullStatusModifiedTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.statusModifiedTime);
+ }
+
/** Checks whether the 'merchantAppCharge' field is set and is not null */
public boolean isNotNullMerchantAppCharge() {
return genClient.cacheValueIsNotNull(CacheKey.merchantAppCharge);
}
+ /** Checks whether the 'developerApp' field is set and is not null */
+ public boolean isNotNullDeveloperApp() {
+ return genClient.cacheValueIsNotNull(CacheKey.developerApp);
+ }
+
+ /** Checks whether the 'developer' field is set and is not null */
+ public boolean isNotNullDeveloper() {
+ return genClient.cacheValueIsNotNull(CacheKey.developer);
+ }
+
/** Checks whether the 'merchantPlanCharge' field is set and is not null */
public boolean isNotNullMerchantPlanCharge() {
return genClient.cacheValueIsNotNull(CacheKey.merchantPlanCharge);
@@ -328,6 +426,22 @@ public boolean isNotNullInfoleaseChargeAttempts() {
/** Checks whether the 'infoleaseChargeAttempts' field is set and is not null and is not empty */
public boolean isNotEmptyInfoleaseChargeAttempts() { return isNotNullInfoleaseChargeAttempts() && !getInfoleaseChargeAttempts().isEmpty(); }
+ /** Checks whether the 'partialCharge' field is set and is not null */
+ public boolean isNotNullPartialCharge() {
+ return genClient.cacheValueIsNotNull(CacheKey.partialCharge);
+ }
+
+ /** Checks whether the 'partialCharge' field is set and is not null and is not empty */
+ public boolean isNotEmptyPartialCharge() { return isNotNullPartialCharge() && !getPartialCharge().isEmpty(); }
+
+ /** Checks whether the 'additionalFeeDetails' field is set and is not null */
+ public boolean isNotNullAdditionalFeeDetails() {
+ return genClient.cacheValueIsNotNull(CacheKey.additionalFeeDetails);
+ }
+
+ /** Checks whether the 'additionalFeeDetails' field is set and is not null and is not empty */
+ public boolean isNotEmptyAdditionalFeeDetails() { return isNotNullAdditionalFeeDetails() && !getAdditionalFeeDetails().isEmpty(); }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -340,6 +454,11 @@ public boolean hasCurrency() {
return genClient.cacheHasKey(CacheKey.currency);
}
+ /** Checks whether the 'country' field has been set, however the value could be null */
+ public boolean hasCountry() {
+ return genClient.cacheHasKey(CacheKey.country);
+ }
+
/** Checks whether the 'amount' field has been set, however the value could be null */
public boolean hasAmount() {
return genClient.cacheHasKey(CacheKey.amount);
@@ -380,6 +499,11 @@ public boolean hasEndDate() {
return genClient.cacheHasKey(CacheKey.endDate);
}
+ /** Checks whether the 'stmtMonth' field has been set, however the value could be null */
+ public boolean hasStmtMonth() {
+ return genClient.cacheHasKey(CacheKey.stmtMonth);
+ }
+
/** Checks whether the 'exportMonth' field has been set, however the value could be null */
public boolean hasExportMonth() {
return genClient.cacheHasKey(CacheKey.exportMonth);
@@ -395,11 +519,26 @@ public boolean hasModifiedTime() {
return genClient.cacheHasKey(CacheKey.modifiedTime);
}
+ /** Checks whether the 'statusModifiedTime' field has been set, however the value could be null */
+ public boolean hasStatusModifiedTime() {
+ return genClient.cacheHasKey(CacheKey.statusModifiedTime);
+ }
+
/** Checks whether the 'merchantAppCharge' field has been set, however the value could be null */
public boolean hasMerchantAppCharge() {
return genClient.cacheHasKey(CacheKey.merchantAppCharge);
}
+ /** Checks whether the 'developerApp' field has been set, however the value could be null */
+ public boolean hasDeveloperApp() {
+ return genClient.cacheHasKey(CacheKey.developerApp);
+ }
+
+ /** Checks whether the 'developer' field has been set, however the value could be null */
+ public boolean hasDeveloper() {
+ return genClient.cacheHasKey(CacheKey.developer);
+ }
+
/** Checks whether the 'merchantPlanCharge' field has been set, however the value could be null */
public boolean hasMerchantPlanCharge() {
return genClient.cacheHasKey(CacheKey.merchantPlanCharge);
@@ -410,6 +549,16 @@ public boolean hasInfoleaseChargeAttempts() {
return genClient.cacheHasKey(CacheKey.infoleaseChargeAttempts);
}
+ /** Checks whether the 'partialCharge' field has been set, however the value could be null */
+ public boolean hasPartialCharge() {
+ return genClient.cacheHasKey(CacheKey.partialCharge);
+ }
+
+ /** Checks whether the 'additionalFeeDetails' field has been set, however the value could be null */
+ public boolean hasAdditionalFeeDetails() {
+ return genClient.cacheHasKey(CacheKey.additionalFeeDetails);
+ }
+
/**
* Sets the field 'id'.
@@ -425,6 +574,13 @@ public Charge setCurrency(java.lang.String currency) {
return genClient.setOther(currency, CacheKey.currency);
}
+ /**
+ * Sets the field 'country'.
+ */
+ public Charge setCountry(java.lang.String country) {
+ return genClient.setOther(country, CacheKey.country);
+ }
+
/**
* Sets the field 'amount'.
*/
@@ -481,6 +637,13 @@ public Charge setEndDate(java.lang.Long endDate) {
return genClient.setOther(endDate, CacheKey.endDate);
}
+ /**
+ * Sets the field 'stmtMonth'.
+ */
+ public Charge setStmtMonth(java.lang.Long stmtMonth) {
+ return genClient.setOther(stmtMonth, CacheKey.stmtMonth);
+ }
+
/**
* Sets the field 'exportMonth'.
*/
@@ -502,6 +665,13 @@ public Charge setModifiedTime(java.lang.Long modifiedTime) {
return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
}
+ /**
+ * Sets the field 'statusModifiedTime'.
+ */
+ public Charge setStatusModifiedTime(java.lang.Long statusModifiedTime) {
+ return genClient.setOther(statusModifiedTime, CacheKey.statusModifiedTime);
+ }
+
/**
* Sets the field 'merchantAppCharge'.
*
@@ -511,6 +681,24 @@ public Charge setMerchantAppCharge(com.clover.sdk.v3.base.Reference merchantAppC
return genClient.setRecord(merchantAppCharge, CacheKey.merchantAppCharge);
}
+ /**
+ * Sets the field 'developerApp'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public Charge setDeveloperApp(com.clover.sdk.v3.apps.App developerApp) {
+ return genClient.setRecord(developerApp, CacheKey.developerApp);
+ }
+
+ /**
+ * Sets the field 'developer'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public Charge setDeveloper(com.clover.sdk.v3.developer.Developer developer) {
+ return genClient.setRecord(developer, CacheKey.developer);
+ }
+
/**
* Sets the field 'merchantPlanCharge'.
*
@@ -529,6 +717,24 @@ public Charge setInfoleaseChargeAttempts(java.util.List partialCharge) {
+ return genClient.setArrayRecord(partialCharge, CacheKey.partialCharge);
+ }
+
+ /**
+ * Sets the field 'additionalFeeDetails'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public Charge setAdditionalFeeDetails(java.util.List additionalFeeDetails) {
+ return genClient.setArrayRecord(additionalFeeDetails, CacheKey.additionalFeeDetails);
+ }
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -538,6 +744,10 @@ public void clearId() {
public void clearCurrency() {
genClient.clear(CacheKey.currency);
}
+ /** Clears the 'country' field, the 'has' method for this field will now return false */
+ public void clearCountry() {
+ genClient.clear(CacheKey.country);
+ }
/** Clears the 'amount' field, the 'has' method for this field will now return false */
public void clearAmount() {
genClient.clear(CacheKey.amount);
@@ -570,6 +780,10 @@ public void clearStartDate() {
public void clearEndDate() {
genClient.clear(CacheKey.endDate);
}
+ /** Clears the 'stmtMonth' field, the 'has' method for this field will now return false */
+ public void clearStmtMonth() {
+ genClient.clear(CacheKey.stmtMonth);
+ }
/** Clears the 'exportMonth' field, the 'has' method for this field will now return false */
public void clearExportMonth() {
genClient.clear(CacheKey.exportMonth);
@@ -582,10 +796,22 @@ public void clearCreatedTime() {
public void clearModifiedTime() {
genClient.clear(CacheKey.modifiedTime);
}
+ /** Clears the 'statusModifiedTime' field, the 'has' method for this field will now return false */
+ public void clearStatusModifiedTime() {
+ genClient.clear(CacheKey.statusModifiedTime);
+ }
/** Clears the 'merchantAppCharge' field, the 'has' method for this field will now return false */
public void clearMerchantAppCharge() {
genClient.clear(CacheKey.merchantAppCharge);
}
+ /** Clears the 'developerApp' field, the 'has' method for this field will now return false */
+ public void clearDeveloperApp() {
+ genClient.clear(CacheKey.developerApp);
+ }
+ /** Clears the 'developer' field, the 'has' method for this field will now return false */
+ public void clearDeveloper() {
+ genClient.clear(CacheKey.developer);
+ }
/** Clears the 'merchantPlanCharge' field, the 'has' method for this field will now return false */
public void clearMerchantPlanCharge() {
genClient.clear(CacheKey.merchantPlanCharge);
@@ -594,6 +820,14 @@ public void clearMerchantPlanCharge() {
public void clearInfoleaseChargeAttempts() {
genClient.clear(CacheKey.infoleaseChargeAttempts);
}
+ /** Clears the 'partialCharge' field, the 'has' method for this field will now return false */
+ public void clearPartialCharge() {
+ genClient.clear(CacheKey.partialCharge);
+ }
+ /** Clears the 'additionalFeeDetails' field, the 'has' method for this field will now return false */
+ public void clearAdditionalFeeDetails() {
+ genClient.clear(CacheKey.additionalFeeDetails);
+ }
/**
@@ -660,6 +894,8 @@ public interface Constraints {
public static final long ID_MAX_LEN = 13;
public static final boolean CURRENCY_IS_REQUIRED = false;
public static final long CURRENCY_MAX_LEN = 3;
+ public static final boolean COUNTRY_IS_REQUIRED = false;
+ public static final long COUNTRY_MAX_LEN = 127;
public static final boolean AMOUNT_IS_REQUIRED = true;
public static final boolean TAX_IS_REQUIRED = false;
public static final boolean DEVELOPERPORTION_IS_REQUIRED = false;
@@ -668,12 +904,18 @@ public interface Constraints {
public static final boolean TAXCLASSIFICATIONCODE_IS_REQUIRED = false;
public static final boolean STARTDATE_IS_REQUIRED = false;
public static final boolean ENDDATE_IS_REQUIRED = false;
+ public static final boolean STMTMONTH_IS_REQUIRED = false;
public static final boolean EXPORTMONTH_IS_REQUIRED = false;
public static final boolean CREATEDTIME_IS_REQUIRED = false;
public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
+ public static final boolean STATUSMODIFIEDTIME_IS_REQUIRED = false;
public static final boolean MERCHANTAPPCHARGE_IS_REQUIRED = false;
+ public static final boolean DEVELOPERAPP_IS_REQUIRED = false;
+ public static final boolean DEVELOPER_IS_REQUIRED = false;
public static final boolean MERCHANTPLANCHARGE_IS_REQUIRED = false;
public static final boolean INFOLEASECHARGEATTEMPTS_IS_REQUIRED = false;
+ public static final boolean PARTIALCHARGE_IS_REQUIRED = false;
+ public static final boolean ADDITIONALFEEDETAILS_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/ChargeSystemType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/ChargeSystemType.java
index 0308f844eb..50e6dcbe6e 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/ChargeSystemType.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/ChargeSystemType.java
@@ -31,7 +31,7 @@
*/
@SuppressWarnings("all")
public enum ChargeSystemType implements Parcelable {
- BRAINTREE, INFOLEASE, LOCAL, GOLEO;
+ BRAINTREE, INFOLEASE, LOCAL, GOLEO, ODESSA;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DeviceCountInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DeviceCountInfo.java
index 0b1e78bb95..af09bab513 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DeviceCountInfo.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DeviceCountInfo.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -22,12 +22,24 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
/**
- * @deprecated This is a Clover private internal use class and should not be used. There are no connectors
- * available to get this data from Clover services.
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getTotalDevices totalDevices}
+ * - {@link #getNumStations numStations}
+ * - {@link #getNumMobiles numMobiles}
+ * - {@link #getNumMinis numMinis}
+ * - {@link #getNumBayleafs numBayleafs}
+ * - {@link #getNumBambooleafs numBambooleafs}
+ * - {@link #getNumGMCs numGMCs}
+ * - {@link #getNumGoldenoaks numGoldenoaks}
+ *
*/
@SuppressWarnings("all")
public class DeviceCountInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
@@ -84,7 +96,7 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
numGoldenoaks
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
- ;
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DevicePriceInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DevicePriceInfo.java
index e7015f1c0e..e803d443ef 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DevicePriceInfo.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/DevicePriceInfo.java
@@ -22,12 +22,18 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
/**
- * @deprecated This is a Clover private internal use class and should not be used. There are no connectors
- * available to get this data from Clover services.
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getPrice price}
+ * - {@link #getDeviceCountInfo deviceCountInfo}
+ *
*/
@SuppressWarnings("all")
public class DevicePriceInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/InfoleaseChargeAttempt.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/InfoleaseChargeAttempt.java
index a40e909c48..e224c430c0 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/InfoleaseChargeAttempt.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/InfoleaseChargeAttempt.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/MerchantAppCharge.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/MerchantAppCharge.java
index de8843d3d4..73d83a669c 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/MerchantAppCharge.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/MerchantAppCharge.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
@@ -31,6 +32,7 @@
* Fields
*
* - {@link #getId id}
+ * - {@link #getDeveloper developer}
* - {@link #getCharge charge}
* - {@link #getApp app}
* - {@link #getMerchant merchant}
@@ -49,6 +51,10 @@ public java.lang.String getId() {
return genClient.cacheGet(CacheKey.id);
}
+ public com.clover.sdk.v3.developer.Developer getDeveloper() {
+ return genClient.cacheGet(CacheKey.developer);
+ }
+
public com.clover.sdk.v3.billing.Charge getCharge() {
return genClient.cacheGet(CacheKey.charge);
}
@@ -103,6 +109,8 @@ public java.util.List getAppMeteredEv
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
id
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ developer
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.developer.Developer.JSON_CREATOR)),
charge
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.billing.Charge.JSON_CREATOR)),
app
@@ -207,6 +215,11 @@ public boolean isNotNullId() {
return genClient.cacheValueIsNotNull(CacheKey.id);
}
+ /** Checks whether the 'developer' field is set and is not null */
+ public boolean isNotNullDeveloper() {
+ return genClient.cacheValueIsNotNull(CacheKey.developer);
+ }
+
/** Checks whether the 'charge' field is set and is not null */
public boolean isNotNullCharge() {
return genClient.cacheValueIsNotNull(CacheKey.charge);
@@ -262,6 +275,11 @@ public boolean hasId() {
return genClient.cacheHasKey(CacheKey.id);
}
+ /** Checks whether the 'developer' field has been set, however the value could be null */
+ public boolean hasDeveloper() {
+ return genClient.cacheHasKey(CacheKey.developer);
+ }
+
/** Checks whether the 'charge' field has been set, however the value could be null */
public boolean hasCharge() {
return genClient.cacheHasKey(CacheKey.charge);
@@ -315,6 +333,15 @@ public MerchantAppCharge setId(java.lang.String id) {
return genClient.setOther(id, CacheKey.id);
}
+ /**
+ * Sets the field 'developer'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public MerchantAppCharge setDeveloper(com.clover.sdk.v3.developer.Developer developer) {
+ return genClient.setRecord(developer, CacheKey.developer);
+ }
+
/**
* Sets the field 'charge'.
*
@@ -393,6 +420,10 @@ public MerchantAppCharge setAppMeteredEvents(java.util.List{@link #getMerchantPlan merchantPlan}
* - {@link #getCreatedTime createdTime}
* - {@link #getModifiedTime modifiedTime}
+ * - {@link #getDeviceTypeName deviceTypeName}
+ * - {@link #getDeviceTypeId deviceTypeId}
*
*/
@SuppressWarnings("all")
@@ -81,6 +84,14 @@ public java.lang.Long getModifiedTime() {
return genClient.cacheGet(CacheKey.modifiedTime);
}
+ public java.lang.String getDeviceTypeName() {
+ return genClient.cacheGet(CacheKey.deviceTypeName);
+ }
+
+ public java.lang.Long getDeviceTypeId() {
+ return genClient.cacheGet(CacheKey.deviceTypeId);
+ }
+
@@ -101,6 +112,10 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
modifiedTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ deviceTypeName
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ deviceTypeId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -216,6 +231,16 @@ public boolean isNotNullModifiedTime() {
return genClient.cacheValueIsNotNull(CacheKey.modifiedTime);
}
+ /** Checks whether the 'deviceTypeName' field is set and is not null */
+ public boolean isNotNullDeviceTypeName() {
+ return genClient.cacheValueIsNotNull(CacheKey.deviceTypeName);
+ }
+
+ /** Checks whether the 'deviceTypeId' field is set and is not null */
+ public boolean isNotNullDeviceTypeId() {
+ return genClient.cacheValueIsNotNull(CacheKey.deviceTypeId);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -258,6 +283,16 @@ public boolean hasModifiedTime() {
return genClient.cacheHasKey(CacheKey.modifiedTime);
}
+ /** Checks whether the 'deviceTypeName' field has been set, however the value could be null */
+ public boolean hasDeviceTypeName() {
+ return genClient.cacheHasKey(CacheKey.deviceTypeName);
+ }
+
+ /** Checks whether the 'deviceTypeId' field has been set, however the value could be null */
+ public boolean hasDeviceTypeId() {
+ return genClient.cacheHasKey(CacheKey.deviceTypeId);
+ }
+
/**
* Sets the field 'id'.
@@ -321,6 +356,20 @@ public MerchantPlanCharge setModifiedTime(java.lang.Long modifiedTime) {
return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
}
+ /**
+ * Sets the field 'deviceTypeName'.
+ */
+ public MerchantPlanCharge setDeviceTypeName(java.lang.String deviceTypeName) {
+ return genClient.setOther(deviceTypeName, CacheKey.deviceTypeName);
+ }
+
+ /**
+ * Sets the field 'deviceTypeId'.
+ */
+ public MerchantPlanCharge setDeviceTypeId(java.lang.Long deviceTypeId) {
+ return genClient.setOther(deviceTypeId, CacheKey.deviceTypeId);
+ }
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -354,6 +403,14 @@ public void clearCreatedTime() {
public void clearModifiedTime() {
genClient.clear(CacheKey.modifiedTime);
}
+ /** Clears the 'deviceTypeName' field, the 'has' method for this field will now return false */
+ public void clearDeviceTypeName() {
+ genClient.clear(CacheKey.deviceTypeName);
+ }
+ /** Clears the 'deviceTypeId' field, the 'has' method for this field will now return false */
+ public void clearDeviceTypeId() {
+ genClient.clear(CacheKey.deviceTypeId);
+ }
/**
@@ -425,6 +482,8 @@ public interface Constraints {
public static final boolean MERCHANTPLAN_IS_REQUIRED = false;
public static final boolean CREATEDTIME_IS_REQUIRED = false;
public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
+ public static final boolean DEVICETYPENAME_IS_REQUIRED = false;
+ public static final boolean DEVICETYPEID_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PartialCharge.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PartialCharge.java
new file mode 100644
index 0000000000..0221598353
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PartialCharge.java
@@ -0,0 +1,432 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.billing;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Partial Charges need to be handle here.
+ *
+ *
Fields
+ *
+ * - {@link #getId id}
+ * - {@link #getParentChargeId parentChargeId}
+ * - {@link #getCurrency currency}
+ * - {@link #getAmount amount}
+ * - {@link #getTax tax}
+ * - {@link #getStatus status}
+ * - {@link #getCreatedTime createdTime}
+ * - {@link #getModifiedTime modifiedTime}
+ *
+ */
+@SuppressWarnings("all")
+public class PartialCharge extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getId() {
+ return genClient.cacheGet(CacheKey.id);
+ }
+
+ public java.lang.Long getParentChargeId() {
+ return genClient.cacheGet(CacheKey.parentChargeId);
+ }
+
+ public java.lang.String getCurrency() {
+ return genClient.cacheGet(CacheKey.currency);
+ }
+
+ public java.lang.Long getAmount() {
+ return genClient.cacheGet(CacheKey.amount);
+ }
+
+ public java.lang.Long getTax() {
+ return genClient.cacheGet(CacheKey.tax);
+ }
+
+ public com.clover.sdk.v3.billing.ChargeStatus getStatus() {
+ return genClient.cacheGet(CacheKey.status);
+ }
+
+ public java.lang.Long getCreatedTime() {
+ return genClient.cacheGet(CacheKey.createdTime);
+ }
+
+ public java.lang.Long getModifiedTime() {
+ return genClient.cacheGet(CacheKey.modifiedTime);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ id
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ parentChargeId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ currency
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ tax
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ status
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.billing.ChargeStatus.class)),
+ createdTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ modifiedTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public PartialCharge() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected PartialCharge(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public PartialCharge(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public PartialCharge(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public PartialCharge(PartialCharge src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ genClient.validateCloverId(CacheKey.id, getId());
+
+ genClient.validateNotNull(CacheKey.parentChargeId, getParentChargeId());
+
+ genClient.validateLength(CacheKey.currency, getCurrency(), 3);
+
+ genClient.validateNotNull(CacheKey.amount, getAmount());
+
+ genClient.validateNotNull(CacheKey.tax, getTax());
+
+ genClient.validateNotNull(CacheKey.status, getStatus());
+ }
+
+ /** Checks whether the 'id' field is set and is not null */
+ public boolean isNotNullId() {
+ return genClient.cacheValueIsNotNull(CacheKey.id);
+ }
+
+ /** Checks whether the 'parentChargeId' field is set and is not null */
+ public boolean isNotNullParentChargeId() {
+ return genClient.cacheValueIsNotNull(CacheKey.parentChargeId);
+ }
+
+ /** Checks whether the 'currency' field is set and is not null */
+ public boolean isNotNullCurrency() {
+ return genClient.cacheValueIsNotNull(CacheKey.currency);
+ }
+
+ /** Checks whether the 'amount' field is set and is not null */
+ public boolean isNotNullAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.amount);
+ }
+
+ /** Checks whether the 'tax' field is set and is not null */
+ public boolean isNotNullTax() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax);
+ }
+
+ /** Checks whether the 'status' field is set and is not null */
+ public boolean isNotNullStatus() {
+ return genClient.cacheValueIsNotNull(CacheKey.status);
+ }
+
+ /** Checks whether the 'createdTime' field is set and is not null */
+ public boolean isNotNullCreatedTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.createdTime);
+ }
+
+ /** Checks whether the 'modifiedTime' field is set and is not null */
+ public boolean isNotNullModifiedTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.modifiedTime);
+ }
+
+
+
+ /** Checks whether the 'id' field has been set, however the value could be null */
+ public boolean hasId() {
+ return genClient.cacheHasKey(CacheKey.id);
+ }
+
+ /** Checks whether the 'parentChargeId' field has been set, however the value could be null */
+ public boolean hasParentChargeId() {
+ return genClient.cacheHasKey(CacheKey.parentChargeId);
+ }
+
+ /** Checks whether the 'currency' field has been set, however the value could be null */
+ public boolean hasCurrency() {
+ return genClient.cacheHasKey(CacheKey.currency);
+ }
+
+ /** Checks whether the 'amount' field has been set, however the value could be null */
+ public boolean hasAmount() {
+ return genClient.cacheHasKey(CacheKey.amount);
+ }
+
+ /** Checks whether the 'tax' field has been set, however the value could be null */
+ public boolean hasTax() {
+ return genClient.cacheHasKey(CacheKey.tax);
+ }
+
+ /** Checks whether the 'status' field has been set, however the value could be null */
+ public boolean hasStatus() {
+ return genClient.cacheHasKey(CacheKey.status);
+ }
+
+ /** Checks whether the 'createdTime' field has been set, however the value could be null */
+ public boolean hasCreatedTime() {
+ return genClient.cacheHasKey(CacheKey.createdTime);
+ }
+
+ /** Checks whether the 'modifiedTime' field has been set, however the value could be null */
+ public boolean hasModifiedTime() {
+ return genClient.cacheHasKey(CacheKey.modifiedTime);
+ }
+
+
+ /**
+ * Sets the field 'id'.
+ */
+ public PartialCharge setId(java.lang.String id) {
+ return genClient.setOther(id, CacheKey.id);
+ }
+
+ /**
+ * Sets the field 'parentChargeId'.
+ */
+ public PartialCharge setParentChargeId(java.lang.Long parentChargeId) {
+ return genClient.setOther(parentChargeId, CacheKey.parentChargeId);
+ }
+
+ /**
+ * Sets the field 'currency'.
+ */
+ public PartialCharge setCurrency(java.lang.String currency) {
+ return genClient.setOther(currency, CacheKey.currency);
+ }
+
+ /**
+ * Sets the field 'amount'.
+ */
+ public PartialCharge setAmount(java.lang.Long amount) {
+ return genClient.setOther(amount, CacheKey.amount);
+ }
+
+ /**
+ * Sets the field 'tax'.
+ */
+ public PartialCharge setTax(java.lang.Long tax) {
+ return genClient.setOther(tax, CacheKey.tax);
+ }
+
+ /**
+ * Sets the field 'status'.
+ */
+ public PartialCharge setStatus(com.clover.sdk.v3.billing.ChargeStatus status) {
+ return genClient.setOther(status, CacheKey.status);
+ }
+
+ /**
+ * Sets the field 'createdTime'.
+ */
+ public PartialCharge setCreatedTime(java.lang.Long createdTime) {
+ return genClient.setOther(createdTime, CacheKey.createdTime);
+ }
+
+ /**
+ * Sets the field 'modifiedTime'.
+ */
+ public PartialCharge setModifiedTime(java.lang.Long modifiedTime) {
+ return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
+ }
+
+
+ /** Clears the 'id' field, the 'has' method for this field will now return false */
+ public void clearId() {
+ genClient.clear(CacheKey.id);
+ }
+ /** Clears the 'parentChargeId' field, the 'has' method for this field will now return false */
+ public void clearParentChargeId() {
+ genClient.clear(CacheKey.parentChargeId);
+ }
+ /** Clears the 'currency' field, the 'has' method for this field will now return false */
+ public void clearCurrency() {
+ genClient.clear(CacheKey.currency);
+ }
+ /** Clears the 'amount' field, the 'has' method for this field will now return false */
+ public void clearAmount() {
+ genClient.clear(CacheKey.amount);
+ }
+ /** Clears the 'tax' field, the 'has' method for this field will now return false */
+ public void clearTax() {
+ genClient.clear(CacheKey.tax);
+ }
+ /** Clears the 'status' field, the 'has' method for this field will now return false */
+ public void clearStatus() {
+ genClient.clear(CacheKey.status);
+ }
+ /** Clears the 'createdTime' field, the 'has' method for this field will now return false */
+ public void clearCreatedTime() {
+ genClient.clear(CacheKey.createdTime);
+ }
+ /** Clears the 'modifiedTime' field, the 'has' method for this field will now return false */
+ public void clearModifiedTime() {
+ genClient.clear(CacheKey.modifiedTime);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public PartialCharge copyChanges() {
+ PartialCharge copy = new PartialCharge();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(PartialCharge src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new PartialCharge(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public PartialCharge createFromParcel(android.os.Parcel in) {
+ PartialCharge instance = new PartialCharge(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public PartialCharge[] newArray(int size) {
+ return new PartialCharge[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return PartialCharge.class;
+ }
+
+ @Override
+ public PartialCharge create(org.json.JSONObject jsonObject) {
+ return new PartialCharge(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ID_IS_REQUIRED = false;
+ public static final long ID_MAX_LEN = 13;
+ public static final boolean PARENTCHARGEID_IS_REQUIRED = true;
+ public static final boolean CURRENCY_IS_REQUIRED = false;
+ public static final long CURRENCY_MAX_LEN = 3;
+ public static final boolean AMOUNT_IS_REQUIRED = true;
+ public static final boolean TAX_IS_REQUIRED = true;
+ public static final boolean STATUS_IS_REQUIRED = true;
+ public static final boolean CREATEDTIME_IS_REQUIRED = false;
+ public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PlanActionFeeRateSummary.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PlanActionFeeRateSummary.java
index caa48e1031..2b6f03fbc4 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PlanActionFeeRateSummary.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PlanActionFeeRateSummary.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Statement.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Statement.java
index 2f4925f636..ece4e33477 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Statement.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/Statement.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.billing;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
@@ -32,8 +33,11 @@
*
* - {@link #getYear year}
* - {@link #getMonth month}
+ * - {@link #getDay day}
* - {@link #getAmount amount}
* - {@link #getTax tax}
+ * - {@link #getInvoiceNumber invoiceNumber}
+ * - {@link #getBillingMethod billingMethod}
*
*/
@SuppressWarnings("all")
@@ -47,6 +51,10 @@ public java.lang.Integer getMonth() {
return genClient.cacheGet(CacheKey.month);
}
+ public java.lang.Integer getDay() {
+ return genClient.cacheGet(CacheKey.day);
+ }
+
public java.lang.Long getAmount() {
return genClient.cacheGet(CacheKey.amount);
}
@@ -55,6 +63,14 @@ public java.lang.Long getTax() {
return genClient.cacheGet(CacheKey.tax);
}
+ public java.lang.String getInvoiceNumber() {
+ return genClient.cacheGet(CacheKey.invoiceNumber);
+ }
+
+ public com.clover.sdk.v3.billing.BillingMethod getBillingMethod() {
+ return genClient.cacheGet(CacheKey.billingMethod);
+ }
+
@@ -63,10 +79,16 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
month
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ day
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
amount
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
tax
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ invoiceNumber
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ billingMethod
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.billing.BillingMethod.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -151,6 +173,11 @@ public boolean isNotNullMonth() {
return genClient.cacheValueIsNotNull(CacheKey.month);
}
+ /** Checks whether the 'day' field is set and is not null */
+ public boolean isNotNullDay() {
+ return genClient.cacheValueIsNotNull(CacheKey.day);
+ }
+
/** Checks whether the 'amount' field is set and is not null */
public boolean isNotNullAmount() {
return genClient.cacheValueIsNotNull(CacheKey.amount);
@@ -161,6 +188,16 @@ public boolean isNotNullTax() {
return genClient.cacheValueIsNotNull(CacheKey.tax);
}
+ /** Checks whether the 'invoiceNumber' field is set and is not null */
+ public boolean isNotNullInvoiceNumber() {
+ return genClient.cacheValueIsNotNull(CacheKey.invoiceNumber);
+ }
+
+ /** Checks whether the 'billingMethod' field is set and is not null */
+ public boolean isNotNullBillingMethod() {
+ return genClient.cacheValueIsNotNull(CacheKey.billingMethod);
+ }
+
/** Checks whether the 'year' field has been set, however the value could be null */
@@ -173,6 +210,11 @@ public boolean hasMonth() {
return genClient.cacheHasKey(CacheKey.month);
}
+ /** Checks whether the 'day' field has been set, however the value could be null */
+ public boolean hasDay() {
+ return genClient.cacheHasKey(CacheKey.day);
+ }
+
/** Checks whether the 'amount' field has been set, however the value could be null */
public boolean hasAmount() {
return genClient.cacheHasKey(CacheKey.amount);
@@ -183,6 +225,16 @@ public boolean hasTax() {
return genClient.cacheHasKey(CacheKey.tax);
}
+ /** Checks whether the 'invoiceNumber' field has been set, however the value could be null */
+ public boolean hasInvoiceNumber() {
+ return genClient.cacheHasKey(CacheKey.invoiceNumber);
+ }
+
+ /** Checks whether the 'billingMethod' field has been set, however the value could be null */
+ public boolean hasBillingMethod() {
+ return genClient.cacheHasKey(CacheKey.billingMethod);
+ }
+
/**
* Sets the field 'year'.
@@ -198,6 +250,13 @@ public Statement setMonth(java.lang.Integer month) {
return genClient.setOther(month, CacheKey.month);
}
+ /**
+ * Sets the field 'day'.
+ */
+ public Statement setDay(java.lang.Integer day) {
+ return genClient.setOther(day, CacheKey.day);
+ }
+
/**
* Sets the field 'amount'.
*/
@@ -212,6 +271,20 @@ public Statement setTax(java.lang.Long tax) {
return genClient.setOther(tax, CacheKey.tax);
}
+ /**
+ * Sets the field 'invoiceNumber'.
+ */
+ public Statement setInvoiceNumber(java.lang.String invoiceNumber) {
+ return genClient.setOther(invoiceNumber, CacheKey.invoiceNumber);
+ }
+
+ /**
+ * Sets the field 'billingMethod'.
+ */
+ public Statement setBillingMethod(com.clover.sdk.v3.billing.BillingMethod billingMethod) {
+ return genClient.setOther(billingMethod, CacheKey.billingMethod);
+ }
+
/** Clears the 'year' field, the 'has' method for this field will now return false */
public void clearYear() {
@@ -221,6 +294,10 @@ public void clearYear() {
public void clearMonth() {
genClient.clear(CacheKey.month);
}
+ /** Clears the 'day' field, the 'has' method for this field will now return false */
+ public void clearDay() {
+ genClient.clear(CacheKey.day);
+ }
/** Clears the 'amount' field, the 'has' method for this field will now return false */
public void clearAmount() {
genClient.clear(CacheKey.amount);
@@ -229,6 +306,14 @@ public void clearAmount() {
public void clearTax() {
genClient.clear(CacheKey.tax);
}
+ /** Clears the 'invoiceNumber' field, the 'has' method for this field will now return false */
+ public void clearInvoiceNumber() {
+ genClient.clear(CacheKey.invoiceNumber);
+ }
+ /** Clears the 'billingMethod' field, the 'has' method for this field will now return false */
+ public void clearBillingMethod() {
+ genClient.clear(CacheKey.billingMethod);
+ }
/**
@@ -293,8 +378,11 @@ public Statement create(org.json.JSONObject jsonObject) {
public interface Constraints {
public static final boolean YEAR_IS_REQUIRED = false;
public static final boolean MONTH_IS_REQUIRED = false;
+ public static final boolean DAY_IS_REQUIRED = false;
public static final boolean AMOUNT_IS_REQUIRED = false;
public static final boolean TAX_IS_REQUIRED = false;
+ public static final boolean INVOICENUMBER_IS_REQUIRED = false;
+ public static final boolean BILLINGMETHOD_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/device/Device.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/device/Device.java
index b3d199149e..f7c8a2cde7 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/device/Device.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/device/Device.java
@@ -55,11 +55,14 @@
* {@link #getOfflinePaymentsLimit offlinePaymentsLimit}
* {@link #getOfflinePaymentsPromptThreshold offlinePaymentsPromptThreshold}
* {@link #getOfflinePaymentsTotalPaymentsLimit offlinePaymentsTotalPaymentsLimit}
+ * {@link #getOfflinePaymentsPerCardLimit offlinePaymentsPerCardLimit}
* {@link #getOfflinePaymentsLimitDefault offlinePaymentsLimitDefault}
* {@link #getOfflinePaymentsPromptThresholdDefault offlinePaymentsPromptThresholdDefault}
* {@link #getOfflinePaymentsTotalPaymentsLimitDefault offlinePaymentsTotalPaymentsLimitDefault}
+ * {@link #getOfflinePaymentsPerCardLimitDefault offlinePaymentsPerCardLimitDefault}
* {@link #getOfflinePaymentsMaxLimit offlinePaymentsMaxLimit}
* {@link #getOfflinePaymentsMaxTotalPaymentsLimit offlinePaymentsMaxTotalPaymentsLimit}
+ * {@link #getOfflinePaymentsMaxPerCardLimit offlinePaymentsMaxPerCardLimit}
* {@link #getShowOfflinePayments showOfflinePayments}
* {@link #getMaxOfflineDays maxOfflineDays}
* {@link #getAllowStoreAndForward allowStoreAndForward}
@@ -197,6 +200,10 @@ public java.lang.Long getOfflinePaymentsTotalPaymentsLimit() {
return genClient.cacheGet(CacheKey.offlinePaymentsTotalPaymentsLimit);
}
+ public java.lang.Long getOfflinePaymentsPerCardLimit() {
+ return genClient.cacheGet(CacheKey.offlinePaymentsPerCardLimit);
+ }
+
public java.lang.Long getOfflinePaymentsLimitDefault() {
return genClient.cacheGet(CacheKey.offlinePaymentsLimitDefault);
}
@@ -209,6 +216,10 @@ public java.lang.Long getOfflinePaymentsTotalPaymentsLimitDefault() {
return genClient.cacheGet(CacheKey.offlinePaymentsTotalPaymentsLimitDefault);
}
+ public java.lang.Long getOfflinePaymentsPerCardLimitDefault() {
+ return genClient.cacheGet(CacheKey.offlinePaymentsPerCardLimitDefault);
+ }
+
public java.lang.Long getOfflinePaymentsMaxLimit() {
return genClient.cacheGet(CacheKey.offlinePaymentsMaxLimit);
}
@@ -217,6 +228,10 @@ public java.lang.Long getOfflinePaymentsMaxTotalPaymentsLimit() {
return genClient.cacheGet(CacheKey.offlinePaymentsMaxTotalPaymentsLimit);
}
+ public java.lang.Long getOfflinePaymentsMaxPerCardLimit() {
+ return genClient.cacheGet(CacheKey.offlinePaymentsMaxPerCardLimit);
+ }
+
public java.lang.Boolean getShowOfflinePayments() {
return genClient.cacheGet(CacheKey.showOfflinePayments);
}
@@ -291,16 +306,22 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsTotalPaymentsLimit
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ offlinePaymentsPerCardLimit
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsLimitDefault
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsPromptThresholdDefault
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsTotalPaymentsLimitDefault
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ offlinePaymentsPerCardLimitDefault
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsMaxLimit
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
offlinePaymentsMaxTotalPaymentsLimit
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ offlinePaymentsMaxPerCardLimit
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
showOfflinePayments
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
maxOfflineDays
@@ -539,6 +560,11 @@ public boolean isNotNullOfflinePaymentsTotalPaymentsLimit() {
return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsTotalPaymentsLimit);
}
+ /** Checks whether the 'offlinePaymentsPerCardLimit' field is set and is not null */
+ public boolean isNotNullOfflinePaymentsPerCardLimit() {
+ return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsPerCardLimit);
+ }
+
/** Checks whether the 'offlinePaymentsLimitDefault' field is set and is not null */
public boolean isNotNullOfflinePaymentsLimitDefault() {
return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsLimitDefault);
@@ -554,6 +580,11 @@ public boolean isNotNullOfflinePaymentsTotalPaymentsLimitDefault() {
return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsTotalPaymentsLimitDefault);
}
+ /** Checks whether the 'offlinePaymentsPerCardLimitDefault' field is set and is not null */
+ public boolean isNotNullOfflinePaymentsPerCardLimitDefault() {
+ return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsPerCardLimitDefault);
+ }
+
/** Checks whether the 'offlinePaymentsMaxLimit' field is set and is not null */
public boolean isNotNullOfflinePaymentsMaxLimit() {
return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsMaxLimit);
@@ -564,6 +595,11 @@ public boolean isNotNullOfflinePaymentsMaxTotalPaymentsLimit() {
return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsMaxTotalPaymentsLimit);
}
+ /** Checks whether the 'offlinePaymentsMaxPerCardLimit' field is set and is not null */
+ public boolean isNotNullOfflinePaymentsMaxPerCardLimit() {
+ return genClient.cacheValueIsNotNull(CacheKey.offlinePaymentsMaxPerCardLimit);
+ }
+
/** Checks whether the 'showOfflinePayments' field is set and is not null */
public boolean isNotNullShowOfflinePayments() {
return genClient.cacheValueIsNotNull(CacheKey.showOfflinePayments);
@@ -719,6 +755,11 @@ public boolean hasOfflinePaymentsTotalPaymentsLimit() {
return genClient.cacheHasKey(CacheKey.offlinePaymentsTotalPaymentsLimit);
}
+ /** Checks whether the 'offlinePaymentsPerCardLimit' field has been set, however the value could be null */
+ public boolean hasOfflinePaymentsPerCardLimit() {
+ return genClient.cacheHasKey(CacheKey.offlinePaymentsPerCardLimit);
+ }
+
/** Checks whether the 'offlinePaymentsLimitDefault' field has been set, however the value could be null */
public boolean hasOfflinePaymentsLimitDefault() {
return genClient.cacheHasKey(CacheKey.offlinePaymentsLimitDefault);
@@ -734,6 +775,11 @@ public boolean hasOfflinePaymentsTotalPaymentsLimitDefault() {
return genClient.cacheHasKey(CacheKey.offlinePaymentsTotalPaymentsLimitDefault);
}
+ /** Checks whether the 'offlinePaymentsPerCardLimitDefault' field has been set, however the value could be null */
+ public boolean hasOfflinePaymentsPerCardLimitDefault() {
+ return genClient.cacheHasKey(CacheKey.offlinePaymentsPerCardLimitDefault);
+ }
+
/** Checks whether the 'offlinePaymentsMaxLimit' field has been set, however the value could be null */
public boolean hasOfflinePaymentsMaxLimit() {
return genClient.cacheHasKey(CacheKey.offlinePaymentsMaxLimit);
@@ -744,6 +790,11 @@ public boolean hasOfflinePaymentsMaxTotalPaymentsLimit() {
return genClient.cacheHasKey(CacheKey.offlinePaymentsMaxTotalPaymentsLimit);
}
+ /** Checks whether the 'offlinePaymentsMaxPerCardLimit' field has been set, however the value could be null */
+ public boolean hasOfflinePaymentsMaxPerCardLimit() {
+ return genClient.cacheHasKey(CacheKey.offlinePaymentsMaxPerCardLimit);
+ }
+
/** Checks whether the 'showOfflinePayments' field has been set, however the value could be null */
public boolean hasShowOfflinePayments() {
return genClient.cacheHasKey(CacheKey.showOfflinePayments);
@@ -947,6 +998,13 @@ public Device setOfflinePaymentsTotalPaymentsLimit(java.lang.Long offlinePayment
return genClient.setOther(offlinePaymentsTotalPaymentsLimit, CacheKey.offlinePaymentsTotalPaymentsLimit);
}
+ /**
+ * Sets the field 'offlinePaymentsPerCardLimit'.
+ */
+ public Device setOfflinePaymentsPerCardLimit(java.lang.Long offlinePaymentsPerCardLimit) {
+ return genClient.setOther(offlinePaymentsPerCardLimit, CacheKey.offlinePaymentsPerCardLimit);
+ }
+
/**
* Sets the field 'offlinePaymentsLimitDefault'.
*/
@@ -968,6 +1026,13 @@ public Device setOfflinePaymentsTotalPaymentsLimitDefault(java.lang.Long offline
return genClient.setOther(offlinePaymentsTotalPaymentsLimitDefault, CacheKey.offlinePaymentsTotalPaymentsLimitDefault);
}
+ /**
+ * Sets the field 'offlinePaymentsPerCardLimitDefault'.
+ */
+ public Device setOfflinePaymentsPerCardLimitDefault(java.lang.Long offlinePaymentsPerCardLimitDefault) {
+ return genClient.setOther(offlinePaymentsPerCardLimitDefault, CacheKey.offlinePaymentsPerCardLimitDefault);
+ }
+
/**
* Sets the field 'offlinePaymentsMaxLimit'.
*/
@@ -982,6 +1047,13 @@ public Device setOfflinePaymentsMaxTotalPaymentsLimit(java.lang.Long offlinePaym
return genClient.setOther(offlinePaymentsMaxTotalPaymentsLimit, CacheKey.offlinePaymentsMaxTotalPaymentsLimit);
}
+ /**
+ * Sets the field 'offlinePaymentsMaxPerCardLimit'.
+ */
+ public Device setOfflinePaymentsMaxPerCardLimit(java.lang.Long offlinePaymentsMaxPerCardLimit) {
+ return genClient.setOther(offlinePaymentsMaxPerCardLimit, CacheKey.offlinePaymentsMaxPerCardLimit);
+ }
+
/**
* Sets the field 'showOfflinePayments'.
*/
@@ -1120,6 +1192,10 @@ public void clearOfflinePaymentsPromptThreshold() {
public void clearOfflinePaymentsTotalPaymentsLimit() {
genClient.clear(CacheKey.offlinePaymentsTotalPaymentsLimit);
}
+ /** Clears the 'offlinePaymentsPerCardLimit' field, the 'has' method for this field will now return false */
+ public void clearOfflinePaymentsPerCardLimit() {
+ genClient.clear(CacheKey.offlinePaymentsPerCardLimit);
+ }
/** Clears the 'offlinePaymentsLimitDefault' field, the 'has' method for this field will now return false */
public void clearOfflinePaymentsLimitDefault() {
genClient.clear(CacheKey.offlinePaymentsLimitDefault);
@@ -1132,6 +1208,10 @@ public void clearOfflinePaymentsPromptThresholdDefault() {
public void clearOfflinePaymentsTotalPaymentsLimitDefault() {
genClient.clear(CacheKey.offlinePaymentsTotalPaymentsLimitDefault);
}
+ /** Clears the 'offlinePaymentsPerCardLimitDefault' field, the 'has' method for this field will now return false */
+ public void clearOfflinePaymentsPerCardLimitDefault() {
+ genClient.clear(CacheKey.offlinePaymentsPerCardLimitDefault);
+ }
/** Clears the 'offlinePaymentsMaxLimit' field, the 'has' method for this field will now return false */
public void clearOfflinePaymentsMaxLimit() {
genClient.clear(CacheKey.offlinePaymentsMaxLimit);
@@ -1140,6 +1220,10 @@ public void clearOfflinePaymentsMaxLimit() {
public void clearOfflinePaymentsMaxTotalPaymentsLimit() {
genClient.clear(CacheKey.offlinePaymentsMaxTotalPaymentsLimit);
}
+ /** Clears the 'offlinePaymentsMaxPerCardLimit' field, the 'has' method for this field will now return false */
+ public void clearOfflinePaymentsMaxPerCardLimit() {
+ genClient.clear(CacheKey.offlinePaymentsMaxPerCardLimit);
+ }
/** Clears the 'showOfflinePayments' field, the 'has' method for this field will now return false */
public void clearShowOfflinePayments() {
genClient.clear(CacheKey.showOfflinePayments);
@@ -1260,11 +1344,14 @@ public interface Constraints {
public static final boolean OFFLINEPAYMENTSLIMIT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSPROMPTTHRESHOLD_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSTOTALPAYMENTSLIMIT_IS_REQUIRED = false;
+ public static final boolean OFFLINEPAYMENTSPERCARDLIMIT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSLIMITDEFAULT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSPROMPTTHRESHOLDDEFAULT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSTOTALPAYMENTSLIMITDEFAULT_IS_REQUIRED = false;
+ public static final boolean OFFLINEPAYMENTSPERCARDLIMITDEFAULT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSMAXLIMIT_IS_REQUIRED = false;
public static final boolean OFFLINEPAYMENTSMAXTOTALPAYMENTSLIMIT_IS_REQUIRED = false;
+ public static final boolean OFFLINEPAYMENTSMAXPERCARDLIMIT_IS_REQUIRED = false;
public static final boolean SHOWOFFLINEPAYMENTS_IS_REQUIRED = false;
public static final boolean MAXOFFLINEDAYS_IS_REQUIRED = false;
public static final boolean ALLOWSTOREANDFORWARD_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Menu.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Menu.java
index ac6e2c2425..3741247723 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Menu.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Menu.java
@@ -39,7 +39,7 @@
* {@link #getCreatedTime createdTime}
* {@link #getDeletedTime deletedTime}
* {@link #getDayParts dayParts}
-
+ * {@link #getFallbackMenu fallbackMenu}
*
*/
@SuppressWarnings("all")
@@ -94,6 +94,12 @@ public java.util.List getDayParts()
return genClient.cacheGet(CacheKey.dayParts);
}
+ /**
+ * Whether the menu is fallback menu for current merchant.
+ */
+ public java.lang.Boolean getFallbackMenu() {
+ return genClient.cacheGet(CacheKey.fallbackMenu);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
id
@@ -110,6 +116,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
dayParts
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.multiplemenu.MenuDayPart.JSON_CREATOR)),
+ fallbackMenu
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -226,6 +234,10 @@ public boolean isNotNullDayParts() {
/** Checks whether the 'dayParts' field is set and is not null and is not empty */
public boolean isNotEmptyDayParts() { return isNotNullDayParts() && !getDayParts().isEmpty(); }
+ /** Checks whether the 'fallbackMenu' field is set and is not null */
+ public boolean isNotNullFallbackMenu() {
+ return genClient.cacheValueIsNotNull(CacheKey.fallbackMenu);
+ }
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
@@ -262,6 +274,11 @@ public boolean hasDayParts() {
return genClient.cacheHasKey(CacheKey.dayParts);
}
+ /** Checks whether the 'fallbackMenu' field has been set, however the value could be null */
+ public boolean hasFallbackMenu() {
+ return genClient.cacheHasKey(CacheKey.fallbackMenu);
+ }
+
/**
* Sets the field 'id'.
*/
@@ -313,6 +330,12 @@ public Menu setDayParts(java.util.List{@link #getMcc mcc}
* {@link #getTokenType tokenType}
* {@link #getGroupId groupId}
+ * {@link #getPlatform platform}
* {@link #getDebitKeyCode debitKeyCode}
* {@link #getSredCode sredCode}
* {@link #getSupportsTipAdjust supportsTipAdjust}
@@ -127,6 +128,10 @@ public java.lang.String getGroupId() {
return genClient.cacheGet(CacheKey.groupId);
}
+ public java.lang.String getPlatform() {
+ return genClient.cacheGet(CacheKey.platform);
+ }
+
public java.lang.String getDebitKeyCode() {
return genClient.cacheGet(CacheKey.debitKeyCode);
}
@@ -205,6 +210,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
groupId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ platform
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
debitKeyCode
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
sredCode
@@ -382,6 +389,11 @@ public boolean isNotNullGroupId() {
return genClient.cacheValueIsNotNull(CacheKey.groupId);
}
+ /** Checks whether the 'platform' field is set and is not null */
+ public boolean isNotNullPlatform() {
+ return genClient.cacheValueIsNotNull(CacheKey.platform);
+ }
+
/** Checks whether the 'debitKeyCode' field is set and is not null */
public boolean isNotNullDebitKeyCode() {
return genClient.cacheValueIsNotNull(CacheKey.debitKeyCode);
@@ -509,6 +521,11 @@ public boolean hasGroupId() {
return genClient.cacheHasKey(CacheKey.groupId);
}
+ /** Checks whether the 'platform' field has been set, however the value could be null */
+ public boolean hasPlatform() {
+ return genClient.cacheHasKey(CacheKey.platform);
+ }
+
/** Checks whether the 'debitKeyCode' field has been set, however the value could be null */
public boolean hasDebitKeyCode() {
return genClient.cacheHasKey(CacheKey.debitKeyCode);
@@ -667,6 +684,13 @@ public Gateway setGroupId(java.lang.String groupId) {
return genClient.setOther(groupId, CacheKey.groupId);
}
+ /**
+ * Sets the field 'platform'.
+ */
+ public Gateway setPlatform(java.lang.String platform) {
+ return genClient.setOther(platform, CacheKey.platform);
+ }
+
/**
* Sets the field 'debitKeyCode'.
*/
@@ -795,6 +819,10 @@ public void clearTokenType() {
public void clearGroupId() {
genClient.clear(CacheKey.groupId);
}
+ /** Clears the 'platform' field, the 'has' method for this field will now return false */
+ public void clearPlatform() {
+ genClient.clear(CacheKey.platform);
+ }
/** Clears the 'debitKeyCode' field, the 'has' method for this field will now return false */
public void clearDebitKeyCode() {
genClient.clear(CacheKey.debitKeyCode);
@@ -912,6 +940,7 @@ public interface Constraints {
public static final boolean MCC_IS_REQUIRED = false;
public static final boolean TOKENTYPE_IS_REQUIRED = false;
public static final boolean GROUPID_IS_REQUIRED = false;
+ public static final boolean PLATFORM_IS_REQUIRED = false;
public static final boolean DEBITKEYCODE_IS_REQUIRED = false;
public static final boolean SREDCODE_IS_REQUIRED = false;
public static final boolean SUPPORTSTIPADJUST_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantDevicesV2Contract.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantDevicesV2Contract.java
index 61880d02fe..1f727ba40f 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantDevicesV2Contract.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantDevicesV2Contract.java
@@ -183,11 +183,15 @@ public interface DeviceColumns {
* Offline payments total payments limit.
*/
public static final String OFFLINE_PAYMENTS_TOTAL_PAYMENTS_LIMIT = "offline_payments_total_payments_limit";
+ /**
+ * Offline payments total payments per card limit.
+ */
+ public static final String OFFLINE_PAYMENTS_PER_CARD_LIMIT = "offline_payments_per_card_limit";
static final String[] COLUMNS = { ID, NAME, MODEL, MERCHANT_ID, ORDER_PREFIX,
TERMINAL_PREFIX, SERIAL, SECURE_ID, BUILD_TYPE, DEVICE_TYPE_NAME, PRODUCT_NAME,
PIN_DISABLED, OFFLINE_PAYMENTS, OFFLINE_PAYMENTS_ALL, OFFLINE_PAYMENTS_LIMIT,
- OFFLINE_PAYMENTS_PROMPT_THRESHOLD, OFFLINE_PAYMENTS_TOTAL_PAYMENTS_LIMIT};
+ OFFLINE_PAYMENTS_PROMPT_THRESHOLD, OFFLINE_PAYMENTS_TOTAL_PAYMENTS_LIMIT, OFFLINE_PAYMENTS_PER_CARD_LIMIT};
}
public static final class Device implements BaseColumns, DeviceColumns {
@@ -229,6 +233,9 @@ public static com.clover.sdk.v3.device.Device fromCursor(Cursor cursor) {
device.setOfflinePaymentsLimit(getLong(cursor, OFFLINE_PAYMENTS_LIMIT));
device.setOfflinePaymentsPromptThreshold(getLong(cursor, OFFLINE_PAYMENTS_PROMPT_THRESHOLD));
device.setOfflinePaymentsTotalPaymentsLimit(getLong(cursor, OFFLINE_PAYMENTS_TOTAL_PAYMENTS_LIMIT));
+ if (getColumnIndex(cursor, OFFLINE_PAYMENTS_PER_CARD_LIMIT) != -1) { // don't set this field if column per_card_limit doesn't exit in merchant_device_v2.db version 2
+ device.setOfflinePaymentsPerCardLimit(getLong(cursor, OFFLINE_PAYMENTS_PER_CARD_LIMIT));
+ }
return device;
}
@@ -291,6 +298,9 @@ public static ContentValues toContentValues(com.clover.sdk.v3.device.Device devi
if (device.hasOfflinePaymentsTotalPaymentsLimit()) {
values.put(OFFLINE_PAYMENTS_TOTAL_PAYMENTS_LIMIT, device.getOfflinePaymentsTotalPaymentsLimit());
}
+ if (device.hasOfflinePaymentsPerCardLimit()) {
+ values.put(OFFLINE_PAYMENTS_PER_CARD_LIMIT, device.getOfflinePaymentsPerCardLimit());
+ }
return values;
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/INfcReaderClient.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/INfcReaderClient.kt
new file mode 100644
index 0000000000..3795b15fb9
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/INfcReaderClient.kt
@@ -0,0 +1,62 @@
+package com.clover.sdk.v3.nfc.connector
+
+import com.clover.sdk.v3.nfc.listener.INfcReaderClientListener
+import com.clover.sdk.v3.nfc.model.FelicaCardCommand
+import com.clover.sdk.v3.nfc.model.FelicaCardResponse
+import com.clover.sdk.v3.nfc.model.FelicaCardUuid
+
+/**
+ * Nfc reader Client to perform NFC reader operations.
+ * Please make sure to finish any NFC reading/writing operations within 30 seconds.
+ * If you couldn't finish an operation with in 30 seconds, please invoke connect again.
+ */
+interface INfcReaderClient {
+
+ /**
+ * Connect Nfc reader service client to start NFC operations.
+ * Please make sure to finish any NFC reading/writing operations with in 30 seconds
+ */
+ fun connect(readerClientListener: INfcReaderClientListener)
+
+ /**
+ * Disconnect the NFC reader client after finishing operation.
+ */
+ fun disconnect()
+
+ /**
+ * Cancel any running existing NFC operation. It will throw error in current running operation.
+ */
+ fun cancel()
+
+ /**
+ * Returns Felica card UUID.
+ * This function turns on the RF and starts polling.
+ */
+ fun felicaUuid(): FelicaCardUuid?
+
+ /**
+ * Returns Felica card response.
+ * Use this function to send Felica commands after felicaUuid() is called.
+ * Please make sure card is tapped until felicaUuid & felicaCommand operations are completed.
+ */
+ fun felicaCommand(felicaCardCmd: FelicaCardCommand): FelicaCardResponse?
+
+ /**
+ * Turn on RF and initialize NFC controller for Felica operations
+ */
+ fun felicaRfOn()
+
+ /**
+ * Returns Felica card response.
+ * Use this function to send Felica commands after felicaRfOn() is called.
+ * This function sends the commands as it without NFC reader library pre-processing.
+ * Please make sure card is tapped until all felicaCommandRaw operations are completed.
+ */
+ fun felicaCommandRaw(felicaCardCmd: FelicaCardCommand): FelicaCardResponse?
+
+ /**
+ * Turn off RF.
+ * Call this function after all card operations are done.
+ */
+ fun felicaRfOff()
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClient.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClient.kt
new file mode 100644
index 0000000000..d18bbb9dc7
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClient.kt
@@ -0,0 +1,23 @@
+package com.clover.sdk.v3.nfc.connector
+
+import android.annotation.SuppressLint
+import android.content.Context
+
+abstract class NfcReaderClient : INfcReaderClient {
+
+ companion object {
+ @SuppressLint("StaticFieldLeak")
+ private var instance: INfcReaderClient? = null
+
+ /**
+ * Returns instance of NFC reader service client. Please make sure to invoke connect before doing any operations.
+ * You can use this instance to do any NFC reader operations only for 30 seconds.
+ * After 30 seconds, please invoke connect again.
+ */
+ fun getInstance(context: Context): INfcReaderClient {
+ return instance ?: synchronized(this) {
+ instance ?: NfcReaderClientImpl(context).also { instance = it }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClientImpl.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClientImpl.kt
new file mode 100644
index 0000000000..57c79e3472
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderClientImpl.kt
@@ -0,0 +1,89 @@
+package com.clover.sdk.v3.nfc.connector
+
+import android.content.Context
+import com.clover.sdk.v3.nfc.listener.INfcReaderClientListener
+import com.clover.sdk.v3.nfc.model.FelicaCardCommand
+import com.clover.sdk.v3.nfc.model.FelicaCardResponse
+import com.clover.sdk.v3.nfc.model.FelicaCardUuid
+import com.clover.sdk.v3.payment.raw.listener.IServiceListener
+import com.clover.sdk.v3.nfc.service.INfcReaderService
+
+internal class NfcReaderClientImpl(private val context: Context) : NfcReaderClient() {
+ private val nfcServiceConnector = NfcServiceConnector(context)
+ private var iNfcReaderClientListener: INfcReaderClientListener? = null
+ private var iNfcReaderService: INfcReaderService? = null
+ private var isNfcReaderServiceConnected = false
+
+ override fun connect(readerClientListener: INfcReaderClientListener) {
+ iNfcReaderClientListener = readerClientListener
+ nfcServiceConnector.connect(nfcReaderListener)
+ }
+
+ override fun disconnect() {
+ nfcServiceConnector.disconnect()
+ }
+
+ override fun cancel() {
+ if (isNfcServiceAvailable()) {
+ iNfcReaderService?.cancel()
+ } else {
+ throw NfcReaderException("Cancel failed")
+ }
+ }
+
+ override fun felicaUuid(): FelicaCardUuid? {
+ if (isNfcServiceAvailable()) {
+ return iNfcReaderService?.felicaUuid()
+ }
+ throw NfcReaderException("Couldn't read Felica card UUID.")
+ }
+
+ override fun felicaCommand(felicaCardCmd: FelicaCardCommand): FelicaCardResponse? {
+ if (isNfcServiceAvailable()) {
+ val felicaCardCmd: FelicaCardCommand =
+ FelicaCardCommand(felicaCardCmd.commandDataInHex);
+ return iNfcReaderService?.felicaCommand(felicaCardCmd)
+ }
+ throw NfcReaderException("Couldn't execute Felica card command.")
+ }
+
+ override fun felicaRfOn() {
+ if (isNfcServiceAvailable()) {
+ iNfcReaderService?.felicaRfOn()
+ }
+ }
+
+ override fun felicaCommandRaw(felicaCardCmd: FelicaCardCommand): FelicaCardResponse? {
+ if (isNfcServiceAvailable()) {
+ val felicaCardCmd: FelicaCardCommand =
+ FelicaCardCommand(felicaCardCmd.commandDataInHex);
+ return iNfcReaderService?.felicaCommandRaw(felicaCardCmd)
+ }
+ throw NfcReaderException("Couldn't execute Felica card raw command.")
+ }
+
+ override fun felicaRfOff() {
+ if (isNfcServiceAvailable()) {
+ iNfcReaderService?.felicaRfOff()
+ }
+ }
+
+ private fun isNfcServiceAvailable(): Boolean {
+ return isNfcReaderServiceConnected && iNfcReaderService != null && iNfcReaderClientListener != null
+ }
+
+ private val nfcReaderListener = object : IServiceListener {
+ override fun onConnected(nfcReaderService: INfcReaderService) {
+ isNfcReaderServiceConnected = true
+ iNfcReaderService = nfcReaderService
+ iNfcReaderClientListener?.onConnected()
+ }
+
+ override fun onDisconnected() {
+ iNfcReaderClientListener?.onDisconnect()
+ isNfcReaderServiceConnected = false
+ iNfcReaderService = null
+ iNfcReaderClientListener = null
+ }
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderException.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderException.kt
new file mode 100644
index 0000000000..6be7461a07
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcReaderException.kt
@@ -0,0 +1,3 @@
+package com.clover.sdk.v3.nfc.connector
+
+class NfcReaderException(val errorMessage: String) : Throwable(errorMessage)
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcServiceConnector.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcServiceConnector.kt
new file mode 100644
index 0000000000..6151666a73
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/connector/NfcServiceConnector.kt
@@ -0,0 +1,97 @@
+package com.clover.sdk.v3.nfc.connector
+
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.content.ServiceConnection
+import android.content.pm.PackageManager
+import android.os.CountDownTimer
+import android.os.IBinder
+import android.util.Log
+import com.clover.sdk.v3.nfc.service.INfcReaderService
+import com.clover.sdk.v3.payment.raw.listener.IServiceListener
+
+internal class NfcServiceConnector(private val context: Context) {
+
+ private var bound = false
+ private var serviceConnection: ServiceConnection? = null
+ private var nfcServiceBinder: INfcReaderService? = null
+ private var timer: CountDownTimer? = null
+
+ companion object {
+ private const val NFC_SERVICE_CLASS =
+ "com.clover.payment.service.services.nfc.NfcReaderService"
+ private const val CORE_PAYMENTS_PACKAGE = "com.clover.payment.core"
+ private const val DEVICE_TIMEOUT: Long = 30 * 1000 // 30 seconds
+ private const val TIME_INTERVAL_ONE_SEC: Long = 1000 // 1 sec
+ }
+
+ internal fun connect(serviceListener: IServiceListener) {
+ val serviceIntent = Intent()
+ serviceIntent.setClassName(CORE_PAYMENTS_PACKAGE, NFC_SERVICE_CLASS)
+ if (!isServiceAvailable(context, serviceIntent)) {
+ throw RuntimeException("$CORE_PAYMENTS_PACKAGE is not available")
+ }
+
+ serviceConnection = object : ServiceConnection {
+ override fun onServiceConnected(componentName: ComponentName, binder: IBinder) {
+ val localNfcServiceBinder = INfcReaderService.Stub.asInterface(binder)
+ localNfcServiceBinder.openSession()
+ bound = true
+ nfcServiceBinder = localNfcServiceBinder
+ startTimer()
+ serviceListener.onConnected(localNfcServiceBinder)
+ }
+
+ override fun onServiceDisconnected(p0: ComponentName?) {
+ bound = false
+ nfcServiceBinder?.closeSession()
+ timer?.cancel()
+ serviceListener.onDisconnected()
+ }
+ }
+ context.bindService(
+ serviceIntent,
+ serviceConnection as ServiceConnection,
+ Context.BIND_AUTO_CREATE
+ )
+ }
+
+ internal fun disconnect(): Boolean {
+ if (bound) {
+ serviceConnection?.let { localServiceConnection ->
+ context.unbindService(localServiceConnection)
+ } ?: run {
+ Log.i(
+ NfcServiceConnector::class.simpleName,
+ "NFC service not connected on disconnect"
+ )
+ }
+ timer?.cancel()
+ bound = false
+ serviceConnection = null
+ return true
+ }
+ return false
+ }
+
+ internal fun isServiceAvailable(context: Context, serviceIntent: Intent): Boolean {
+ val infos =
+ context.packageManager.queryIntentServices(serviceIntent, PackageManager.GET_META_DATA)
+ return infos.isNotEmpty()
+ }
+
+ private fun startTimer() {
+ timer = object : CountDownTimer(DEVICE_TIMEOUT, TIME_INTERVAL_ONE_SEC) {
+ override fun onTick(tickTime: Long) {
+ // Not needed in current logic
+ }
+
+ override fun onFinish() {
+ disconnect()
+ }
+ }.apply {
+ start()
+ }
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/listener/INfcReaderClientListener.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/listener/INfcReaderClientListener.kt
new file mode 100644
index 0000000000..760b8da3e4
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/listener/INfcReaderClientListener.kt
@@ -0,0 +1,6 @@
+package com.clover.sdk.v3.nfc.listener
+
+interface INfcReaderClientListener {
+ fun onConnected()
+ fun onDisconnect()
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardCommand.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardCommand.kt
new file mode 100644
index 0000000000..97f3189258
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardCommand.kt
@@ -0,0 +1,9 @@
+package com.clover.sdk.v3.nfc.model
+
+import android.os.Parcelable
+import kotlinx.parcelize.Parcelize
+
+@Parcelize
+data class FelicaCardCommand(
+ val commandDataInHex: String
+) : Parcelable
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardResponse.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardResponse.kt
new file mode 100644
index 0000000000..58f1ef78c1
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardResponse.kt
@@ -0,0 +1,7 @@
+package com.clover.sdk.v3.nfc.model
+
+import android.os.Parcelable
+import kotlinx.parcelize.Parcelize
+
+@Parcelize
+data class FelicaCardResponse(val cardRsp: String?) : Parcelable
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardUuid.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardUuid.kt
new file mode 100644
index 0000000000..3cb3ece1ff
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/nfc/model/FelicaCardUuid.kt
@@ -0,0 +1,7 @@
+package com.clover.sdk.v3.nfc.model
+
+import android.os.Parcelable
+import kotlinx.parcelize.Parcelize
+
+@Parcelize
+data class FelicaCardUuid(val felicaCardUuid: String) : Parcelable
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV31Connector.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV31Connector.java
index b450893962..7f779a2f4a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV31Connector.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV31Connector.java
@@ -1645,4 +1645,19 @@ public Order setLineItemInfo(final String orderId, final String lineItemId, fina
return getValue(service.setLineItemInfo(orderId, lineItemId, lineItemInfo, status));
});
}
+
+ /**
+ * Voids eligible alternate payments (e.g., Klarna).
+ * Records the void locally and sends a void request (synchronous or queued) to the server.
+ * Not available to non-Clover apps.
+ * @y\.exclude
+ */
+ public Order voidAlternatePayment(final String orderId, final String paymentId, final String iccContainer, final VoidReason reason, final String source) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable() {
+ @Override
+ public Order call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.voidAlternatePayment(orderId, paymentId, iccContainer, reason, source, status));
+ }
+ });
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV3Connector.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV3Connector.java
index 61b1c66a90..d9751999df 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV3Connector.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderV3Connector.java
@@ -1082,4 +1082,18 @@ public Order setLineItemInfo(final String orderId, final String lineItemId, fina
});
}
+ /**
+ * Voids eligible alternate payments (e.g., Klarna).
+ * Records the void locally and sends a void request (synchronous or queued) to the server.
+ * Not available to non-Clover apps.
+ * @y\.exclude
+ */
+ public Order voidAlternatePayment(final String orderId, final String paymentId, final String iccContainer, final VoidReason reason, final String source) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable() {
+ @Override
+ public Order call(IOrderService service, ResultStatus status) throws RemoteException {
+ return service.voidAlternatePayment(orderId, paymentId, iccContainer, reason, source, status);
+ }
+ });
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/InitTransactionRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/InitTransactionRequest.java
new file mode 100644
index 0000000000..d81bdc7614
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/InitTransactionRequest.java
@@ -0,0 +1,301 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.pay;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getEntryType entryType}
+ * - {@link #getAmount amount}
+ * - {@link #getSred sred}
+ * - {@link #getKsn ksn}
+ *
+ */
+@SuppressWarnings("all")
+public class InitTransactionRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public com.clover.sdk.v3.payments.CardEntryType getEntryType() {
+ return genClient.cacheGet(CacheKey.entryType);
+ }
+
+ public java.lang.Long getAmount() {
+ return genClient.cacheGet(CacheKey.amount);
+ }
+
+ public java.lang.String getSred() {
+ return genClient.cacheGet(CacheKey.sred);
+ }
+
+ public java.lang.String getKsn() {
+ return genClient.cacheGet(CacheKey.ksn);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ entryType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.CardEntryType.class)),
+ amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ sred
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ksn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public InitTransactionRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected InitTransactionRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public InitTransactionRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public InitTransactionRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public InitTransactionRequest(InitTransactionRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'entryType' field is set and is not null */
+ public boolean isNotNullEntryType() {
+ return genClient.cacheValueIsNotNull(CacheKey.entryType);
+ }
+
+ /** Checks whether the 'amount' field is set and is not null */
+ public boolean isNotNullAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.amount);
+ }
+
+ /** Checks whether the 'sred' field is set and is not null */
+ public boolean isNotNullSred() {
+ return genClient.cacheValueIsNotNull(CacheKey.sred);
+ }
+
+ /** Checks whether the 'ksn' field is set and is not null */
+ public boolean isNotNullKsn() {
+ return genClient.cacheValueIsNotNull(CacheKey.ksn);
+ }
+
+
+
+ /** Checks whether the 'entryType' field has been set, however the value could be null */
+ public boolean hasEntryType() {
+ return genClient.cacheHasKey(CacheKey.entryType);
+ }
+
+ /** Checks whether the 'amount' field has been set, however the value could be null */
+ public boolean hasAmount() {
+ return genClient.cacheHasKey(CacheKey.amount);
+ }
+
+ /** Checks whether the 'sred' field has been set, however the value could be null */
+ public boolean hasSred() {
+ return genClient.cacheHasKey(CacheKey.sred);
+ }
+
+ /** Checks whether the 'ksn' field has been set, however the value could be null */
+ public boolean hasKsn() {
+ return genClient.cacheHasKey(CacheKey.ksn);
+ }
+
+
+ /**
+ * Sets the field 'entryType'.
+ */
+ public InitTransactionRequest setEntryType(com.clover.sdk.v3.payments.CardEntryType entryType) {
+ return genClient.setOther(entryType, CacheKey.entryType);
+ }
+
+ /**
+ * Sets the field 'amount'.
+ */
+ public InitTransactionRequest setAmount(java.lang.Long amount) {
+ return genClient.setOther(amount, CacheKey.amount);
+ }
+
+ /**
+ * Sets the field 'sred'.
+ */
+ public InitTransactionRequest setSred(java.lang.String sred) {
+ return genClient.setOther(sred, CacheKey.sred);
+ }
+
+ /**
+ * Sets the field 'ksn'.
+ */
+ public InitTransactionRequest setKsn(java.lang.String ksn) {
+ return genClient.setOther(ksn, CacheKey.ksn);
+ }
+
+
+ /** Clears the 'entryType' field, the 'has' method for this field will now return false */
+ public void clearEntryType() {
+ genClient.clear(CacheKey.entryType);
+ }
+ /** Clears the 'amount' field, the 'has' method for this field will now return false */
+ public void clearAmount() {
+ genClient.clear(CacheKey.amount);
+ }
+ /** Clears the 'sred' field, the 'has' method for this field will now return false */
+ public void clearSred() {
+ genClient.clear(CacheKey.sred);
+ }
+ /** Clears the 'ksn' field, the 'has' method for this field will now return false */
+ public void clearKsn() {
+ genClient.clear(CacheKey.ksn);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public InitTransactionRequest copyChanges() {
+ InitTransactionRequest copy = new InitTransactionRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(InitTransactionRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new InitTransactionRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public InitTransactionRequest createFromParcel(android.os.Parcel in) {
+ InitTransactionRequest instance = new InitTransactionRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public InitTransactionRequest[] newArray(int size) {
+ return new InitTransactionRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return InitTransactionRequest.class;
+ }
+
+ @Override
+ public InitTransactionRequest create(org.json.JSONObject jsonObject) {
+ return new InitTransactionRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ENTRYTYPE_IS_REQUIRED = false;
+ public static final boolean AMOUNT_IS_REQUIRED = false;
+ public static final boolean SRED_IS_REQUIRED = false;
+ public static final boolean KSN_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequest.java
index 75c6ea7e55..fcb71810b9 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequest.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequest.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.pay;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
@@ -49,6 +50,10 @@
* {@link #getTaxableAmountRates taxableAmountRates}
* {@link #getLineItems lineItems}
* {@link #getCard card}
+ * {@link #getServiceFeePaymentId serviceFeePaymentId}
+ * {@link #getServiceFeeOrderId serviceFeeOrderId}
+ * {@link #getServiceFeeAmount serviceFeeAmount}
+ * {@link #getAuthorizationId authorizationId}
*
*/
@SuppressWarnings("all")
@@ -172,7 +177,19 @@ public com.clover.sdk.v3.pay.PaymentRequestCardDetails getCard() {
return genClient.cacheGet(CacheKey.card);
}
+ /**
+ * Unique identifier to map the ServiceFee payment record associated to the payment
+ */
+ public java.lang.String getServiceFeePaymentId() {
+ return genClient.cacheGet(CacheKey.serviceFeePaymentId);
+ }
+ /**
+ * Unique identifier to map the ServiceFee order record associated to the ServiceFee payment
+ */
+ public java.lang.String getServiceFeeOrderId() {
+ return genClient.cacheGet(CacheKey.serviceFeeOrderId);
+ }
/**
* Total service fee amount to be processed for associated MID
@@ -181,48 +198,64 @@ public java.lang.Long getServiceFeeAmount() {
return genClient.cacheGet(CacheKey.serviceFeeAmount);
}
+ /**
+ * Unique identifier of the authorization with which this payment is associated
+ */
+ public java.lang.String getAuthorizationId() {
+ return genClient.cacheGet(CacheKey.authorizationId);
+ }
+
+
+
+
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
id
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
orderId
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
timestamp
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
tender
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Tender.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Tender.JSON_CREATOR)),
amount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
tipAmount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
taxAmount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
cashBackAmount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
cashTendered
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
employeeId
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
employeeName
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
authorizationCode
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
externalReferenceId
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
externalPaymentId
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
serviceChargeAmount
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.ServiceChargeAmount.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.ServiceChargeAmount.JSON_CREATOR)),
singlePayToken
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
taxableAmountRates
- (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.TaxableAmountRate.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.TaxableAmountRate.JSON_CREATOR)),
lineItems
- (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.LineItemPayment.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.LineItemPayment.JSON_CREATOR)),
card
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.pay.PaymentRequestCardDetails.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.pay.PaymentRequestCardDetails.JSON_CREATOR)),
+ serviceFeePaymentId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ serviceFeeOrderId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
serviceFeeAmount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
- ;
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ authorizationId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -302,7 +335,11 @@ public void validate() {
genClient.validateLength(CacheKey.employeeName, getEmployeeName(), 127);
- genClient.validateLength(CacheKey.externalPaymentId, getExternalPaymentId(), 32);
+ genClient.validateCloverId(CacheKey.serviceFeePaymentId, getServiceFeePaymentId());
+
+ genClient.validateCloverId(CacheKey.serviceFeeOrderId, getServiceFeeOrderId());
+
+ genClient.validateCloverId(CacheKey.authorizationId, getAuthorizationId());
}
/** Checks whether the 'id' field is set and is not null */
@@ -406,11 +443,27 @@ public boolean isNotNullCard() {
return genClient.cacheValueIsNotNull(CacheKey.card);
}
+ /** Checks whether the 'serviceFeePaymentId' field is set and is not null */
+ public boolean isNotNullServiceFeePaymentId() {
+ return genClient.cacheValueIsNotNull(CacheKey.serviceFeePaymentId);
+ }
+
+ /** Checks whether the 'serviceFeeOrderId' field is set and is not null */
+ public boolean isNotNullServiceFeeOrderId() {
+ return genClient.cacheValueIsNotNull(CacheKey.serviceFeeOrderId);
+ }
+
/** Checks whether the 'serviceFeeAmount' field is set and is not null */
public boolean isNotNullServiceFeeAmount() {
return genClient.cacheValueIsNotNull(CacheKey.serviceFeeAmount);
}
+ /** Checks whether the 'authorizationId' field is set and is not null */
+ public boolean isNotNullAuthorizationId() {
+ return genClient.cacheValueIsNotNull(CacheKey.authorizationId);
+ }
+
+
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
@@ -507,11 +560,27 @@ public boolean hasCard() {
return genClient.cacheHasKey(CacheKey.card);
}
+ /** Checks whether the 'serviceFeePaymentId' field has been set, however the value could be null */
+ public boolean hasServiceFeePaymentId() {
+ return genClient.cacheHasKey(CacheKey.serviceFeePaymentId);
+ }
+
+ /** Checks whether the 'serviceFeeOrderId' field has been set, however the value could be null */
+ public boolean hasServiceFeeOrderId() {
+ return genClient.cacheHasKey(CacheKey.serviceFeeOrderId);
+ }
+
/** Checks whether the 'serviceFeeAmount' field has been set, however the value could be null */
public boolean hasServiceFeeAmount() {
return genClient.cacheHasKey(CacheKey.serviceFeeAmount);
}
+ /** Checks whether the 'authorizationId' field has been set, however the value could be null */
+ public boolean hasAuthorizationId() {
+ return genClient.cacheHasKey(CacheKey.authorizationId);
+ }
+
+
/**
* Sets the field 'id'.
*/
@@ -655,6 +724,20 @@ public PaymentRequest setCard(com.clover.sdk.v3.pay.PaymentRequestCardDetails ca
return genClient.setRecord(card, CacheKey.card);
}
+ /**
+ * Sets the field 'serviceFeePaymentId'.
+ */
+ public PaymentRequest setServiceFeePaymentId(java.lang.String serviceFeePaymentId) {
+ return genClient.setOther(serviceFeePaymentId, CacheKey.serviceFeePaymentId);
+ }
+
+ /**
+ * Sets the field 'serviceFeeOrderId'.
+ */
+ public PaymentRequest setServiceFeeOrderId(java.lang.String serviceFeeOrderId) {
+ return genClient.setOther(serviceFeeOrderId, CacheKey.serviceFeeOrderId);
+ }
+
/**
* Sets the field 'serviceFeeAmount'.
*/
@@ -662,6 +745,14 @@ public PaymentRequest setServiceFeeAmount(java.lang.Long serviceFeeAmount) {
return genClient.setOther(serviceFeeAmount, CacheKey.serviceFeeAmount);
}
+ /**
+ * Sets the field 'authorizationId'.
+ */
+ public PaymentRequest setAuthorizationId(java.lang.String authorizationId) {
+ return genClient.setOther(authorizationId, CacheKey.authorizationId);
+ }
+
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
genClient.clear(CacheKey.id);
@@ -738,11 +829,23 @@ public void clearLineItems() {
public void clearCard() {
genClient.clear(CacheKey.card);
}
-
+ /** Clears the 'serviceFeePaymentId' field, the 'has' method for this field will now return false */
+ public void clearServiceFeePaymentId() {
+ genClient.clear(CacheKey.serviceFeePaymentId);
+ }
+ /** Clears the 'serviceFeeOrderId' field, the 'has' method for this field will now return false */
+ public void clearServiceFeeOrderId() {
+ genClient.clear(CacheKey.serviceFeeOrderId);
+ }
/** Clears the 'serviceFeeAmount' field, the 'has' method for this field will now return false */
public void clearServiceFeeAmount() {
genClient.clear(CacheKey.serviceFeeAmount);
}
+ /** Clears the 'authorizationId' field, the 'has' method for this field will now return false */
+ public void clearAuthorizationId() {
+ genClient.clear(CacheKey.authorizationId);
+ }
+
/**
* Returns true if this instance has any changes.
@@ -822,13 +925,18 @@ public interface Constraints {
public static final boolean AUTHORIZATIONCODE_IS_REQUIRED = false;
public static final boolean EXTERNALREFERENCEID_IS_REQUIRED = false;
public static final boolean EXTERNALPAYMENTID_IS_REQUIRED = false;
- public static final long EXTERNALPAYMENTID_MAX_LEN = 32;
public static final boolean SERVICECHARGEAMOUNT_IS_REQUIRED = false;
public static final boolean SINGLEPAYTOKEN_IS_REQUIRED = false;
public static final boolean TAXABLEAMOUNTRATES_IS_REQUIRED = false;
public static final boolean LINEITEMS_IS_REQUIRED = false;
public static final boolean CARD_IS_REQUIRED = false;
+ public static final boolean SERVICEFEEPAYMENTID_IS_REQUIRED = false;
+ public static final long SERVICEFEEPAYMENTID_MAX_LEN = 13;
+ public static final boolean SERVICEFEEORDERID_IS_REQUIRED = false;
+ public static final long SERVICEFEEORDERID_MAX_LEN = 13;
public static final boolean SERVICEFEEAMOUNT_IS_REQUIRED = false;
+ public static final boolean AUTHORIZATIONID_IS_REQUIRED = false;
+ public static final long AUTHORIZATIONID_MAX_LEN = 13;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequestCardDetails.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequestCardDetails.java
index 4fcc559e2c..b2f867174a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequestCardDetails.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/PaymentRequestCardDetails.java
@@ -67,6 +67,11 @@
* {@link #getPlainCardData plainCardData}
* {@link #getTransactionData transactionData}
* {@link #getAccountSelection accountSelection}
+ * {@link #getPanKsn panKsn}
+ * {@link #getTrack1Ksn track1Ksn}
+ * {@link #getTrack2Ksn track2Ksn}
+ * {@link #getTrack3Ksn track3Ksn}
+ * {@link #getEncRandomKey encRandomKey}
*
*/
@SuppressWarnings("all")
@@ -216,8 +221,25 @@ public java.lang.String getAccountSelection() {
return genClient.cacheGet(CacheKey.accountSelection);
}
+ public java.lang.String getPanKsn() {
+ return genClient.cacheGet(CacheKey.panKsn);
+ }
+
+ public java.lang.String getTrack1Ksn() {
+ return genClient.cacheGet(CacheKey.track1Ksn);
+ }
+ public java.lang.String getTrack2Ksn() {
+ return genClient.cacheGet(CacheKey.track2Ksn);
+ }
+ public java.lang.String getTrack3Ksn() {
+ return genClient.cacheGet(CacheKey.track3Ksn);
+ }
+
+ public java.lang.String getEncRandomKey() {
+ return genClient.cacheGet(CacheKey.encRandomKey);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
track1
@@ -292,6 +314,16 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.pay.TransactionData.JSON_CREATOR)),
accountSelection
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ panKsn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ track1Ksn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ track2Ksn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ track3Ksn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ encRandomKey
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -546,6 +578,30 @@ public boolean isNotNullAccountSelection() {
return genClient.cacheValueIsNotNull(CacheKey.accountSelection);
}
+ /** Checks whether the 'panKsn' field is set and is not null */
+ public boolean isNotNullPanKsn() {
+ return genClient.cacheValueIsNotNull(CacheKey.panKsn);
+ }
+
+ /** Checks whether the 'track1Ksn' field is set and is not null */
+ public boolean isNotNullTrack1Ksn() {
+ return genClient.cacheValueIsNotNull(CacheKey.track1Ksn);
+ }
+
+ /** Checks whether the 'track2Ksn' field is set and is not null */
+ public boolean isNotNullTrack2Ksn() {
+ return genClient.cacheValueIsNotNull(CacheKey.track2Ksn);
+ }
+
+ /** Checks whether the 'track3Ksn' field is set and is not null */
+ public boolean isNotNullTrack3Ksn() {
+ return genClient.cacheValueIsNotNull(CacheKey.track3Ksn);
+ }
+
+ /** Checks whether the 'encRandomKey' field is set and is not null */
+ public boolean isNotNullEncRandomKey() {
+ return genClient.cacheValueIsNotNull(CacheKey.encRandomKey);
+ }
/** Checks whether the 'track1' field has been set, however the value could be null */
@@ -728,6 +784,30 @@ public boolean hasAccountSelection() {
return genClient.cacheHasKey(CacheKey.accountSelection);
}
+ /** Checks whether the 'panKsn' field has been set, however the value could be null */
+ public boolean hasPanKsn() {
+ return genClient.cacheHasKey(CacheKey.panKsn);
+ }
+
+ /** Checks whether the 'track1Ksn' field has been set, however the value could be null */
+ public boolean hasTrack1Ksn() {
+ return genClient.cacheHasKey(CacheKey.track1Ksn);
+ }
+
+ /** Checks whether the 'track2Ksn' field has been set, however the value could be null */
+ public boolean hasTrack2Ksn() {
+ return genClient.cacheHasKey(CacheKey.track2Ksn);
+ }
+
+ /** Checks whether the 'track3Ksn' field has been set, however the value could be null */
+ public boolean hasTrack3Ksn() {
+ return genClient.cacheHasKey(CacheKey.track3Ksn);
+ }
+
+ /** Checks whether the 'encRandomKey' field has been set, however the value could be null */
+ public boolean hasEncRandomKey() {
+ return genClient.cacheHasKey(CacheKey.encRandomKey);
+ }
/**
* Sets the field 'track1'.
@@ -983,6 +1063,41 @@ public PaymentRequestCardDetails setAccountSelection(java.lang.String accountSel
return genClient.setOther(accountSelection, CacheKey.accountSelection);
}
+ /**
+ * Sets the field 'panKsn'.
+ */
+ public PaymentRequestCardDetails setPanKsn(java.lang.String panKsn) {
+ return genClient.setOther(panKsn, CacheKey.panKsn);
+ }
+
+ /**
+ * Sets the field 'track1Ksn'.
+ */
+ public PaymentRequestCardDetails setTrack1Ksn(java.lang.String track1Ksn) {
+ return genClient.setOther(track1Ksn, CacheKey.track1Ksn);
+ }
+
+ /**
+ * Sets the field 'track2Ksn'.
+ */
+ public PaymentRequestCardDetails setTrack2Ksn(java.lang.String track2Ksn) {
+ return genClient.setOther(track2Ksn, CacheKey.track2Ksn);
+ }
+
+ /**
+ * Sets the field 'track3Ksn'.
+ */
+ public PaymentRequestCardDetails setTrack3Ksn(java.lang.String track3Ksn) {
+ return genClient.setOther(track3Ksn, CacheKey.track3Ksn);
+ }
+
+ /**
+ * Sets the field 'encRandomKey'.
+ */
+ public PaymentRequestCardDetails setEncRandomKey(java.lang.String encRandomKey) {
+ return genClient.setOther(encRandomKey, CacheKey.encRandomKey);
+ }
+
/** Clears the 'track1' field, the 'has' method for this field will now return false */
public void clearTrack1() {
@@ -1129,6 +1244,26 @@ public void clearAccountSelection() {
genClient.clear(CacheKey.accountSelection);
}
+ /** Clears the 'panKsn' field, the 'has' method for this field will now return false */
+ public void clearPanKsn() {
+ genClient.clear(CacheKey.panKsn);
+ }
+ /** Clears the 'track1Ksn' field, the 'has' method for this field will now return false */
+ public void clearTrack1Ksn() {
+ genClient.clear(CacheKey.track1Ksn);
+ }
+ /** Clears the 'track2Ksn' field, the 'has' method for this field will now return false */
+ public void clearTrack2Ksn() {
+ genClient.clear(CacheKey.track2Ksn);
+ }
+ /** Clears the 'track3Ksn' field, the 'has' method for this field will now return false */
+ public void clearTrack3Ksn() {
+ genClient.clear(CacheKey.track3Ksn);
+ }
+ /** Clears the 'encRandomKey' field, the 'has' method for this field will now return false */
+ public void clearEncRandomKey() {
+ genClient.clear(CacheKey.encRandomKey);
+ }
/**
* Returns true if this instance has any changes.
@@ -1226,6 +1361,11 @@ public interface Constraints {
public static final boolean PLAINCARDDATA_IS_REQUIRED = false;
public static final boolean TRANSACTIONDATA_IS_REQUIRED = false;
public static final boolean ACCOUNTSELECTION_IS_REQUIRED = false;
+ public static final boolean PANKSN_IS_REQUIRED = false;
+ public static final boolean TRACK1KSN_IS_REQUIRED = false;
+ public static final boolean TRACK2KSN_IS_REQUIRED = false;
+ public static final boolean TRACK3KSN_IS_REQUIRED = false;
+ public static final boolean ENCRANDOMKEY_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/CheckEventRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/CheckEventRequest.java
new file mode 100644
index 0000000000..da0f954ce5
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/CheckEventRequest.java
@@ -0,0 +1,305 @@
+/**
+ * Autogenerated by Avro
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getSupportedEntryModes supportedEntryModes}
+ * - {@link #getTimeout timeout}
+ * - {@link #getOpenLeftDigits openLeftDigits}
+ * - {@link #getOpenRightDigits openRightDigits}
+ *
+ */
+@SuppressWarnings("all")
+public class CheckEventRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.util.List getSupportedEntryModes() {
+ return genClient.cacheGet(CacheKey.supportedEntryModes);
+ }
+
+ public java.lang.Integer getTimeout() {
+ return genClient.cacheGet(CacheKey.timeout);
+ }
+
+ public java.lang.Integer getOpenLeftDigits() {
+ return genClient.cacheGet(CacheKey.openLeftDigits);
+ }
+
+ public java.lang.Integer getOpenRightDigits() {
+ return genClient.cacheGet(CacheKey.openRightDigits);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ supportedEntryModes
+ (com.clover.sdk.extractors.EnumListExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.EntryMode.class)),
+ timeout
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ openLeftDigits
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ openRightDigits
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public CheckEventRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CheckEventRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CheckEventRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public CheckEventRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public CheckEventRequest(CheckEventRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'supportedEntryModes' field is set and is not null */
+ public boolean isNotNullSupportedEntryModes() {
+ return genClient.cacheValueIsNotNull(CacheKey.supportedEntryModes);
+ }
+
+ /** Checks whether the 'supportedEntryModes' field is set and is not null and is not empty */
+ public boolean isNotEmptySupportedEntryModes() { return isNotNullSupportedEntryModes() && !getSupportedEntryModes().isEmpty(); }
+
+ /** Checks whether the 'timeout' field is set and is not null */
+ public boolean isNotNullTimeout() {
+ return genClient.cacheValueIsNotNull(CacheKey.timeout);
+ }
+
+ /** Checks whether the 'openLeftDigits' field is set and is not null */
+ public boolean isNotNullOpenLeftDigits() {
+ return genClient.cacheValueIsNotNull(CacheKey.openLeftDigits);
+ }
+
+ /** Checks whether the 'openRightDigits' field is set and is not null */
+ public boolean isNotNullOpenRightDigits() {
+ return genClient.cacheValueIsNotNull(CacheKey.openRightDigits);
+ }
+
+
+
+ /** Checks whether the 'supportedEntryModes' field has been set, however the value could be null */
+ public boolean hasSupportedEntryModes() {
+ return genClient.cacheHasKey(CacheKey.supportedEntryModes);
+ }
+
+ /** Checks whether the 'timeout' field has been set, however the value could be null */
+ public boolean hasTimeout() {
+ return genClient.cacheHasKey(CacheKey.timeout);
+ }
+
+ /** Checks whether the 'openLeftDigits' field has been set, however the value could be null */
+ public boolean hasOpenLeftDigits() {
+ return genClient.cacheHasKey(CacheKey.openLeftDigits);
+ }
+
+ /** Checks whether the 'openRightDigits' field has been set, however the value could be null */
+ public boolean hasOpenRightDigits() {
+ return genClient.cacheHasKey(CacheKey.openRightDigits);
+ }
+
+
+ /**
+ * Sets the field 'supportedEntryModes'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public CheckEventRequest setSupportedEntryModes(java.util.List supportedEntryModes) {
+ return genClient.setArrayOther(supportedEntryModes, CacheKey.supportedEntryModes);
+ }
+
+ /**
+ * Sets the field 'timeout'.
+ */
+ public CheckEventRequest setTimeout(java.lang.Integer timeout) {
+ return genClient.setOther(timeout, CacheKey.timeout);
+ }
+
+ /**
+ * Sets the field 'openLeftDigits'.
+ */
+ public CheckEventRequest setOpenLeftDigits(java.lang.Integer openLeftDigits) {
+ return genClient.setOther(openLeftDigits, CacheKey.openLeftDigits);
+ }
+
+ /**
+ * Sets the field 'openRightDigits'.
+ */
+ public CheckEventRequest setOpenRightDigits(java.lang.Integer openRightDigits) {
+ return genClient.setOther(openRightDigits, CacheKey.openRightDigits);
+ }
+
+
+ /** Clears the 'supportedEntryModes' field, the 'has' method for this field will now return false */
+ public void clearSupportedEntryModes() {
+ genClient.clear(CacheKey.supportedEntryModes);
+ }
+ /** Clears the 'timeout' field, the 'has' method for this field will now return false */
+ public void clearTimeout() {
+ genClient.clear(CacheKey.timeout);
+ }
+ /** Clears the 'openLeftDigits' field, the 'has' method for this field will now return false */
+ public void clearOpenLeftDigits() {
+ genClient.clear(CacheKey.openLeftDigits);
+ }
+ /** Clears the 'openRightDigits' field, the 'has' method for this field will now return false */
+ public void clearOpenRightDigits() {
+ genClient.clear(CacheKey.openRightDigits);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public CheckEventRequest copyChanges() {
+ CheckEventRequest copy = new CheckEventRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CheckEventRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CheckEventRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CheckEventRequest createFromParcel(android.os.Parcel in) {
+ CheckEventRequest instance = new CheckEventRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public CheckEventRequest[] newArray(int size) {
+ return new CheckEventRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CheckEventRequest.class;
+ }
+
+ @Override
+ public CheckEventRequest create(org.json.JSONObject jsonObject) {
+ return new CheckEventRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean SUPPORTEDENTRYMODES_IS_REQUIRED = false;
+ public static final boolean TIMEOUT_IS_REQUIRED = false;
+ public static final boolean OPENLEFTDIGITS_IS_REQUIRED = false;
+ public static final boolean OPENRIGHTDIGITS_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EmvTrackIds.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EmvTrackIds.java
new file mode 100644
index 0000000000..ed69fe47b5
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EmvTrackIds.java
@@ -0,0 +1,70 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum EmvTrackIds implements Parcelable {
+ PAN((byte) 0x01),
+ TRACK1((byte) 0x02),
+ TRACK2((byte) 0x04),
+ TRACK3((byte) 0x08);
+
+ private final byte code;
+
+ EmvTrackIds(byte code) {
+ this.code = code;
+ }
+
+ public byte getCode() {
+ return code;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(final Parcel dest, final int flags) {
+ dest.writeString(name());
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public EmvTrackIds createFromParcel(final Parcel source) {
+ return EmvTrackIds.valueOf(source.readString());
+ }
+
+ @Override
+ public EmvTrackIds[] newArray(final int size) {
+ return new EmvTrackIds[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferRequest.java
new file mode 100644
index 0000000000..d80d2ac397
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferRequest.java
@@ -0,0 +1,359 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getKeySlot keySlot}
+ * - {@link #getKeyType keyType}
+ * - {@link #getEncryptMode encryptMode}
+ * - {@link #getEncSessionKey encSessionKey}
+ * - {@link #getInitVector initVector}
+ * - {@link #getInputData inputData}
+ *
+ */
+@SuppressWarnings("all")
+public class EncryptBufferRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getKeySlot() {
+ return genClient.cacheGet(CacheKey.keySlot);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType getKeyType() {
+ return genClient.cacheGet(CacheKey.keyType);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.EncryptMode getEncryptMode() {
+ return genClient.cacheGet(CacheKey.encryptMode);
+ }
+
+ public java.lang.String getEncSessionKey() {
+ return genClient.cacheGet(CacheKey.encSessionKey);
+ }
+
+ public java.lang.String getInitVector() {
+ return genClient.cacheGet(CacheKey.initVector);
+ }
+
+ public java.lang.String getInputData() {
+ return genClient.cacheGet(CacheKey.inputData);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ keySlot
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ keyType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType.class)),
+ encryptMode
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.EncryptMode.class)),
+ encSessionKey
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ initVector
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ inputData
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public EncryptBufferRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected EncryptBufferRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public EncryptBufferRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public EncryptBufferRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public EncryptBufferRequest(EncryptBufferRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'keySlot' field is set and is not null */
+ public boolean isNotNullKeySlot() {
+ return genClient.cacheValueIsNotNull(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'keyType' field is set and is not null */
+ public boolean isNotNullKeyType() {
+ return genClient.cacheValueIsNotNull(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'encryptMode' field is set and is not null */
+ public boolean isNotNullEncryptMode() {
+ return genClient.cacheValueIsNotNull(CacheKey.encryptMode);
+ }
+
+ /** Checks whether the 'encSessionKey' field is set and is not null */
+ public boolean isNotNullEncSessionKey() {
+ return genClient.cacheValueIsNotNull(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'initVector' field is set and is not null */
+ public boolean isNotNullInitVector() {
+ return genClient.cacheValueIsNotNull(CacheKey.initVector);
+ }
+
+ /** Checks whether the 'inputData' field is set and is not null */
+ public boolean isNotNullInputData() {
+ return genClient.cacheValueIsNotNull(CacheKey.inputData);
+ }
+
+
+
+ /** Checks whether the 'keySlot' field has been set, however the value could be null */
+ public boolean hasKeySlot() {
+ return genClient.cacheHasKey(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'keyType' field has been set, however the value could be null */
+ public boolean hasKeyType() {
+ return genClient.cacheHasKey(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'encryptMode' field has been set, however the value could be null */
+ public boolean hasEncryptMode() {
+ return genClient.cacheHasKey(CacheKey.encryptMode);
+ }
+
+ /** Checks whether the 'encSessionKey' field has been set, however the value could be null */
+ public boolean hasEncSessionKey() {
+ return genClient.cacheHasKey(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'initVector' field has been set, however the value could be null */
+ public boolean hasInitVector() {
+ return genClient.cacheHasKey(CacheKey.initVector);
+ }
+
+ /** Checks whether the 'inputData' field has been set, however the value could be null */
+ public boolean hasInputData() {
+ return genClient.cacheHasKey(CacheKey.inputData);
+ }
+
+
+ /**
+ * Sets the field 'keySlot'.
+ */
+ public EncryptBufferRequest setKeySlot(java.lang.String keySlot) {
+ return genClient.setOther(keySlot, CacheKey.keySlot);
+ }
+
+ /**
+ * Sets the field 'keyType'.
+ */
+ public EncryptBufferRequest setKeyType(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType keyType) {
+ return genClient.setOther(keyType, CacheKey.keyType);
+ }
+
+ /**
+ * Sets the field 'encryptMode'.
+ */
+ public EncryptBufferRequest setEncryptMode(com.clover.sdk.v3.payment.raw.model.EncryptMode encryptMode) {
+ return genClient.setOther(encryptMode, CacheKey.encryptMode);
+ }
+
+ /**
+ * Sets the field 'encSessionKey'.
+ */
+ public EncryptBufferRequest setEncSessionKey(java.lang.String encSessionKey) {
+ return genClient.setOther(encSessionKey, CacheKey.encSessionKey);
+ }
+
+ /**
+ * Sets the field 'initVector'.
+ */
+ public EncryptBufferRequest setInitVector(java.lang.String initVector) {
+ return genClient.setOther(initVector, CacheKey.initVector);
+ }
+
+ /**
+ * Sets the field 'inputData'.
+ */
+ public EncryptBufferRequest setInputData(java.lang.String inputData) {
+ return genClient.setOther(inputData, CacheKey.inputData);
+ }
+
+
+ /** Clears the 'keySlot' field, the 'has' method for this field will now return false */
+ public void clearKeySlot() {
+ genClient.clear(CacheKey.keySlot);
+ }
+ /** Clears the 'keyType' field, the 'has' method for this field will now return false */
+ public void clearKeyType() {
+ genClient.clear(CacheKey.keyType);
+ }
+ /** Clears the 'encryptMode' field, the 'has' method for this field will now return false */
+ public void clearEncryptMode() {
+ genClient.clear(CacheKey.encryptMode);
+ }
+ /** Clears the 'encSessionKey' field, the 'has' method for this field will now return false */
+ public void clearEncSessionKey() {
+ genClient.clear(CacheKey.encSessionKey);
+ }
+ /** Clears the 'initVector' field, the 'has' method for this field will now return false */
+ public void clearInitVector() {
+ genClient.clear(CacheKey.initVector);
+ }
+ /** Clears the 'inputData' field, the 'has' method for this field will now return false */
+ public void clearInputData() {
+ genClient.clear(CacheKey.inputData);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public EncryptBufferRequest copyChanges() {
+ EncryptBufferRequest copy = new EncryptBufferRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(EncryptBufferRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new EncryptBufferRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public EncryptBufferRequest createFromParcel(android.os.Parcel in) {
+ EncryptBufferRequest instance = new EncryptBufferRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public EncryptBufferRequest[] newArray(int size) {
+ return new EncryptBufferRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return EncryptBufferRequest.class;
+ }
+
+ @Override
+ public EncryptBufferRequest create(org.json.JSONObject jsonObject) {
+ return new EncryptBufferRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean KEYSLOT_IS_REQUIRED = false;
+ public static final boolean KEYTYPE_IS_REQUIRED = false;
+ public static final boolean ENCRYPTMODE_IS_REQUIRED = false;
+ public static final boolean ENCSESSIONKEY_IS_REQUIRED = false;
+ public static final boolean INITVECTOR_IS_REQUIRED = false;
+ public static final boolean INPUTDATA_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferResponse.java
new file mode 100644
index 0000000000..1ec636f05d
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptBufferResponse.java
@@ -0,0 +1,243 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getEncryptedData encryptedData}
+ * - {@link #getDataKsn dataKsn}
+ *
+ */
+@SuppressWarnings("all")
+public class EncryptBufferResponse extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getEncryptedData() {
+ return genClient.cacheGet(CacheKey.encryptedData);
+ }
+
+ public java.lang.String getDataKsn() {
+ return genClient.cacheGet(CacheKey.dataKsn);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ encryptedData
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ dataKsn
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public EncryptBufferResponse() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected EncryptBufferResponse(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public EncryptBufferResponse(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public EncryptBufferResponse(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public EncryptBufferResponse(EncryptBufferResponse src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'encryptedData' field is set and is not null */
+ public boolean isNotNullEncryptedData() {
+ return genClient.cacheValueIsNotNull(CacheKey.encryptedData);
+ }
+
+ /** Checks whether the 'dataKsn' field is set and is not null */
+ public boolean isNotNullDataKsn() {
+ return genClient.cacheValueIsNotNull(CacheKey.dataKsn);
+ }
+
+
+
+ /** Checks whether the 'encryptedData' field has been set, however the value could be null */
+ public boolean hasEncryptedData() {
+ return genClient.cacheHasKey(CacheKey.encryptedData);
+ }
+
+ /** Checks whether the 'dataKsn' field has been set, however the value could be null */
+ public boolean hasDataKsn() {
+ return genClient.cacheHasKey(CacheKey.dataKsn);
+ }
+
+
+ /**
+ * Sets the field 'encryptedData'.
+ */
+ public EncryptBufferResponse setEncryptedData(java.lang.String encryptedData) {
+ return genClient.setOther(encryptedData, CacheKey.encryptedData);
+ }
+
+ /**
+ * Sets the field 'dataKsn'.
+ */
+ public EncryptBufferResponse setDataKsn(java.lang.String dataKsn) {
+ return genClient.setOther(dataKsn, CacheKey.dataKsn);
+ }
+
+
+ /** Clears the 'encryptedData' field, the 'has' method for this field will now return false */
+ public void clearEncryptedData() {
+ genClient.clear(CacheKey.encryptedData);
+ }
+ /** Clears the 'dataKsn' field, the 'has' method for this field will now return false */
+ public void clearDataKsn() {
+ genClient.clear(CacheKey.dataKsn);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public EncryptBufferResponse copyChanges() {
+ EncryptBufferResponse copy = new EncryptBufferResponse();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(EncryptBufferResponse src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new EncryptBufferResponse(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public EncryptBufferResponse createFromParcel(android.os.Parcel in) {
+ EncryptBufferResponse instance = new EncryptBufferResponse(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public EncryptBufferResponse[] newArray(int size) {
+ return new EncryptBufferResponse[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return EncryptBufferResponse.class;
+ }
+
+ @Override
+ public EncryptBufferResponse create(org.json.JSONObject jsonObject) {
+ return new EncryptBufferResponse(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ENCRYPTEDDATA_IS_REQUIRED = false;
+ public static final boolean DATAKSN_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptMode.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptMode.java
new file mode 100644
index 0000000000..a4605609a1
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/EncryptMode.java
@@ -0,0 +1,69 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum EncryptMode implements Parcelable {
+ CBC((byte) 0x01),
+ ECB((byte) 0x02);
+
+ private final byte code;
+
+ EncryptMode(byte code) {
+ this.code = code;
+ }
+
+ public byte getCode() {
+ return code;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(final Parcel dest, final int flags) {
+ dest.writeString(name());
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public EncryptMode createFromParcel(final Parcel source) {
+ return EncryptMode.valueOf(source.readString());
+ }
+
+ @Override
+ public EncryptMode[] newArray(final int size) {
+ return new EncryptMode[size];
+ }
+ };
+}
+
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataDetailsRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataDetailsRequest.java
new file mode 100644
index 0000000000..711916e157
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataDetailsRequest.java
@@ -0,0 +1,451 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getKeySlot keySlot}
+ * - {@link #getRequestedTracks requestedTracks}
+ * - {@link #getKeyType keyType}
+ * - {@link #getEncryptMode encryptMode}
+ * - {@link #getEncSessionKey encSessionKey}
+ * - {@link #getInitVector initVector}
+ * - {@link #getRsaModulus rsaModulus}
+ * - {@link #getRsaExponent rsaExponent}
+ * - {@link #getNumClearDigits numClearDigits}
+ *
+ */
+@SuppressWarnings("all")
+public class GetCardDataDetailsRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getKeySlot() {
+ return genClient.cacheGet(CacheKey.keySlot);
+ }
+
+ public java.util.List getRequestedTracks() {
+ return genClient.cacheGet(CacheKey.requestedTracks);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType getKeyType() {
+ return genClient.cacheGet(CacheKey.keyType);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.EncryptMode getEncryptMode() {
+ return genClient.cacheGet(CacheKey.encryptMode);
+ }
+
+ public java.lang.String getEncSessionKey() {
+ return genClient.cacheGet(CacheKey.encSessionKey);
+ }
+
+ public java.lang.String getInitVector() {
+ return genClient.cacheGet(CacheKey.initVector);
+ }
+
+ public java.lang.String getRsaModulus() {
+ return genClient.cacheGet(CacheKey.rsaModulus);
+ }
+
+ public java.lang.String getRsaExponent() {
+ return genClient.cacheGet(CacheKey.rsaExponent);
+ }
+
+ public java.lang.Integer getNumClearDigits() {
+ return genClient.cacheGet(CacheKey.numClearDigits);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ keySlot
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ requestedTracks
+ (com.clover.sdk.extractors.EnumListExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.EmvTrackIds.class)),
+ keyType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType.class)),
+ encryptMode
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.EncryptMode.class)),
+ encSessionKey
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ initVector
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ rsaModulus
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ rsaExponent
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ numClearDigits
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public GetCardDataDetailsRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected GetCardDataDetailsRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public GetCardDataDetailsRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public GetCardDataDetailsRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public GetCardDataDetailsRequest(GetCardDataDetailsRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'keySlot' field is set and is not null */
+ public boolean isNotNullKeySlot() {
+ return genClient.cacheValueIsNotNull(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'requestedTracks' field is set and is not null */
+ public boolean isNotNullRequestedTracks() {
+ return genClient.cacheValueIsNotNull(CacheKey.requestedTracks);
+ }
+
+ /** Checks whether the 'requestedTracks' field is set and is not null and is not empty */
+ public boolean isNotEmptyRequestedTracks() { return isNotNullRequestedTracks() && !getRequestedTracks().isEmpty(); }
+
+ /** Checks whether the 'keyType' field is set and is not null */
+ public boolean isNotNullKeyType() {
+ return genClient.cacheValueIsNotNull(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'encryptMode' field is set and is not null */
+ public boolean isNotNullEncryptMode() {
+ return genClient.cacheValueIsNotNull(CacheKey.encryptMode);
+ }
+
+ /** Checks whether the 'encSessionKey' field is set and is not null */
+ public boolean isNotNullEncSessionKey() {
+ return genClient.cacheValueIsNotNull(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'initVector' field is set and is not null */
+ public boolean isNotNullInitVector() {
+ return genClient.cacheValueIsNotNull(CacheKey.initVector);
+ }
+
+ /** Checks whether the 'rsaModulus' field is set and is not null */
+ public boolean isNotNullRsaModulus() {
+ return genClient.cacheValueIsNotNull(CacheKey.rsaModulus);
+ }
+
+ /** Checks whether the 'rsaExponent' field is set and is not null */
+ public boolean isNotNullRsaExponent() {
+ return genClient.cacheValueIsNotNull(CacheKey.rsaExponent);
+ }
+
+ /** Checks whether the 'numClearDigits' field is set and is not null */
+ public boolean isNotNullNumClearDigits() {
+ return genClient.cacheValueIsNotNull(CacheKey.numClearDigits);
+ }
+
+
+
+ /** Checks whether the 'keySlot' field has been set, however the value could be null */
+ public boolean hasKeySlot() {
+ return genClient.cacheHasKey(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'requestedTracks' field has been set, however the value could be null */
+ public boolean hasRequestedTracks() {
+ return genClient.cacheHasKey(CacheKey.requestedTracks);
+ }
+
+ /** Checks whether the 'keyType' field has been set, however the value could be null */
+ public boolean hasKeyType() {
+ return genClient.cacheHasKey(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'encryptMode' field has been set, however the value could be null */
+ public boolean hasEncryptMode() {
+ return genClient.cacheHasKey(CacheKey.encryptMode);
+ }
+
+ /** Checks whether the 'encSessionKey' field has been set, however the value could be null */
+ public boolean hasEncSessionKey() {
+ return genClient.cacheHasKey(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'initVector' field has been set, however the value could be null */
+ public boolean hasInitVector() {
+ return genClient.cacheHasKey(CacheKey.initVector);
+ }
+
+ /** Checks whether the 'rsaModulus' field has been set, however the value could be null */
+ public boolean hasRsaModulus() {
+ return genClient.cacheHasKey(CacheKey.rsaModulus);
+ }
+
+ /** Checks whether the 'rsaExponent' field has been set, however the value could be null */
+ public boolean hasRsaExponent() {
+ return genClient.cacheHasKey(CacheKey.rsaExponent);
+ }
+
+ /** Checks whether the 'numClearDigits' field has been set, however the value could be null */
+ public boolean hasNumClearDigits() {
+ return genClient.cacheHasKey(CacheKey.numClearDigits);
+ }
+
+
+ /**
+ * Sets the field 'keySlot'.
+ */
+ public GetCardDataDetailsRequest setKeySlot(java.lang.String keySlot) {
+ return genClient.setOther(keySlot, CacheKey.keySlot);
+ }
+
+ /**
+ * Sets the field 'requestedTracks'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public GetCardDataDetailsRequest setRequestedTracks(java.util.List requestedTracks) {
+ return genClient.setArrayOther(requestedTracks, CacheKey.requestedTracks);
+ }
+
+ /**
+ * Sets the field 'keyType'.
+ */
+ public GetCardDataDetailsRequest setKeyType(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType keyType) {
+ return genClient.setOther(keyType, CacheKey.keyType);
+ }
+
+ /**
+ * Sets the field 'encryptMode'.
+ */
+ public GetCardDataDetailsRequest setEncryptMode(com.clover.sdk.v3.payment.raw.model.EncryptMode encryptMode) {
+ return genClient.setOther(encryptMode, CacheKey.encryptMode);
+ }
+
+ /**
+ * Sets the field 'encSessionKey'.
+ */
+ public GetCardDataDetailsRequest setEncSessionKey(java.lang.String encSessionKey) {
+ return genClient.setOther(encSessionKey, CacheKey.encSessionKey);
+ }
+
+ /**
+ * Sets the field 'initVector'.
+ */
+ public GetCardDataDetailsRequest setInitVector(java.lang.String initVector) {
+ return genClient.setOther(initVector, CacheKey.initVector);
+ }
+
+ /**
+ * Sets the field 'rsaModulus'.
+ */
+ public GetCardDataDetailsRequest setRsaModulus(java.lang.String rsaModulus) {
+ return genClient.setOther(rsaModulus, CacheKey.rsaModulus);
+ }
+
+ /**
+ * Sets the field 'rsaExponent'.
+ */
+ public GetCardDataDetailsRequest setRsaExponent(java.lang.String rsaExponent) {
+ return genClient.setOther(rsaExponent, CacheKey.rsaExponent);
+ }
+
+ /**
+ * Sets the field 'numClearDigits'.
+ */
+ public GetCardDataDetailsRequest setNumClearDigits(java.lang.Integer numClearDigits) {
+ return genClient.setOther(numClearDigits, CacheKey.numClearDigits);
+ }
+
+
+ /** Clears the 'keySlot' field, the 'has' method for this field will now return false */
+ public void clearKeySlot() {
+ genClient.clear(CacheKey.keySlot);
+ }
+ /** Clears the 'requestedTracks' field, the 'has' method for this field will now return false */
+ public void clearRequestedTracks() {
+ genClient.clear(CacheKey.requestedTracks);
+ }
+ /** Clears the 'keyType' field, the 'has' method for this field will now return false */
+ public void clearKeyType() {
+ genClient.clear(CacheKey.keyType);
+ }
+ /** Clears the 'encryptMode' field, the 'has' method for this field will now return false */
+ public void clearEncryptMode() {
+ genClient.clear(CacheKey.encryptMode);
+ }
+ /** Clears the 'encSessionKey' field, the 'has' method for this field will now return false */
+ public void clearEncSessionKey() {
+ genClient.clear(CacheKey.encSessionKey);
+ }
+ /** Clears the 'initVector' field, the 'has' method for this field will now return false */
+ public void clearInitVector() {
+ genClient.clear(CacheKey.initVector);
+ }
+ /** Clears the 'rsaModulus' field, the 'has' method for this field will now return false */
+ public void clearRsaModulus() {
+ genClient.clear(CacheKey.rsaModulus);
+ }
+ /** Clears the 'rsaExponent' field, the 'has' method for this field will now return false */
+ public void clearRsaExponent() {
+ genClient.clear(CacheKey.rsaExponent);
+ }
+ /** Clears the 'numClearDigits' field, the 'has' method for this field will now return false */
+ public void clearNumClearDigits() {
+ genClient.clear(CacheKey.numClearDigits);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public GetCardDataDetailsRequest copyChanges() {
+ GetCardDataDetailsRequest copy = new GetCardDataDetailsRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(GetCardDataDetailsRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new GetCardDataDetailsRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public GetCardDataDetailsRequest createFromParcel(android.os.Parcel in) {
+ GetCardDataDetailsRequest instance = new GetCardDataDetailsRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public GetCardDataDetailsRequest[] newArray(int size) {
+ return new GetCardDataDetailsRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return GetCardDataDetailsRequest.class;
+ }
+
+ @Override
+ public GetCardDataDetailsRequest create(org.json.JSONObject jsonObject) {
+ return new GetCardDataDetailsRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean KEYSLOT_IS_REQUIRED = false;
+ public static final boolean REQUESTEDTRACKS_IS_REQUIRED = false;
+ public static final boolean KEYTYPE_IS_REQUIRED = false;
+ public static final boolean ENCRYPTMODE_IS_REQUIRED = false;
+ public static final boolean ENCSESSIONKEY_IS_REQUIRED = false;
+ public static final boolean INITVECTOR_IS_REQUIRED = false;
+ public static final boolean RSAMODULUS_IS_REQUIRED = false;
+ public static final boolean RSAEXPONENT_IS_REQUIRED = false;
+ public static final boolean NUMCLEARDIGITS_IS_REQUIRED = false;
+ }
+
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataRequest.java
index 41f3b7ef20..4500067ab1 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataRequest.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardDataRequest.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -42,6 +42,8 @@
* {@link #getEmvTagList emvTagList}
* {@link #getCardEntryMode cardEntryMode}
* {@link #getTimeout timeout}
+ * {@link #getOpenLeftDigits openLeftDigits}
+ * {@link #getOpenRightDigits openRightDigits}
*
*/
@SuppressWarnings("all")
@@ -98,9 +100,13 @@ public java.lang.Long getTimeout() {
return genClient.cacheGet(CacheKey.timeout);
}
+ public java.lang.Integer getOpenLeftDigits() {
+ return genClient.cacheGet(CacheKey.openLeftDigits);
+ }
-
-
+ public java.lang.Integer getOpenRightDigits() {
+ return genClient.cacheGet(CacheKey.openRightDigits);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
config
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
@@ -126,7 +132,11 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
timeout
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
- ;
+ openLeftDigits
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ openRightDigits
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -263,6 +273,15 @@ public boolean isNotNullTimeout() {
return genClient.cacheValueIsNotNull(CacheKey.timeout);
}
+ /** Checks whether the 'openLeftDigits' field is set and is not null */
+ public boolean isNotNullOpenLeftDigits() {
+ return genClient.cacheValueIsNotNull(CacheKey.openLeftDigits);
+ }
+
+ /** Checks whether the 'openRightDigits' field is set and is not null */
+ public boolean isNotNullOpenRightDigits() {
+ return genClient.cacheValueIsNotNull(CacheKey.openRightDigits);
+ }
/** Checks whether the 'config' field has been set, however the value could be null */
@@ -325,6 +344,16 @@ public boolean hasTimeout() {
return genClient.cacheHasKey(CacheKey.timeout);
}
+ /** Checks whether the 'openLeftDigits' field has been set, however the value could be null */
+ public boolean hasOpenLeftDigits() {
+ return genClient.cacheHasKey(CacheKey.openLeftDigits);
+ }
+
+ /** Checks whether the 'openRightDigits' field has been set, however the value could be null */
+ public boolean hasOpenRightDigits() {
+ return genClient.cacheHasKey(CacheKey.openRightDigits);
+ }
+
/**
* Sets the field 'config'.
@@ -412,6 +441,19 @@ public GetCardDataRequest setTimeout(java.lang.Long timeout) {
return genClient.setOther(timeout, CacheKey.timeout);
}
+ /**
+ * Sets the field 'openLeftDigits'.
+ */
+ public GetCardDataRequest setOpenLeftDigits(java.lang.Integer openLeftDigits) {
+ return genClient.setOther(openLeftDigits, CacheKey.openLeftDigits);
+ }
+
+ /**
+ * Sets the field 'openRightDigits'.
+ */
+ public GetCardDataRequest setOpenRightDigits(java.lang.Integer openRightDigits) {
+ return genClient.setOther(openRightDigits, CacheKey.openRightDigits);
+ }
/** Clears the 'config' field, the 'has' method for this field will now return false */
public void clearConfig() {
@@ -461,6 +503,14 @@ public void clearCardEntryMode() {
public void clearTimeout() {
genClient.clear(CacheKey.timeout);
}
+ /** Clears the 'openLeftDigits' field, the 'has' method for this field will now return false */
+ public void clearOpenLeftDigits() {
+ genClient.clear(CacheKey.openLeftDigits);
+ }
+ /** Clears the 'openRightDigits' field, the 'has' method for this field will now return false */
+ public void clearOpenRightDigits() {
+ genClient.clear(CacheKey.openRightDigits);
+ }
/**
@@ -535,6 +585,8 @@ public interface Constraints {
public static final boolean EMVTAGLIST_IS_REQUIRED = false;
public static final boolean CARDENTRYMODE_IS_REQUIRED = false;
public static final boolean TIMEOUT_IS_REQUIRED = false;
+ public static final boolean OPENLEFTDIGITS_IS_REQUIRED = false;
+ public static final boolean OPENRIGHTDIGITS_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataRequest.java
new file mode 100644
index 0000000000..0f14e72258
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataRequest.java
@@ -0,0 +1,219 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getEmvTagList emvTagList}
+ *
+ */
+@SuppressWarnings("all")
+public class GetCardEmvDataRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.util.List getEmvTagList() {
+ return genClient.cacheGet(CacheKey.emvTagList);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ emvTagList
+ (com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public GetCardEmvDataRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected GetCardEmvDataRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public GetCardEmvDataRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public GetCardEmvDataRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public GetCardEmvDataRequest(GetCardEmvDataRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'emvTagList' field is set and is not null */
+ public boolean isNotNullEmvTagList() {
+ return genClient.cacheValueIsNotNull(CacheKey.emvTagList);
+ }
+
+ /** Checks whether the 'emvTagList' field is set and is not null and is not empty */
+ public boolean isNotEmptyEmvTagList() { return isNotNullEmvTagList() && !getEmvTagList().isEmpty(); }
+
+
+
+ /** Checks whether the 'emvTagList' field has been set, however the value could be null */
+ public boolean hasEmvTagList() {
+ return genClient.cacheHasKey(CacheKey.emvTagList);
+ }
+
+
+ /**
+ * Sets the field 'emvTagList'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public GetCardEmvDataRequest setEmvTagList(java.util.List emvTagList) {
+ return genClient.setArrayOther(emvTagList, CacheKey.emvTagList);
+ }
+
+
+ /** Clears the 'emvTagList' field, the 'has' method for this field will now return false */
+ public void clearEmvTagList() {
+ genClient.clear(CacheKey.emvTagList);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public GetCardEmvDataRequest copyChanges() {
+ GetCardEmvDataRequest copy = new GetCardEmvDataRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(GetCardEmvDataRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new GetCardEmvDataRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public GetCardEmvDataRequest createFromParcel(android.os.Parcel in) {
+ GetCardEmvDataRequest instance = new GetCardEmvDataRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public GetCardEmvDataRequest[] newArray(int size) {
+ return new GetCardEmvDataRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return GetCardEmvDataRequest.class;
+ }
+
+ @Override
+ public GetCardEmvDataRequest create(org.json.JSONObject jsonObject) {
+ return new GetCardEmvDataRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean EMVTAGLIST_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataResponse.java
new file mode 100644
index 0000000000..07450f96a1
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetCardEmvDataResponse.java
@@ -0,0 +1,214 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getIccContainer iccContainer}
+ *
+ */
+@SuppressWarnings("all")
+public class GetCardEmvDataResponse extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getIccContainer() {
+ return genClient.cacheGet(CacheKey.iccContainer);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ iccContainer
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public GetCardEmvDataResponse() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected GetCardEmvDataResponse(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public GetCardEmvDataResponse(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public GetCardEmvDataResponse(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public GetCardEmvDataResponse(GetCardEmvDataResponse src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'iccContainer' field is set and is not null */
+ public boolean isNotNullIccContainer() {
+ return genClient.cacheValueIsNotNull(CacheKey.iccContainer);
+ }
+
+
+
+ /** Checks whether the 'iccContainer' field has been set, however the value could be null */
+ public boolean hasIccContainer() {
+ return genClient.cacheHasKey(CacheKey.iccContainer);
+ }
+
+
+ /**
+ * Sets the field 'iccContainer'.
+ */
+ public GetCardEmvDataResponse setIccContainer(java.lang.String iccContainer) {
+ return genClient.setOther(iccContainer, CacheKey.iccContainer);
+ }
+
+
+ /** Clears the 'iccContainer' field, the 'has' method for this field will now return false */
+ public void clearIccContainer() {
+ genClient.clear(CacheKey.iccContainer);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public GetCardEmvDataResponse copyChanges() {
+ GetCardEmvDataResponse copy = new GetCardEmvDataResponse();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(GetCardEmvDataResponse src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new GetCardEmvDataResponse(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public GetCardEmvDataResponse createFromParcel(android.os.Parcel in) {
+ GetCardEmvDataResponse instance = new GetCardEmvDataResponse(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public GetCardEmvDataResponse[] newArray(int size) {
+ return new GetCardEmvDataResponse[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return GetCardEmvDataResponse.class;
+ }
+
+ @Override
+ public GetCardEmvDataResponse create(org.json.JSONObject jsonObject) {
+ return new GetCardEmvDataResponse(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ICCCONTAINER_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetPinRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetPinRequest.java
new file mode 100644
index 0000000000..34bd1548ef
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/GetPinRequest.java
@@ -0,0 +1,387 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getKeySlot keySlot}
+ * - {@link #getKeyType keyType}
+ * - {@link #getPinBlockFormat pinBlockFormat}
+ * - {@link #getEncSessionKey encSessionKey}
+ * - {@link #getEncryptedPan encryptedPan}
+ * - {@link #getMaxPinLength maxPinLength}
+ * - {@link #getMinPinLength minPinLength}
+ *
+ */
+@SuppressWarnings("all")
+public class GetPinRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getKeySlot() {
+ return genClient.cacheGet(CacheKey.keySlot);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType getKeyType() {
+ return genClient.cacheGet(CacheKey.keyType);
+ }
+
+ public com.clover.sdk.v3.payment.raw.model.PinBlockFormat getPinBlockFormat() {
+ return genClient.cacheGet(CacheKey.pinBlockFormat);
+ }
+
+ public java.lang.String getEncSessionKey() {
+ return genClient.cacheGet(CacheKey.encSessionKey);
+ }
+
+ public java.lang.String getEncryptedPan() {
+ return genClient.cacheGet(CacheKey.encryptedPan);
+ }
+
+ public java.lang.Integer getMaxPinLength() {
+ return genClient.cacheGet(CacheKey.maxPinLength);
+ }
+
+ public java.lang.Integer getMinPinLength() {
+ return genClient.cacheGet(CacheKey.minPinLength);
+ }
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ keySlot
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ keyType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType.class)),
+ pinBlockFormat
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payment.raw.model.PinBlockFormat.class)),
+ encSessionKey
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ encryptedPan
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ maxPinLength
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ minPinLength
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public GetPinRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected GetPinRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public GetPinRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public GetPinRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public GetPinRequest(GetPinRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'keySlot' field is set and is not null */
+ public boolean isNotNullKeySlot() {
+ return genClient.cacheValueIsNotNull(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'keyType' field is set and is not null */
+ public boolean isNotNullKeyType() {
+ return genClient.cacheValueIsNotNull(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'pinBlockFormat' field is set and is not null */
+ public boolean isNotNullPinBlockFormat() {
+ return genClient.cacheValueIsNotNull(CacheKey.pinBlockFormat);
+ }
+
+ /** Checks whether the 'encSessionKey' field is set and is not null */
+ public boolean isNotNullEncSessionKey() {
+ return genClient.cacheValueIsNotNull(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'encryptedPan' field is set and is not null */
+ public boolean isNotNullEncryptedPan() {
+ return genClient.cacheValueIsNotNull(CacheKey.encryptedPan);
+ }
+
+ /** Checks whether the 'maxPinLength' field is set and is not null */
+ public boolean isNotNullMaxPinLength() {
+ return genClient.cacheValueIsNotNull(CacheKey.maxPinLength);
+ }
+
+ /** Checks whether the 'minPinLength' field is set and is not null */
+ public boolean isNotNullMinPinLength() {
+ return genClient.cacheValueIsNotNull(CacheKey.minPinLength);
+ }
+
+
+
+ /** Checks whether the 'keySlot' field has been set, however the value could be null */
+ public boolean hasKeySlot() {
+ return genClient.cacheHasKey(CacheKey.keySlot);
+ }
+
+ /** Checks whether the 'keyType' field has been set, however the value could be null */
+ public boolean hasKeyType() {
+ return genClient.cacheHasKey(CacheKey.keyType);
+ }
+
+ /** Checks whether the 'pinBlockFormat' field has been set, however the value could be null */
+ public boolean hasPinBlockFormat() {
+ return genClient.cacheHasKey(CacheKey.pinBlockFormat);
+ }
+
+ /** Checks whether the 'encSessionKey' field has been set, however the value could be null */
+ public boolean hasEncSessionKey() {
+ return genClient.cacheHasKey(CacheKey.encSessionKey);
+ }
+
+ /** Checks whether the 'encryptedPan' field has been set, however the value could be null */
+ public boolean hasEncryptedPan() {
+ return genClient.cacheHasKey(CacheKey.encryptedPan);
+ }
+
+ /** Checks whether the 'maxPinLength' field has been set, however the value could be null */
+ public boolean hasMaxPinLength() {
+ return genClient.cacheHasKey(CacheKey.maxPinLength);
+ }
+
+ /** Checks whether the 'minPinLength' field has been set, however the value could be null */
+ public boolean hasMinPinLength() {
+ return genClient.cacheHasKey(CacheKey.minPinLength);
+ }
+
+
+ /**
+ * Sets the field 'keySlot'.
+ */
+ public GetPinRequest setKeySlot(java.lang.String keySlot) {
+ return genClient.setOther(keySlot, CacheKey.keySlot);
+ }
+
+ /**
+ * Sets the field 'keyType'.
+ */
+ public GetPinRequest setKeyType(com.clover.sdk.v3.payment.raw.model.KeyStorageKeyType keyType) {
+ return genClient.setOther(keyType, CacheKey.keyType);
+ }
+
+ /**
+ * Sets the field 'pinBlockFormat'.
+ */
+ public GetPinRequest setPinBlockFormat(com.clover.sdk.v3.payment.raw.model.PinBlockFormat pinBlockFormat) {
+ return genClient.setOther(pinBlockFormat, CacheKey.pinBlockFormat);
+ }
+
+ /**
+ * Sets the field 'encSessionKey'.
+ */
+ public GetPinRequest setEncSessionKey(java.lang.String encSessionKey) {
+ return genClient.setOther(encSessionKey, CacheKey.encSessionKey);
+ }
+
+ /**
+ * Sets the field 'encryptedPan'.
+ */
+ public GetPinRequest setEncryptedPan(java.lang.String encryptedPan) {
+ return genClient.setOther(encryptedPan, CacheKey.encryptedPan);
+ }
+
+ /**
+ * Sets the field 'maxPinLength'.
+ */
+ public GetPinRequest setMaxPinLength(java.lang.Integer maxPinLength) {
+ return genClient.setOther(maxPinLength, CacheKey.maxPinLength);
+ }
+
+ /**
+ * Sets the field 'minPinLength'.
+ */
+ public GetPinRequest setMinPinLength(java.lang.Integer minPinLength) {
+ return genClient.setOther(minPinLength, CacheKey.minPinLength);
+ }
+
+
+ /** Clears the 'keySlot' field, the 'has' method for this field will now return false */
+ public void clearKeySlot() {
+ genClient.clear(CacheKey.keySlot);
+ }
+ /** Clears the 'keyType' field, the 'has' method for this field will now return false */
+ public void clearKeyType() {
+ genClient.clear(CacheKey.keyType);
+ }
+ /** Clears the 'pinBlockFormat' field, the 'has' method for this field will now return false */
+ public void clearPinBlockFormat() {
+ genClient.clear(CacheKey.pinBlockFormat);
+ }
+ /** Clears the 'encSessionKey' field, the 'has' method for this field will now return false */
+ public void clearEncSessionKey() {
+ genClient.clear(CacheKey.encSessionKey);
+ }
+ /** Clears the 'encryptedPan' field, the 'has' method for this field will now return false */
+ public void clearEncryptedPan() {
+ genClient.clear(CacheKey.encryptedPan);
+ }
+ /** Clears the 'maxPinLength' field, the 'has' method for this field will now return false */
+ public void clearMaxPinLength() {
+ genClient.clear(CacheKey.maxPinLength);
+ }
+ /** Clears the 'minPinLength' field, the 'has' method for this field will now return false */
+ public void clearMinPinLength() {
+ genClient.clear(CacheKey.minPinLength);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public GetPinRequest copyChanges() {
+ GetPinRequest copy = new GetPinRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(GetPinRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new GetPinRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public GetPinRequest createFromParcel(android.os.Parcel in) {
+ GetPinRequest instance = new GetPinRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public GetPinRequest[] newArray(int size) {
+ return new GetPinRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return GetPinRequest.class;
+ }
+
+ @Override
+ public GetPinRequest create(org.json.JSONObject jsonObject) {
+ return new GetPinRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean KEYSLOT_IS_REQUIRED = false;
+ public static final boolean KEYTYPE_IS_REQUIRED = false;
+ public static final boolean PINBLOCKFORMAT_IS_REQUIRED = false;
+ public static final boolean ENCSESSIONKEY_IS_REQUIRED = false;
+ public static final boolean ENCRYPTEDPAN_IS_REQUIRED = false;
+ public static final boolean MAXPINLENGTH_IS_REQUIRED = false;
+ public static final boolean MINPINLENGTH_IS_REQUIRED = false;
+ }
+
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/KeyStorageKeyType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/KeyStorageKeyType.java
new file mode 100644
index 0000000000..3d6419a97a
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/KeyStorageKeyType.java
@@ -0,0 +1,76 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+import android.os.Parcelable;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum KeyStorageKeyType implements Parcelable {
+ DUKPT_3DES((byte) 0x00),
+ MK_WK_3DES((byte) 0x01),
+ DUKPT_AES((byte) 0x02),
+ MK_WK_AES((byte) 0x03),
+ RANDOM_RSA((byte) 0x04);
+
+ private final byte code;
+
+ KeyStorageKeyType(byte code) {
+ this.code = code;
+ }
+
+ public byte getCode() {
+ return code;
+ }
+
+ // Parcelable implementation
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(android.os.Parcel dest, int flags) {
+ dest.writeInt(code);
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public KeyStorageKeyType createFromParcel(android.os.Parcel in) {
+ byte code = (byte) in.readInt();
+ for (KeyStorageKeyType type : KeyStorageKeyType.values()) {
+ if (type.getCode() == code) return type;
+ }
+ return null; // or throw exception
+ }
+
+ @Override
+ public KeyStorageKeyType[] newArray(int size) {
+ return new KeyStorageKeyType[size];
+ }
+ };
+}
+
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/PinBlockFormat.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/PinBlockFormat.java
new file mode 100644
index 0000000000..d3f9f90606
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/raw/model/PinBlockFormat.java
@@ -0,0 +1,75 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payment.raw.model;
+
+import android.os.Parcelable;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum PinBlockFormat implements Parcelable {
+ ISO_0((byte)0x00),
+ ISO_1((byte)0x01),
+ ISO_2((byte)0x02),
+ ISO_3((byte)0x03),
+ ISO_4((byte)0x04);
+
+ private final byte code;
+
+ PinBlockFormat(byte code) {
+ this.code = code;
+ }
+
+ public byte getCode() {
+ return code;
+ }
+
+ // Parcelable implementation
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(android.os.Parcel dest, int flags) {
+ dest.writeInt(code);
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public PinBlockFormat createFromParcel(android.os.Parcel in) {
+ byte code = (byte) in.readInt();
+ for (PinBlockFormat format : PinBlockFormat.values()) {
+ if (format.getCode() == code) return format;
+ }
+ return null; // or throw exception
+ }
+
+ @Override
+ public PinBlockFormat[] newArray(int size) {
+ return new PinBlockFormat[size];
+ }
+ };
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardlessPaymentNetwork.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardlessPaymentNetwork.java
index 0271b56f71..86dacd38fd 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardlessPaymentNetwork.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardlessPaymentNetwork.java
@@ -31,7 +31,7 @@
*/
@SuppressWarnings("all")
public enum CardlessPaymentNetwork implements Parcelable {
- ALIPAY, WECHAT, PAYPAL, VENMO, UPI, BHARAT_QR, AMAZON_PAY, ICICI_FASTAG, MOBIKWIK, CARDLESS_EMI, PAYMENT_LINK, STATIC_QR, PAYNOW;
+ ALIPAY, WECHAT, PAYPAL, VENMO, UPI, BHARAT_QR, AMAZON_PAY, ICICI_FASTAG, MOBIKWIK, CARDLESS_EMI, PAYMENT_LINK, STATIC_QR, PAYNOW, KLARNA;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/FeatureMetrics.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/FeatureMetrics.java
index 54b980ab03..cb25844478 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/FeatureMetrics.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/FeatureMetrics.java
@@ -31,54 +31,54 @@
*
*
Fields
*
- * - {@link #getAccessibilityMode accessibilityMode}
- * - {@link #getAccessibilityOptionPin accessibilityOptionPin}
- * - {@link #getAccessibilityOptionTactile accessibilityOptionTactile}
- * - {@link #getAccessibilityOptionTraining accessibilityOptionTraining}
+ * - {@link #getAudioAccessibilityMode audioAccessibilityMode}
+ * - {@link #getAudioAccessibilityOptionPin audioAccessibilityOptionPin}
+ * - {@link #getAudioAccessibilityOptionTactile audioAccessibilityOptionTactile}
+ * - {@link #getAudioAccessibilityOptionTraining audioAccessibilityOptionTraining}
*
*/
@SuppressWarnings("all")
public class FeatureMetrics extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
/**
- * Set to true if audio accessibility mode was selected by the user to perform a transaction.
+ * Set to true if Accessibility Mode was selected by the user to perform a transaction.
*/
public java.lang.Boolean getAudioAccessibilityMode() {
- return genClient.cacheGet(CacheKey.accessibilityMode);
+ return genClient.cacheGet(CacheKey.audioAccessibilityMode);
}
/**
- * Set to true if Accessibility Option "Enter PIN on screen" was selected by the user to perform a transaction.
+ * Set to true if Accessibility Option 'PIN' was selected by the user to perform a transaction.
*/
public java.lang.Boolean getAudioAccessibilityOptionPin() {
- return genClient.cacheGet(CacheKey.accessibilityOptionPin);
+ return genClient.cacheGet(CacheKey.audioAccessibilityOptionPin);
}
/**
- * Set to true if Accessibility Option "Request a tactile overlay" was selected by the user to perform a transaction.
+ * Set to true if Accessibility Option 'TACTILE' was selected by the user to perform a transaction.
*/
public java.lang.Boolean getAudioAccessibilityOptionTactile() {
- return genClient.cacheGet(CacheKey.accessibilityOptionTactile);
+ return genClient.cacheGet(CacheKey.audioAccessibilityOptionTactile);
}
/**
- * Set to true if Accessibility Option "Practice PIN on screen" was selected by the user before performing a transaction.
+ * Set to true if Accessibility Option 'TRAINING' was selected by the user before performing a transaction.
*/
public java.lang.Boolean getAudioAccessibilityOptionTraining() {
- return genClient.cacheGet(CacheKey.accessibilityOptionTraining);
+ return genClient.cacheGet(CacheKey.audioAccessibilityOptionTraining);
}
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
- accessibilityMode
+ audioAccessibilityMode
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
- accessibilityOptionPin
+ audioAccessibilityOptionPin
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
- accessibilityOptionTactile
+ audioAccessibilityOptionTactile
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
- accessibilityOptionTraining
+ audioAccessibilityOptionTraining
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
;
@@ -154,93 +154,93 @@ public org.json.JSONObject getJSONObject() {
public void validate() {
}
- /** Checks whether the 'accessibilityMode' field is set and is not null */
- public boolean isNotNullAccessibilityMode() {
- return genClient.cacheValueIsNotNull(CacheKey.accessibilityMode);
+ /** Checks whether the 'audioAccessibilityMode' field is set and is not null */
+ public boolean isNotNullAudioAccessibilityMode() {
+ return genClient.cacheValueIsNotNull(CacheKey.audioAccessibilityMode);
}
- /** Checks whether the 'accessibilityOptionPin' field is set and is not null */
- public boolean isNotNullAccessibilityOptionPin() {
- return genClient.cacheValueIsNotNull(CacheKey.accessibilityOptionPin);
+ /** Checks whether the 'audioAccessibilityOptionPin' field is set and is not null */
+ public boolean isNotNullAudioAccessibilityOptionPin() {
+ return genClient.cacheValueIsNotNull(CacheKey.audioAccessibilityOptionPin);
}
- /** Checks whether the 'accessibilityOptionTactile' field is set and is not null */
- public boolean isNotNullAccessibilityOptionTactile() {
- return genClient.cacheValueIsNotNull(CacheKey.accessibilityOptionTactile);
+ /** Checks whether the 'audioAccessibilityOptionTactile' field is set and is not null */
+ public boolean isNotNullAudioAccessibilityOptionTactile() {
+ return genClient.cacheValueIsNotNull(CacheKey.audioAccessibilityOptionTactile);
}
- /** Checks whether the 'accessibilityOptionTraining' field is set and is not null */
- public boolean isNotNullAccessibilityOptionTraining() {
- return genClient.cacheValueIsNotNull(CacheKey.accessibilityOptionTraining);
+ /** Checks whether the 'audioAccessibilityOptionTraining' field is set and is not null */
+ public boolean isNotNullAudioAccessibilityOptionTraining() {
+ return genClient.cacheValueIsNotNull(CacheKey.audioAccessibilityOptionTraining);
}
- /** Checks whether the 'accessibilityMode' field has been set, however the value could be null */
- public boolean hasAccessibilityMode() {
- return genClient.cacheHasKey(CacheKey.accessibilityMode);
+ /** Checks whether the 'audioAccessibilityMode' field has been set, however the value could be null */
+ public boolean hasAudioAccessibilityMode() {
+ return genClient.cacheHasKey(CacheKey.audioAccessibilityMode);
}
- /** Checks whether the 'accessibilityOptionPin' field has been set, however the value could be null */
- public boolean hasAccessibilityOptionPin() {
- return genClient.cacheHasKey(CacheKey.accessibilityOptionPin);
+ /** Checks whether the 'audioAccessibilityOptionPin' field has been set, however the value could be null */
+ public boolean hasAudioAccessibilityOptionPin() {
+ return genClient.cacheHasKey(CacheKey.audioAccessibilityOptionPin);
}
- /** Checks whether the 'accessibilityOptionTactile' field has been set, however the value could be null */
- public boolean hasAccessibilityOptionTactile() {
- return genClient.cacheHasKey(CacheKey.accessibilityOptionTactile);
+ /** Checks whether the 'audioAccessibilityOptionTactile' field has been set, however the value could be null */
+ public boolean hasAudioAccessibilityOptionTactile() {
+ return genClient.cacheHasKey(CacheKey.audioAccessibilityOptionTactile);
}
- /** Checks whether the 'accessibilityOptionTraining' field has been set, however the value could be null */
- public boolean hasAccessibilityOptionTraining() {
- return genClient.cacheHasKey(CacheKey.accessibilityOptionTraining);
+ /** Checks whether the 'audioAccessibilityOptionTraining' field has been set, however the value could be null */
+ public boolean hasAudioAccessibilityOptionTraining() {
+ return genClient.cacheHasKey(CacheKey.audioAccessibilityOptionTraining);
}
/**
- * Sets the field 'accessibilityMode'.
+ * Sets the field 'audioAccessibilityMode'.
*/
- public FeatureMetrics setAccessibilityMode(java.lang.Boolean accessibilityMode) {
- return genClient.setOther(accessibilityMode, CacheKey.accessibilityMode);
+ public FeatureMetrics setAudioAccessibilityMode(java.lang.Boolean audioAccessibilityMode) {
+ return genClient.setOther(audioAccessibilityMode, CacheKey.audioAccessibilityMode);
}
/**
- * Sets the field 'accessibilityOptionPin'.
+ * Sets the field 'audioAccessibilityOptionPin'.
*/
- public FeatureMetrics setAccessibilityOptionPin(java.lang.Boolean accessibilityOptionPin) {
- return genClient.setOther(accessibilityOptionPin, CacheKey.accessibilityOptionPin);
+ public FeatureMetrics setAudioAccessibilityOptionPin(java.lang.Boolean audioAccessibilityOptionPin) {
+ return genClient.setOther(audioAccessibilityOptionPin, CacheKey.audioAccessibilityOptionPin);
}
/**
- * Sets the field 'accessibilityOptionTactile'.
+ * Sets the field 'audioAccessibilityOptionTactile'.
*/
- public FeatureMetrics setAccessibilityOptionTactile(java.lang.Boolean accessibilityOptionTactile) {
- return genClient.setOther(accessibilityOptionTactile, CacheKey.accessibilityOptionTactile);
+ public FeatureMetrics setAudioAccessibilityOptionTactile(java.lang.Boolean audioAccessibilityOptionTactile) {
+ return genClient.setOther(audioAccessibilityOptionTactile, CacheKey.audioAccessibilityOptionTactile);
}
/**
- * Sets the field 'accessibilityOptionTraining'.
+ * Sets the field 'audioAccessibilityOptionTraining'.
*/
- public FeatureMetrics setAccessibilityOptionTraining(java.lang.Boolean accessibilityOptionTraining) {
- return genClient.setOther(accessibilityOptionTraining, CacheKey.accessibilityOptionTraining);
+ public FeatureMetrics setAudioAccessibilityOptionTraining(java.lang.Boolean audioAccessibilityOptionTraining) {
+ return genClient.setOther(audioAccessibilityOptionTraining, CacheKey.audioAccessibilityOptionTraining);
}
- /** Clears the 'accessibilityMode' field, the 'has' method for this field will now return false */
- public void clearAccessibilityMode() {
- genClient.clear(CacheKey.accessibilityMode);
+ /** Clears the 'audioAccessibilityMode' field, the 'has' method for this field will now return false */
+ public void clearAudioAccessibilityMode() {
+ genClient.clear(CacheKey.audioAccessibilityMode);
}
- /** Clears the 'accessibilityOptionPin' field, the 'has' method for this field will now return false */
- public void clearAccessibilityOptionPin() {
- genClient.clear(CacheKey.accessibilityOptionPin);
+ /** Clears the 'audioAccessibilityOptionPin' field, the 'has' method for this field will now return false */
+ public void clearAudioAccessibilityOptionPin() {
+ genClient.clear(CacheKey.audioAccessibilityOptionPin);
}
- /** Clears the 'accessibilityOptionTactile' field, the 'has' method for this field will now return false */
- public void clearAccessibilityOptionTactile() {
- genClient.clear(CacheKey.accessibilityOptionTactile);
+ /** Clears the 'audioAccessibilityOptionTactile' field, the 'has' method for this field will now return false */
+ public void clearAudioAccessibilityOptionTactile() {
+ genClient.clear(CacheKey.audioAccessibilityOptionTactile);
}
- /** Clears the 'accessibilityOptionTraining' field, the 'has' method for this field will now return false */
- public void clearAccessibilityOptionTraining() {
- genClient.clear(CacheKey.accessibilityOptionTraining);
+ /** Clears the 'audioAccessibilityOptionTraining' field, the 'has' method for this field will now return false */
+ public void clearAudioAccessibilityOptionTraining() {
+ genClient.clear(CacheKey.audioAccessibilityOptionTraining);
}
@@ -304,10 +304,10 @@ public FeatureMetrics create(org.json.JSONObject jsonObject) {
};
public interface Constraints {
- public static final boolean ACCESSIBILITYMODE_IS_REQUIRED = false;
- public static final boolean ACCESSIBILITYOPTIONPIN_IS_REQUIRED = false;
- public static final boolean ACCESSIBILITYOPTIONTACTILE_IS_REQUIRED = false;
- public static final boolean ACCESSIBILITYOPTIONTRAINING_IS_REQUIRED = false;
+ public static final boolean AUDIOACCESSIBILITYMODE_IS_REQUIRED = false;
+ public static final boolean AUDIOACCESSIBILITYOPTIONPIN_IS_REQUIRED = false;
+ public static final boolean AUDIOACCESSIBILITYOPTIONTACTILE_IS_REQUIRED = false;
+ public static final boolean AUDIOACCESSIBILITYOPTIONTRAINING_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/InitTransactionResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/InitTransactionResponse.java
new file mode 100644
index 0000000000..a6877765f9
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/InitTransactionResponse.java
@@ -0,0 +1,372 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payments;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Response returned after initializing a transaction with the payment gateway
+ *
+ *
Fields
+ *
+ * - {@link #getTransactionId transactionId}
+ * - {@link #getTerminalRiskInfo terminalRiskInfo}
+ * - {@link #getTerminalId terminalId}
+ * - {@link #getStatus status}
+ * - {@link #getClientData clientData}
+ * - {@link #getErrorCode errorCode}
+ *
+ */
+@SuppressWarnings("all")
+public class InitTransactionResponse extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getTransactionId() {
+ return genClient.cacheGet(CacheKey.transactionId);
+ }
+
+ public com.clover.sdk.v3.payments.TerminalRiskInfo getTerminalRiskInfo() {
+ return genClient.cacheGet(CacheKey.terminalRiskInfo);
+ }
+
+ public java.lang.String getTerminalId() {
+ return genClient.cacheGet(CacheKey.terminalId);
+ }
+
+ /**
+ * The status of the transaction on the server
+ */
+ public com.clover.sdk.v3.payments.TransactionStatus getStatus() {
+ return genClient.cacheGet(CacheKey.status);
+ }
+
+ /**
+ * Additional data sent back from the gateway
+ */
+ public java.util.Map getClientData() {
+ return genClient.cacheGet(CacheKey.clientData);
+ }
+
+ public java.lang.String getErrorCode() {
+ return genClient.cacheGet(CacheKey.errorCode);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ transactionId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ terminalRiskInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.TerminalRiskInfo.JSON_CREATOR)),
+ terminalId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ status
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.TransactionStatus.class)),
+ clientData
+ (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
+ errorCode
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public InitTransactionResponse() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected InitTransactionResponse(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public InitTransactionResponse(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public InitTransactionResponse(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public InitTransactionResponse(InitTransactionResponse src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'transactionId' field is set and is not null */
+ public boolean isNotNullTransactionId() {
+ return genClient.cacheValueIsNotNull(CacheKey.transactionId);
+ }
+
+ /** Checks whether the 'terminalRiskInfo' field is set and is not null */
+ public boolean isNotNullTerminalRiskInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.terminalRiskInfo);
+ }
+
+ /** Checks whether the 'terminalId' field is set and is not null */
+ public boolean isNotNullTerminalId() {
+ return genClient.cacheValueIsNotNull(CacheKey.terminalId);
+ }
+
+ /** Checks whether the 'status' field is set and is not null */
+ public boolean isNotNullStatus() {
+ return genClient.cacheValueIsNotNull(CacheKey.status);
+ }
+
+ /** Checks whether the 'clientData' field is set and is not null */
+ public boolean isNotNullClientData() {
+ return genClient.cacheValueIsNotNull(CacheKey.clientData);
+ }
+
+ /** Checks whether the 'clientData' field is set and is not null and is not empty */
+ public boolean isNotEmptyClientData() { return isNotNullClientData() && !getClientData().isEmpty(); }
+
+ /** Checks whether the 'errorCode' field is set and is not null */
+ public boolean isNotNullErrorCode() {
+ return genClient.cacheValueIsNotNull(CacheKey.errorCode);
+ }
+
+
+
+ /** Checks whether the 'transactionId' field has been set, however the value could be null */
+ public boolean hasTransactionId() {
+ return genClient.cacheHasKey(CacheKey.transactionId);
+ }
+
+ /** Checks whether the 'terminalRiskInfo' field has been set, however the value could be null */
+ public boolean hasTerminalRiskInfo() {
+ return genClient.cacheHasKey(CacheKey.terminalRiskInfo);
+ }
+
+ /** Checks whether the 'terminalId' field has been set, however the value could be null */
+ public boolean hasTerminalId() {
+ return genClient.cacheHasKey(CacheKey.terminalId);
+ }
+
+ /** Checks whether the 'status' field has been set, however the value could be null */
+ public boolean hasStatus() {
+ return genClient.cacheHasKey(CacheKey.status);
+ }
+
+ /** Checks whether the 'clientData' field has been set, however the value could be null */
+ public boolean hasClientData() {
+ return genClient.cacheHasKey(CacheKey.clientData);
+ }
+
+ /** Checks whether the 'errorCode' field has been set, however the value could be null */
+ public boolean hasErrorCode() {
+ return genClient.cacheHasKey(CacheKey.errorCode);
+ }
+
+
+ /**
+ * Sets the field 'transactionId'.
+ */
+ public InitTransactionResponse setTransactionId(java.lang.String transactionId) {
+ return genClient.setOther(transactionId, CacheKey.transactionId);
+ }
+
+ /**
+ * Sets the field 'terminalRiskInfo'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public InitTransactionResponse setTerminalRiskInfo(com.clover.sdk.v3.payments.TerminalRiskInfo terminalRiskInfo) {
+ return genClient.setRecord(terminalRiskInfo, CacheKey.terminalRiskInfo);
+ }
+
+ /**
+ * Sets the field 'terminalId'.
+ */
+ public InitTransactionResponse setTerminalId(java.lang.String terminalId) {
+ return genClient.setOther(terminalId, CacheKey.terminalId);
+ }
+
+ /**
+ * Sets the field 'status'.
+ */
+ public InitTransactionResponse setStatus(com.clover.sdk.v3.payments.TransactionStatus status) {
+ return genClient.setOther(status, CacheKey.status);
+ }
+
+ /**
+ * Sets the field 'clientData'.
+ */
+ public InitTransactionResponse setClientData(java.util.Map clientData) {
+ return genClient.setOther(clientData, CacheKey.clientData);
+ }
+
+ /**
+ * Sets the field 'errorCode'.
+ */
+ public InitTransactionResponse setErrorCode(java.lang.String errorCode) {
+ return genClient.setOther(errorCode, CacheKey.errorCode);
+ }
+
+
+ /** Clears the 'transactionId' field, the 'has' method for this field will now return false */
+ public void clearTransactionId() {
+ genClient.clear(CacheKey.transactionId);
+ }
+ /** Clears the 'terminalRiskInfo' field, the 'has' method for this field will now return false */
+ public void clearTerminalRiskInfo() {
+ genClient.clear(CacheKey.terminalRiskInfo);
+ }
+ /** Clears the 'terminalId' field, the 'has' method for this field will now return false */
+ public void clearTerminalId() {
+ genClient.clear(CacheKey.terminalId);
+ }
+ /** Clears the 'status' field, the 'has' method for this field will now return false */
+ public void clearStatus() {
+ genClient.clear(CacheKey.status);
+ }
+ /** Clears the 'clientData' field, the 'has' method for this field will now return false */
+ public void clearClientData() {
+ genClient.clear(CacheKey.clientData);
+ }
+ /** Clears the 'errorCode' field, the 'has' method for this field will now return false */
+ public void clearErrorCode() {
+ genClient.clear(CacheKey.errorCode);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public InitTransactionResponse copyChanges() {
+ InitTransactionResponse copy = new InitTransactionResponse();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(InitTransactionResponse src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new InitTransactionResponse(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public InitTransactionResponse createFromParcel(android.os.Parcel in) {
+ InitTransactionResponse instance = new InitTransactionResponse(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public InitTransactionResponse[] newArray(int size) {
+ return new InitTransactionResponse[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return InitTransactionResponse.class;
+ }
+
+ @Override
+ public InitTransactionResponse create(org.json.JSONObject jsonObject) {
+ return new InitTransactionResponse(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean TRANSACTIONID_IS_REQUIRED = false;
+ public static final boolean TERMINALRISKINFO_IS_REQUIRED = false;
+ public static final boolean TERMINALID_IS_REQUIRED = false;
+ public static final boolean STATUS_IS_REQUIRED = false;
+ public static final boolean CLIENTDATA_IS_REQUIRED = false;
+ public static final boolean ERRORCODE_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/KlarnaGatewayInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/KlarnaGatewayInfo.java
new file mode 100644
index 0000000000..e48e60bef4
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/KlarnaGatewayInfo.java
@@ -0,0 +1,217 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payments;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getTransactionId transactionId}
+ *
+ */
+@SuppressWarnings("all")
+public class KlarnaGatewayInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Payment transaction id received from Klarna
+ */
+ public String getTransactionId() {
+ return genClient.cacheGet(CacheKey.transactionId);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ transactionId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public KlarnaGatewayInfo() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected KlarnaGatewayInfo(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public KlarnaGatewayInfo(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public KlarnaGatewayInfo(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public KlarnaGatewayInfo(KlarnaGatewayInfo src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'transactionId' field is set and is not null */
+ public boolean isNotNullTransactionId() {
+ return genClient.cacheValueIsNotNull(CacheKey.transactionId);
+ }
+
+
+
+ /** Checks whether the 'transactionId' field has been set, however the value could be null */
+ public boolean hasTransactionId() {
+ return genClient.cacheHasKey(CacheKey.transactionId);
+ }
+
+
+ /**
+ * Sets the field 'transactionId'.
+ */
+ public KlarnaGatewayInfo setTransactionId(String transactionId) {
+ return genClient.setOther(transactionId, CacheKey.transactionId);
+ }
+
+
+ /** Clears the 'transactionId' field, the 'has' method for this field will now return false */
+ public void clearTransactionId() {
+ genClient.clear(CacheKey.transactionId);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public KlarnaGatewayInfo copyChanges() {
+ KlarnaGatewayInfo copy = new KlarnaGatewayInfo();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(KlarnaGatewayInfo src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new KlarnaGatewayInfo(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public KlarnaGatewayInfo createFromParcel(android.os.Parcel in) {
+ KlarnaGatewayInfo instance = new KlarnaGatewayInfo(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public KlarnaGatewayInfo[] newArray(int size) {
+ return new KlarnaGatewayInfo[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return KlarnaGatewayInfo.class;
+ }
+
+ @Override
+ public KlarnaGatewayInfo create(org.json.JSONObject jsonObject) {
+ return new KlarnaGatewayInfo(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean TRANSACTIONID_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Payment.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Payment.java
index bc932aee21..be48b0f1c6 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Payment.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Payment.java
@@ -73,6 +73,7 @@
* {@link #getPurchaseCardL2 purchaseCardL2}
* {@link #getPurchaseCardL3 purchaseCardL3}
* {@link #getOceanGatewayInfo oceanGatewayInfo}
+ * {@link #getKlarnaGatewayInfo klarnaGatewayInfo}
* {@link #getTerminalManagementComponents terminalManagementComponents}
* {@link #getEmiInfo emiInfo}
* {@link #getInstallmentPlan installmentPlan}
@@ -342,6 +343,13 @@ public com.clover.sdk.v3.payments.OceanGatewayInfo getOceanGatewayInfo() {
return genClient.cacheGet(CacheKey.oceanGatewayInfo);
}
+ /**
+ * Klarna Gateway info
+ */
+ public com.clover.sdk.v3.payments.KlarnaGatewayInfo getKlarnaGatewayInfo() {
+ return genClient.cacheGet(CacheKey.klarnaGatewayInfo);
+ }
+
/**
* Terminal management components as defined by Nexo. They contain general information on the terminal, the installed payment app, etc.
*/
@@ -469,6 +477,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.PurchaseCardL3.JSON_CREATOR)),
oceanGatewayInfo
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.OceanGatewayInfo.JSON_CREATOR)),
+ klarnaGatewayInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.KlarnaGatewayInfo.JSON_CREATOR)),
terminalManagementComponents
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.TerminalManagementComponent.JSON_CREATOR)),
emiInfo
@@ -793,6 +803,11 @@ public boolean isNotNullOceanGatewayInfo() {
return genClient.cacheValueIsNotNull(CacheKey.oceanGatewayInfo);
}
+ /** Checks whether the 'klarnaGatewayInfo' field is set and is not null */
+ public boolean isNotNullKlarnaGatewayInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.klarnaGatewayInfo);
+ }
+
/** Checks whether the 'terminalManagementComponents' field is set and is not null */
public boolean isNotNullTerminalManagementComponents() {
return genClient.cacheValueIsNotNull(CacheKey.terminalManagementComponents);
@@ -1038,6 +1053,11 @@ public boolean hasOceanGatewayInfo() {
return genClient.cacheHasKey(CacheKey.oceanGatewayInfo);
}
+ /** Checks whether the 'klarnaGatewayInfo' field has been set, however the value could be null */
+ public boolean hasKlarnaGatewayInfo() {
+ return genClient.cacheHasKey(CacheKey.klarnaGatewayInfo);
+ }
+
/** Checks whether the 'terminalManagementComponents' field has been set, however the value could be null */
public boolean hasTerminalManagementComponents() {
return genClient.cacheHasKey(CacheKey.terminalManagementComponents);
@@ -1413,6 +1433,15 @@ public Payment setOceanGatewayInfo(com.clover.sdk.v3.payments.OceanGatewayInfo o
return genClient.setRecord(oceanGatewayInfo, CacheKey.oceanGatewayInfo);
}
+ /**
+ * Sets the field 'klarnaGatewayInfo'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public Payment setKlarnaGatewayInfo(com.clover.sdk.v3.payments.KlarnaGatewayInfo klarnaGatewayInfo) {
+ return genClient.setRecord(klarnaGatewayInfo, CacheKey.klarnaGatewayInfo);
+ }
+
/**
* Sets the field 'terminalManagementComponents'.
*
@@ -1634,6 +1663,10 @@ public void clearPurchaseCardL3() {
public void clearOceanGatewayInfo() {
genClient.clear(CacheKey.oceanGatewayInfo);
}
+ /** Clears the 'klarnaGatewayInfo' field, the 'has' method for this field will now return false */
+ public void clearKlarnaGatewayInfo() {
+ genClient.clear(CacheKey.klarnaGatewayInfo);
+ }
/** Clears the 'terminalManagementComponents' field, the 'has' method for this field will now return false */
public void clearTerminalManagementComponents() {
genClient.clear(CacheKey.terminalManagementComponents);
@@ -1765,6 +1798,7 @@ public interface Constraints {
public static final boolean PURCHASECARDL2_IS_REQUIRED = false;
public static final boolean PURCHASECARDL3_IS_REQUIRED = false;
public static final boolean OCEANGATEWAYINFO_IS_REQUIRED = false;
+ public static final boolean KLARNAGATEWAYINFO_IS_REQUIRED = false;
public static final boolean TERMINALMANAGEMENTCOMPONENTS_IS_REQUIRED = false;
public static final boolean EMIINFO_IS_REQUIRED = false;
public static final boolean INSTALLMENTPLAN_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RTDConstraints.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RTDConstraints.java
index 24a4a667ec..4902ef981e 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RTDConstraints.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RTDConstraints.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -34,6 +34,7 @@
* {@link #getCardType cardType}
* {@link #getBinLow binLow}
* {@link #getBinHigh binHigh}
+ * {@link #getWallet wallet}
*
*/
@SuppressWarnings("all")
@@ -60,17 +61,26 @@ public String getBinHigh() {
return genClient.cacheGet(CacheKey.binHigh);
}
+ /**
+ * The name for a payment wallet
+ */
+ public String getWallet() {
+ return genClient.cacheGet(CacheKey.wallet);
+ }
+
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
cardType
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
binLow
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
binHigh
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
- ;
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ wallet
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -159,6 +169,11 @@ public boolean isNotNullBinHigh() {
return genClient.cacheValueIsNotNull(CacheKey.binHigh);
}
+ /** Checks whether the 'wallet' field is set and is not null */
+ public boolean isNotNullWallet() {
+ return genClient.cacheValueIsNotNull(CacheKey.wallet);
+ }
+
/** Checks whether the 'cardType' field has been set, however the value could be null */
@@ -176,6 +191,11 @@ public boolean hasBinHigh() {
return genClient.cacheHasKey(CacheKey.binHigh);
}
+ /** Checks whether the 'wallet' field has been set, however the value could be null */
+ public boolean hasWallet() {
+ return genClient.cacheHasKey(CacheKey.wallet);
+ }
+
/**
* Sets the field 'cardType'.
@@ -198,6 +218,13 @@ public RTDConstraints setBinHigh(String binHigh) {
return genClient.setOther(binHigh, CacheKey.binHigh);
}
+ /**
+ * Sets the field 'wallet'.
+ */
+ public RTDConstraints setWallet(String wallet) {
+ return genClient.setOther(wallet, CacheKey.wallet);
+ }
+
/** Clears the 'cardType' field, the 'has' method for this field will now return false */
public void clearCardType() {
@@ -211,6 +238,10 @@ public void clearBinLow() {
public void clearBinHigh() {
genClient.clear(CacheKey.binHigh);
}
+ /** Clears the 'wallet' field, the 'has' method for this field will now return false */
+ public void clearWallet() {
+ genClient.clear(CacheKey.wallet);
+ }
/**
@@ -276,6 +307,7 @@ public interface Constraints {
public static final boolean CARDTYPE_IS_REQUIRED = false;
public static final boolean BINLOW_IS_REQUIRED = false;
public static final boolean BINHIGH_IS_REQUIRED = false;
+ public static final boolean WALLET_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RefundRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RefundRequest.java
index 266db1adf3..73859c627d 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RefundRequest.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/RefundRequest.java
@@ -22,6 +22,7 @@
package com.clover.sdk.v3.payments;
+
import com.clover.sdk.GenericClient;
import com.clover.sdk.GenericParcelable;
@@ -31,6 +32,7 @@
* Fields
*
* - {@link #getRefund refund}
+ * - {@link #getExternalPaymentId externalPaymentId}
* - {@link #getCard card}
* - {@link #getIsAdjustment isAdjustment}
*
@@ -42,6 +44,13 @@ public com.clover.sdk.v3.payments.Refund getRefund() {
return genClient.cacheGet(CacheKey.refund);
}
+ /**
+ * External payment ID when using custom tender
+ */
+ public java.lang.String getExternalPaymentId() {
+ return genClient.cacheGet(CacheKey.externalPaymentId);
+ }
+
public com.clover.sdk.v3.pay.PaymentRequestCardDetails getCard() {
return genClient.cacheGet(CacheKey.card);
}
@@ -56,6 +65,8 @@ public java.lang.Boolean getIsAdjustment() {
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
refund
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.Refund.JSON_CREATOR)),
+ externalPaymentId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
card
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.pay.PaymentRequestCardDetails.JSON_CREATOR)),
isAdjustment
@@ -139,6 +150,11 @@ public boolean isNotNullRefund() {
return genClient.cacheValueIsNotNull(CacheKey.refund);
}
+ /** Checks whether the 'externalPaymentId' field is set and is not null */
+ public boolean isNotNullExternalPaymentId() {
+ return genClient.cacheValueIsNotNull(CacheKey.externalPaymentId);
+ }
+
/** Checks whether the 'card' field is set and is not null */
public boolean isNotNullCard() {
return genClient.cacheValueIsNotNull(CacheKey.card);
@@ -156,6 +172,11 @@ public boolean hasRefund() {
return genClient.cacheHasKey(CacheKey.refund);
}
+ /** Checks whether the 'externalPaymentId' field has been set, however the value could be null */
+ public boolean hasExternalPaymentId() {
+ return genClient.cacheHasKey(CacheKey.externalPaymentId);
+ }
+
/** Checks whether the 'card' field has been set, however the value could be null */
public boolean hasCard() {
return genClient.cacheHasKey(CacheKey.card);
@@ -176,6 +197,13 @@ public RefundRequest setRefund(com.clover.sdk.v3.payments.Refund refund) {
return genClient.setRecord(refund, CacheKey.refund);
}
+ /**
+ * Sets the field 'externalPaymentId'.
+ */
+ public RefundRequest setExternalPaymentId(java.lang.String externalPaymentId) {
+ return genClient.setOther(externalPaymentId, CacheKey.externalPaymentId);
+ }
+
/**
* Sets the field 'card'.
*
@@ -197,6 +225,10 @@ public RefundRequest setIsAdjustment(java.lang.Boolean isAdjustment) {
public void clearRefund() {
genClient.clear(CacheKey.refund);
}
+ /** Clears the 'externalPaymentId' field, the 'has' method for this field will now return false */
+ public void clearExternalPaymentId() {
+ genClient.clear(CacheKey.externalPaymentId);
+ }
/** Clears the 'card' field, the 'has' method for this field will now return false */
public void clearCard() {
genClient.clear(CacheKey.card);
@@ -268,6 +300,7 @@ public RefundRequest create(org.json.JSONObject jsonObject) {
public interface Constraints {
public static final boolean REFUND_IS_REQUIRED = false;
+ public static final boolean EXTERNALPAYMENTID_IS_REQUIRED = false;
public static final boolean CARD_IS_REQUIRED = false;
public static final boolean ISADJUSTMENT_IS_REQUIRED = false;
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TerminalRiskInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TerminalRiskInfo.java
new file mode 100644
index 0000000000..54d10abd89
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TerminalRiskInfo.java
@@ -0,0 +1,448 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payments;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Response returned after initializing a transaction with the payment gateway for terminal risk info
+ *
+ *
Fields
+ *
+ * - {@link #getCardType cardType}
+ * - {@link #getPaymentCode paymentCode}
+ * - {@link #getFloorLimit floorLimit}
+ * - {@link #getRandomSelectionTargetPercentage randomSelectionTargetPercentage}
+ * - {@link #getRandomSelectionMaxTargetPercentage randomSelectionMaxTargetPercentage}
+ * - {@link #getRandomSelectionThresholdValue randomSelectionThresholdValue}
+ * - {@link #getTacDefault tacDefault}
+ * - {@link #getTacDenial tacDenial}
+ * - {@link #getTacOnline tacOnline}
+ *
+ */
+@SuppressWarnings("all")
+public class TerminalRiskInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public com.clover.sdk.v3.payments.CardType getCardType() {
+ return genClient.cacheGet(CacheKey.cardType);
+ }
+
+ public java.lang.String getPaymentCode() {
+ return genClient.cacheGet(CacheKey.paymentCode);
+ }
+
+ public java.lang.Long getFloorLimit() {
+ return genClient.cacheGet(CacheKey.floorLimit);
+ }
+
+ public java.lang.Integer getRandomSelectionTargetPercentage() {
+ return genClient.cacheGet(CacheKey.randomSelectionTargetPercentage);
+ }
+
+ public java.lang.Integer getRandomSelectionMaxTargetPercentage() {
+ return genClient.cacheGet(CacheKey.randomSelectionMaxTargetPercentage);
+ }
+
+ public java.lang.Integer getRandomSelectionThresholdValue() {
+ return genClient.cacheGet(CacheKey.randomSelectionThresholdValue);
+ }
+
+ public java.lang.String getTacDefault() {
+ return genClient.cacheGet(CacheKey.tacDefault);
+ }
+
+ public java.lang.String getTacDenial() {
+ return genClient.cacheGet(CacheKey.tacDenial);
+ }
+
+ public java.lang.String getTacOnline() {
+ return genClient.cacheGet(CacheKey.tacOnline);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ cardType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.CardType.class)),
+ paymentCode
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ floorLimit
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ randomSelectionTargetPercentage
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ randomSelectionMaxTargetPercentage
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ randomSelectionThresholdValue
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ tacDefault
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ tacDenial
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ tacOnline
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public TerminalRiskInfo() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected TerminalRiskInfo(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public TerminalRiskInfo(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public TerminalRiskInfo(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public TerminalRiskInfo(TerminalRiskInfo src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'cardType' field is set and is not null */
+ public boolean isNotNullCardType() {
+ return genClient.cacheValueIsNotNull(CacheKey.cardType);
+ }
+
+ /** Checks whether the 'paymentCode' field is set and is not null */
+ public boolean isNotNullPaymentCode() {
+ return genClient.cacheValueIsNotNull(CacheKey.paymentCode);
+ }
+
+ /** Checks whether the 'floorLimit' field is set and is not null */
+ public boolean isNotNullFloorLimit() {
+ return genClient.cacheValueIsNotNull(CacheKey.floorLimit);
+ }
+
+ /** Checks whether the 'randomSelectionTargetPercentage' field is set and is not null */
+ public boolean isNotNullRandomSelectionTargetPercentage() {
+ return genClient.cacheValueIsNotNull(CacheKey.randomSelectionTargetPercentage);
+ }
+
+ /** Checks whether the 'randomSelectionMaxTargetPercentage' field is set and is not null */
+ public boolean isNotNullRandomSelectionMaxTargetPercentage() {
+ return genClient.cacheValueIsNotNull(CacheKey.randomSelectionMaxTargetPercentage);
+ }
+
+ /** Checks whether the 'randomSelectionThresholdValue' field is set and is not null */
+ public boolean isNotNullRandomSelectionThresholdValue() {
+ return genClient.cacheValueIsNotNull(CacheKey.randomSelectionThresholdValue);
+ }
+
+ /** Checks whether the 'tacDefault' field is set and is not null */
+ public boolean isNotNullTacDefault() {
+ return genClient.cacheValueIsNotNull(CacheKey.tacDefault);
+ }
+
+ /** Checks whether the 'tacDenial' field is set and is not null */
+ public boolean isNotNullTacDenial() {
+ return genClient.cacheValueIsNotNull(CacheKey.tacDenial);
+ }
+
+ /** Checks whether the 'tacOnline' field is set and is not null */
+ public boolean isNotNullTacOnline() {
+ return genClient.cacheValueIsNotNull(CacheKey.tacOnline);
+ }
+
+
+
+ /** Checks whether the 'cardType' field has been set, however the value could be null */
+ public boolean hasCardType() {
+ return genClient.cacheHasKey(CacheKey.cardType);
+ }
+
+ /** Checks whether the 'paymentCode' field has been set, however the value could be null */
+ public boolean hasPaymentCode() {
+ return genClient.cacheHasKey(CacheKey.paymentCode);
+ }
+
+ /** Checks whether the 'floorLimit' field has been set, however the value could be null */
+ public boolean hasFloorLimit() {
+ return genClient.cacheHasKey(CacheKey.floorLimit);
+ }
+
+ /** Checks whether the 'randomSelectionTargetPercentage' field has been set, however the value could be null */
+ public boolean hasRandomSelectionTargetPercentage() {
+ return genClient.cacheHasKey(CacheKey.randomSelectionTargetPercentage);
+ }
+
+ /** Checks whether the 'randomSelectionMaxTargetPercentage' field has been set, however the value could be null */
+ public boolean hasRandomSelectionMaxTargetPercentage() {
+ return genClient.cacheHasKey(CacheKey.randomSelectionMaxTargetPercentage);
+ }
+
+ /** Checks whether the 'randomSelectionThresholdValue' field has been set, however the value could be null */
+ public boolean hasRandomSelectionThresholdValue() {
+ return genClient.cacheHasKey(CacheKey.randomSelectionThresholdValue);
+ }
+
+ /** Checks whether the 'tacDefault' field has been set, however the value could be null */
+ public boolean hasTacDefault() {
+ return genClient.cacheHasKey(CacheKey.tacDefault);
+ }
+
+ /** Checks whether the 'tacDenial' field has been set, however the value could be null */
+ public boolean hasTacDenial() {
+ return genClient.cacheHasKey(CacheKey.tacDenial);
+ }
+
+ /** Checks whether the 'tacOnline' field has been set, however the value could be null */
+ public boolean hasTacOnline() {
+ return genClient.cacheHasKey(CacheKey.tacOnline);
+ }
+
+
+ /**
+ * Sets the field 'cardType'.
+ */
+ public TerminalRiskInfo setCardType(com.clover.sdk.v3.payments.CardType cardType) {
+ return genClient.setOther(cardType, CacheKey.cardType);
+ }
+
+ /**
+ * Sets the field 'paymentCode'.
+ */
+ public TerminalRiskInfo setPaymentCode(java.lang.String paymentCode) {
+ return genClient.setOther(paymentCode, CacheKey.paymentCode);
+ }
+
+ /**
+ * Sets the field 'floorLimit'.
+ */
+ public TerminalRiskInfo setFloorLimit(java.lang.Long floorLimit) {
+ return genClient.setOther(floorLimit, CacheKey.floorLimit);
+ }
+
+ /**
+ * Sets the field 'randomSelectionTargetPercentage'.
+ */
+ public TerminalRiskInfo setRandomSelectionTargetPercentage(java.lang.Integer randomSelectionTargetPercentage) {
+ return genClient.setOther(randomSelectionTargetPercentage, CacheKey.randomSelectionTargetPercentage);
+ }
+
+ /**
+ * Sets the field 'randomSelectionMaxTargetPercentage'.
+ */
+ public TerminalRiskInfo setRandomSelectionMaxTargetPercentage(java.lang.Integer randomSelectionMaxTargetPercentage) {
+ return genClient.setOther(randomSelectionMaxTargetPercentage, CacheKey.randomSelectionMaxTargetPercentage);
+ }
+
+ /**
+ * Sets the field 'randomSelectionThresholdValue'.
+ */
+ public TerminalRiskInfo setRandomSelectionThresholdValue(java.lang.Integer randomSelectionThresholdValue) {
+ return genClient.setOther(randomSelectionThresholdValue, CacheKey.randomSelectionThresholdValue);
+ }
+
+ /**
+ * Sets the field 'tacDefault'.
+ */
+ public TerminalRiskInfo setTacDefault(java.lang.String tacDefault) {
+ return genClient.setOther(tacDefault, CacheKey.tacDefault);
+ }
+
+ /**
+ * Sets the field 'tacDenial'.
+ */
+ public TerminalRiskInfo setTacDenial(java.lang.String tacDenial) {
+ return genClient.setOther(tacDenial, CacheKey.tacDenial);
+ }
+
+ /**
+ * Sets the field 'tacOnline'.
+ */
+ public TerminalRiskInfo setTacOnline(java.lang.String tacOnline) {
+ return genClient.setOther(tacOnline, CacheKey.tacOnline);
+ }
+
+
+ /** Clears the 'cardType' field, the 'has' method for this field will now return false */
+ public void clearCardType() {
+ genClient.clear(CacheKey.cardType);
+ }
+ /** Clears the 'paymentCode' field, the 'has' method for this field will now return false */
+ public void clearPaymentCode() {
+ genClient.clear(CacheKey.paymentCode);
+ }
+ /** Clears the 'floorLimit' field, the 'has' method for this field will now return false */
+ public void clearFloorLimit() {
+ genClient.clear(CacheKey.floorLimit);
+ }
+ /** Clears the 'randomSelectionTargetPercentage' field, the 'has' method for this field will now return false */
+ public void clearRandomSelectionTargetPercentage() {
+ genClient.clear(CacheKey.randomSelectionTargetPercentage);
+ }
+ /** Clears the 'randomSelectionMaxTargetPercentage' field, the 'has' method for this field will now return false */
+ public void clearRandomSelectionMaxTargetPercentage() {
+ genClient.clear(CacheKey.randomSelectionMaxTargetPercentage);
+ }
+ /** Clears the 'randomSelectionThresholdValue' field, the 'has' method for this field will now return false */
+ public void clearRandomSelectionThresholdValue() {
+ genClient.clear(CacheKey.randomSelectionThresholdValue);
+ }
+ /** Clears the 'tacDefault' field, the 'has' method for this field will now return false */
+ public void clearTacDefault() {
+ genClient.clear(CacheKey.tacDefault);
+ }
+ /** Clears the 'tacDenial' field, the 'has' method for this field will now return false */
+ public void clearTacDenial() {
+ genClient.clear(CacheKey.tacDenial);
+ }
+ /** Clears the 'tacOnline' field, the 'has' method for this field will now return false */
+ public void clearTacOnline() {
+ genClient.clear(CacheKey.tacOnline);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public TerminalRiskInfo copyChanges() {
+ TerminalRiskInfo copy = new TerminalRiskInfo();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(TerminalRiskInfo src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new TerminalRiskInfo(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public TerminalRiskInfo createFromParcel(android.os.Parcel in) {
+ TerminalRiskInfo instance = new TerminalRiskInfo(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public TerminalRiskInfo[] newArray(int size) {
+ return new TerminalRiskInfo[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return TerminalRiskInfo.class;
+ }
+
+ @Override
+ public TerminalRiskInfo create(org.json.JSONObject jsonObject) {
+ return new TerminalRiskInfo(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean CARDTYPE_IS_REQUIRED = false;
+ public static final boolean PAYMENTCODE_IS_REQUIRED = false;
+ public static final boolean FLOORLIMIT_IS_REQUIRED = false;
+ public static final boolean RANDOMSELECTIONTARGETPERCENTAGE_IS_REQUIRED = false;
+ public static final boolean RANDOMSELECTIONMAXTARGETPERCENTAGE_IS_REQUIRED = false;
+ public static final boolean RANDOMSELECTIONTHRESHOLDVALUE_IS_REQUIRED = false;
+ public static final boolean TACDEFAULT_IS_REQUIRED = false;
+ public static final boolean TACDENIAL_IS_REQUIRED = false;
+ public static final boolean TACONLINE_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionInfo.java
index 00292ec05f..7466cc0dde 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionInfo.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionInfo.java
@@ -87,6 +87,8 @@
* {@link #getIsCoBrandCard isCoBrandCard}
* {@link #getOriginalSaleAmount originalSaleAmount}
* {@link #getPartialPendingAmount partialPendingAmount}
+ * {@link #getPreDatedDate preDatedDate}
+ * {@link #getPreDatedTerm preDatedTerm}
*
*/
@SuppressWarnings("all")
@@ -477,6 +479,20 @@ public java.lang.Long getPartialPendingAmount() {
return genClient.cacheGet(CacheKey.partialPendingAmount);
}
+ /**
+ * Pre-dated date value in the yyyyMMdd format
+ */
+ public java.lang.String getPreDatedDate() {
+ return genClient.cacheGet(CacheKey.preDatedDate);
+ }
+
+ /**
+ * Pre-dated value as term in calendar days
+ */
+ public java.lang.Integer getPreDatedTerm() {
+ return genClient.cacheGet(CacheKey.preDatedTerm);
+ }
+
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
languageIndicator
@@ -592,6 +608,10 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
partialPendingAmount
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ preDatedDate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ preDatedTerm
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -958,6 +978,16 @@ public boolean isNotNullPartialPendingAmount() {
return genClient.cacheValueIsNotNull(CacheKey.partialPendingAmount);
}
+ /** Checks whether the 'preDatedDate' field is set and is not null */
+ public boolean isNotNullPreDatedDate() {
+ return genClient.cacheValueIsNotNull(CacheKey.preDatedDate);
+ }
+
+ /** Checks whether the 'preDatedTerm' field is set and is not null */
+ public boolean isNotNullPreDatedTerm() {
+ return genClient.cacheValueIsNotNull(CacheKey.preDatedTerm);
+ }
+
/** Checks whether the 'languageIndicator' field has been set, however the value could be null */
public boolean hasLanguageIndicator() {
return genClient.cacheHasKey(CacheKey.languageIndicator);
@@ -1239,6 +1269,16 @@ public boolean hasPartialPendingAmount() {
return genClient.cacheHasKey(CacheKey.partialPendingAmount);
}
+ /** Checks whether the 'preDatedDate' field has been set, however the value could be null */
+ public boolean hasPreDatedDate() {
+ return genClient.cacheHasKey(CacheKey.preDatedDate);
+ }
+
+ /** Checks whether the 'preDatedTerm' field has been set, however the value could be null */
+ public boolean hasPreDatedTerm() {
+ return genClient.cacheHasKey(CacheKey.preDatedTerm);
+ }
+
/**
* Sets the field 'languageIndicator'.
*/
@@ -1639,6 +1679,20 @@ public TransactionInfo setPartialPendingAmount(java.lang.Long partialPendingAmou
return genClient.setOther(partialPendingAmount, CacheKey.partialPendingAmount);
}
+ /**
+ * Sets the field 'preDatedDate'.
+ */
+ public TransactionInfo setPreDatedDate(java.lang.String preDatedDate) {
+ return genClient.setOther(preDatedDate, CacheKey.preDatedDate);
+ }
+
+ /**
+ * Sets the field 'preDatedTerm'.
+ */
+ public TransactionInfo setPreDatedTerm(java.lang.Integer preDatedTerm) {
+ return genClient.setOther(preDatedTerm, CacheKey.preDatedTerm);
+ }
+
/** Clears the 'languageIndicator' field, the 'has' method for this field will now return false */
public void clearLanguageIndicator() {
genClient.clear(CacheKey.languageIndicator);
@@ -1866,6 +1920,15 @@ public void clearPartialPendingAmount() {
genClient.clear(CacheKey.partialPendingAmount);
}
+ /** Clears the 'preDatedDate' field, the 'has' method for this field will now return false */
+ public void clearPreDatedDate() {
+ genClient.clear(CacheKey.preDatedDate);
+ }
+ /** Clears the 'preDatedTerm' field, the 'has' method for this field will now return false */
+ public void clearPreDatedTerm() {
+ genClient.clear(CacheKey.preDatedTerm);
+ }
+
/**
* Returns true if this instance has any changes.
*/
@@ -1987,6 +2050,8 @@ public interface Constraints {
public static final boolean ISCOBRANDCARD_IS_REQUIRED = false;
public static final boolean ORIGINALSALEAMOUNT_IS_REQUIRED = false;
public static final boolean PARTIALPENDINGAMOUNT_IS_REQUIRED = false;
+ public static final boolean PREDATEDDATE_IS_REQUIRED = false;
+ public static final boolean PREDATEDTERM_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionSettings.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionSettings.java
index 205c9ed393..76fcc301d2 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionSettings.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionSettings.java
@@ -100,6 +100,10 @@ public java.lang.Long getSignatureThreshold() {
return genClient.cacheGet(CacheKey.signatureThreshold);
}
+ public java.lang.String getDynamicTipSelection() {
+ return genClient.cacheGet(CacheKey.dynamicTipSelection);
+ }
+
public com.clover.sdk.v3.payments.DataEntryLocation getSignatureEntryLocation() {
return genClient.cacheGet(CacheKey.signatureEntryLocation);
}
@@ -260,6 +264,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
rtdProviders
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.RTDProviderConstraints.JSON_CREATOR)),
+ dynamicTipSelection
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -379,6 +385,11 @@ public boolean isNotNullSignatureThreshold() {
return genClient.cacheValueIsNotNull(CacheKey.signatureThreshold);
}
+ /** Checks whether the 'dynamicTipSelection' field is set and is not null */
+ public boolean isNotNullDynamicTipSelection() {
+ return genClient.cacheValueIsNotNull(CacheKey.dynamicTipSelection);
+ }
+
/** Checks whether the 'signatureEntryLocation' field is set and is not null */
public boolean isNotNullSignatureEntryLocation() {
return genClient.cacheValueIsNotNull(CacheKey.signatureEntryLocation);
@@ -544,6 +555,11 @@ public boolean hasSignatureThreshold() {
return genClient.cacheHasKey(CacheKey.signatureThreshold);
}
+ /** Checks whether the 'dynamicTipSelection' field has been set, however the value could be null */
+ public boolean hasDynamicTipSelection() {
+ return genClient.cacheHasKey(CacheKey.dynamicTipSelection);
+ }
+
/** Checks whether the 'signatureEntryLocation' field has been set, however the value could be null */
public boolean hasSignatureEntryLocation() {
return genClient.cacheHasKey(CacheKey.signatureEntryLocation);
@@ -708,6 +724,13 @@ public TransactionSettings setSignatureThreshold(java.lang.Long signatureThresho
return genClient.setOther(signatureThreshold, CacheKey.signatureThreshold);
}
+ /**
+ * Sets the field 'dynamicTipSelection'.
+ */
+ public TransactionSettings setDynamicTipSelection(java.lang.String dynamicTipSelection) {
+ return genClient.setOther(dynamicTipSelection, CacheKey.dynamicTipSelection);
+ }
+
/**
* Sets the field 'signatureEntryLocation'.
*/
@@ -891,6 +914,10 @@ public void clearForceOfflinePayment() {
public void clearSignatureThreshold() {
genClient.clear(CacheKey.signatureThreshold);
}
+ /** Clears the 'dynamicTipSelection' field, the 'has' method for this field will now return false */
+ public void clearDynamicTipSelection() {
+ genClient.clear(CacheKey.dynamicTipSelection);
+ }
/** Clears the 'signatureEntryLocation' field, the 'has' method for this field will now return false */
public void clearSignatureEntryLocation() {
genClient.clear(CacheKey.signatureEntryLocation);
@@ -1042,6 +1069,7 @@ public interface Constraints {
public static final boolean APPROVEOFFLINEPAYMENTWITHOUTPROMPT_IS_REQUIRED = false;
public static final boolean FORCEOFFLINEPAYMENT_IS_REQUIRED = false;
public static final boolean SIGNATURETHRESHOLD_IS_REQUIRED = false;
+ public static final boolean DYNAMICTIPSELECTION_IS_REQUIRED = false;
public static final boolean SIGNATUREENTRYLOCATION_IS_REQUIRED = false;
public static final boolean TIPMODE_IS_REQUIRED = false;
public static final boolean TIPPABLEAMOUNT_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionStatus.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionStatus.java
new file mode 100644
index 0000000000..583e880ca7
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/TransactionStatus.java
@@ -0,0 +1,57 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payments;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum TransactionStatus implements Parcelable {
+ INITIATED, APPROVED, COMPLETED, DECLINED, VOIDED;
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(final Parcel dest, final int flags) {
+ dest.writeString(name());
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public TransactionStatus createFromParcel(final Parcel source) {
+ return TransactionStatus.valueOf(source.readString());
+ }
+
+ @Override
+ public TransactionStatus[] newArray(final int size) {
+ return new TransactionStatus[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/VoidRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/VoidRequest.java
new file mode 100644
index 0000000000..44e5bce58b
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/VoidRequest.java
@@ -0,0 +1,413 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+
+/*
+ * Copyright (C) 2019 Clover Network, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.clover.sdk.v3.payments;
+
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ * - {@link #getOrderId orderId}
+ * - {@link #getPaymentId paymentId}
+ * - {@link #getExternalPaymentId externalPaymentId}
+ * - {@link #getReason reason}
+ * - {@link #getCardDetails cardDetails}
+ * - {@link #getEmployeeId employeeId}
+ * - {@link #getAppTracking appTracking}
+ *
+ */
+@SuppressWarnings("all")
+public class VoidRequest extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Order ID of the order
+ */
+ public java.lang.String getOrderId() {
+ return genClient.cacheGet(CacheKey.orderId);
+ }
+
+ /**
+ * Payment ID of payment
+ */
+ public java.lang.String getPaymentId() {
+ return genClient.cacheGet(CacheKey.paymentId);
+ }
+
+ /**
+ * External payment ID when using custom tender
+ */
+ public java.lang.String getExternalPaymentId() {
+ return genClient.cacheGet(CacheKey.externalPaymentId);
+ }
+
+ /**
+ * Void Reason
+ */
+ public java.lang.String getReason() {
+ return genClient.cacheGet(CacheKey.reason);
+ }
+
+ /**
+ * Payment Card Data
+ */
+ public com.clover.sdk.v3.pay.PaymentRequestCardDetails getCardDetails() {
+ return genClient.cacheGet(CacheKey.cardDetails);
+ }
+
+ /**
+ * Employee ID
+ */
+ public java.lang.String getEmployeeId() {
+ return genClient.cacheGet(CacheKey.employeeId);
+ }
+
+ /**
+ * Tracking information for the app that created this payment.
+ */
+ public com.clover.sdk.v3.apps.AppTracking getAppTracking() {
+ return genClient.cacheGet(CacheKey.appTracking);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ orderId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ paymentId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ externalPaymentId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ reason
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ cardDetails
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.pay.PaymentRequestCardDetails.JSON_CREATOR)),
+ employeeId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ appTracking
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.apps.AppTracking.JSON_CREATOR)),
+ ;
+
+ private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
+
+ private CacheKey(com.clover.sdk.extractors.ExtractionStrategy s) {
+ extractionStrategy = s;
+ }
+
+ @Override
+ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
+ return extractionStrategy;
+ }
+ }
+
+ private final GenericClient genClient;
+
+ /**
+ * Constructs a new empty instance.
+ */
+ public VoidRequest() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected VoidRequest(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public VoidRequest(String json) throws IllegalArgumentException {
+ this();
+ genClient.initJsonObject(json);
+ }
+
+ /**
+ * Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public VoidRequest(org.json.JSONObject jsonObject) {
+ this();
+ genClient.setJsonObject(jsonObject);
+ }
+
+ /**
+ * Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
+ */
+ public VoidRequest(VoidRequest src) {
+ this();
+ if (src.genClient.getJsonObject() != null) {
+ genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
+ }
+ }
+
+ /**
+ * Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
+ * reflected in this instance and vice-versa.
+ */
+ public org.json.JSONObject getJSONObject() {
+ return genClient.getJSONObject();
+ }
+
+ @Override
+ public void validate() {
+ }
+
+ /** Checks whether the 'orderId' field is set and is not null */
+ public boolean isNotNullOrderId() {
+ return genClient.cacheValueIsNotNull(CacheKey.orderId);
+ }
+
+ /** Checks whether the 'paymentId' field is set and is not null */
+ public boolean isNotNullPaymentId() {
+ return genClient.cacheValueIsNotNull(CacheKey.paymentId);
+ }
+
+ /** Checks whether the 'externalPaymentId' field is set and is not null */
+ public boolean isNotNullExternalPaymentId() {
+ return genClient.cacheValueIsNotNull(CacheKey.externalPaymentId);
+ }
+
+ /** Checks whether the 'reason' field is set and is not null */
+ public boolean isNotNullReason() {
+ return genClient.cacheValueIsNotNull(CacheKey.reason);
+ }
+
+ /** Checks whether the 'cardDetails' field is set and is not null */
+ public boolean isNotNullCardDetails() {
+ return genClient.cacheValueIsNotNull(CacheKey.cardDetails);
+ }
+
+ /** Checks whether the 'employeeId' field is set and is not null */
+ public boolean isNotNullEmployeeId() {
+ return genClient.cacheValueIsNotNull(CacheKey.employeeId);
+ }
+
+ /** Checks whether the 'appTracking' field is set and is not null */
+ public boolean isNotNullAppTracking() {
+ return genClient.cacheValueIsNotNull(CacheKey.appTracking);
+ }
+
+
+
+ /** Checks whether the 'orderId' field has been set, however the value could be null */
+ public boolean hasOrderId() {
+ return genClient.cacheHasKey(CacheKey.orderId);
+ }
+
+ /** Checks whether the 'paymentId' field has been set, however the value could be null */
+ public boolean hasPaymentId() {
+ return genClient.cacheHasKey(CacheKey.paymentId);
+ }
+
+ /** Checks whether the 'externalPaymentId' field has been set, however the value could be null */
+ public boolean hasExternalPaymentId() {
+ return genClient.cacheHasKey(CacheKey.externalPaymentId);
+ }
+
+ /** Checks whether the 'reason' field has been set, however the value could be null */
+ public boolean hasReason() {
+ return genClient.cacheHasKey(CacheKey.reason);
+ }
+
+ /** Checks whether the 'cardDetails' field has been set, however the value could be null */
+ public boolean hasCardDetails() {
+ return genClient.cacheHasKey(CacheKey.cardDetails);
+ }
+
+ /** Checks whether the 'employeeId' field has been set, however the value could be null */
+ public boolean hasEmployeeId() {
+ return genClient.cacheHasKey(CacheKey.employeeId);
+ }
+
+ /** Checks whether the 'appTracking' field has been set, however the value could be null */
+ public boolean hasAppTracking() {
+ return genClient.cacheHasKey(CacheKey.appTracking);
+ }
+
+
+ /**
+ * Sets the field 'orderId'.
+ */
+ public VoidRequest setOrderId(java.lang.String orderId) {
+ return genClient.setOther(orderId, CacheKey.orderId);
+ }
+
+ /**
+ * Sets the field 'paymentId'.
+ */
+ public VoidRequest setPaymentId(java.lang.String paymentId) {
+ return genClient.setOther(paymentId, CacheKey.paymentId);
+ }
+
+ /**
+ * Sets the field 'externalPaymentId'.
+ */
+ public VoidRequest setExternalPaymentId(java.lang.String externalPaymentId) {
+ return genClient.setOther(externalPaymentId, CacheKey.externalPaymentId);
+ }
+
+ /**
+ * Sets the field 'reason'.
+ */
+ public VoidRequest setReason(java.lang.String reason) {
+ return genClient.setOther(reason, CacheKey.reason);
+ }
+
+ /**
+ * Sets the field 'cardDetails'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public VoidRequest setCardDetails(com.clover.sdk.v3.pay.PaymentRequestCardDetails cardDetails) {
+ return genClient.setRecord(cardDetails, CacheKey.cardDetails);
+ }
+
+ /**
+ * Sets the field 'employeeId'.
+ */
+ public VoidRequest setEmployeeId(java.lang.String employeeId) {
+ return genClient.setOther(employeeId, CacheKey.employeeId);
+ }
+
+ /**
+ * Sets the field 'appTracking'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public VoidRequest setAppTracking(com.clover.sdk.v3.apps.AppTracking appTracking) {
+ return genClient.setRecord(appTracking, CacheKey.appTracking);
+ }
+
+
+ /** Clears the 'orderId' field, the 'has' method for this field will now return false */
+ public void clearOrderId() {
+ genClient.clear(CacheKey.orderId);
+ }
+ /** Clears the 'paymentId' field, the 'has' method for this field will now return false */
+ public void clearPaymentId() {
+ genClient.clear(CacheKey.paymentId);
+ }
+ /** Clears the 'externalPaymentId' field, the 'has' method for this field will now return false */
+ public void clearExternalPaymentId() {
+ genClient.clear(CacheKey.externalPaymentId);
+ }
+ /** Clears the 'reason' field, the 'has' method for this field will now return false */
+ public void clearReason() {
+ genClient.clear(CacheKey.reason);
+ }
+ /** Clears the 'cardDetails' field, the 'has' method for this field will now return false */
+ public void clearCardDetails() {
+ genClient.clear(CacheKey.cardDetails);
+ }
+ /** Clears the 'employeeId' field, the 'has' method for this field will now return false */
+ public void clearEmployeeId() {
+ genClient.clear(CacheKey.employeeId);
+ }
+ /** Clears the 'appTracking' field, the 'has' method for this field will now return false */
+ public void clearAppTracking() {
+ genClient.clear(CacheKey.appTracking);
+ }
+
+
+ /**
+ * Returns true if this instance has any changes.
+ */
+ public boolean containsChanges() {
+ return genClient.containsChanges();
+ }
+
+ /**
+ * Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
+ */
+ public void resetChangeLog() {
+ genClient.resetChangeLog();
+ }
+
+ /**
+ * Create a copy of this instance that contains only fields that were set after the constructor was called.
+ */
+ public VoidRequest copyChanges() {
+ VoidRequest copy = new VoidRequest();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(VoidRequest src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new VoidRequest(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public VoidRequest createFromParcel(android.os.Parcel in) {
+ VoidRequest instance = new VoidRequest(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
+ instance.genClient.setChangeLog(in.readBundle());
+ return instance;
+ }
+
+ @Override
+ public VoidRequest[] newArray(int size) {
+ return new VoidRequest[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return VoidRequest.class;
+ }
+
+ @Override
+ public VoidRequest create(org.json.JSONObject jsonObject) {
+ return new VoidRequest(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ORDERID_IS_REQUIRED = false;
+ public static final boolean PAYMENTID_IS_REQUIRED = false;
+ public static final boolean EXTERNALPAYMENTID_IS_REQUIRED = false;
+ public static final boolean REASON_IS_REQUIRED = false;
+ public static final boolean CARDDETAILS_IS_REQUIRED = false;
+ public static final boolean EMPLOYEEID_IS_REQUIRED = false;
+ public static final boolean APPTRACKING_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PAPIResultReceiver.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PAPIResultReceiver.kt
new file mode 100644
index 0000000000..8bd3c4cdf4
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PAPIResultReceiver.kt
@@ -0,0 +1,16 @@
+package com.clover.sdk.v3.payments.api
+
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.os.ResultReceiver
+
+interface ResultCallback {
+ fun onReceiveResult(resultCode: Int, resultData: Bundle?)
+}
+
+class PAPIResultReceiver(var callback: ResultCallback) : ResultReceiver(Handler(Looper.getMainLooper())) {
+ override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
+ callback.onReceiveResult(resultCode, resultData)
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RemotePaymentsAPIConnector.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RemotePaymentsAPIConnector.kt
index 4e8932ef61..de59e38af1 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RemotePaymentsAPIConnector.kt
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RemotePaymentsAPIConnector.kt
@@ -10,7 +10,6 @@ import android.os.IBinder
import android.util.Log
import com.clover.sdk.v3.remotepay.CloverDeviceEvent
import com.clover.sdk.v3.remotepay.InputOption
-import java.util.concurrent.Executors
/**
* A connector that enables device requests (e.g. Read Card), using Android Payments API
@@ -28,7 +27,7 @@ class RemotePaymentsAPIConnector(var context: Context) {
_rpapiConnector = it
_intent?.also {
intent ->
- _rpapiConnector?.start(object:RemotePaymentsAPI_V1_ConnectorListener.Stub(){
+ _rpapiConnector?.start(_intent, object:RemotePaymentsAPI_V1_ConnectorListener.Stub(){
override fun onDeviceEvent(cloverDeviceEvent: CloverDeviceEvent, isStartEvent:Boolean) {
_listener?.onDeviceEvent(cloverDeviceEvent, isStartEvent)
}
@@ -112,4 +111,5 @@ class RemotePaymentsAPIConnector(var context: Context) {
context.unbindService(serviceConnection)
_rpapiConnector = null;
}
+
}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePaymentRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePaymentRequestIntentBuilder.java
index 28844cdf80..dd5820989e 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePaymentRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePaymentRequestIntentBuilder.java
@@ -3,6 +3,10 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.ResultReceiver;
+
import com.clover.sdk.v1.Intents;
public class RetrievePaymentRequestIntentBuilder extends BaseIntentBuilder {
@@ -21,6 +25,11 @@ public RetrievePaymentRequestIntentBuilder paymentId(String paymentId) {
return this;
}
+ /**
+ * Returns an activity intent to retrieve a payment. the headless flag does NOT apply to this intent.
+ * @param context
+ * @return
+ */
public Intent build(Context context) {
if (context == null) {
throw new IllegalArgumentException("context must be populated with a non null value");
@@ -42,6 +51,23 @@ public Intent build(Context context) {
return i;
}
+ /**
+ * Returns a service intent to retrieve a payment. Once the task is complete, the ResultCallback will
+ * be called.
+ * @param context
+ * @param resultCallback
+ * @return an intent that can be executed using Context.startService()
+ */
+ public Intent buildServiceIntent(Context context, ResultCallback resultCallback) {
+ // require callback
+ Intent svcIntent = build(context);
+ PAPIResultReceiver rr = new PAPIResultReceiver(resultCallback);
+ svcIntent.putExtra(Intents.EXTRA_RESULT_RECEIVER, rr);
+ svcIntent.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.RetrievePaymentRequestHandlerService"));
+
+ return svcIntent;
+ }
+
public static class Response {
/**
* If an external Payment ID is sent in, it will be returned.
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardType.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardType.kt
new file mode 100644
index 0000000000..9cb5a6b444
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardType.kt
@@ -0,0 +1,9 @@
+package com.clover.sdk.v3.realtimediscount
+
+data class CardType(
+ val cardType: String
+) {
+ companion object {
+ const val JSON_KEY = "cardType"
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardTypeWithRange.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardTypeWithRange.kt
new file mode 100644
index 0000000000..67d138f97f
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/CardTypeWithRange.kt
@@ -0,0 +1,11 @@
+package com.clover.sdk.v3.realtimediscount
+
+data class CardTypeWithRange(
+ val cardType: String,
+ val lowBin: String,
+ val highBin: String
+) {
+ companion object {
+ const val JSON_KEY = "cardTypeWithRange"
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/DiscountResponse.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/DiscountResponse.kt
index 7c5c6d546b..5883b312e4 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/DiscountResponse.kt
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/DiscountResponse.kt
@@ -11,5 +11,6 @@ data class DiscountResponse(
val orderId: String? = null,
val discountType: String,
val success: Boolean,
- val errorMessage: String? = null
+ val errorMessage: String? = null,
+ val additionalData: Map? = null
) : Parcelable
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RealtimeDiscountProviderInfo.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RealtimeDiscountProviderInfo.kt
index d77f51d9e5..4cccb6fda7 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RealtimeDiscountProviderInfo.kt
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RealtimeDiscountProviderInfo.kt
@@ -4,5 +4,6 @@ data class RealtimeDiscountProviderInfo(
val packageName: String,
val serviceName: String,
val displayName: String? = null,
- val priority: Int = 0
+ val priority: Int = 0,
+ val remotePackageName: String? = null
)
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RtdConstants.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RtdConstants.kt
new file mode 100644
index 0000000000..32be228a9d
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/RtdConstants.kt
@@ -0,0 +1,17 @@
+package com.clover.sdk.v3.realtimediscount
+
+/**
+ * Constants for Real Time Discount additional data map keys.
+ * These are used to pass Argentina-specific data through the RTD interface.
+ */
+object RtdConstants {
+ // Request keys
+ const val KEY_MERCHANT_ID = "merchantId"
+ const val KEY_INSTALLMENTS = "installments"
+ const val KEY_ENTRY_MODE = "entryMode"
+
+ // Response keys
+ const val KEY_NEW_MERCHANT_ID = "newMerchantId"
+ const val KEY_NEW_INSTALLMENTS = "newInstallments"
+ const val KEY_CONFIRM_CHANGES = "confirmChanges"
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/Wallet.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/Wallet.kt
new file mode 100644
index 0000000000..283062accd
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/realtimediscount/Wallet.kt
@@ -0,0 +1,9 @@
+package com.clover.sdk.v3.realtimediscount
+
+data class Wallet(
+ val wallet: String
+) {
+ companion object {
+ const val JSON_KEY = "wallet"
+ }
+}
diff --git a/common.gradle b/common.gradle
index b96a2d7e0e..4dc1ce88b3 100644
--- a/common.gradle
+++ b/common.gradle
@@ -5,6 +5,8 @@ repositories {
mavenLocal()
mavenCentral()
google()
+ mavenCentral()
+ google()
}
dependencies {
diff --git a/gradle/plugins/build.gradle b/gradle/plugins/build.gradle
index 19a79731e4..469c8b0bfc 100644
--- a/gradle/plugins/build.gradle
+++ b/gradle/plugins/build.gradle
@@ -1,13 +1,4 @@
buildscript {
- if (!project.hasProperty('androidBuild')) {
- def likelyAndroidBuild = file("$rootDir/../android-build")
- if (likelyAndroidBuild.exists()) {
- ext.androidBuild = likelyAndroidBuild.absolutePath
- } else {
- throw new GradleException("Couldn't find android-build at " + likelyAndroidBuild.absolutePath)
- }
- }
-
repositories {
mavenLocal()
mavenCentral()