diff --git a/app.gradle b/app.gradle
index 677332579..6460b00a7 100644
--- a/app.gradle
+++ b/app.gradle
@@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
apply from: file("${project.rootDir}/common.gradle")
+apply from: file("${project.rootDir}/list-dependencies.gradle")
/**
* Gets the full path of the proguard file specified by `name`.
@@ -80,8 +81,14 @@ android {
matchingFallbacks = ['release']
}
+
+ }
+
+ buildFeatures {
+ buildConfig = true
}
+
compileSdkVersion COMPILE_SDK_VERSION
useLibrary HTTP_LIBRARY
@@ -103,8 +110,4 @@ android {
lintOptions {
abortOnError false
}
-
- dexOptions {
- preDexLibraries = Boolean.valueOf(System.getProperty("androidPreDex", "true"))
- }
}
diff --git a/assets/clover.css b/assets/clover.css
new file mode 100644
index 000000000..103ba9f03
--- /dev/null
+++ b/assets/clover.css
@@ -0,0 +1,13 @@
+.theme-dark {
+ --sidemenu-section-active-color: rgba(34, 136, 0, 0.5) !important;
+}
+html:not(.theme-dark) {
+ --sidemenu-section-active-color: rgba(34, 136, 0, 0.09) !important;
+}
+html:not(.theme-dark) .sideMenuPart[data-active] > .overview > a {
+ color: #1c6e00 !important;
+}
+
+html:not(.theme-dark) .sideMenuPart[data-active] > .overview .navButtonContent::before {
+ background-color: var(--default-font-color);
+}
\ No newline at end of file
diff --git a/assets/logo-icon.svg b/assets/logo-icon.svg
new file mode 100644
index 000000000..48a97f13e
--- /dev/null
+++ b/assets/logo-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 28a2aa03d..1d288ca24 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+import org.jetbrains.dokka.gradle.DokkaTaskPartial
+import org.gradle.api.internal.project.DefaultProject
buildscript {
if (!project.hasProperty('androidBuild')) {
def likelyAndroidBuild = file('../android-build')
@@ -32,6 +33,9 @@ buildscript {
}
google()
mavenCentral()
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
}
dependencies {
@@ -42,10 +46,74 @@ buildscript {
}
}
+plugins {
+ id("org.jetbrains.dokka") version "1.9.20"
+}
+
+repositories {
+ mavenCentral()
+}
+
defaultTasks 'clean', 'install'
// SonarQube static analysis configuration
// Adding detekt tasks to all the sub-modules
subprojects {
+ tasks.withType(DokkaTaskPartial.class).configureEach {
+ dependsOn compileReleaseAidl
+ moduleName.set(project.name)
+ moduleVersion.set(project.version.toString())
+
+ String config = """
+ {
+ "customAssets": ["${file("assets/logo-icon.svg")}"],
+ "customStyleSheets": ["${file("assets/clover.css")}"]
+ }
+ """
+ pluginsMapConfiguration.set([
+ "org.jetbrains.dokka.base.DokkaBase": config
+ ])
+ dokkaSourceSets {
+ named("main") {
+ // https://slack-chats.kotlinlang.org/t/484637/hi-all-i-m-trying-to-get-dokka-to-include-documentation-for-#3fae1eb4-6f24-4765-8803-687e6c5819be
+ sourceRoots.from(file("build/generated/aidl_source_output_dir/release/out"))
+ suppressGeneratedFiles.set(false)
+ sourceLink {
+ // FIXME: source linking just doesn't seem to work
+ localDirectory.set(rootDir)
+ remoteUrl.set(new URL("https://github.com/clover/clover-android-sdk/tree/master"))
+ remoteLineSuffix.set("#L")
+ }
+ externalDocumentationLink {
+ url.set(new URL("https://square.github.io/retrofit/2.x/retrofit/"))
+ }
+ externalDocumentationLink {
+ url.set(new URL("https://square.github.io/okhttp/3.x/okhttp/"))
+ }
+ if(project.name == "clover-android-sdk") includes.from("overview.md")
+ }
+ }
+
+ dependencies {
+ dokkaPlugin('org.jetbrains.dokka:kotlin-as-java-plugin:1.9.20')
+ }
+ }
+}
+tasks.dokkaHtmlMultiModule {
+ moduleName.set("Clover Android SDK")
+ moduleVersion.set("r"+(project(":clover-android-sdk") as DefaultProject).evaluate().version)
+
+ String config = """
+{
+ "customAssets": ["${file("assets/logo-icon.svg")}"],
+ "customStyleSheets": ["${file("assets/clover.css")}"]
+}
+"""
+ pluginsMapConfiguration.set([
+ "org.jetbrains.dokka.base.DokkaBase": config
+ ])
}
+dependencies {
+ dokkaPlugin('org.jetbrains.dokka:kotlin-as-java-plugin:1.9.20')
+}
\ No newline at end of file
diff --git a/clover-android-connector-sdk/build.gradle b/clover-android-connector-sdk/build.gradle
index 5cfeb42be..09e98fac7 100644
--- a/clover-android-connector-sdk/build.gradle
+++ b/clover-android-connector-sdk/build.gradle
@@ -1,3 +1,5 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
/**
* Copyright (C) 2016 Clover Network, Inc.
*
@@ -14,15 +16,45 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
-version = '306'
+version = '316'
apply from: file("${project.rootDir}/lib.gradle")
+apply plugin: 'kotlin-android'
+apply plugin: 'org.jetbrains.dokka'
+
+android {
+
+ buildTypes.configureEach {
+ consumerProguardFiles 'proguard-rules.pro'
+ }
+
+ buildFeatures {
+ aidl true
+ }
+
+ namespace 'com.clover.android.connector.sdk'
+
+ compileOptions {
+ sourceCompatibility = 8
+ targetCompatibility = 8
+ }
+ tasks.withType(KotlinCompile).configureEach {
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+ }
+
+}
dependencies {
implementation project(':clover-android-sdk')
implementation "androidx.annotation:annotation:$ANDROIDX_ANNOTATION_VERSION"
- implementation "com.google.code.gson:gson:$GSON_VERSION"
+ implementation ("com.google.code.gson:gson") {
+ version {
+ strictly "$GSON_VERSION"
+ }
+ }
}
ext {
diff --git a/clover-android-connector-sdk/src/main/AndroidManifest.xml b/clover-android-connector-sdk/src/main/AndroidManifest.xml
index 1d22d6bb6..54dd6b7f8 100644
--- a/clover-android-connector-sdk/src/main/AndroidManifest.xml
+++ b/clover-android-connector-sdk/src/main/AndroidManifest.xml
@@ -16,7 +16,6 @@
-->
diff --git a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/CardEntryMethods.java b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/CardEntryMethods.java
index f7ec8f340..f02b7685b 100644
--- a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/CardEntryMethods.java
+++ b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/CardEntryMethods.java
@@ -19,7 +19,7 @@
public class CardEntryMethods {
private static int KIOSK_CARD_ENTRY_METHODS = 1 << 15;
- public static int CARD_ENTRY_METHOD_MAG_STRIPE = 0b0001 | 0b000100000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33026
+ public static int CARD_ENTRY_METHOD_MAG_STRIPE = 0b0001 | 0b000100000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33025
public static int CARD_ENTRY_METHOD_ICC_CONTACT = 0b0010 | 0b001000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33282
public static int CARD_ENTRY_METHOD_NFC_CONTACTLESS = 0b0100 | 0b010000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33796
public static int CARD_ENTRY_METHOD_MANUAL = 0b1000 | 0b100000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 34824
@@ -27,11 +27,11 @@ public class CardEntryMethods {
public static int DEFAULT =
CardEntryMethods.CARD_ENTRY_METHOD_MAG_STRIPE |
CardEntryMethods.CARD_ENTRY_METHOD_ICC_CONTACT |
- CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS; // | CARD_ENTRY_METHOD_MANUAL;
+ CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS; // 34567;
public static int ALL =
CardEntryMethods.CARD_ENTRY_METHOD_MAG_STRIPE |
CardEntryMethods.CARD_ENTRY_METHOD_ICC_CONTACT |
CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS |
- CardEntryMethods.CARD_ENTRY_METHOD_MANUAL;
+ CardEntryMethods.CARD_ENTRY_METHOD_MANUAL; // 32768
}
\ No newline at end of file
diff --git a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionConnector.java b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionConnector.java
index 3b648bba5..a5049d9b7 100644
--- a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionConnector.java
+++ b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionConnector.java
@@ -1,8 +1,6 @@
package com.clover.connector.sdk.v3.session;
-import com.clover.sdk.v1.merchant.Merchant;
import com.clover.sdk.v3.customers.CustomerInfo;
-import com.clover.sdk.v3.employees.Employee;
import com.clover.sdk.v3.order.DisplayOrder;
import com.clover.sdk.v3.payments.Transaction;
@@ -47,8 +45,6 @@ public class SessionConnector implements Serializable, SessionListener {
public static final String QUERY_PARAMETER_VALUE = "value";
public static final String QUERY_PARAMETER_NAME = "name";
public static final String QUERY_PARAMETER_SRC = "src";
- public static final String BUNDLE_KEY_MERCHANT = "Merchant";
- public static final String BUNDLE_KEY_EMPLOYEE = "Employee";
public static final String BUNDLE_KEY_TYPE = "TYPE";
public static final String BUNDLE_KEY_DATA = "DATA";
public static final String BUNDLE_KEY_MESSAGE = "MESSAGE";
@@ -189,48 +185,6 @@ public void setDisplayOrder(DisplayOrder displayOrder, boolean isOrderModificati
}
}
- public Map getProperties() {
- Map properties = new HashMap<>();
- try {
- if (connect()) {
- try (Cursor cursor = sessionContentProviderClient.query(SessionContract.PROPERTIES_URI, null, null, null, null)) {
- if (null != cursor && cursor.moveToFirst()) {
- do {
- String key = cursor.getString(0);
- String value = cursor.getString(1);
- properties.put(key, value);
- } while (cursor.moveToNext());
- }
- }
- }
- } catch (Exception e) {
- Log.e(TAG, e.getMessage(), e);
- }
- return properties;
- }
-
- public Merchant getMerchantInfo() {
- try {
- Log.d(TAG, "Calling getMerchant");
- Bundle result = sessionContentProviderClient.call(SessionContract.CALL_METHOD_GET_MERCHANT, null, null);
- return result == null ? null : (Merchant) result.getParcelable(BUNDLE_KEY_MERCHANT);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public Employee getEmployee() {
- try {
- Log.d(TAG, "Calling getEmployee");
- Bundle result = sessionContentProviderClient.call(SessionContract.CALL_METHOD_GET_EMPLOYEE, null, null);
- return result == null ? null : (Employee) result.getParcelable(BUNDLE_KEY_EMPLOYEE);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
public void setProperty(String key, String value) {
try {
if (connect()) {
diff --git a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionContract.java b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionContract.java
index c01b7e7a8..8fa7da490 100644
--- a/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionContract.java
+++ b/clover-android-connector-sdk/src/main/java/com/clover/connector/sdk/v3/session/SessionContract.java
@@ -65,15 +65,10 @@ public class SessionContract {
matcher.addURI(SessionContract.AUTHORITY, SessionContract.SESSION_EVENT + "/*", SessionContract.EVENT);
}
-
public static final String CALL_METHOD_ON_EVENT = "onEvent";
public static final String CALL_METHOD_CLEAR_SESSION = "clearSession";
- public static final String CALL_METHOD_GET_MERCHANT = "getMerchant";
- public static final String CALL_METHOD_GET_EMPLOYEE = "getEmployee";
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_TRANSACTION = "setTransaction";
- public static final String CALL_METHOD_ANNOUNCE_CUSTOMER_PROVIDED_DATA = "announceCustomerProvidedData";
-
}
\ No newline at end of file
diff --git a/clover-android-connector-sdk/src/main/res/values-pt-rBR/strings.xml b/clover-android-connector-sdk/src/main/res/values-pt-rBR/strings.xml
new file mode 100644
index 000000000..c0dabfd31
--- /dev/null
+++ b/clover-android-connector-sdk/src/main/res/values-pt-rBR/strings.xml
@@ -0,0 +1,5 @@
+
+
+ Transação manual
+ Autorização
+
diff --git a/clover-android-loyalty-kit/build.gradle b/clover-android-loyalty-kit/build.gradle
index 9dee6f5c6..e2850c11e 100644
--- a/clover-android-loyalty-kit/build.gradle
+++ b/clover-android-loyalty-kit/build.gradle
@@ -1,3 +1,5 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
/**
* Copyright (C) 2016 Clover Network, Inc.
*
@@ -14,14 +16,44 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
-version = '306'
+version = '316'
apply from: file("${project.rootDir}/lib.gradle")
+apply plugin: 'kotlin-android'
+apply plugin: 'org.jetbrains.dokka'
+
+android {
+
+ buildTypes.configureEach {
+ consumerProguardFiles 'proguard-rules.pro'
+ }
+
+ buildFeatures {
+ aidl true
+ }
+
+ namespace "com.clover.android.loyalty"
+
+ compileOptions {
+ sourceCompatibility = 8
+ targetCompatibility = 8
+ }
+ tasks.withType(KotlinCompile).configureEach {
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+ }
+}
dependencies {
implementation project(':clover-android-sdk')
implementation "androidx.annotation:annotation:$ANDROIDX_ANNOTATION_VERSION"
+ implementation ("com.google.code.gson:gson") {
+ version {
+ strictly "$GSON_VERSION"
+ }
+ }
}
ext{
diff --git a/clover-android-loyalty-kit/src/main/AndroidManifest.xml b/clover-android-loyalty-kit/src/main/AndroidManifest.xml
index f3ff53606..0100f4aa1 100644
--- a/clover-android-loyalty-kit/src/main/AndroidManifest.xml
+++ b/clover-android-loyalty-kit/src/main/AndroidManifest.xml
@@ -17,7 +17,6 @@
diff --git a/clover-android-loyalty-kit/src/main/java/com/clover/loyalty/activity/helper/CloverCFPLoyaltyHelper.java b/clover-android-loyalty-kit/src/main/java/com/clover/loyalty/activity/helper/CloverCFPLoyaltyHelper.java
new file mode 100644
index 000000000..87d3378cd
--- /dev/null
+++ b/clover-android-loyalty-kit/src/main/java/com/clover/loyalty/activity/helper/CloverCFPLoyaltyHelper.java
@@ -0,0 +1,857 @@
+package com.clover.loyalty.activity.helper;
+
+import static android.app.Activity.RESULT_OK;
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Handler;
+import android.os.IInterface;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+
+import com.clover.sdk.cfp.activity.CFPConstants;
+import com.clover.sdk.cfp.activity.helper.CloverCFPActivityHelper;
+import com.clover.sdk.cfp.activity.helper.CloverCFPCommsHelper;
+import com.clover.sdk.cfp.connector.session.CFPSessionConnector;
+import com.clover.sdk.cfp.connector.session.CFPSessionListener;
+import com.clover.loyalty.ILoyaltyDataService;
+import com.clover.loyalty.LoyaltyConnector;
+import com.clover.loyalty.LoyaltyDataTypes;
+import com.clover.sdk.v1.ServiceConnector;
+import com.clover.sdk.v3.customers.CustomerInfo;
+import com.clover.sdk.v3.loyalty.LoyaltyDataConfig;
+import com.clover.sdk.v3.order.DisplayOrder;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+/**
+ * Used by an Activity on the customer facing side to allow loyalty and customer information to be passed between
+ * the customer and merchant facing sides.
+ *
+ * Allows an integrator to use whatever base class they want to use for their Activity.
+ *
+ * @since 4.1.0
+ */
+public class CloverCFPLoyaltyHelper {
+ /**
+ * Interface implemented on the customer facing side.
+ *
+ * This extends an interface which adds: Interface implemented on the customer facing side to:
+ *
+ *
Via onMessage(), receive messages from the merchant facing side, or
+ *
Via sendMessage(), send messages back to the merchant facing side
+ *
+ *
+ * @since 4.1.0
+ */
+ public interface LoyaltyListener {
+
+ /**
+ * Message sent from the merchant facing side.
+ *
+ * @param payload - most likely a string JSON payload
+ * @since 4.0.0
+ */
+ void onMessage(String payload);
+
+ /**
+ * Sends a message back to the merchant facing side.
+ *
+ * @param payload - most likely a string JSON payload
+ * @throws Exception - thrown if the action id for messages sent from the Custom Activity is null
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ void sendMessage(String payload) throws Exception;
+
+ /**
+ * When the implementing class connects, it will receive the current list of LoyaltyDataConfigs and current
+ * customerInfo.
+ *
+ * @param configs - the list of loyalty data configs
+ * @param customerInfo - customer info
+ * @since 4.1.0
+ */
+ void onLoyaltyDataLoaded(List configs, CustomerInfo customerInfo);
+
+ /**
+ * Notified when the state of a loyalty service changes.
+ *
+ * @param type - something like: "EMAIL", "PHONE", "CLEAR"
+ * @param state - a string that describes whether the service is "up" or "down".
+ * @since 4.1.0
+ */
+ void onLoyaltyServiceStateChanged(String type, String state);
+ }
+
+ public static final String LOG_TAG = CloverCFPLoyaltyHelper.class.getSimpleName();
+
+ private final Gson gson = new GsonBuilder().serializeNulls().create();
+
+ protected WeakReference activityWeakReference;
+ private CFPSessionConnector sessionConnector;
+ private LoyaltyConnector loyaltyConnector;
+
+ // Private session listener that forwards session events to the "externalSessionListener" - the session listener
+ // passed in on the constructor for this class.
+ private CFPSessionListener internalSessionListener;
+
+ // We use this flag to determine if dispose() has been called. Once dispose() is called, there's no point to handling
+ // "in-flight" events.
+ private boolean isStopping = false;
+
+ private List loyaltyDataConfigList = new ArrayList<>();
+
+ Map typeToConfig = new HashMap<>();
+
+ private CustomerInfo customerInfo;
+ private DisplayOrder displayOrder;
+
+ private WeakReference weakReferenceLoyaltyListener;
+ private final WeakReference weakReferenceSessionListener;
+ private final Map loyaltyServiceStateChangeReceiver = new HashMap<>();
+ private final CloverCFPActivityHelper cloverCFPActivityHelper;
+ private final CloverCFPCommsHelper cloverCFPCommsHelper;
+
+ Executor executor = Executors.newSingleThreadExecutor();
+
+ /**
+ * Main constructor.
+ *
+ *
+ * @param activity - a reference to the activity that is using this helper class.
+ * @param loyaltyListener - a client that receives the onLoyaltyDataLoaded(), onLoyaltyServiceStateChanged(), onMessage()
+ * events, and sends an event via sendMessage().
+ * @param externalSessionListener - a client that will receive onSessionDataChanged and onSessionEvent events.
+ * @since 4.1.0
+ */
+ public CloverCFPLoyaltyHelper(final Activity activity, final LoyaltyListener loyaltyListener, final CFPSessionListener externalSessionListener) {
+ activityWeakReference = new WeakReference<>(activity);
+ weakReferenceLoyaltyListener = new WeakReference<>(loyaltyListener);
+ weakReferenceSessionListener = new WeakReference<>(externalSessionListener);
+
+ sessionConnector = new CFPSessionConnector(activity);
+ this.internalSessionListener = new CFPSessionListener() {
+ /**
+ * Data can be any type of string such as:
+ *
+ *
+ * @since 4.1.0
+ */
+ @SuppressWarnings("unused")
+ public void onStop() {
+ Log.d(LOG_TAG, "Activity lifecycle being stopped");
+ }
+
+ /**
+ * Given a config type, returns the corresponding LoyaltyDataConfig.
+ *
+ * Type will resemble something like: "EMAIL", "PHONE", "CLEAR"
+ *
+ * @param type - a string representing the LoyaltyDataConfig key
+ * @return null, if none exists
+ * @see LoyaltyDataTypes
+ * @since 4.1.0
+ */
+ @Nullable
+ @SuppressWarnings("unused")
+ public LoyaltyDataConfig getLoyaltyDataConfig(@Nullable String type) {
+ if (typeToConfig == null || type == null) {
+ return null;
+ }
+
+ return typeToConfig.get(type);
+ }
+
+ /**
+ * This method is called by the ServiceConnector.OnServiceConnectedListener#onServiceConnected when it receives
+ * a connection notification.
+ *
+ * Consumers of this class who want to receive the onLoyaltyDataLoaded() event will want to implement the
+ * CloverCFPLoyaltyHelper.LoyaltyListener interface:
+ *
+ * public class CloverLoyaltyCustomActivity extends Activity implements CloverCFPLoyaltyHelper.LoyaltyListener {
+ * private CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper;
+ * ...
+ * public void onLoyaltyDataLoaded(List loyaltyDataConfigList, CustomerInfo customerInfo) {
+ * // Handle it here...
+ * // Use it to update various UI widgets...maybe like the Customer Panel, etc.
+ * }
+ * ...
+ * }
+ *
+ *
+ * @param configs - from the LoyaltyConnector - a list of the desired loyalty data configs
+ * @param customerInfo - from the SessionConnector
+ * @since 4.1.0
+ */
+ final protected void onLoyaltyDataLoaded(List configs, CustomerInfo customerInfo) {
+ Log.d(LOG_TAG, "onLoyaltyDataLoaded " + loyaltyDataConfigList);
+
+ for (LoyaltyDataConfig config : configs) {
+ typeToConfig.put(config.getType(), config);
+ }
+
+ loyaltyDataConfigList = configs;
+ // Here is where we give integrators the ability to also handle the onLoyaltyDataLoaded event too.
+ LoyaltyListener loyaltyListener = weakReferenceLoyaltyListener.get();
+ if (loyaltyListener != null) {
+ loyaltyListener.onLoyaltyDataLoaded(configs, customerInfo);
+ }
+ }
+
+ /**
+ * Message sent from the merchant facing side. This method just forwards the request to the LoyaltyListener class.
+ *
+ * It is called by the CloverCFPCommsHelper#onMessage() method from within the CloverCFPLoyaltyHelper's constructor.
+ *
+ * Consumers of this class who want to receive the onLoyaltyDataLoaded() event will want to implement the
+ * ICloverCFP interface:
+ *
+ * public class CloverLoyaltyCustomActivity extends Activity implements CloverCFPLoyaltyHelper.LoyaltyListener {
+ * private CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper;
+ * ...
+ * //Use this method to receive a message from the merchant side
+ * public void onMessage(String payload) {
+ * // Handle it here..
+ * }
+ *
+ * //Use this method to send a message back to the merchant side
+ * public void sendMessage(String payload) throws Exception {
+ * cloverCFPLoyaltyHelper.sendMessage(payload);
+ * }
+ * ...
+ * }
+ *
+ *
+ * @param payload - most likely a string JSON payload
+ * @since 4.1.0
+ */
+ private void onMessage(String payload) {
+ // Here is where we give integrators the ability to handle the onMessage event too.
+ LoyaltyListener loyaltyListener = weakReferenceLoyaltyListener.get();
+ if (loyaltyListener != null) {
+ loyaltyListener.onMessage(payload);
+ }
+ }
+
+ /**
+ * Send a message back to the POS. Used by Activities that desire to send a message back to the merchant facing
+ * side.
+ *
+ * @param payload - mostly likely a JSON serialized string.
+ * @throws Exception - thrown when the action id for messages sent from the Custom Activity have not been set
+ * @see #onMessage(String) javadoc
+ * @since 4.1.0
+ */
+ @SuppressWarnings("unused")
+ public void sendMessage(String payload) throws Exception {
+ cloverCFPCommsHelper.sendMessage(payload);
+ }
+
+ /**
+ * Cleans up the sessionConnector, loyalty connector and
+ *
+ * Consumers of this class will want to call this method in their Activity's onDestroy method:
+ *
+ *
+ * public class CloverLoyaltyCustomActivity extends Activity {
+ * private CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper;
+ * ...
+ * protected void onDestroy() {
+ * // Tell the helper to clean up everything
+ * cloverCFPLoyaltyHelper.dispose();
+ * super.onDestroy();
+ * }
+ * ...
+ * }
+ *
+ * Here's an example of using this method:
+ *
+ *
+ * public class CloverLoyaltyCustomActivity extends Activity {
+ * private CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper;
+ * ...
+ * public void onMessage(String payload) {
+ * // this is a custom message that will finish the activity if a "finish" message is sent
+ * // by the pos
+ * if ("finish".equals(payload)) {
+ * cloverCFPLoyaltyHelper.finishActivity();
+ * } else {
+ * ...
+ * }
+ * }
+ * ...
+ * }
+ *
+ *
+ * @since 4.1.0
+ */
+ @SuppressWarnings("unused")
+ public final void finishActivity() {
+ cloverCFPActivityHelper.setResultAndFinish(RESULT_OK, null);
+ }
+
+ /**
+ * @param type the LoyaltyServiceType to start
+ * @since 4.1.0
+ * @deprecated - use com.clover.cfp.activity.CloverCFPLoyaltyHelper#start(java.lang.String, java.util.Map, java.lang.String)
+ * with start(type, null, null) for all services
+ *
+ */
+ public void start(final String type) {
+ String config = null;
+ start(type, null, config);
+ }
+
+
+ /**
+ * use to start a loyalty data service.
+ *
+ * @param type - will look like: "EMAIL", "PHONE", "CLEAR"
+ * @param dataExtrasIn -
+ * @param config - Usually a JSON serialized string
+ * @since 4.1.0
+ */
+ public void start(final String type, @Nullable final Map dataExtrasIn, final String config) {
+ callConnector(new StartRunnable(this, type, dataExtrasIn, config));
+ }
+
+ private static class StartRunnable implements Runnable {
+ private final WeakReference cloverCFPLoyaltyHelperWeakReference;
+ private final String type;
+ private final Map dataExtrasIn;
+ private final String config;
+
+ StartRunnable(CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper, final String type, final Map dataExtrasIn, final String config) {
+ this.cloverCFPLoyaltyHelperWeakReference = new WeakReference<>(cloverCFPLoyaltyHelper);
+ this.type = type;
+ this.dataExtrasIn = dataExtrasIn;
+ this.config = config;
+ }
+
+ @Override
+ public void run() {
+ try {
+ Log.d(LOG_TAG, String.format("Calling connector.start(%s)", type));
+
+ CloverCFPLoyaltyHelper cloverCFPLoyaltyHelper = cloverCFPLoyaltyHelperWeakReference.get();
+ if (cloverCFPLoyaltyHelper == null) {
+ Log.d(LOG_TAG, "Unable to start b/c CloverCFPLoyaltyHelper was null!");
+ return;
+ }
+
+ String key = ILoyaltyDataService.Util.getServiceStateEventAction(type);
+ if (cloverCFPLoyaltyHelper.getLoyaltyServiceStateChangeReceiver().get(key) == null) {
+ BroadcastReceiver statusReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String state = intent.getStringExtra(ILoyaltyDataService.LOYALTY_SERVICE_STATE_EVENT);
+ cloverCFPLoyaltyHelper.onLoyaltyServiceStateChanged(type, state);
+ }
+ };
+
+ Context context = cloverCFPLoyaltyHelper.getActivity();
+ if (context != null) {
+ context.registerReceiver(statusReceiver, new IntentFilter(key));
+ }
+ cloverCFPLoyaltyHelper.getLoyaltyServiceStateChangeReceiver().put(key, statusReceiver);
+ }
+ Map dataExtras = cloverCFPLoyaltyHelper.addToLoyaltyServiceExtras(dataExtrasIn);
+ dataExtras.put(
+ "com.clover.payment.executor.secure.EXTRA_PROXY_PROVIDER", // todo: This constant needs to be in ONE place
+ "com.clover.payment.builder.pay");
+
+ LoyaltyConnector loyaltyConnector = cloverCFPLoyaltyHelper.getLoyaltyConnector();
+ if (loyaltyConnector != null) {
+ loyaltyConnector.startLoyaltyService(type, dataExtras, config);
+ } else {
+ Log.w(LOG_TAG, "Unable to start Loyalty Service because it is null!");
+ }
+ } catch (Exception e) {
+ Log.e(LOG_TAG, String.format("Error when starting service of type %s", type), e);
+ }
+ }
+ }
+
+ /**
+ * Override this to get updates to loyalty data service.
+ *
+ * @param type - something like: "EMAIL", "PHONE", "CLEAR"
+ * @param state - a string that looks like: "com.clover.loyalty.service.state.running" or "com.clover.loyalty.service.state.running"
+ * @since 4.1.0
+ */
+ final protected void onLoyaltyServiceStateChanged(String type, String state) {
+ LoyaltyListener loyaltyListener = weakReferenceLoyaltyListener.get();
+ if (loyaltyListener != null) {
+ loyaltyListener.onLoyaltyServiceStateChanged(type, state);
+ }
+ }
+
+ /**
+ * Used to stop a loyalty data service
+ *
+ * @param type -
+ * @since 4.1.0
+ */
+ public void stop(final String type) {
+ final Runnable runLater = new StopRunnable(loyaltyConnector, type);
+ callConnector(runLater);
+ }
+
+ private static class StopRunnable implements Runnable {
+ private final WeakReference loyaltyConnectorWeakReference;
+ private final String type;
+
+ StopRunnable(LoyaltyConnector loyaltyConnector, String type) {
+ this.loyaltyConnectorWeakReference = new WeakReference<>(loyaltyConnector);
+ this.type = type;
+ }
+
+ @Override
+ public void run() {
+ try {
+ LoyaltyConnector loyaltyConnector = loyaltyConnectorWeakReference.get();
+ if (loyaltyConnector == null) {
+ Log.w(LOG_TAG, "Unable to stop the Loyalty Service because it is null!");
+ return;
+ }
+ Log.d(LOG_TAG, String.format("Calling connector.stop(%s)", type));
+ loyaltyConnector.stopLoyaltyService(type);
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Ow!", e);
+ }
+ }
+ }
+
+ /**
+ * Used by custom activities to announce loyalty data, collected by the custom activity
+ * and put it in the loyalty platform.
+ *
+ * @param loyaltyDataConfig - the corresponding data config for the given data
+ * @param data - mostly likely a JSON serialized string.
+ * @since 4.1.0
+ */
+ public void announceCustomerProvidedData(final LoyaltyDataConfig loyaltyDataConfig, final String data) {
+ executor.execute(() -> callConnector(new AnnounceDataRunnable(loyaltyConnector, loyaltyDataConfig, data)));
+ }
+
+ private static class AnnounceDataRunnable implements Runnable {
+ private final LoyaltyConnector loyaltyConnector;
+ private final LoyaltyDataConfig loyaltyDataConfig;
+ private final String data;
+
+ AnnounceDataRunnable(LoyaltyConnector loyaltyConnector, LoyaltyDataConfig loyaltyDataConfig, String data) {
+ this.loyaltyConnector = loyaltyConnector;
+ this.loyaltyDataConfig = loyaltyDataConfig;
+ this.data = data;
+ }
+
+ @Override
+ public void run() {
+ try {
+ Log.d(LOG_TAG, "Calling connector.announceCustomerProvidedData");
+ loyaltyConnector.announceCustomerProvidedData(loyaltyDataConfig, data);
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Ow!", e);
+ }
+ }
+ }
+
+ /**
+ * Add information to the map of extra information in the VasSettings
+ *
+ * @param map - the possibly null map of extras
+ * @return the non null map of extra data
+ *
+ * This call will return immediately with the new customer.
+ * @param firstName The first name of the customer, can be null.
+ * @param lastName The last name of the customer, can be null.
+ * @return A {@link com.clover.sdk.v1.customer.Customer} object.
+ */
+ Customer newCustomer(in String firstName, in String lastName, out ResultStatus resultStatus);
+
}
diff --git a/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/inventory/IInventoryService.aidl b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/inventory/IInventoryService.aidl
index 8da14ac73..b8df83aa8 100644
--- a/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/inventory/IInventoryService.aidl
+++ b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/inventory/IInventoryService.aidl
@@ -769,23 +769,25 @@ interface IInventoryService {
OrderFee getOrderFee(in String orderFeeId, out ResultStatus resultStatus);
/**
- * Adds a new order fee.
- *
- * @clover.perm INVENTORY_W
+ * Not available to non-Clover apps.
+ * @y.exclude
*/
OrderFee createOrderFee(in OrderFee orderFee, out ResultStatus resultStatus);
/**
- * Updates an existing order fee.
- *
- * @clover.perm INVENTORY_W
+ * Not available to non-Clover apps.
+ * @y.exclude
*/
void updateOrderFee(in OrderFee orderFee, out ResultStatus resultStatus);
/**
- * Deletes an order fee.
- *
- * @clover.perm INVENTORY_W
+ * Not available to non-Clover apps.
+ * @y.exclude
*/
void deleteOrderFee(in String orderFeeId, out ResultStatus resultStatus);
+
+ /**
+ * Retrieve an individual item using the item ID.
+ */
+ Item getPosMenuItem(in String itemId, in String menuId, out ResultStatus resultStatus);
}
diff --git a/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/FulfillmentInfo.aidl b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/FulfillmentInfo.aidl
new file mode 100644
index 000000000..6336a6c15
--- /dev/null
+++ b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/FulfillmentInfo.aidl
@@ -0,0 +1,4 @@
+// FulfillmentInfo.aidl
+package com.clover.sdk.v3.order;
+
+parcelable FulfillmentInfo;
diff --git a/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/IOrderServiceV3_1.aidl b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/IOrderServiceV3_1.aidl
index ac51c0b9d..432a3e97d 100644
--- a/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/IOrderServiceV3_1.aidl
+++ b/clover-android-sdk/src/main/aidl/com/clover/sdk/v3/order/IOrderServiceV3_1.aidl
@@ -16,8 +16,10 @@ import com.clover.sdk.v3.order.LineItemMapFdParcelable;
import com.clover.sdk.v3.order.DiscountFdParcelable;
import com.clover.sdk.v3.order.DiscountListFdParcelable;
import com.clover.sdk.v3.order.ModificationFdParcelable;
+import com.clover.sdk.v3.order.FulfillmentInfo;
import com.clover.sdk.v3.onlineorder.OrderState;
import com.clover.sdk.v3.onlineorder.Reason;
+import com.clover.sdk.v3.payments.Authorization;
import com.clover.sdk.v3.payments.PaymentFdParcelable;
import com.clover.sdk.v3.payments.PaymentListFdParcelable;
import com.clover.sdk.v3.payments.CreditFdParcelable;
@@ -830,9 +832,10 @@ interface IOrderServiceV3_1 {
/**
* Not available to non-Clover apps.
+ * @deprecated Use {@link #deletePreAuth2}.
* @y.exclude
*/
- OrderFdParcelable deletePreAuth(String orderId, String paymentId, in VoidReason voidReason, in VoidExtraData voidExtraData, out ResultStatus status);
+ OrderFdParcelable deletePreAuth(String orderId, in String paymentId, in VoidReason voidReason, in VoidExtraData voidExtraData, out ResultStatus status);
/**
* Not available to non-Clover apps.
@@ -897,10 +900,74 @@ interface IOrderServiceV3_1 {
*/
boolean fireLineItems(String sourceOrderid, in List lineItemList, out ResultStatus status);
+ /**
+ * Set the fulfillment info for an order.
+ * @clover.perm ORDERS_W
+ *
+ * Not available to non-Clover apps.
+ * @y.exclude
+ *
+ */
+ OrderFdParcelable setFulfillmentInfo(String orderId, in FulfillmentInfo fulfillmentInfo, out ResultStatus status);
/**
* Not available to non-Clover apps.
* @y.exclude
*/
OrderFdParcelable capturePreAuthorization(String orderId, in PaymentFdParcelable preAuth, in PaymentFdParcelable closingPayment, in LineItemListFdParcelable fdLineItems, out ResultStatus status);
+
+ LineItemListFdParcelable addMenuFixedPriceLineItems(String orderId, String menuId, String itemId, String binName, String userData, int numItems, out ResultStatus status);
+
+ LineItemListFdParcelable addMenuPerUnitLineItems(String orderId, String menuId, String itemId, int unitQuantity, String binName, String userData, int numItems, out ResultStatus status);
+
+ LineItemListFdParcelable addMenuVariablePriceLineItems(String orderId, String menuId, String itemId, long price, String binName, String userData, int numItems, out ResultStatus status);
+
+ /**
+ * Adds a native cash discount on an order. If lineitemIds is empty, the discount will be applied to the entire order.
+ * @clover.perm ORDERS_W
+ *
+ * Not available to non-Clover apps.
+ * @y.exclude
+ *
+ */
+ OrderFdParcelable updateCashDiscount(String orderId, in List lineItemIds, in DiscountFdParcelable cashDiscount, out ResultStatus status);
+
+ /**
+ * Reopen an order for further edits if possible. Once reopened, new line items,
+ * discounts, etc. may be added to the order.
+
+ * @param orderId the ID of the order to change the state.
+ * @return true if order is reopenable else false.
+ * @clover.perm ORDERS_W
+ */
+ boolean reopenOrder(String orderId, out ResultStatus status);
+
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
+ OrderFdParcelable deletePreAuth2(String orderId, in Authorization auth, in VoidReason voidReason, in VoidExtraData voidExtraData, out ResultStatus status);
+
+ /**
+ * This is a replacement for the methods addPayment2() and addLPMPayment()
+ * It will handle a payment with optional line items so can be used in full POS mode (Register, Dining)
+ * It will also handle both card transactions that have already been processed on server via /v1/pay
+ * or (via createOnServer boolean flag) will POST the transaction to the CreatePayment endpoint on server
+ * Additionally, it will support being called by SiTef apps if a) the device has TRANSACTION_OPERATION_MODE
+ * of SITEF, and b) if the calling package is in RAW_TRANSACTION_SERVICE_WHITELIST
+ * Not available to most non-Clover apps.
+ * @y.exclude
+ */
+ OrderFdParcelable addPayment3(String orderId, in PaymentFdParcelable payment, in LineItemListFdParcelable fdLineItems, boolean createOnServer, out ResultStatus status);
+
+ /**
+ * This is a replacement for the method refund2(), with passthroughs
+ * It will record a refund locally and also update refund on the server
+ * Additionally, it will support being called by SiTef apps if a) the device has TRANSACTION_OPERATION_MODE
+ * of SITEF, and b) if the calling package is in RAW_TRANSACTION_SERVICE_WHITELIST
+ * Not available to most non-Clover apps.
+ * @y.exclude
+ */
+ RefundFdParcelable addRefund3(String orderId, in RefundFdParcelable fdRefund, in Map passThroughExtras, out ResultStatus resultStatus);
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/common2/payments/PayIntent.java b/clover-android-sdk/src/main/java/com/clover/common2/payments/PayIntent.java
index fb28b176e..db749b148 100644
--- a/clover-android-sdk/src/main/java/com/clover/common2/payments/PayIntent.java
+++ b/clover-android-sdk/src/main/java/com/clover/common2/payments/PayIntent.java
@@ -1148,6 +1148,12 @@ private static TransactionSettings mergeDeprecatedTransactionSettingsProperties(
if (ts.isNotNullEnableKioskMode()) {
transactionSettings.setEnableKioskMode(ts.getEnableKioskMode());
}
+ if (ts.isNotNullPreAuthType()) {
+ transactionSettings.setPreAuthType(ts.getPreAuthType());
+ }
+ if (ts.isNotNullReceiptSelectionTimeoutThreshold()) {
+ transactionSettings.setReceiptSelectionTimeoutThreshold(ts.getReceiptSelectionTimeoutThreshold());
+ }
} else { // No incoming ts fields, so use deprecated properties and default values where appropriate.
transactionSettings.setCloverShouldHandleReceipts(!remotePrintIn);
transactionSettings.setDisableRestartTransactionOnFailure(disableRestartTransactionWhenFailedIn);
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CFPConstants.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CFPConstants.java
new file mode 100644
index 000000000..a80e524b3
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CFPConstants.java
@@ -0,0 +1,95 @@
+package com.clover.sdk.cfp.activity;
+
+/**
+ *
+ * @since 4.0.0
+ */
+@SuppressWarnings("unused")
+public class CFPConstants {
+ public static final String CUSTOMER_INFO_EXTRA = "com.clover.extra.CUSTOMER_INFO";
+ public static final String DISPLAY_ORDER_EXTRA = "com.clover.extra.DISPLAY_ORDER";
+
+ public static final String ACTION_SESSION_DATA = "com.clover.cfp.SESSION_DATA_ACTION";
+ public static final String EXTRA_PAYLOAD = "com.clover.remote.terminal.remotecontrol.extra.EXTRA_PAYLOAD";
+ /**
+ * @deprecated
+ */
+ @SuppressWarnings("DeprecatedIsStillUsed")
+ public static final String ACTION_V1_MESSAGE_TO_ACTIVITY = "com.clover.remote-terminal.remotecontrol.action.V1_MESSAGE_TO_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ @SuppressWarnings("DeprecatedIsStillUsed")
+ public static final String ACTION_V1_MESSAGE_FROM_ACTIVITY = "com.clover.remote-terminal.remotecontrol.action.V1_MESSAGE_FROM_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ @SuppressWarnings("DeprecatedIsStillUsed")
+ public static final String CATEGORY_CUSTOM_ACTIVITY = "com.clover.cfp.ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_V1_CUSTOM_INPUT_OPTIONS = "com.clover.remote-terminal.remotecontrol.action.V1_CUSTOM_INPUT_OPTIONS";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_V1_CUSTOM_DEVICE_EVENT = "com.clover.remote-terminal.remotecontrol.action.V1_CUSTOM_DEVICE_EVENT";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_V1_CUSTOM_KEY_PRESS = "com.clover.remote-terminal.remotecontrol.action.V1_CUSTOM_KEY_PRESS";
+
+ /**
+ * @deprecated
+ */
+ public static final String EXTRA_DEVICE_EVENT = "com.clover.remote.terminal.remotecontrol.extra.DEVICE_EVENT";
+ /**
+ * @deprecated
+ */
+ public static final String EXTRA_KEYPRESS = "com.clover.remote.terminal.remotecontrol.extra.KEY_PRESS";
+
+ /**
+ * @deprecated
+ */
+ public static final String CATEGORY_REMOTE_PROTOCOL_ACTIVITY = "com.clover.remote.protocol.ACTIVITY";
+
+ // This section used to designate Touch Point activity actions
+
+ // Customer Experience Touch Point actions
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_START_CUSTOMER_EXPERIENCE_ACTIVITY = "com.clover.remote.terminal.action.START_CUSTOMER_EXPERIENCE_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_START_LOGO_ACTIVITY = "com.clover.remote.terminal.action.START_WELCOME_LOGO_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_START_MESSAGE_ACTIVITY = "com.clover.remote.terminal.action.START_MESSAGE_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_START_THANK_YOU_ACTIVITY = "com.clover.remote.terminal.action.START_THANK_YOU_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final String ACTION_START_DISPLAY_ORDER_ACTIVITY = "com.clover.remote.terminal.action.START_DISPLAY_ORDER_ACTIVITY";
+ /**
+ * @deprecated
+ */
+ public static final int LOGO_TOUCHPOINT_ACTIVITY_REQUEST_CODE = 201;
+ /**
+ * @deprecated
+ */
+ public static final int THANK_YOU_TOUCHPOINT_ACTIVITY_REQUEST_CODE = 202;
+ /**
+ * @deprecated
+ */
+ public static final int MESSAGE_TOUCHPOINT_ACTIVITY_REQUEST_CODE = 203;
+ /**
+ * @deprecated
+ */
+ public static final int DISPLAY_ORDER_TOUCHPOINT_ACTIVITY_REQUEST_CODE = 204;
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CloverTouchPointActivity.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CloverTouchPointActivity.java
new file mode 100644
index 000000000..75387c3e8
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/CloverTouchPointActivity.java
@@ -0,0 +1,94 @@
+package com.clover.sdk.cfp.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+
+import androidx.annotation.CallSuper;
+
+import com.clover.sdk.cfp.activity.helper.CloverCFPActivityHelper;
+import com.clover.sdk.cfp.connector.session.CFPSessionConnector;
+import com.clover.sdk.cfp.connector.session.CFPSessionListener;
+
+/**
+ * A convenience base class for a TouchPoint Custom Activity that provides capabilities to simplify
+ * data flow in, and out of, a custom activity
+ *
+ * Note: This class is NOT strictly required for an activity to be launched as a touch point activity.
+ * CloverCFPActivityHelper, CloverCFPLoyaltyHelper and SessionConnector can be used to get the same
+ * capabilities without extending this activity. However, extending this class is recommended,
+ * as there are other included behaviors which aid in proper function within the Clover platform.
+ *
+ * @since 4.0.0
+ */
+
+public abstract class CloverTouchPointActivity extends Activity implements CFPSessionListener {
+ private static final String LOG_TAG = CloverTouchPointActivity.class.getSimpleName();
+ private CloverCFPActivityHelper cloverCFPActivityHelper;
+ protected CFPSessionConnector sessionConnector;
+
+ /**
+ * Override a standard lifecycle method to create the helpers. Subclasses should call super.onCreate()
+ *
+ * @since 4.0.0
+ */
+ @Override
+ @CallSuper
+ public void onCreate(Bundle savedInstance) {
+ Log.d(LOG_TAG, "onCreate() called");
+ super.onCreate(null); // Do not save state!
+ cloverCFPActivityHelper = new CloverCFPActivityHelper(this);
+ if (sessionConnector == null) {
+ Log.i(LOG_TAG, "Adding new sessionConnector");
+ sessionConnector = new CFPSessionConnector(getApplicationContext());
+ Log.i(LOG_TAG, "Adding sessionConnector data change listener");
+ sessionConnector.addSessionListener(this);
+ }
+ }
+
+ /**
+ * Override a standard lifecycle method to dispose of the helpers. Subclasses should call super.onDestroy()
+ *
+ * @since 4.0.0
+ */
+ @Override
+ @CallSuper
+ public void onDestroy() {
+ super.onDestroy();
+ if (cloverCFPActivityHelper != null) {
+ cloverCFPActivityHelper.dispose();
+ }
+ if (sessionConnector != null) {
+ Log.i(LOG_TAG, "Setting sessionConnector = null");
+ sessionConnector.removeSessionListener(this);
+ sessionConnector = null;
+ }
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @Override
+ @CallSuper
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ if (resultCode == ExitTouchHandler.EXITING_ON_TOUCH) {
+ cloverCFPActivityHelper.setResultAndFinish(ExitTouchHandler.EXITING_ON_TOUCH, null);
+ }
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @Override
+ public void onSessionDataChanged(String type, Object data) {
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @Override
+ public void onSessionEvent(String type, String data) {
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/ExitTouchHandler.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/ExitTouchHandler.java
new file mode 100644
index 000000000..928de084a
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/ExitTouchHandler.java
@@ -0,0 +1,253 @@
+package com.clover.sdk.cfp.activity;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.graphics.Point;
+import android.os.Build;
+import android.os.Handler;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.WindowManager;
+import androidx.annotation.MainThread;
+
+import java.lang.ref.WeakReference;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Added to an activity and used for handling touch events, this class determines whether to exit the activity once the
+ * user has touched the four corners of the display.
+ *
+ * You can use this class in one of three ways: CloverCFPActivityHelper, CloverCFPLoyaltyHelper or direct usage.
+ *
+ * The benefits of using CloverCFPActivityHelper is that it:
+ * 1. Allows you to use any Activity subclass
+ * 2. Reduces the number of api calls to setup the ExitTouchHandler
+ * 3. Provides an easy to overload method "onTrigger()" for triggering the handling of the touch event
+ * 4. Handles cleanup automatically
+ *
+ * The benefits of using CloverCFPLoyaltyHelper is that it:
+ * 1. Delegates to CloverCFPActivityHelper
+ * 2. Handles Loyalty
+ *
+ *
+ * @since 4.0.0
+ */
+public class ExitTouchHandler {
+
+ private enum Corner {LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM}
+
+ private static final String TAG = ExitTouchHandler.class.getSimpleName();
+
+ /**
+ * @since 4.0.0
+ */
+ public static int EXITING_ON_TOUCH = -111;
+ public static final String ACTION_EXIT_ON_TOUCH = "com.clover.cfp.activity.EXIT_ON_TOUCH";
+
+ /**
+ * Dimensions (square) of the hot area at each corner of screen.
+ */
+ private static final float TRIGGER_SIZE = 150;
+
+ /**
+ * Sequence must be triggered in this amount of time or is reset.
+ */
+ private static final long TRIGGER_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
+
+ private final Handler uiHandler = new Handler();
+ private final int width;
+ private final int height;
+ private final WeakReference activityWeakReference;
+ private final Set corners = new HashSet<>();
+ private final boolean isRunningOnSecondaryDisplay;
+
+ /**
+ * Constructor - determines the height and width of the display
+ *
+ * @param activity - you want triggered ended when the 4-finger touch criteria is satisfied
+ * @since 4.0.0
+ */
+ @SuppressLint("ObsoleteSdkInt")
+ @SuppressWarnings("ConstantConditions")
+ public ExitTouchHandler(Activity activity) {
+ this.activityWeakReference = new WeakReference<>(activity);
+
+ WindowManager w = activity.getWindowManager();
+ Display d = w.getDefaultDisplay();
+ DisplayMetrics metrics = new DisplayMetrics();
+ d.getMetrics(metrics);
+
+ int width = metrics.widthPixels;
+ int height = metrics.heightPixels;
+
+ // includes window decorations (statusbar bar/menu bar)
+ if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 17) {
+ try {
+ //noinspection JavaReflectionMemberAccess
+ width = (Integer) Display.class.getMethod("getRawWidth").invoke(d);
+ //noinspection JavaReflectionMemberAccess
+ height = (Integer) Display.class.getMethod("getRawHeight").invoke(d);
+ } catch (Exception ignored) {
+ }
+ }
+
+ // includes window decorations (statusbar bar/menu bar)
+ if (Build.VERSION.SDK_INT >= 17) {
+ try {
+ Point realSize = new Point();
+ Display.class.getMethod("getRealSize", Point.class).invoke(d, realSize);
+ width = realSize.x;
+ height = realSize.y;
+ } catch (Exception ignored) {
+ }
+ }
+
+ this.width = width;
+ this.height = height;
+
+ // NOTE: This logic was copied from PlatformUtil to prevent introducing a dependency
+ // on an internal clover library (e.g. android-common)
+ // Oreo is the first version to allow activities on secondary displays
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
+ isRunningOnSecondaryDisplay = false;
+ } else {
+ isRunningOnSecondaryDisplay = d.getDisplayId() != Display.DEFAULT_DISPLAY;
+ }
+ }
+
+ /**
+ * Receives the touch event from an activity and then decides whether to finish the activity or not.
+ *
+ * Consumers of this method can do one of two approaches:
+ *
+ * On a view, add a touch listener that directly calls this method:
+ *
+ *
+ * @since 4.0.0
+ */
+ public void onTouchEvent(MotionEvent event) {
+ if (isRunningOnSecondaryDisplay) {
+ // Disable touch events if running on a secondary display
+ return;
+ }
+
+ if ((event.getActionMasked() == MotionEvent.ACTION_DOWN || event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN)) {
+ uiHandler.removeCallbacksAndMessages(null);
+
+ Corner c = getCorner(event);
+ if (c == null) {
+ Log.d(TAG, "no corner found, clearing corners");
+ corners.clear();
+ return;
+ }
+
+ Log.d(TAG, "touch in corner: " + c + ", corners: " + corners);
+ corners.add(c);
+
+ if (corners.size() >= 4) {
+ corners.clear();
+ Activity activity = activityWeakReference.get();
+ if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
+ Log.d(TAG, "triggering");
+ onTrigger();
+ }
+ } else {
+ uiHandler.postDelayed(() -> {
+ Log.d(TAG, "timeout reached, clearing corners");
+ corners.clear();
+ }, TRIGGER_TIMEOUT);
+ }
+ }
+ }
+
+ /**
+ * Finishes the activity. Called by the onTouchEvent() method.
+ *
+ * @see ExitTouchHandler#onTouchEvent
+ * @since 4.0.0
+ */
+ @MainThread
+ protected void onTrigger() {
+ Activity activity = activityWeakReference.get();
+ if (activity != null) {
+ activity.setResult(EXITING_ON_TOUCH);
+ // Should already be on the UI Thread
+ activity.finish();
+ }
+ }
+
+ private Corner getCorner(MotionEvent event) {
+ if (isInRegion(0, 0, TRIGGER_SIZE, TRIGGER_SIZE, event)) {
+ return Corner.LEFT_TOP;
+ }
+ if (isInRegion(width - TRIGGER_SIZE, 0, width, TRIGGER_SIZE, event)) {
+ return Corner.LEFT_BOTTOM;
+ }
+ if (isInRegion(0, height - TRIGGER_SIZE, TRIGGER_SIZE, height, event)) {
+ return Corner.RIGHT_TOP;
+ }
+ if (isInRegion(width - TRIGGER_SIZE, height - TRIGGER_SIZE, width, height, event)) {
+ return Corner.RIGHT_BOTTOM;
+ }
+ //noinspection IntegerDivisionInFloatingPointContext
+ if (isInRegion((width / 2) - TRIGGER_SIZE, (height / 2) - TRIGGER_SIZE, (width / 2) + TRIGGER_SIZE, (height / 2) + TRIGGER_SIZE, event)) {
+ corners.clear();
+ }
+
+ return null;
+ }
+
+ private boolean isInRegion(float x1, float y1, float x2, float y2, MotionEvent event) {
+ float x = event.getX(event.getActionIndex());
+ float y = event.getY(event.getActionIndex());
+ return x > x1 && x < x2 && y > y1 && y < y2;
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPActivityHelper.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPActivityHelper.java
new file mode 100644
index 000000000..e54eaffc7
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPActivityHelper.java
@@ -0,0 +1,250 @@
+package com.clover.sdk.cfp.activity.helper;
+
+import com.clover.sdk.cfp.activity.CFPConstants;
+import com.clover.sdk.cfp.activity.ExitTouchHandler;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Handler;
+import android.util.Log;
+import android.view.View;
+
+import java.lang.ref.WeakReference;
+
+import static android.app.Activity.RESULT_CANCELED;
+
+/**
+ * Provides helper methods for handling Activities on Clover devices.
+ *
+ * If you use CloverCFPLoyaltyHelper, it will use this class internally to interact with the Activity.
+ *
+ *
+ * In particular, attaches the 4-finger exit handler (ExitHandler) to the activity.
+ *
+ * @since 4.1.0
+ */
+public class CloverCFPActivityHelper extends ExitTouchHandler {
+ private static final int NUCLEAR_FINISH_ANY_ACTIVITY = -999;
+ private static final int DEFAULT_ACTIVITY_INTENT_REQUEST_CODE = -998;
+ private static final int DEFAULT_FINISH_RECEIVER_INTENT_REQUEST_CODE = -997;
+ private static final String ACTION_FINISH_ACTIVITY = "com.clover.cfp.activity.FINISH";
+ private static final String ACTION_ACTIVITY_STARTED = "com.clover.cfp.activity.STARTED";
+ private static final String ACTION_ACTIVITY_FINISHED = "com.clover.cfp.activity.FINISHED";
+ public static final String EXTRA_ACTIVITY_REQCODE = "com.clover.remote.terminal.remotecontrol.extra.ACTIVITY_REQCODE";
+ private static final String EXTRA_ACTIVITY_ACTION = "com.clover.remote.terminal.remotecontrol.extra.ACTIVITY_ACTION";
+
+ protected String LOG_TAG;
+ protected WeakReference activityRef;
+ protected String action; // action from the intent used to start this activity
+ protected int reqCode; // the reqCode used to start this activity
+ protected Intent resultIntent; // The intent from setResultAndFinish()
+ protected Intent originalIntent; // The intent that started the referenced Activity
+ private FinishMessageReceiver finishReceiver;
+ protected boolean receivedFinishRequest;
+
+ /**
+ * Sets the ExitHandler on the activity.
+ *
+ * @param activity - the activity you want to manage with this helper class.
+ *
+ * @since 4.1.0
+ */
+ @SuppressLint("ClickableViewAccessibility")
+ public CloverCFPActivityHelper(Activity activity) {
+ super(activity);
+ if (activity != null) {
+ activityRef = new WeakReference<>(activity);
+ originalIntent = activity.getIntent();
+ action = originalIntent.getAction();
+ registerFinishReceiver();
+ LOG_TAG = activity.getLocalClassName();
+ reqCode = activity.getIntent().getIntExtra(EXTRA_ACTIVITY_REQCODE, DEFAULT_ACTIVITY_INTENT_REQUEST_CODE);
+ View view = activity.findViewById(android.R.id.content).getRootView();
+ if (view != null) {
+ /*
+ * Called when a touch event is dispatched to a view. This allows listeners to
+ * get a chance to respond before the target view.
+ *
+ * This allows the "4-finger exit touch handler" (i.e. ExitTouchHandler) to handle the event.
+ */
+ view.setOnTouchListener((view1, motionEvent) -> {
+ CloverCFPActivityHelper.this.onTouchEvent(motionEvent);
+ return true;
+ });
+ }
+ // Announce that the activity has started and pass back the data from the original intent
+ Intent startedIntent = new Intent(ACTION_ACTIVITY_STARTED);
+ startedIntent.putExtra(EXTRA_ACTIVITY_ACTION, action);
+ startedIntent.putExtras(activity.getIntent());
+ activity.sendBroadcast(startedIntent);
+ @SuppressLint("DefaultLocale") String logMessage = String.format("CloverCFPActivityHelper.constructor: Sending ACTION_ACTIVITY_STARTED broadcast with requestCode: %d and intent: %s", reqCode, startedIntent);
+ Log.d(LOG_TAG, logMessage);
+ }
+ }
+
+ private void registerFinishReceiver() {
+ if (finishReceiver != null) {
+ return;
+ }
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ finishReceiver = new FinishMessageReceiver();
+ activity.registerReceiver(finishReceiver, new IntentFilter(ACTION_FINISH_ACTIVITY));
+ }
+ }
+
+ private void unregisterFinishReceiver() {
+ if (finishReceiver != null) {
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ activity.unregisterReceiver(finishReceiver);
+ finishReceiver = null;
+ }
+ }
+ }
+
+ /**
+ * Sets the result and finishes an activity with an associated string payload.
+ *
+ * @param resultCode - @see Activity (like RESULT_CANCELED(0), RESULT_OK(-1), etc.)
+ * @param payload - Most likely a JSON string or null.
+ *
+ * @since 4.1.0
+ */
+ public void setResultAndFinish(int resultCode, String payload) {
+ if (shouldFinishActivity(originalIntent, false)) {
+ receivedFinishRequest = true;
+ @SuppressLint("DefaultLocale") String logMessage = String.format("CloverCFPActivityHelper.setResultAndFinish() called with resultCode: %d and payload: %s", resultCode, payload);
+ Log.d(LOG_TAG, logMessage);
+ resultIntent = new Intent(action);
+ resultIntent.putExtra(CFPConstants.EXTRA_PAYLOAD, payload);
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ activity.setResult(resultCode, resultIntent);
+ // Create a handler for "finishing" the activity.
+ new Handler(activity.getMainLooper()).post(activity::finish);
+ } else {
+ Log.w(LOG_TAG, "activity is null!");
+ }
+ }
+ }
+
+ private void setResultAndFinishFromReceiver(Intent receiverIntent) {
+ int finishRequestCode = receiverIntent.getIntExtra(EXTRA_ACTIVITY_REQCODE, DEFAULT_FINISH_RECEIVER_INTENT_REQUEST_CODE);
+ if (shouldFinishActivity(receiverIntent, true)) {
+ receivedFinishRequest = true;
+ resultIntent = new Intent(action);
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ activity.setResult(RESULT_CANCELED, resultIntent);
+ // Create a handler for "finishing" the activity.
+ new Handler(activity.getMainLooper()).post(activity::finish);
+ } else {
+ Log.w(LOG_TAG, "activity is null!");
+ }
+ } else {
+ @SuppressLint("DefaultLocale") String logMessage = String.format("CloverCFPActivityHelper.setResultAndFinishFromReceiver(): Received intent to explicitly finish activity with requestCode: %d, but was already in the process of finishing or request code didn't match this activity reqCode of %d. Ignoring request.", finishRequestCode, reqCode);
+ Log.d(LOG_TAG, logMessage);
+ }
+ }
+
+ /**
+ * Called when the ExitTouchHandler is triggered to finish the activity.
+ *
+ * @since 4.1.0
+ */
+ @Override
+ protected void onTrigger() {
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ Intent exitOnTouchBroadcastIntent = new Intent(ACTION_EXIT_ON_TOUCH);
+ activity.sendOrderedBroadcast(exitOnTouchBroadcastIntent, null);
+ }
+ setResultAndFinish(ExitTouchHandler.EXITING_ON_TOUCH, null);
+ }
+
+ /**
+ *
+ * @since 4.1.0
+ */
+ @SuppressWarnings("unused")
+ public String getInitialPayload() {
+ Activity activity = activityRef.get();
+ if (activity != null && activity.getIntent() != null) {
+ return activity.getIntent().getStringExtra(CFPConstants.EXTRA_PAYLOAD);
+ } else {
+ Log.w(LOG_TAG, "activity is null!");
+ }
+ return null;
+ }
+
+ /**
+ * Removes the weak reference for the activity.
+ *
+ * Called by:
+ *
+ *
CloverCFPActivity#onDestroy(), and
+ *
CloverCFPLoyaltyHelper#dispose()
+ *
+ *
+ * @since 4.1.0
+ */
+ public void dispose() {
+ unregisterFinishReceiver();
+ // Announce that the activity has finished using either the normal result intent
+ // or a generic finished intent (likely due to a finish request)
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ if (resultIntent != null) {
+ resultIntent.putExtra(EXTRA_ACTIVITY_ACTION, action);
+ resultIntent.setAction(ACTION_ACTIVITY_FINISHED);
+ resultIntent.putExtra(EXTRA_ACTIVITY_REQCODE, reqCode);
+ activity.sendBroadcast(resultIntent);
+ } else {
+ Intent finishedIntent = new Intent(ACTION_ACTIVITY_FINISHED);
+ finishedIntent.putExtra(EXTRA_ACTIVITY_REQCODE, reqCode);
+ activity.sendBroadcast(finishedIntent);
+ }
+ }
+ activityRef = null;
+ }
+
+ /*
+ This method should only return true if the finish intent
+ matches the request code of the current activity. If the
+ current activity doesn't specify a request code, then it
+ should only be finished if utilizing the nuclear option.
+ */
+ private boolean shouldFinishActivity(Intent intent, boolean fromReceiver) {
+ Activity activity = activityRef.get();
+ if (activity != null) {
+ // Basically we want to finish the activity if:
+ // a) it's not already in the process of finishing
+ // AND
+ // b) The finish requestCode matches this activity
+ // OR
+ // c) The finish is the nuclear finish
+ int finishRequestCode = intent != null ? intent.getIntExtra(EXTRA_ACTIVITY_REQCODE, fromReceiver ? DEFAULT_FINISH_RECEIVER_INTENT_REQUEST_CODE : DEFAULT_ACTIVITY_INTENT_REQUEST_CODE) : reqCode;
+ boolean shouldFinish = (!activity.isFinishing() && !receivedFinishRequest &&
+ ((reqCode == finishRequestCode) ||
+ finishRequestCode == NUCLEAR_FINISH_ANY_ACTIVITY));
+ if (shouldFinish) {
+ @SuppressLint("DefaultLocale") String logMessage = String.format(fromReceiver ? "CloverCFPActivityHelper.setResultAndFinishFromReceiver() called with requestCode: %d and resultCode: %d." : "CloverCFPActivityHelper.setResultAndFinish() called with requestCode: %d and resultCode: %d.", finishRequestCode, RESULT_CANCELED);
+ Log.d(LOG_TAG, logMessage);
+ }
+ return shouldFinish;
+ }
+ return false;
+ }
+
+ private class FinishMessageReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ setResultAndFinishFromReceiver(intent);
+ }
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPCommsHelper.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPCommsHelper.java
new file mode 100644
index 000000000..189564b8c
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/activity/helper/CloverCFPCommsHelper.java
@@ -0,0 +1,161 @@
+package com.clover.sdk.cfp.activity.helper;
+
+import com.clover.sdk.cfp.activity.CFPConstants;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.util.Log;
+import androidx.annotation.RequiresApi;
+
+import java.lang.ref.WeakReference;
+import java.util.Objects;
+
+/**
+ * @since 4.1.0
+ */
+public class CloverCFPCommsHelper {
+ /**
+ * @since 4.1.0
+ */
+ public interface MessageListener {
+ /**
+ * Message sent from the merchant facing side.
+ *
+ * @param payload - most likely a string JSON payload
+ * @since 4.0.0
+ */
+ void onMessage(String payload);
+ }
+
+ public static final String LOG_TAG = CloverCFPCommsHelper.class.getSimpleName();
+ private final String receiver; // action id for messages sent to the Custom Activity
+ private final String broadcaster; // action id for messages sent from the Custom Activity
+ private final WeakReference contextRef;
+ private BroadcastReceiver messageReceiver;
+ private final WeakReference weakReferenceMessageListener;
+
+ /**
+ * @param context -
+ * @param intent -
+ * @since 4.1.0
+ */
+ public CloverCFPCommsHelper(Context context, Intent intent, MessageListener messageListener) {
+ contextRef = new WeakReference<>(context);
+ //noinspection deprecation
+ receiver = intent.getStringExtra(CFPConstants.ACTION_V1_MESSAGE_TO_ACTIVITY);
+ //noinspection deprecation
+ broadcaster = intent.getStringExtra(CFPConstants.ACTION_V1_MESSAGE_FROM_ACTIVITY);
+ weakReferenceMessageListener = new WeakReference<>(messageListener);
+
+ if (receiver != null) {
+ registerCustomActivityMessageReceiver();
+ }
+ }
+
+ private void registerCustomActivityMessageReceiver() {
+ if (messageReceiver != null) {
+ return;
+ }
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(receiver);
+ //noinspection deprecation
+ filter.addCategory(CFPConstants.CATEGORY_CUSTOM_ACTIVITY);
+ messageReceiver = new CustomActivityMessageReceiver();
+ Context ctx = contextRef.get();
+ if (ctx != null) {
+ ctx.registerReceiver(messageReceiver, filter);
+ } else {
+ Log.w(LOG_TAG, "context is null!");
+ }
+ }
+
+ /**
+ * Message sent from the merchant facing side.
+ *
+ * @param payload - most likely a string JSON payload
+ * @since 4.0.0
+ */
+ private void onMessage(String payload) {
+ MessageListener messageListener = weakReferenceMessageListener.get();
+ if (messageListener != null) {
+ messageListener.onMessage(payload);
+ }
+ }
+
+ /**
+ * Sends a message back to the merchant facing application (i.e. POS).
+ *
+ * @param payload - most likely a string JSON payload
+ * @throws Exception - thrown if the action id for messages sent from the Custom Activity is null
+ * i.e. the Activity's intent is missing a CFPConstants.ACTION_V1_MESSAGE_FROM_ACTIVITY.
+ * @since 4.1.0
+ */
+ public final void sendMessage(String payload) throws Exception {
+ if (broadcaster != null) { //should always be true, but just in case.
+ Intent intent = new Intent(broadcaster);
+ //noinspection deprecation
+ intent.addCategory(CFPConstants.CATEGORY_CUSTOM_ACTIVITY);
+ intent.putExtra(CFPConstants.EXTRA_PAYLOAD, payload);
+ Context ctx = contextRef.get();
+ if (ctx != null) {
+ ctx.sendBroadcast(intent);
+ } else {
+ Log.w(LOG_TAG, "context is null!");
+ }
+ } else {
+ throw new Exception("sendMessage called without a valid Broadcaster specified.");
+ }
+ }
+
+ private void unregisterCustomActivityMessageReceiver() {
+ if (messageReceiver == null) {
+ return;
+ }
+
+ Context context = contextRef.get();
+ if (context != null) {
+ context.unregisterReceiver(messageReceiver);
+ } else {
+ Log.w(LOG_TAG, "context is null!");
+ }
+ messageReceiver = null;
+ }
+
+ /**
+ * Cleans up the sessionConnector, loyalty connector and
+ *
+ * Consumers of this class will want to call this method in their Activity's onDestroy method:
+ *
+ *
+ * public class MyCustomActivity extends Activity {
+ * private CloverCFPCommsHelper cloverCFPCommsHelper;
+ * ...
+ * protected void onDestroy() {
+ * // Tell the helper to clean up everything
+ * cloverCFPCommsHelper.dispose();
+ * super.onDestroy();
+ * }
+ * ...
+ * }
+ *
+ *
+ * @since 4.1.0
+ */
+ public void dispose() {
+ unregisterCustomActivityMessageReceiver();
+ }
+
+ class CustomActivityMessageReceiver extends BroadcastReceiver {
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String payload = intent.getStringExtra(CFPConstants.EXTRA_PAYLOAD);
+ if (Objects.equals(intent.getAction(), receiver)) {
+ onMessage(payload);
+ }
+ }
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/BaseResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/BaseResponse.java
new file mode 100644
index 000000000..9a885aed9
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/BaseResponse.java
@@ -0,0 +1,25 @@
+package com.clover.sdk.cfp.connector;
+
+/**
+ * @since 4.0.0
+ */
+class BaseResponse {
+ final ResultCode resultCode;
+ private final boolean success;
+
+ /**
+ * @since 4.0.0
+ */
+ public BaseResponse(ResultCode resultCode) {
+ success = resultCode == ResultCode.OK;
+ this.resultCode = resultCode;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public boolean isSuccess() {
+ return success;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityListener.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityListener.java
new file mode 100644
index 000000000..9d52999a9
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityListener.java
@@ -0,0 +1,16 @@
+package com.clover.sdk.cfp.connector;
+
+/**
+ * @since 4.0.0
+ */
+public interface CustomActivityListener {
+ /**
+ * @since 4.0.0
+ */
+ void onMessageFromActivity(MessageFromActivity message);
+
+ /**
+ * @since 4.0.0
+ */
+ void onCustomActivityResult(CustomActivityResponse result);
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityRequest.java
new file mode 100644
index 000000000..9ae050215
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityRequest.java
@@ -0,0 +1,25 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class CustomActivityRequest {
+ /**
+ * @since 4.0.0
+ */
+ public String name;
+
+ /**
+ * @since 4.0.0
+ */
+ public String payload;
+
+
+ /**
+ * @since 4.0.0
+ */
+ public CustomActivityRequest(String name, String payload) {
+ this.name = name;
+ this.payload = payload;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityResponse.java
new file mode 100644
index 000000000..b957c12a5
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/CustomActivityResponse.java
@@ -0,0 +1,58 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class CustomActivityResponse extends BaseResponse {
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public static final int CUSTOM_ACTIVITY_RESULT_OK = -1;
+
+ /**
+ * @since 4.0.0
+ */
+ public static final int CUSTOM_ACTIVITY_RESULT_CANCEL = 0;
+
+ /**
+ * The identifier for the custom activity
+ * @since 4.0.0
+ */
+ public final String name;
+
+ /**
+ * The Activity's result code when it finishes
+ * @since 4.0.0
+ */
+ public final int result;
+
+ /**
+ * The Activity's PAYLOAD extra in the result
+ * @since 4.0.0
+ */
+ public final String payload;
+
+ /**
+ * Optionally extra information if the custom activity failed to start
+ * @since 4.0.0
+ */
+ public final String failReason;
+
+ /**
+ * @since 4.0.0
+ */
+ public CustomActivityResponse(String name, int result, String payload, String failReason) {
+ this(ResultCode.OK, name, result, payload, failReason);
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ public CustomActivityResponse(ResultCode code, String name, int result, String payload, String failReason) {
+ super(code);
+ this.name = name;
+ this.result = result;
+ this.payload = payload;
+ this.failReason = failReason;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusRequest.java
new file mode 100644
index 000000000..7f8ab2520
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusRequest.java
@@ -0,0 +1,6 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class DeviceStatusRequest {
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusResponse.java
new file mode 100644
index 000000000..ae1990df0
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/DeviceStatusResponse.java
@@ -0,0 +1,50 @@
+package com.clover.sdk.cfp.connector;
+
+/**
+ * @since 4.0.0
+ */
+public class DeviceStatusResponse extends BaseResponse {
+ /**
+ * @since 4.0.0
+ */
+ public ExternalDeviceState state;
+
+ /**
+ * @since 4.0.0
+ */
+ public ExternalDeviceStateData data;
+
+ /**
+ * @since 4.0.0
+ */
+ public DeviceStatusResponse(ResultCode resultCode) {
+ super(resultCode);
+ state = null;
+ data = null;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ public DeviceStatusResponse(ResultCode resultCode, ExternalDeviceState state, ExternalDeviceStateData data) {
+ super(resultCode);
+ this.state = state;
+ this.data = data;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public ExternalDeviceState getState() {
+ return state;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public ExternalDeviceStateData getData() {
+ return data;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceState.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceState.java
new file mode 100644
index 000000000..55ad52039
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceState.java
@@ -0,0 +1,32 @@
+package com.clover.sdk.cfp.connector;
+
+import java.io.Serializable;
+/**
+ * @since 4.0.0
+ */
+public enum ExternalDeviceState implements Serializable {
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ IDLE,
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ BUSY,
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ WAITING_FOR_POS,
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ WAITING_FOR_CUSTOMER,
+ /**
+ * @since 4.0.0
+ */
+ UNKNOWN
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceStateData.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceStateData.java
new file mode 100644
index 000000000..84778baaf
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ExternalDeviceStateData.java
@@ -0,0 +1,27 @@
+package com.clover.sdk.cfp.connector;
+
+import java.io.Serializable;
+/**
+ * @since 4.0.0
+ */
+public class ExternalDeviceStateData implements Serializable {
+ public final String externalPaymentId;
+ public final String customActivityId;
+
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public ExternalDeviceStateData() {
+ this.externalPaymentId = null;
+ this.customActivityId = null;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ public ExternalDeviceStateData(String externalPaymentId, String customActivityId) {
+ this.externalPaymentId = externalPaymentId;
+ this.customActivityId = customActivityId;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageFromActivity.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageFromActivity.java
new file mode 100644
index 000000000..02fe1151d
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageFromActivity.java
@@ -0,0 +1,23 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class MessageFromActivity {
+ /**
+ * @since 4.0.0
+ */
+ public final String name;
+
+ /**
+ * @since 4.0.0
+ */
+ public final String payload;
+
+ /**
+ * @since 4.0.0
+ */
+ public MessageFromActivity(String name, String payload) {
+ this.name = name;
+ this.payload = payload;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageToActivity.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageToActivity.java
new file mode 100644
index 000000000..997471884
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/MessageToActivity.java
@@ -0,0 +1,23 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class MessageToActivity {
+ /**
+ * @since 4.0.0
+ */
+ public final String name;
+
+ /**
+ * @since 4.0.0
+ */
+ public final String payload;
+
+ /**
+ * @since 4.0.0
+ */
+ public MessageToActivity(String name, String payload) {
+ this.name = name;
+ this.payload = payload;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/RemoteDeviceConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/RemoteDeviceConnector.java
new file mode 100644
index 000000000..cb5354655
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/RemoteDeviceConnector.java
@@ -0,0 +1,619 @@
+package com.clover.sdk.cfp.connector;
+
+import android.accounts.Account;
+import android.annotation.SuppressLint;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.util.Log;
+import androidx.annotation.NonNull;
+import androidx.annotation.WorkerThread;
+
+
+import com.clover.android.sdk.BuildConfig;
+
+import java.lang.ref.WeakReference;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @since 4.0.0
+ */
+@SuppressWarnings("unused")
+public class RemoteDeviceConnector {
+ // even # messages POS -> TERMINAL, odd # message TERMINAL -> POS
+ public static final int REGISTER_LISTENER_MSG = 0;
+ @SuppressWarnings("unused")
+ public static final int UNREGISTER_LISTENER_MSG = 2;
+ public static final int CONNECT_MSG = 4;
+ public static final int DISCONNECT_MSG = 6;
+ public static final int CONNECTED_MSG = 5;
+ public static final int DISCONNECTED_MSG = 7;
+ public static final int START_CUSTOM_ACTIVITY_MSG = 30;
+ public static final int CUSTOM_ACTIVITY_RESPONSE_MSG = 31;
+ public static final int SEND_MSG_TO_ACTIVITY_MSG = 32;
+ public static final int RECEIVE_MSG_FROM_ACTIVITY_MSG = 33;
+ public static final int DEVICE_STATUS_MSG = 40;
+ public static final int DEVICE_STATUS_RESPONSE_MSG = 41;
+ public static final int RESET_DEVICE_MSG = 1000;
+ public static final int RESET_DEVICE_RESPONSE_MSG = 1001;
+ @SuppressWarnings("unused")
+ public static final int LOG_MSG = 2000;
+
+ public static final int INVALID_STATE_TRANSITION = 11;
+ public static final int DEVICE_ERROR_MSG = 13;
+
+ @SuppressWarnings("unused")
+ public static final String RESPONSE_KEY = "RESPONSE";
+ @SuppressWarnings("unused")
+ public static final String REQUEST_KEY = "REQUEST";
+ public static final String NAME_KEY = "NAME_KEY";
+ public static final String PAYLOAD_KEY = "PAYLOAD_KEY";
+ public static final String APP_ID_KEY = "APP_ID_KEY";
+ public static final String SDK_VERSION_KEY = "SDK_VERSION_KEY";
+ public static final String CONNECTOR_INSTANCE_ID_KEY = "CONNECTOR_INSTANCE_ID_KEY";
+ public static final String RESULT_KEY = "RESULT_KEY";
+ public static final String FAIL_REASON_KEY = "FAIL_REASON_KEY";
+ public static final String RESULT_CODE_KEY = "RESULT_CODE_KEY";
+ public static final String INSTANCE_ID_KEY = "INSTANCE_ID_KEY";
+ public static final String EXTERNAL_DEVICE_STATE_KEY = "EXTERNAL_DEVICE_STATE_KEY";
+ public static final String EXTERNAL_DEVICE_STATE_DATA_PAYMENT_ID_KEY = "EXTERNAL_DEVICE_STATE_DATA_PAYMENT_ID_KEY";
+ public static final String EXTERNAL_DEVICE_STATE_DATA_CUSTOM_ACTIVITY_KEY = "EXTERNAL_DEVICE_STATE_DATA_CUSTOM_ACTIVITY_KEY";
+ @SuppressWarnings("unused")
+ public static final String IS_NON_BLOCKING_KEY = "IS_NON_BLOCKING_KEY";
+ public static final String REMOTE_REMOTE_DEVICE_CONNECTOR_ACTION = "com.clover.remote.RemoteDeviceConnector";
+ public static final String LOCAL_PAY_DISPLAY_PACKAGE = "com.clover.remote.protocol.local";
+ public static final String USB_PAY_DISPLAY_PACKAGE = "com.clover.remote.protocol.usb";
+
+ private boolean isConnected = false;
+
+ private final WeakReference context;
+ @SuppressWarnings({"unused", "FieldCanBeLocal"})
+ private final WeakReference account;
+ private ServiceConnection serviceConnection;
+ private CountDownLatch connectionLatch = null;// connection latch
+ private SynchronousQueue resetDeviceQueue = null;
+ private SynchronousQueue deviceStatusQueue = null;
+
+ // this will only work if all custom activities started are nonBlocking activities,
+ // where the 2nd request WILL finish the first, therefore the response
+ // should go to the first request's listener
+ private final Map instanceIdToCustomActivityListenersMap = new HashMap<>();
+ private final Object connectLock = new Object();
+ private final Object resetDeviceLock = new Object();
+ private final Object deviceStatusLock = new Object();
+ private final Messenger callbackMessenger;
+ @SuppressWarnings("FieldCanBeLocal")
+ private final Handler callbackHandler;
+ private Messenger mMessenger;
+ private final String instanceId = UUID.randomUUID().toString();
+ private final String appId;
+ private final String sdkVersion;
+ @SuppressWarnings("unused")
+ private final Executor connectExecutor = Executors.newSingleThreadExecutor(); // control connects and disconnects
+
+ /**
+ * @since 4.0.0
+ */
+ public RemoteDeviceConnector(Context context, Account account) {
+ this.context = new WeakReference<>(context);
+ this.account = new WeakReference<>(account);
+ this.appId = context.getPackageName();
+ this.sdkVersion = String.format("%s:%s", BuildConfig.LIBRARY_PACKAGE_NAME, BuildConfig.VERSION_NAME);
+
+ callbackHandler = new IncomingHandler(context.getMainLooper());
+ callbackMessenger = new Messenger(callbackHandler);
+ }
+
+ /**
+ * Calls connect with 5000ms connection timeout.
+ * @since 4.0.0
+ */
+ public boolean connect() throws IllegalStateException {
+ return connect(5000);
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ // SuppressLint("NewApi") is because serviceIntent.setPackage requires > Android.DONUT
+ @WorkerThread
+ @SuppressLint("NewApi")
+ public boolean connect(long connectionTimeout) throws IllegalThreadStateException {
+ if (Looper.myLooper() == Looper.getMainLooper()) {
+ throw new IllegalThreadStateException("Connector invoked on main thread");
+ }
+
+ if (!isConnected) {
+ synchronized (connectLock) {
+ if (isConnected) {
+ return true;
+ }
+ try {
+ connectionLatch = new CountDownLatch(1);
+ final CountDownLatch countDownLatch = connectionLatch;
+
+ Intent serviceIntent = new Intent(REMOTE_REMOTE_DEVICE_CONNECTOR_ACTION);
+ serviceIntent.setPackage(LOCAL_PAY_DISPLAY_PACKAGE);
+
+ List resolveInfos = context.get().getPackageManager().queryIntentServices(serviceIntent, 0);
+ if (resolveInfos == null || resolveInfos.size() == 0) {
+ serviceIntent.setPackage(USB_PAY_DISPLAY_PACKAGE);
+ }
+ resolveInfos = context.get().getPackageManager().queryIntentServices(serviceIntent, 0);
+
+ if (resolveInfos == null || resolveInfos.size() == 0) {
+ connectionLatch = null;
+ return false;
+ }
+
+ serviceConnection = new ServiceConnection() {
+ @Override
+ public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
+ mMessenger = new Messenger(iBinder);
+
+ // this try catch block is necessary for older versions of remote-pay, but for > 2020 Feb. release isn't needed,
+ // as the connect call will register the listener
+ try {
+ sendMessage(REGISTER_LISTENER_MSG, null, callbackMessenger);
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending message.", e);
+
+ //noinspection ConstantConditions
+ if (countDownLatch != null) {
+ countDownLatch.countDown();
+ }
+ return;
+ }
+
+ // now that we registered a RemoteDeviceStateService listener, we can ask it to connect.
+ // we will also pass in the "listener" messenger, which will make the registerListener call OBE, for newer versions
+ try {
+ sendMessage(CONNECT_MSG, null, callbackMessenger);
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending message.", e);
+
+ //noinspection ConstantConditions
+ if (countDownLatch != null) {
+ countDownLatch.countDown();
+ }
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName componentName) {
+ isConnected = false;
+ mMessenger = null;
+ countDownLatch.countDown();
+ instanceIdToCustomActivityListenersMap.clear();
+ connectionLatch = null;
+ }
+ };
+
+ Context ctx = this.context.get();
+
+ if (ctx != null) {
+ ComponentName componentName = ctx.startService(serviceIntent);
+ if (componentName != null) {
+ Log.d(RemoteDeviceConnector.class.getSimpleName(), String.format("%s:%s", componentName.getPackageName(), componentName.getClassName()));
+ } else {
+ Log.d(RemoteDeviceConnector.class.getSimpleName(), "startService returned null");
+ return false;
+ }
+ if (ctx.bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE)) { // if we auto-create, then we should get an immediate response even if not connected
+ try {
+ connectionLatch.await(connectionTimeout, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ disconnect();
+ e.printStackTrace();
+ } finally {
+ connectionLatch = null;
+ }
+ } else { // couldn't bind, so set the ServiceConnection to null and return false...i.e. NOT connected
+ serviceConnection = null;
+ return false;
+ }
+ }
+ } finally {
+ connectionLatch = null;
+ }
+ }
+ }
+
+ if (!isConnected) {
+ Context ctx = this.context.get();
+ ServiceConnection sc = serviceConnection;
+ if (ctx != null && sc != null) {
+ try {
+ ctx.unbindService(serviceConnection);
+ } catch (Exception e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error unbinding from service.", e);
+ } finally {
+ serviceConnection = null;
+ }
+ }
+ }
+ return isConnected;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ public void disconnect() {
+ synchronized (connectLock) {
+
+ if (isConnected) {
+ isConnected = false;
+
+ try {
+ sendMessage(DISCONNECT_MSG, null);
+
+ } catch (RemoteException re) {
+ Log.w(RemoteDeviceConnector.class.getSimpleName(), "Error sending disconnect message.", re);
+ }
+
+ }
+ instanceIdToCustomActivityListenersMap.clear();
+ Context ctx = context.get();
+ if (ctx != null) {
+ ServiceConnection sc = serviceConnection;
+ if (sc != null) {
+ serviceConnection = null;
+ try {
+ ctx.unbindService(sc);
+ } catch (Exception e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Can't unbind to service.", e);
+ }
+ }
+ } else {
+ Log.i(RemoteDeviceConnector.class.getSimpleName(), "Context is null, can't disconnect");
+ }
+ }
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @WorkerThread
+ @SuppressWarnings("unused")
+ public void startCustomActivity(CustomActivityRequest request, CustomActivityListener listener) {
+ if (request == null) {
+ throw new IllegalArgumentException("Request can't be null");
+ }
+ if (listener == null) {
+ throw new IllegalArgumentException("Listener can't be null");
+ }
+
+ String instanceId = UUID.randomUUID().toString();
+ if (connect()) {
+ instanceIdToCustomActivityListenersMap.put(instanceId, listener);
+
+ try {
+ Bundle customActivityRequestBundle = new Bundle();
+ customActivityRequestBundle.putString(NAME_KEY, request.name);
+ customActivityRequestBundle.putString(PAYLOAD_KEY, request.payload);
+// customActivityRequestBundle.putBoolean(IS_NON_BLOCKING_KEY, request.nonBlocking);
+ customActivityRequestBundle.putString(INSTANCE_ID_KEY, instanceId);
+ sendMessage(START_CUSTOM_ACTIVITY_MSG, customActivityRequestBundle);
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending start custom activity message", e);
+ instanceIdToCustomActivityListenersMap.remove(instanceId);
+ listener.onCustomActivityResult(new CustomActivityResponse(request.name, CustomActivityResponse.CUSTOM_ACTIVITY_RESULT_CANCEL, null, "Communication Error."));
+ }
+ } else {
+ listener.onCustomActivityResult(new CustomActivityResponse(request.name, CustomActivityResponse.CUSTOM_ACTIVITY_RESULT_CANCEL, null, "Not connected"));
+ }
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @WorkerThread
+ @SuppressWarnings({"UnusedReturnValue", "unused"})
+ public boolean sendMessageToActivity(MessageToActivity messageToActivity) {
+ if (instanceIdToCustomActivityListenersMap.size() > 0 && connect()) {
+ try {
+ Bundle messageToActivityBundle = new Bundle();
+ messageToActivityBundle.putString(NAME_KEY, messageToActivity.name);
+ messageToActivityBundle.putString(PAYLOAD_KEY, messageToActivity.payload);
+ sendMessage(SEND_MSG_TO_ACTIVITY_MSG, messageToActivityBundle);
+ return true;
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending start custom activity message", e);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @WorkerThread
+ @SuppressWarnings({"UnusedParameters", "unused"})
+ public ResetDeviceResponse resetDevice(ResetDeviceRequest request) {
+ if(!connect()){
+ return new ResetDeviceResponse(ResultCode.DISCONNECTED);
+ }
+ synchronized (resetDeviceLock) {
+ if (resetDeviceQueue != null) {
+ return new ResetDeviceResponse(ResultCode.INTERRUPTED);
+ }
+ //noinspection ConstantConditions
+ if (resetDeviceQueue == null) {
+ try {
+ Bundle resetDeviceBundle = new Bundle();
+ resetDeviceQueue = new SynchronousQueue<>();
+ sendMessage(RESET_DEVICE_MSG, resetDeviceBundle);
+ ResetDeviceResponse response = resetDeviceQueue.poll(2000, TimeUnit.MILLISECONDS);
+ return (response != null) ? response : new ResetDeviceResponse(ResultCode.INTERRUPTED);
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending reset device message", e);
+ return new ResetDeviceResponse(ResultCode.ERROR);
+ } catch (InterruptedException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending reset device message", e);
+ return new ResetDeviceResponse(ResultCode.INTERRUPTED);
+ } finally {
+ resetDeviceQueue = null;
+ }
+ } else {
+ return new ResetDeviceResponse(ResultCode.INTERRUPTED);
+ }
+ }
+ }
+
+ /**
+ * @since 4.0.0
+ */
+ @WorkerThread
+ @SuppressWarnings({"UnusedParameters", "unused"})
+ public DeviceStatusResponse retrieveDeviceStatus(DeviceStatusRequest request) {
+ if (connect()) {
+ synchronized (deviceStatusLock) {
+ if (deviceStatusQueue != null) {
+ return new DeviceStatusResponse(ResultCode.INTERRUPTED);
+ }
+
+ try {
+ Bundle retrieveDeviceStatusBundle = new Bundle();
+ deviceStatusQueue = new SynchronousQueue<>();
+ sendMessage(DEVICE_STATUS_MSG, retrieveDeviceStatusBundle);
+ DeviceStatusResponse response = deviceStatusQueue.poll(2000, TimeUnit.MILLISECONDS);
+ if (response == null) {
+ response = new DeviceStatusResponse(ResultCode.INTERRUPTED);
+ }
+ return response;
+ } catch (RemoteException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending device status message", e);
+ return new DeviceStatusResponse(ResultCode.ERROR);
+ } catch (InterruptedException e) {
+ Log.e(RemoteDeviceConnector.class.getSimpleName(), "Error sending device status message", e);
+ return new DeviceStatusResponse(ResultCode.INTERRUPTED);
+ } finally {
+ deviceStatusQueue = null;
+ }
+ }
+ } else {
+ return new DeviceStatusResponse(ResultCode.DISCONNECTED);
+ }
+ }
+
+ private void sendMessage(int what, Bundle bundle) throws RemoteException {
+ this.sendMessage(what, bundle, null);
+ }
+
+ @SuppressWarnings("RedundantThrows")
+ private void sendMessage(int what, Bundle bundle, Messenger replyTo) throws RemoteException {
+ if (bundle == null) {
+ bundle = new Bundle();
+ }
+
+ bundle.putString(APP_ID_KEY, appId);
+ bundle.putString(SDK_VERSION_KEY, sdkVersion);
+ bundle.putString(CONNECTOR_INSTANCE_ID_KEY, instanceId);
+
+ Message message = Message.obtain();
+ message.obj = bundle;
+ message.replyTo = replyTo;
+ message.what = what;
+
+ try {
+ mMessenger.send(message);
+ } catch (RemoteException e) {
+ disconnect();
+ }
+ }
+
+ class IncomingHandler extends Handler {
+
+ public IncomingHandler(Looper looper) {
+ super(looper);
+ }
+
+ @Override
+ public void handleMessage(@NonNull Message msg) {
+ try {
+ @SuppressWarnings("rawtypes")
+ SynchronousQueue dsq = deviceStatusQueue;
+ @SuppressWarnings("rawtypes")
+ SynchronousQueue rdq = resetDeviceQueue;
+ Bundle resultBundle = ((Bundle) msg.obj);
+ switch (msg.what) {
+ case CONNECTED_MSG: {
+ isConnected = true;
+ if (connectionLatch != null) {
+ connectionLatch.countDown();
+ }
+ break;
+ }
+ case DISCONNECTED_MSG: {
+ isConnected = false;
+ if (connectionLatch != null) {
+ connectionLatch.countDown();
+ }
+ break;
+ }
+ case CUSTOM_ACTIVITY_RESPONSE_MSG:
+ CustomActivityResponse car = new CustomActivityResponse(resultBundle.getString(NAME_KEY), resultBundle.getInt(RESULT_KEY), resultBundle.getString(PAYLOAD_KEY), resultBundle.getString(FAIL_REASON_KEY));
+ String instanceId = resultBundle.getString(INSTANCE_ID_KEY);
+ CustomActivityListener lListener = instanceIdToCustomActivityListenersMap.remove(instanceId);
+
+ if (lListener != null) {
+ lListener.onCustomActivityResult(new CustomActivityResponse(car.name, car.result, car.payload, car.failReason));
+ } else {
+ // we have a response, with no instanceid match...
+ Log.i(RemoteDeviceConnector.class.getSimpleName(), "Got a custom activity response, but no registered listeners");
+ }
+ break;
+ case RECEIVE_MSG_FROM_ACTIVITY_MSG:
+ MessageFromActivity mfa = new MessageFromActivity(resultBundle.getString(NAME_KEY), resultBundle.getString(PAYLOAD_KEY));
+ String msgInstanceId = resultBundle.getString(INSTANCE_ID_KEY);
+ CustomActivityListener l = instanceIdToCustomActivityListenersMap.get(msgInstanceId);
+ if (l != null) {
+ l.onMessageFromActivity(new MessageFromActivity(mfa.name, mfa.payload));
+ }
+ break;
+ case DEVICE_STATUS_RESPONSE_MSG:
+ if (dsq == null) {
+ Log.w(RemoteDeviceConnector.class.getSimpleName(), "Got device status response, but no one is listening!");
+ return;
+ }
+ String resultCodeValue = resultBundle.getString(RESULT_CODE_KEY);
+ ResultCode resultCode = ResultCode.UNKNOWN;
+ try {
+ resultCode = ResultCode.valueOf(resultCodeValue);
+ } catch (IllegalArgumentException ignored) {
+ }
+
+ String externalDeviceStateValue = resultBundle.getString(EXTERNAL_DEVICE_STATE_KEY);
+ ExternalDeviceState externalDeviceState = ExternalDeviceState.UNKNOWN;
+ try {
+ externalDeviceState = ExternalDeviceState.valueOf(externalDeviceStateValue);
+ } catch (IllegalArgumentException ignored) {
+ }
+
+ String externalDeviceStateDataPaymentValue = resultBundle.getString(EXTERNAL_DEVICE_STATE_DATA_PAYMENT_ID_KEY);
+ String externalDeviceStateDataCustomActivityValue = resultBundle.getString(EXTERNAL_DEVICE_STATE_DATA_CUSTOM_ACTIVITY_KEY);
+ ExternalDeviceStateData externalDeviceStateData = new ExternalDeviceStateData(externalDeviceStateDataPaymentValue, externalDeviceStateDataCustomActivityValue);
+
+ DeviceStatusResponse deviceStatusResponse = new DeviceStatusResponse(resultCode, externalDeviceState, externalDeviceStateData);
+ try {
+ //noinspection unchecked
+ if (!dsq.offer(deviceStatusResponse, 1000, TimeUnit.MILLISECONDS)) {
+ Log.i(DeviceStatusResponse.class.getSimpleName(), "Couldn't place the DeviceStatusResponse in the queue.");
+ }
+ } catch (InterruptedException e) {
+ Log.i(DeviceStatusResponse.class.getSimpleName(), "Error processing DeviceStatusResponse", e);
+ }
+ if (deviceStatusResponse.data != null) {
+ //noinspection unused
+ String currentCustomActivity = deviceStatusResponse.data.customActivityId;
+ // would be an option to clear up the keys here, but that might cause other problems
+ }
+ break;
+ case RESET_DEVICE_RESPONSE_MSG:
+
+ String resetResultCodeValue = resultBundle.getString(RESULT_CODE_KEY);
+ ResultCode resetResultCode = ResultCode.UNKNOWN;
+ try {
+ resetResultCode = ResultCode.valueOf(resetResultCodeValue);
+ } catch (IllegalArgumentException ignored) {
+ }
+
+ //noinspection unused
+ String reason = resultBundle.getString(FAIL_REASON_KEY);
+
+ String resetExternalDeviceStateValue = resultBundle.getString(EXTERNAL_DEVICE_STATE_KEY);
+ @SuppressWarnings("unused")
+ ExternalDeviceState resetExternalDeviceState = ExternalDeviceState.UNKNOWN;
+ try {
+ //noinspection UnusedAssignment
+ resetExternalDeviceState = ExternalDeviceState.valueOf(resetExternalDeviceStateValue);
+ } catch (IllegalArgumentException ignored) {
+ }
+ if (resetResultCode == ResultCode.OK) {
+ ResetDeviceResponse resetDeviceResponse = new ResetDeviceResponse(resetResultCode);
+ if (rdq != null) {
+ try {
+ //noinspection unchecked
+ if (!rdq.offer(resetDeviceResponse, 100, TimeUnit.MILLISECONDS)) {
+ Log.i(RemoteDeviceConnector.class.getSimpleName(), "Couldn't place the ResetDeviceResponse in the queue.");
+ }
+ } catch (InterruptedException e) {
+ Log.i(RemoteDeviceConnector.class.getSimpleName(), "Error processing ResetDeviceResponse", e);
+ }
+ } else {
+ Log.w(RemoteDeviceConnector.class.getSimpleName(), "Got reset device response, but no one is listening for it!");
+ }
+
+ // if we broke while waiting for DeviceStatusRequest
+ if (dsq != null) {
+ try {
+ //noinspection unchecked
+ dsq.offer(new DeviceStatusResponse(ResultCode.FAIL), 100, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException ie) {
+ // don't really care...we are just trying to clean up the queue
+ }
+ }
+
+ for (String key : instanceIdToCustomActivityListenersMap.keySet()) {
+ CustomActivityListener listener = instanceIdToCustomActivityListenersMap.remove(key);
+ if (listener != null) {
+ listener.onCustomActivityResult(new CustomActivityResponse(ResultCode.INTERRUPTED, "action", 0, null, "Device reset."));
+ }
+ }
+ }
+
+ break;
+ case DEVICE_ERROR_MSG:
+ // we will try to reset all states...
+ CountDownLatch cl = connectionLatch;
+ if (cl != null && cl.getCount() > 0) {
+ cl.countDown();
+ }
+ if (dsq != null) {
+ try {
+ //noinspection unchecked
+ dsq.offer(new DeviceStatusResponse(ResultCode.FAIL), 100, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException ie) {
+ // don't really care...we are just trying to clean up the queue
+ }
+ }
+ if (rdq != null) {
+ try {
+ //noinspection unchecked
+ rdq.offer(new ResetDeviceResponse(ResultCode.FAIL), 100, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException ie) {
+ // don't really care...we are just trying to clean up the queue
+ }
+ }
+ instanceIdToCustomActivityListenersMap.clear();
+
+ break;
+ case INVALID_STATE_TRANSITION:
+ // not sure what we can infer from this
+ break;
+ }
+
+ } catch (Throwable throwable) {
+ throwable.printStackTrace();
+ }
+ }
+ }
+}
+
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceRequest.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceRequest.java
new file mode 100644
index 000000000..fc977e6eb
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceRequest.java
@@ -0,0 +1,6 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class ResetDeviceRequest {
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceResponse.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceResponse.java
new file mode 100644
index 000000000..45551de28
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResetDeviceResponse.java
@@ -0,0 +1,24 @@
+package com.clover.sdk.cfp.connector;
+/**
+ * @since 4.0.0
+ */
+public class ResetDeviceResponse extends BaseResponse {
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public String reason;
+
+ /**
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ public ExternalDeviceState state;
+
+ /**
+ * @since 4.0.0
+ */
+ public ResetDeviceResponse(ResultCode resultCode) {
+ super(resultCode);
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResultCode.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResultCode.java
new file mode 100644
index 000000000..04af8d7fc
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/ResultCode.java
@@ -0,0 +1,45 @@
+package com.clover.sdk.cfp.connector;
+
+import java.io.Serializable;
+
+/**
+ * @since 4.0.0
+ */
+public enum ResultCode implements Serializable {
+ /**
+ * completed normally
+ * @since 4.0.0
+ */
+ OK,
+ /**
+ * An Error occurred, reason unknown.
+ * @since 4.0.0
+ */
+ ERROR,
+ /**
+ * Request failed to execute.
+ * @since 4.0.0
+ */
+ FAIL,
+ /**
+ * Request wasn't sent because of a connection failure
+ * @since 4.0.0
+ */
+ DISCONNECTED,
+ /**
+ * Request was cancelled, and completed
+ * @since 4.0.0
+ */
+ @SuppressWarnings("unused")
+ CANCEL,
+ /**
+ * There was an interruption waiting for the response, so the status is unknown
+ * @since 4.0.0
+ */
+ INTERRUPTED,
+ /**
+ * We have an unknown result code
+ * @since 4.0.0
+ */
+ UNKNOWN
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPMessage.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPMessage.java
new file mode 100644
index 000000000..453da8bf8
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPMessage.java
@@ -0,0 +1,300 @@
+/**
+ * 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.cfp.connector.session;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ *
{@link #getMessage message}
+ *
{@link #getBeep beep}
+ *
{@link #getDuration duration}
+ *
{@link #getMessageId messageId}
+ *
+ */
+@SuppressWarnings("all")
+public class CFPMessage extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getMessage() {
+ return genClient.cacheGet(CacheKey.message);
+ }
+
+ public java.lang.Boolean getBeep() {
+ return genClient.cacheGet(CacheKey.beep);
+ }
+
+ public java.lang.Integer getDuration() {
+ return genClient.cacheGet(CacheKey.duration);
+ }
+
+ public java.lang.Integer getMessageId() {
+ return genClient.cacheGet(CacheKey.messageId);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ message
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ beep
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ duration
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ messageId
+ (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 CFPMessage() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CFPMessage(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CFPMessage(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 CFPMessage(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 CFPMessage(CFPMessage 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 'message' field is set and is not null */
+ public boolean isNotNullMessage() {
+ return genClient.cacheValueIsNotNull(CacheKey.message);
+ }
+
+ /** Checks whether the 'beep' field is set and is not null */
+ public boolean isNotNullBeep() {
+ return genClient.cacheValueIsNotNull(CacheKey.beep);
+ }
+
+ /** Checks whether the 'duration' field is set and is not null */
+ public boolean isNotNullDuration() {
+ return genClient.cacheValueIsNotNull(CacheKey.duration);
+ }
+
+ /** Checks whether the 'messageId' field is set and is not null */
+ public boolean isNotNullMessageId() {
+ return genClient.cacheValueIsNotNull(CacheKey.messageId);
+ }
+
+
+
+ /** Checks whether the 'message' field has been set, however the value could be null */
+ public boolean hasMessage() {
+ return genClient.cacheHasKey(CacheKey.message);
+ }
+
+ /** Checks whether the 'beep' field has been set, however the value could be null */
+ public boolean hasBeep() {
+ return genClient.cacheHasKey(CacheKey.beep);
+ }
+
+ /** Checks whether the 'duration' field has been set, however the value could be null */
+ public boolean hasDuration() {
+ return genClient.cacheHasKey(CacheKey.duration);
+ }
+
+ /** Checks whether the 'messageId' field has been set, however the value could be null */
+ public boolean hasMessageId() {
+ return genClient.cacheHasKey(CacheKey.messageId);
+ }
+
+
+ /**
+ * Sets the field 'message'.
+ */
+ public CFPMessage setMessage(java.lang.String message) {
+ return genClient.setOther(message, CacheKey.message);
+ }
+
+ /**
+ * Sets the field 'beep'.
+ */
+ public CFPMessage setBeep(java.lang.Boolean beep) {
+ return genClient.setOther(beep, CacheKey.beep);
+ }
+
+ /**
+ * Sets the field 'duration'.
+ */
+ public CFPMessage setDuration(java.lang.Integer duration) {
+ return genClient.setOther(duration, CacheKey.duration);
+ }
+
+ /**
+ * Sets the field 'messageId'.
+ */
+ public CFPMessage setMessageId(java.lang.Integer messageId) {
+ return genClient.setOther(messageId, CacheKey.messageId);
+ }
+
+
+ /** Clears the 'message' field, the 'has' method for this field will now return false */
+ public void clearMessage() {
+ genClient.clear(CacheKey.message);
+ }
+ /** Clears the 'beep' field, the 'has' method for this field will now return false */
+ public void clearBeep() {
+ genClient.clear(CacheKey.beep);
+ }
+ /** Clears the 'duration' field, the 'has' method for this field will now return false */
+ public void clearDuration() {
+ genClient.clear(CacheKey.duration);
+ }
+ /** Clears the 'messageId' field, the 'has' method for this field will now return false */
+ public void clearMessageId() {
+ genClient.clear(CacheKey.messageId);
+ }
+
+
+ /**
+ * 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 CFPMessage copyChanges() {
+ CFPMessage copy = new CFPMessage();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CFPMessage src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CFPMessage(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CFPMessage createFromParcel(android.os.Parcel in) {
+ CFPMessage instance = new CFPMessage(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 CFPMessage[] newArray(int size) {
+ return new CFPMessage[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CFPMessage.class;
+ }
+
+ @Override
+ public CFPMessage create(org.json.JSONObject jsonObject) {
+ return new CFPMessage(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean MESSAGE_IS_REQUIRED = false;
+ public static final boolean BEEP_IS_REQUIRED = false;
+ public static final boolean DURATION_IS_REQUIRED = false;
+ public static final boolean MESSAGEID_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.java
new file mode 100644
index 000000000..4e792f4f8
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionConnector.java
@@ -0,0 +1,474 @@
+package com.clover.sdk.cfp.connector.session;
+
+import com.clover.sdk.v3.customers.CustomerInfo;
+import com.clover.sdk.v3.order.DisplayOrder;
+import com.clover.sdk.v3.payments.Transaction;
+
+import android.content.ContentProviderClient;
+import android.content.Context;
+import android.database.ContentObserver;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.Serializable;
+import java.lang.ref.WeakReference;
+import java.util.*;
+
+/*
+ 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
+ */
+@SuppressWarnings({"WeakerAccess", "unused"})
+public class CFPSessionConnector implements Serializable, CFPSessionListener {
+ public static final String DISPLAY_ORDER = "com.clover.extra.DISPLAY_ORDER";
+ public static final String CUSTOMER_INFO = "com.clover.extra.CUSTOMER_INFO";
+ public static final String SESSION = "SESSION";
+ public static final String PROPERTIES = "PROPERTIES";
+ public static final String TRANSACTION = "TRANSACTION";
+ public static final String MESSAGE = "MESSAGE";
+ public static final String MESSAGE_DURATION = "MESSAGE_DURATION";
+
+ public static final String QUERY_PARAMETER_VALUE = "value";
+ public static final String QUERY_PARAMETER_NAME = "name";
+ public static final String QUERY_PARAMETER_SRC = "src";
+ public static final String BUNDLE_KEY_TYPE = "TYPE";
+ public static final String BUNDLE_KEY_DATA = "DATA";
+ public static final String BUNDLE_KEY_MESSAGE = "MESSAGE";
+ public static final String BUNDLE_KEY_DURATION = "DURATION";
+ public static final String BUNDLE_KEY_TRANSACTION = "TRANSACTION";
+ private static final String EXTERNAL = "EXTERNAL";
+ private static final String INTERNAL = "INTERNAL";
+ protected String messageUuid;
+
+ private static final String TAG = "SessionConnector";
+
+ private ContentProviderClient sessionContentProviderClient;
+ private WeakReference contextWeakReference;
+ Set sessionListeners = new LinkedHashSet<>();
+ private SessionContentObserver sessionContentObserver = null;
+ private ContentObserver propertyContentObserver;
+ public CFPSessionConnector(Context context) {
+ this.contextWeakReference = new WeakReference<>(context);
+ connect();
+ }
+
+ private Context getContext() {
+ return (null != contextWeakReference) ? contextWeakReference.get() : null;
+ }
+
+ public boolean connect() {
+ Context context = getContext();
+ if (sessionContentProviderClient == null && null != context) {
+ sessionContentProviderClient = context.getContentResolver().acquireContentProviderClient(CFPSessionContract.AUTHORITY);
+ }
+ return sessionContentProviderClient != null;
+ }
+
+ public void disconnect() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ sessionContentProviderClient.close();
+ }
+ sessionContentProviderClient = null;
+ }
+
+ public boolean addSessionListener(CFPSessionListener listener) {
+ Context context = getContext();
+ if (sessionListeners.size() == 0 && null == sessionContentObserver && null != context) {
+ sessionContentObserver = new SessionContentObserver(this);
+ registerContentObserver(context, sessionContentObserver);
+ }
+ return sessionListeners.add(listener);
+ }
+
+ public boolean removeSessionListener(CFPSessionListener listener) {
+ Context context = getContext();
+ boolean result = sessionListeners.remove(listener);
+ if (sessionListeners.size() == 0 && null != context) {
+ unregisterContentObserver(context, sessionContentObserver);
+ sessionContentObserver = null;
+ }
+ return result;
+ }
+
+ 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;
+ }
+
+ protected ContentProviderClient getSessionContentProviderClient() {
+ return sessionContentProviderClient;
+ }
+
+ public CustomerInfo getCustomerInfo() {
+ 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;
+ }
+
+ public void setCustomerInfo(CustomerInfo customerInfo) {
+ 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);
+ }
+ }
+
+ public DisplayOrder getDisplayOrder() {
+ 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;
+ }
+
+ public void setDisplayOrder(DisplayOrder displayOrder, boolean isOrderModificationSupported) {
+ 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);
+ }
+ }
+
+ public void setProperty(String key, String value) {
+ 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(CFPSessionContract.CALL_METHOD_SET_PROPERTY, null, bundle);
+ }
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage(), e);
+ }
+ }
+
+ public String getProperty(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()) {
+ 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;
+ }
+
+ public void removeProperty(String key) {
+ 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);
+ }
+ }
+
+ public Transaction getTransaction() {
+ 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;
+ }
+
+ public void setTransaction(Transaction transaction) {
+ 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);
+ }
+ }
+ }
+
+ public CFPMessage getMessage() {
+ 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;
+ }
+
+ public void setMessage(CFPMessage cfpMessage) {
+ 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);
+ }
+ }
+ }
+ public void sendSessionEvent(String eventType, String data) {
+ 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);
+ }
+ }
+
+ @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.
+ */
+ class SessionContentObserver extends ContentObserver {
+ private CFPSessionConnector connector;
+ private String lastUuid="";
+
+ SessionContentObserver(CFPSessionConnector connector) {
+ super(new Handler());
+ this.connector = connector;
+ }
+
+ CFPSessionConnector getConnector() {
+ return connector;
+ }
+
+ void cleanupSessionConnector() {
+ this.connector = null;
+ }
+
+ @Override
+ public boolean deliverSelfNotifications() {
+ return false;
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ super.onChange(selfChange);
+ }
+
+ @Override
+ public void onChange(boolean selfChange, Uri uri) {
+ if (null == getConnector()) return;
+
+ String 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.equals(lastUuid))) {
+ lastUuid = messageUuid;
+ switch (CFPSessionContract.matcher.match(uri)) {
+ case CFPSessionContract.SESSION:
+ getConnector().onSessionDataChanged(SESSION, null);
+ break;
+ case CFPSessionContract.SESSION_CUSTOMER_INFO:
+ getConnector().onSessionDataChanged(CUSTOMER_INFO, getConnector().getCustomerInfo());
+ break;
+ case CFPSessionContract.SESSION_DISPLAY_ORDER:
+ getConnector().onSessionDataChanged(DISPLAY_ORDER, getConnector().getDisplayOrder());
+ break;
+ case CFPSessionContract.PROPERTIES:
+ getConnector().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(getConnector().messageUuid)) {
+ String key = uri.getLastPathSegment();
+ JSONObject property = getConnector().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);
+ }
+ getConnector().onSessionDataChanged(PROPERTIES, obj);
+ }
+ }
+ break;
+ case CFPSessionContract.SESSION_TRANSACTION:
+ getConnector().onSessionDataChanged(TRANSACTION, getConnector().getTransaction());
+ break;
+ case CFPSessionContract.SESSION_MESSAGE:
+ getConnector().onSessionDataChanged(MESSAGE, getConnector().getMessage());
+ break;
+ case CFPSessionContract.EVENT:
+ String type = uri.getLastPathSegment();
+ String payload = uri.getQueryParameter(QUERY_PARAMETER_VALUE);
+ getConnector().onSessionEvent(type, payload);
+ break;
+ default:
+ Log.d(TAG, "Unknown URI - Changed: --> " + uri.toString());
+ return;
+ }
+ } 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/CFPSessionContract.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.java
new file mode 100644
index 000000000..729407dbe
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionContract.java
@@ -0,0 +1,78 @@
+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_TRANSACTION_CLASS = "TX_CLASS";
+ 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.cfp.provider.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_CLEAR_SESSION = "clearSession";
+ 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_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/CFPSessionListener.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionListener.java
new file mode 100644
index 000000000..07e68ad01
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionListener.java
@@ -0,0 +1,6 @@
+package com.clover.sdk.cfp.connector.session;
+
+public interface CFPSessionListener {
+ void onSessionDataChanged(String type, Object data);
+ void onSessionEvent(String type, String data);
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionProperty.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionProperty.java
new file mode 100644
index 000000000..f193deddd
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionProperty.java
@@ -0,0 +1,267 @@
+package com.clover.sdk.cfp.connector.session;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * 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.
+ */
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ *
{@link #getPropertyName propertyName}
+ *
{@link #getPropertyValue propertyValue}
+ *
{@link #getPropertyAction propertyAction}
+ *
{@link #getInputOptions inputOptions}
+ *
+ */
+@SuppressWarnings("all")
+public class CFPSessionProperty extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getPropertyName() {
+ return genClient.cacheGet(CacheKey.propertyName);
+ }
+
+ public java.lang.String getPropertyValue() {
+ return genClient.cacheGet(CacheKey.propertyValue);
+ }
+
+ public CFPSessionPropertyAction getPropertyAction() {
+ return genClient.cacheGet(CacheKey.propertyAction);
+ }
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ propertyName
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ propertyValue
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ propertyAction
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(CFPSessionPropertyAction.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 CFPSessionProperty() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CFPSessionProperty(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CFPSessionProperty(String json) throws IllegalArgumentException {
+ this();
+ try {
+ genClient.setJsonObject(new org.json.JSONObject(json));
+ } catch (org.json.JSONException e) {
+ throw new IllegalArgumentException("invalid json", e);
+ }
+ }
+
+ /**
+ * 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 CFPSessionProperty(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 CFPSessionProperty(CFPSessionProperty 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 'propertyName' field is set and is not null */
+ public boolean isNotNullPropertyName() {
+ return genClient.cacheValueIsNotNull(CacheKey.propertyName);
+ }
+
+ /** Checks whether the 'propertyValue' field is set and is not null */
+ public boolean isNotNullPropertyValue() {
+ return genClient.cacheValueIsNotNull(CacheKey.propertyValue);
+ }
+
+ /** Checks whether the 'propertyAction' field is set and is not null */
+ public boolean isNotNullPropertyAction() {
+ return genClient.cacheValueIsNotNull(CacheKey.propertyAction);
+ }
+
+
+ /** Checks whether the 'propertyName' field has been set, however the value could be null */
+ public boolean hasPropertyName() {
+ return genClient.cacheHasKey(CacheKey.propertyName);
+ }
+
+ /** Checks whether the 'propertyValue' field has been set, however the value could be null */
+ public boolean hasPropertyValue() {
+ return genClient.cacheHasKey(CacheKey.propertyValue);
+ }
+
+ /** Checks whether the 'propertyAction' field has been set, however the value could be null */
+ public boolean hasPropertyAction() {
+ return genClient.cacheHasKey(CacheKey.propertyAction);
+ }
+
+ /**
+ * Sets the field 'propertyName'.
+ */
+ public CFPSessionProperty setPropertyName(java.lang.String propertyName) {
+ return genClient.setOther(propertyName, CacheKey.propertyName);
+ }
+
+ /**
+ * Sets the field 'propertyValue'.
+ */
+ public CFPSessionProperty setPropertyValue(java.lang.String propertyValue) {
+ return genClient.setOther(propertyValue, CacheKey.propertyValue);
+ }
+
+ /**
+ * Sets the field 'propertyAction'.
+ */
+ public CFPSessionProperty setPropertyAction(CFPSessionPropertyAction propertyAction) {
+ return genClient.setOther(propertyAction, CacheKey.propertyAction);
+ }
+
+ /** Clears the 'propertyName' field, the 'has' method for this field will now return false */
+ public void clearPropertyName() {
+ genClient.clear(CacheKey.propertyName);
+ }
+ /** Clears the 'propertyValue' field, the 'has' method for this field will now return false */
+ public void clearPropertyValue() {
+ genClient.clear(CacheKey.propertyValue);
+ }
+ /** Clears the 'propertyAction' field, the 'has' method for this field will now return false */
+ public void clearPropertyAction() {
+ genClient.clear(CacheKey.propertyAction);
+ }
+
+ /**
+ * 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 CFPSessionProperty copyChanges() {
+ CFPSessionProperty copy = new CFPSessionProperty();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CFPSessionProperty src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CFPSessionProperty(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CFPSessionProperty createFromParcel(android.os.Parcel in) {
+ CFPSessionProperty instance = new CFPSessionProperty(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 CFPSessionProperty[] newArray(int size) {
+ return new CFPSessionProperty[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ @Override
+ public CFPSessionProperty create(org.json.JSONObject jsonObject) {
+ return new CFPSessionProperty(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+
+ public static final boolean PROPERTYNAME_IS_REQUIRED = false;
+ public static final boolean PROPERTYVALUE_IS_REQUIRED = false;
+ public static final boolean PROPERTYACTION_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionPropertyAction.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionPropertyAction.java
new file mode 100644
index 000000000..2ea8beb58
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/session/CFPSessionPropertyAction.java
@@ -0,0 +1,56 @@
+/**
+ * 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.cfp.connector.session;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum CFPSessionPropertyAction implements Parcelable {
+ INSERT, UPDATE, DELETE;
+
+ @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 CFPSessionPropertyAction createFromParcel(final Parcel source) {
+ return CFPSessionPropertyAction.valueOf(source.readString());
+ }
+
+ @Override
+ public CFPSessionPropertyAction[] newArray(final int size) {
+ return new CFPSessionPropertyAction[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingConnector.java
new file mode 100644
index 000000000..b5a253815
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingConnector.java
@@ -0,0 +1,91 @@
+package com.clover.sdk.cfp.connector.touchpoint;
+
+import android.content.Context;
+import android.os.Bundle;
+
+import com.clover.sdk.v1.CallConnector;
+import com.clover.sdk.v3.device.Device;
+import com.clover.sdk.v3.merchant.MerchantDevicesV2Connector;
+
+/**
+ * A class that encapsulates interaction with the CFP_TOUCH_POINT Setting. Changes
+ * to this setting are synced to the cloud.
+ *
+ * @see TouchPointSettingContract
+ */
+public class TouchPointSettingConnector extends CallConnector {
+
+ public static final String METHOD_GET_TOUCH_POINT_SETTING = "METHOD_GET_TOUCH_POINT_SETTING";
+ public static final String METHOD_SET_TOUCH_POINT_SETTING = "METHOD_SET_TOUCH_POINT_SETTING";
+ public static final String SETTING_VALUE = "SETTING_VALUE";
+
+ public TouchPointSettingConnector(Context context) {
+ super(context, TouchPointSettingContract.AUTHORITY_URI);
+ }
+
+ /**
+ * Get the Touch Point setting.
+ *
+ * @return The merchant-level setting value if available, or the global default value if merchant-level is not available.
+ */
+ public String getTouchPointSetting() {
+ final Bundle result = context.getContentResolver().call(TouchPointSettingContract.AUTHORITY_URI, METHOD_GET_TOUCH_POINT_SETTING, null, null);
+ if (result != null) {
+ return result.getString(SETTING_VALUE);
+ }
+ return null;
+ }
+
+ /**
+ * Set a custom Touch Point category for your app activity that corresponds
+ * to the "com.clover.remote.terminal.action.START_CUSTOMER_EXPERIENCE_ACTIVITY" action
+ *
+ * @param category The category string from the manifest of your Take-over Touch Point activity
+ * @return The merchant-level setting value if available, or the global default value if merchant-level is not available.
+ */
+ public String setTouchPointCategory(String category) {
+ return setTouchPointCategory(category, false);
+ }
+
+ /**
+ * Set a custom Touch Point category for your app activity that corresponds
+ * to the "com.clover.remote.terminal.action.START_CUSTOMER_EXPERIENCE_ACTIVITY" action
+ *
+ * @param category The category string from the manifest of your Take-over Touch Point activity
+ * @return The merchant-level setting value if available, or the global default value if merchant-level is not available.
+ */
+ public String setTouchPointCategory(String category, boolean deviceLevel) {
+ checkForNullArgument(category);
+ Bundle extras = new Bundle();
+ extras.putString(TouchPointSettingContract.TOUCH_POINT_CATEGORY, category);
+ Device device = new MerchantDevicesV2Connector(context).getDevice();
+ String deviceId = device != null ? device.getId() : null;
+ if (deviceLevel && deviceId != null) {
+ extras.putString(TouchPointSettingContract.DEVICE_SERIAL, deviceId);
+ }
+ final Bundle result = context.getContentResolver().call(TouchPointSettingContract.AUTHORITY_URI, METHOD_SET_TOUCH_POINT_SETTING, null, extras);
+ if (result != null) {
+ return result.getString(SETTING_VALUE);
+ }
+ return null;
+ }
+
+ /**
+ * Sets the Touch Point category back to the default Clover customer experience activity category
+ * @return The merchant-level setting value if available, or the global default value if merchant-level is not available.
+ */
+ public String restoreDefaultTouchPointCategory() {
+ final Bundle result = context.getContentResolver().call(TouchPointSettingContract.AUTHORITY_URI, METHOD_SET_TOUCH_POINT_SETTING, null, null);
+ if (result != null) {
+ return result.getString(SETTING_VALUE);
+ }
+ return null;
+ }
+
+ protected static void checkForNullArgument(T arg) {
+ if (arg == null) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingContract.java b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingContract.java
new file mode 100644
index 000000000..c61cf9da6
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/cfp/connector/touchpoint/TouchPointSettingContract.java
@@ -0,0 +1,19 @@
+package com.clover.sdk.cfp.connector.touchpoint;
+
+import android.net.Uri;
+
+public class TouchPointSettingContract {
+
+ public static final String TOUCH_POINT_CATEGORY = "com.clover.cfp.touchpoint.category";
+ public static final String DEVICE_SERIAL = "com.clover.cfp.device.serial";
+ /**
+ * The authority for the touch point settings provider
+ */
+ public static final String AUTHORITY = "com.clover.cfp.provider.touchpointsetting.authority";
+
+ /**
+ * A content:// style uri to the authority for the provider
+ */
+ public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/nexo/NexoLocalReceiptHelper.java b/clover-android-sdk/src/main/java/com/clover/sdk/nexo/NexoLocalReceiptHelper.java
new file mode 100644
index 000000000..21d5c2091
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/nexo/NexoLocalReceiptHelper.java
@@ -0,0 +1,334 @@
+package com.clover.sdk.nexo;
+
+import android.text.TextUtils;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.clover.sdk.v3.payments.CardTransaction;
+import com.clover.sdk.v3.payments.CardTransactionConstants;
+import com.clover.sdk.v3.payments.DisplayAndPrintMessage;
+import com.clover.sdk.v3.payments.MessageDestination;
+import com.clover.sdk.v3.payments.SepaElvTransactionInfo;
+import com.clover.sdk.v3.payments.TransactionInfo;
+import com.clover.sdk.v3.payments.TransactionResult;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * This class is used to parse and prepare Nexo receipt data, to show them directly on the PrintReceiptActivity screen under "More Options"
+ * or in the NexoTestApp.
+ *
+ * LOCAL RECEIPT DATA
+ * ------------------------------------------------------------------------------------------------------------------------ *
+ * | Receipt Data | Additional text | Source | M|O|C | *
+ * ------------------------------------------------------------------------------------------------------------------------ *
+ * Merchant name - TransactionInfo M *
+ * Merchant ID MID: TransactionInfo M *
+ * Terminal ID TID: TransactionInfo M *
+ * External Terminal ID Device name TransactionInfo C *
+ * AID - CardTransaction C *
+ * Application Label - TransactionInfo M *
+ * ELV extended App Label - SepaElvTransactionInfo C *
+ * PAN + PAN sequence number - CardTransaction M *
+ * Date/Time - TransactionInfo M *
+ * Trace number Trace-Nbr: TransactionInfo M *
+ * ELV fixed text CDGM - SepaElvTransactionInfo C *
+ * ELV Short BIC Short-BC: TransactionInfo C *
+ * ELV Bank account Bank-Acc.: TransactionInfo C *
+ * ELV IBAN IBAN: SepaElvTransactionInfo C *
+ * ELV Creator ID G-ID: SepaElvTransactionInfo C *
+ * ELV Mandat-ID M-ID: SepaElvTransactionInfo C *
+ * Reference TSC Reference ID: CardTransaction M or Auth Code *
+ * AID Parameter - PrintMessages C *
+ * Auth Code Auth ID: CardTransaction M or Reference ID *
+ * Reconciliation ID RECON-ID: TransactionInfo M *
+ * Online result print messages - TransactionInfo O *
+ * CVM result - CardTransaction M *
+ * Card method Method: TransactionInfo M *
+ * Balance BALANCE CardTransaction C *
+ * Receipt extra data TransactionInfo O *
+ * Amount AMOUNT Payment/Credit/Refund/CreditRefund M *
+ * Cashback amount CASHBACK Payment/Refund C *
+ * TIP amount TIP Payment O *
+ * NEXO Service - TransactionInfo M *
+ * NEXO TX result - TransactionInfo M *
+ * ------------------------------------------------------------------------------------------------------------------------ *
+ *
+ */
+@SuppressWarnings("unused")
+public class NexoLocalReceiptHelper {
+ private static final String ELV_CDGM = "CDGM";
+ private static final String LABEL_MID = "MID: ";
+ private static final String LABEL_TID = "TID: ";
+ private static final String LABEL_DEVICE_NAME = "Device Name: ";
+ private static final String LABEL_TRACE_NBR = "Trace-Nbr: ";
+ private static final String LABEL_SHORT_BC = "Short-BC: ";
+ private static final String LABEL_BANK_ACC = "Bank-Acc.: ";
+ private static final String LABEL_IBAN = "IBAN: ";
+ private static final String LABEL_G_ID = "G-ID: ";
+ private static final String LABEL_M_ID = "M-ID: ";
+ private static final String LABEL_REFERENCE_ID = "Reference ID: ";
+ private static final String LABEL_AUTH_ID = "Auth ID: ";
+ private static final String LABEL_RECON_ID = "RECON-ID: ";
+ private static final String LABEL_METHOD = "Method: ";
+ private static final String LABEL_BALANCE = "BALANCE ";
+ @SuppressWarnings("unused")
+ public static final String LABEL_AMOUNT = "AMOUNT ";
+ @SuppressWarnings("unused")
+ public static final String LABEL_CASHBACK = "CASHBACK ";
+ @SuppressWarnings("unused")
+ public static final String LABEL_TIP = "TIP ";
+
+ private static final int PAN_MASK_APPLY = 6;
+ private static final int APPLY_MERCHANT_PAN_MASK = 6;
+
+ public static final String RECEIPT_EXTRA_DATA_ON_MERCHANT_RECEIPT = "isReceiptExtraDataOnMerchantReceipt";
+ public static final String RECEIPT_EXTRA_DATA_ON_CUSTOMER_RECEIPT = "isReceiptExtraDataOnCustomerReceipt";
+
+ @SuppressWarnings("unused")
+ public String getLocalReceiptBody(TransactionInfo transactionInfo, @Nullable CardTransaction cardTransaction, String appLabel, String date, String time, String cvmResult, String balance, Map receiptExtraDataMap, boolean useReferenceId, boolean isCardholderReceipt) {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ if (transactionInfo != null) {
+ String mid = transactionInfo.getMerchantIdentifier();
+ stringBuilder.append(LABEL_MID).append(transactionInfo.getMerchantIdentifier()).append("\n");
+ String tid = transactionInfo.getTerminalIdentification() != null ? transactionInfo.getTerminalIdentification() : transactionInfo.getExternalTerminalId();
+ stringBuilder.append(LABEL_TID).append(tid).append("\n");
+ String deviceName = transactionInfo.getExternalTerminalId();
+ if (deviceName != null) {
+ stringBuilder.append(LABEL_DEVICE_NAME).append(deviceName).append("\n\n");
+ }
+
+ if (cardTransaction != null) {
+ String aid = cardTransaction.getExtra().get(CardTransactionConstants.APPLICATION_IDENTIFIER);
+ if (aid != null) {
+ stringBuilder.append(aid).append("\n");
+ }
+ if (appLabel == null) {
+ appLabel = cardTransaction.getExtra().get(CardTransactionConstants.APPLICATION_LABEL);
+ }
+ stringBuilder.append(appLabel).append("\n");
+ }
+
+ //ELV
+ if (transactionInfo.getIsSepaElv() != null && transactionInfo.getIsSepaElv()) {
+ stringBuilder.append(transactionInfo.getSepaElvTransactionInfo().getExtAppLabel()).append("\n");
+ }
+
+ if (cardTransaction != null) {
+ String track2Data = transactionInfo.getMaskedTrack2();
+ String panMask = transactionInfo.getPanMask();
+ String pan = getNexoCardPan(track2Data, panMask, isCardholderReceipt);
+ stringBuilder.append(pan);
+ }
+
+ String panSequenceNumber = transactionInfo.getApplicationPanSequenceNumber();
+ if (panSequenceNumber != null) {
+ stringBuilder.append(" ").append(panSequenceNumber).append("\n\n");
+ }
+ stringBuilder.append(date).append(" ").append(time).append("\n");
+ String tsc = transactionInfo.getTransactionSequenceCounter();
+ stringBuilder.append(LABEL_TRACE_NBR).append(tsc).append("\n");
+
+ //ELV
+ if (transactionInfo.getIsSepaElv() != null && transactionInfo.getIsSepaElv()) {
+ stringBuilder.append(ELV_CDGM).append("\n");
+ String maskedTrack2 = transactionInfo.getMaskedTrack2();
+ stringBuilder.append(LABEL_SHORT_BC).append(maskedTrack2.substring(3, 8)).append("\n");
+ stringBuilder.append(LABEL_BANK_ACC).append(maskedTrack2.substring(8, 18)).append("\n");
+ SepaElvTransactionInfo sepaElvTransactionInfo = transactionInfo.getSepaElvTransactionInfo();
+ String iban = sepaElvTransactionInfo.getIban();
+ if (iban != null) {
+ String panMask = transactionInfo.getPanMask();
+ String maskedIban = getNexoIban(iban, panMask, isCardholderReceipt);
+ stringBuilder.append(LABEL_IBAN).append(maskedIban).append("\n");
+ }
+ stringBuilder.append(LABEL_G_ID).append(sepaElvTransactionInfo.getCreditorId()).append("\n");
+ stringBuilder.append(LABEL_M_ID).append(sepaElvTransactionInfo.getMandateId()).append("\n");
+ }
+
+ if (cardTransaction != null && useReferenceId) {
+ stringBuilder.append(LABEL_REFERENCE_ID).append(cardTransaction.getReferenceId()).append("\n");
+ }
+
+ String aidParam = getPrintMessage(transactionInfo, true, isCardholderReceipt);
+ if (aidParam != null) {
+ stringBuilder.append(aidParam).append("\n");
+ }
+
+ if (cardTransaction != null && !useReferenceId) {
+ String authCode = cardTransaction.getAuthCode();
+ if (authCode != null) {
+ stringBuilder.append(LABEL_AUTH_ID).append(cardTransaction.getAuthCode()).append("\n");
+ }
+ }
+
+ String reconciliationId = transactionInfo.getBatchNumber();
+ stringBuilder.append(LABEL_RECON_ID).append(reconciliationId).append("\n\n");
+ String printMessage = getPrintMessage(transactionInfo, false, isCardholderReceipt);
+ if (printMessage != null) {
+ stringBuilder.append(printMessage).append("\n\n");
+ }
+ if (TransactionResult.APPROVED.equals(transactionInfo.getTransactionResult())) {
+ stringBuilder.append(cvmResult).append("\n");
+ }
+
+ // Entry method
+ String method;
+ if (transactionInfo.getCardEntryType() != null) {
+ method = transactionInfo.getCardEntryType().name();
+ } else {
+ if (cardTransaction != null && cardTransaction.getEntryType() != null) {
+ method = cardTransaction.getEntryType().name();
+ } else {
+ method = "";
+ }
+ }
+ if (TransactionResult.APPROVED.equals(transactionInfo.getTransactionResult())) {
+ stringBuilder.append(LABEL_METHOD).append(method).append("\n\n");
+ }
+
+ if (isCardholderReceipt && balance != null) {
+ stringBuilder.append(LABEL_BALANCE).append(balance).append("\n");
+ }
+
+ boolean showReceiptExtraData;
+ if (isCardholderReceipt) {
+ showReceiptExtraData = Boolean.TRUE.equals(receiptExtraDataMap.get(RECEIPT_EXTRA_DATA_ON_CUSTOMER_RECEIPT));
+ } else {
+ showReceiptExtraData = Boolean.TRUE.equals(receiptExtraDataMap.get(RECEIPT_EXTRA_DATA_ON_MERCHANT_RECEIPT));
+ }
+ String receiptExtraData = transactionInfo.getReceiptExtraData();
+ if (receiptExtraData != null && showReceiptExtraData) {
+ stringBuilder.append("\n").append(receiptExtraData).append("\n\n");
+ }
+ }
+
+ return stringBuilder.toString();
+ }
+
+ private static String getPrintMessage(TransactionInfo transactionInfo, boolean isAidParam, boolean isCardholderReceipt) {
+ MessageDestination messageDestinationMerchant = isAidParam ? MessageDestination.MERCHANT_RECEIPT_AID_PARAM : MessageDestination.MERCHANT_RECEIPT;
+ MessageDestination messageDestinationCustomer = isAidParam ? MessageDestination.CUSTOMER_RECEIPT_AID_PARAM : MessageDestination.CUSTOMER_RECEIPT;
+ List displayAndPrintMessageList = transactionInfo.getPrintMessages();
+
+ if (displayAndPrintMessageList != null) {
+ for (DisplayAndPrintMessage displayAndPrintMessage : displayAndPrintMessageList) {
+ if (displayAndPrintMessage != null && displayAndPrintMessage.getDestination() != null &&
+ ((displayAndPrintMessage.getDestination() == messageDestinationMerchant && !isCardholderReceipt) ||
+ (displayAndPrintMessage.getDestination() == messageDestinationCustomer && isCardholderReceipt))) {
+ return displayAndPrintMessage.getContent();
+ }
+ }
+ }
+ return null;
+ }
+
+ public String getNexoCardPan(String track2, String panMask, boolean isCustomerCopy) {
+ if (track2 == null) {
+ return null;
+ }
+ int index = 0;
+ try {
+ index = track2.indexOf('=');
+ if (index == -1) {
+ index = track2.indexOf('D');
+ }
+ if (index == -1) {
+ index = track2.indexOf('d');
+ }
+ } catch (Exception e) {
+ //ALog.e(NexoReceiptData.class, e, "BCD ERROR");
+ }
+ if (index <= 0) {
+ return null;
+ }
+
+ String pan = track2.substring(0, index);
+ if (TextUtils.isEmpty(pan)) {
+ return null;
+ }
+ pan = pan.replace("f", "x");
+ return getMaskValue(pan, panMask, isCustomerCopy);
+ }
+
+ public String getNexoIban(@NonNull String iban, String panMask, boolean isCustomerCopy) {
+ return getMaskValue(iban, panMask, isCustomerCopy);
+ }
+
+ private String getMaskValue(String value, String panMask, boolean isCardholder) {
+ StringBuilder leadingPanMaskStringBuilder = new StringBuilder();
+ StringBuilder trailingPanMaskStringBuilder = new StringBuilder();
+ boolean applyPanMaskToMerchantReceipt = false;
+ if (!TextUtils.isEmpty(panMask)) {
+ byte[] panMaskArray = hexStringToByteArray(panMask);
+ if (panMaskArray.length == 7) {
+ applyPanMaskToMerchantReceipt = (panMaskArray[PAN_MASK_APPLY] & (byte) (0x01 << APPLY_MERCHANT_PAN_MASK)) != 0;
+ for (int i = 0; i < panMaskArray.length; i++) {
+ if (i < 3) {
+ leadingPanMaskStringBuilder.append(String.format(Locale.US, "%8s", Integer.toBinaryString(panMaskArray[i] & 0xFF)).replace(' ', '0'));
+ } else if (i < 6) {
+ trailingPanMaskStringBuilder.append(String.format(Locale.US, "%8s", Integer.toBinaryString(panMaskArray[i] & 0xFF)).replace(' ', '0'));
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ if ((isCardholder || applyPanMaskToMerchantReceipt) && leadingPanMaskStringBuilder.length() > 0 && trailingPanMaskStringBuilder.length() > 0) {
+ final StringBuilder leadingPanStringBuilder = new StringBuilder();
+ final StringBuilder trailingPanStringBuilder = new StringBuilder();
+ final String leadingPanMask = leadingPanMaskStringBuilder.toString();
+ final String trailingPanMask = trailingPanMaskStringBuilder.toString();
+ final char maskingChar = 0x30; // ascii "0"
+ final char maskedChar = 0x78; // ascii "x"
+ for (int i = 0; i < value.length(); i++) {
+ if (i >= leadingPanMask.length()) {
+ break; // should never be
+ }
+ if (maskingChar == leadingPanMask.charAt(i)) {
+ leadingPanStringBuilder.append(maskedChar);
+ } else {
+ leadingPanStringBuilder.append(value.charAt(i));
+ }
+ }
+ for (int i = 0; i < value.length(); i++) {
+ if (i >= trailingPanMask.length()) {
+ break; // should never be
+ }
+ if (maskingChar == (trailingPanMask.charAt(trailingPanMask.length() - 1 - i))) {
+ trailingPanStringBuilder.append(maskedChar);
+ } else {
+ trailingPanStringBuilder.append(value.charAt(value.length() - 1 - i));
+ }
+ }
+ final StringBuilder panMaskedStringBuilder = new StringBuilder();
+ final String leadingPanString = leadingPanStringBuilder.toString();
+ final String trailingPanString = trailingPanStringBuilder.reverse().toString();
+ if (value.length() != leadingPanString.length() || value.length() != trailingPanString.length()) {
+ return value;
+ }
+ for (int i = 0; i < value.length(); i++) {
+ final char tmpChar = leadingPanString.charAt(i) != maskedChar ? leadingPanString.charAt(i) : trailingPanString.charAt(i) != maskedChar ? trailingPanString.charAt(i) : maskedChar;
+ panMaskedStringBuilder.append(tmpChar);
+ }
+ return panMaskedStringBuilder.toString();
+ } else {
+ return value;
+ }
+ }
+
+ public static byte[] hexStringToByteArray(String s) {
+ int len = s.length();
+ byte[] data = new byte[len / 2];
+
+ for(int i = 0; i < len; i += 2) {
+ data[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16));
+ }
+
+ return data;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/util/Platform2.java b/clover-android-sdk/src/main/java/com/clover/sdk/util/Platform2.java
index 42178e6e7..98a5f7e75 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/util/Platform2.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/util/Platform2.java
@@ -258,6 +258,27 @@ protected boolean isSupported(Context context) {
return context.getPackageManager().hasSystemFeature("clover.hardware.merchant_only");
}
},
+ /**
+ * Form factor of this device is such that, it is designed only for payment related tasks e.g.
+ * Clover companion
+ */
+ PAYMENT_ONLY {
+ @Override
+ protected boolean isSupported(Context context) {
+ return context.getPackageManager().hasSystemFeature("clover.software.payment_only");
+ }
+ },
+
+ /**
+ * Form factor of this device such that printer is bundled with the device, at this writing there
+ * are only 2 Clover devices which doesn't support bundled printer, Flex 4 Pocket and Clover Companion
+ */
+ BUNDLED_PRINTER {
+ @Override
+ protected boolean isSupported(Context context) {
+ return !context.getPackageManager().hasSystemFeature("clover.hardware.no_bundled_printer");
+ }
+ },
;
protected abstract boolean isSupported(Context context);
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 5dc64a00c..c617ea822 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
@@ -899,6 +899,9 @@ public class Intents {
/** {@link int}, is partial authorization allowed (if it occurs)? */
public static final String EXTRA_ALLOW_PARTIAL_AUTH = "clover.intent.extra.ALLOW_PARTIAL_AUTH";
+ /** {@link int}, optionally set the desired locale)? */
+ public static final String EXTRA_LOCALE = "clover.intent.extra.LOCALE";
+
/** {@link int}, does this intent need german info */
public static final String GERMAN_INFO = "clover.intent.extra.GERMAN_INFO";
@@ -1347,6 +1350,9 @@ public enum RemoteViewSize {
/** {@link Boolean}, is the device interaction for this transaction in kioskMode (i.e. customer-only/no merchant present) */
public static final String EXTRA_ENABLE_KIOSK_MODE = "clover.intent.extra.ENABLE_KIOSK_MODE";
+ /** {@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}, elv transaction type for Germany */
public static final String EXTRA_GERMAN_ELV = "clover.intent.extra.GERMAN_ELV";
/** A value for {@link #EXTRA_GERMAN_ELV} */
@@ -1366,6 +1372,10 @@ public enum RemoteViewSize {
* */
public static final String EXTRA_DATA_READ_MODE = "clover.intent.extra.EXTRA_DATA_READ_MODE";
+ /** A value for {@link #EXTRA_INITIATE_REFUND} data read mode for specific integration use cases
+ * where want trigger refund flow through transaction app */
+ public static final String EXTRA_INITIATE_REFUND = "initiateRefund";
+
/* Transaction Settings Section End */
/**
@@ -1835,4 +1845,16 @@ public static class PAYMENT_TOKEN_TYPE {
*/
public static final String EXTRA_TAXES_AND_FEES_BREAKDOWN = "taxes_and_fees_breakdown";
+ // Indicates that the reason for cancelling a transaction was an error (e.g. authorisation declined)
+ // and not e.g. because the user cancelled the manual card entry screen.
+ public static final String EXTRA_TX_CANCELLED_DUE_TO_ERROR = "clover.intent.extra.EXTRA_TX_CANCELLED_DUE_TO_ERROR";
+
+ public static final String EXTRA_OPEN_PAYMENT_OPTIONS = "clover.intent.extra.EXTRA_OPEN_PAYMENT_OPTIONS";
+
+ public static final String EXTRA_RECEIPT_SELECTION_TIMEOUT_THRESHOLD = "clover.intent.extra.EXTRA_RECEIPT_SELECTION_TIMEOUT_THRESHOLD";
+
+ public static final String EXTRA_VOIDED_PAYMENT_IDS = "clover.intent.extra.EXTRA_VOIDED_PAYMENT_IDS";
+
+ //Pass terminal settings (e.g. Nexo: Config > E1 > DF34 Terminal Settings)
+ public static final String EXTRA_TERMINAL_SETTINGS = "clover.intent.extra.TERMINAL_SETTINGS";
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/customer/CustomerConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/customer/CustomerConnector.java
index 83b892a54..5c9958fc9 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/customer/CustomerConnector.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/customer/CustomerConnector.java
@@ -91,6 +91,7 @@ public Customer call(ICustomerService service, ResultStatus status) throws Remot
});
}
+ @Deprecated
public Customer createCustomer(final String firstName, final String lastName, final boolean marketingAllowed) throws ClientException, ServiceException, BindingException, RemoteException {
return execute(new ServiceCallable() {
public Customer call(ICustomerService service, ResultStatus status) throws RemoteException {
@@ -99,6 +100,15 @@ public Customer call(ICustomerService service, ResultStatus status) throws Remot
});
}
+ public Customer newCustomer(final String firstName, final String lastName)throws ClientException, ServiceException, BindingException, RemoteException {
+ return execute(new ServiceCallable() {
+ public Customer call(ICustomerService service, ResultStatus status) throws RemoteException {
+ return service.newCustomer(firstName, lastName, status);
+ }
+ });
+
+ }
+
public void setName(final String customerId, final String firstName, final String lastName) throws ClientException, ServiceException, BindingException, RemoteException {
execute(new ServiceRunnable() {
public void run(ICustomerService service, ResultStatus status) throws RemoteException {
@@ -107,6 +117,7 @@ public void run(ICustomerService service, ResultStatus status) throws RemoteExce
});
}
+ @Deprecated
public void setMarketingAllowed(final String customerId, final boolean marketingAllowed) throws ClientException, ServiceException, BindingException, RemoteException {
execute(new ServiceRunnable() {
public void run(ICustomerService service, ResultStatus status) throws RemoteException {
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 7f09688e4..baba1ccaa 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
@@ -72,6 +72,13 @@ public enum Module implements Parcelable {
ADVANCED_REPORTING,
RETAIL_HUB,
PURCHASING_CARD,
+ APPOINTMENTS,
+ SERVICE_ITEMS,
+ SERVICE_RESOURCES,
+ BASIC_WEBSITE,
+ STOREFRONT,
+ CHECKOUT,
+ SHIFT_PLANNING
;
@Override
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/Printer.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/Printer.java
index e32f8dcb3..1c4ebcf7a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/Printer.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/Printer.java
@@ -234,7 +234,7 @@ public boolean equals(Object o) {
if (uuid != null ? !uuid.equals(printer.uuid) : printer.uuid != null) {
return false;
}
- if (type != printer.type) {
+ if (type != null ? !type.equals(printer.type) : printer.type != null) {
return false;
}
if (name != null ? !name.equals(printer.name) : printer.name != null) {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptContentContract.kt b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptContentContract.kt
new file mode 100644
index 000000000..cd9c22219
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptContentContract.kt
@@ -0,0 +1,214 @@
+/**
+ * Copyright (C) 2024 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
+ *
+ * http://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.v1.printer
+
+import android.os.ParcelFileDescriptor
+import com.clover.sdk.v1.printer.job.BalanceInquiryPrintJob
+import com.clover.sdk.v1.printer.job.GiftCardPrintJob
+import com.clover.sdk.v1.printer.job.PrintJob
+import com.clover.sdk.v1.printer.job.StaticBillPrintJob
+import com.clover.sdk.v1.printer.job.StaticCreditPrintJob
+import com.clover.sdk.v1.printer.job.StaticGiftReceiptPrintJob
+import com.clover.sdk.v1.printer.job.StaticLabelPrintJob
+import com.clover.sdk.v1.printer.job.StaticOrderPrintJob
+import com.clover.sdk.v1.printer.job.StaticPaymentPrintJob
+import com.clover.sdk.v1.printer.job.StaticRefundPrintJob
+import com.clover.sdk.v1.printer.job.TextPrintJob
+import com.clover.sdk.v1.printer.job.TokenRequestBasedPrintJob
+
+/**
+ *
+ * A class defining the contract to be implemented by content providers that wish
+ * to provide custom content for receipts.
+ *
+ * To integrate a custom receipt provider with Clover, define a content provider
+ * with below meta-data in manifest:
+ *
+ * - exported = true
+ *
+ * - name = [CUSTOM_RECEIPT_CONTENT_PROVIDER_RECEIPT_TYPES], value = comma separated list of [ReceiptType]
+ * List of Print receipt use cases for which the content provider will provide custom formatted receipts
+ *
+ * Ex:
+ * ```
+ * ...
+ *
+ *
+ *
+ *
+ * ```
+ *
+ * Provider must override the "call" method. It should handle the method [METHOD_GET_RECEIPT_CONTENT_URIS]
+ * Input data is passed in as [PrintJob] in extras.
+ * The bundle extras will have the following:
+ * 1. An instance of [PrintJob], which can be of one of the print job types defined in [ReceiptType],
+ * as value of [EXTRA_PRINT_JOB] key
+ * 2. [Printer] on which the receipt will be printed, as value of [EXTRA_PRINTER] key
+ *
+ * Provider must return a list of receipt segment bitmap uris as extra [EXTRA_RECEIPT_CONTENT_URIS]
+ *
+ * Ex:
+ * ```
+ * override fun call(method: String, arg: String?, extras: Bundle?): Bundle {
+ * if (method == [METHOD_GET_RECEIPT_CONTENT_URIS]) {
+ * val printJob = it.getParcelable([EXTRA_PRINT_JOB])
+ * //create receipt bitmaps from printJob
+ * //store it as bitmap blob and get its receipt segment uris
+ * //bundle the receipt segment uris into an ArrayList
+ * //return the bundle
+ * }
+ * ....
+ * }
+ * ```
+ *
+ * Also, provider must override the [android.content.ContentProvider.openFile] method. This method
+ * should take in receipt segment uri, fetch the bitmap using that uri and return
+ * the [ParcelFileDescriptor] using [android.content.ContentProvider.openPipeHelper] of
+ * type [android.graphics.Bitmap]. Clover will use the returned [ParcelFileDescriptor] to open
+ * input stream and fetch the bitmap data.
+ *
+ * Ex.
+ * ```
+ * override fun openFile(contentUri: Uri, mode: String): ParcelFileDescriptor {
+ * val bitmap = getReceiptSegmentBitmap(contentUri)
+ * return openPipeHelper(contentUri, "mimeType", null, bitmap)
+ * { output: ParcelFileDescriptor, uri: Uri, mimeType: String?, opts: Bundle?, args: Bitmap? ->
+ * try {
+ * AutoCloseOutputStream(output).use { bitmap?.compress(Bitmap.CompressFormat.PNG, 100, it) }
+ * } catch (e: IOException) {
+ * e.printStackTrace()
+ * }
+ * }
+ * }
+ * ```
+ *
+ * ### Bitmap specifications:
+ * - If the generated receipt bitmap height is greater than 2048 pixels, it must be divided into
+ * smaller chunks. Clover will reject the print request if the generated receipt bitmap height is greater than
+ * 2048 pixels.
+ * - The generated receipt bitmap width must be obtained from the passed in [Printer] object as shown
+ * in example below. Clover will reject the print request if the generated receipt bitmap width is
+ * greater than the width obtained from the passed in [Printer] object.
+ *
+ * Ex.
+ * ```
+ * val td: TypeDetails = printerConnector.getPrinterTypeDetails(printer)
+ * val supportedWidth = td.numDotsWidth
+ * ```
+ * - When multiple bitmap chunks are present, for Clover to print the receipt in a
+ * proper sequence, provider must return the uris corresponding to the bitmap chunks in the
+ * following order: first chunk: receipt header -> next chunk(s): receipt body -> final chunk: receipt footer
+ * - It is recommended for the generated receipt bitmap to have
+ * [android.graphics.Bitmap.Config.RGB_565] color space.
+ * - It is recommended to send the bitmap in PNG format.
+ *
+ * @see android.content.ContentProvider
+ * @see android.graphics.Bitmap
+ * @see ParcelFileDescriptor
+ * @see PrinterConnector
+ * @see TypeDetails
+ */
+object ReceiptContentContract {
+ /**
+ * Meta-data name for supported receipt types. Values are comma separated list of
+ * one or more case insensitive [ReceiptType] names
+ */
+ const val CUSTOM_RECEIPT_CONTENT_PROVIDER_RECEIPT_TYPES = "com.clover.printer.receipt.custom.content.receipt.types"
+
+ /**
+ * Call method name to invoke "get receipt content uris". When invoked, the extras bundle will include
+ * a key[EXTRA_PRINT_JOB] and value will be one of the [PrintJob] derived classes i.e. [StaticPaymentPrintJob]
+ *
+ * The result bundle must contain a key = [EXTRA_RECEIPT_CONTENT_URIS] and its value being an [ArrayList],
+ * which will have list of receipt segment bitmap uris
+ * Ex.
+ * ```
+ * override fun call(method: String, arg: String?, extras: Bundle?): Bundle {
+ * val result = Bundle()
+ * if (method == "get_receipt_content_uris") {
+ * //bundle the uris into an ArrayList
+ * }
+ * ....
+ * }
+ * ```
+ */
+ const val METHOD_GET_RECEIPT_CONTENT_URIS = "get_receipt_content_uris"
+
+ /**
+ * Extra for the list of receipt segment bitmap uris
+ */
+ const val EXTRA_RECEIPT_CONTENT_URIS = "receipt_content_uris"
+
+ /**
+ * Extra required for call method [METHOD_GET_RECEIPT_CONTENT_URIS]. A [PrintJob] corresponding
+ * to print receipt request.
+ */
+ const val EXTRA_PRINT_JOB = "print_job"
+
+ /**
+ * Extra required for call method [METHOD_GET_RECEIPT_CONTENT_URIS]. The [Printer] on which the
+ * receipt will be printed.
+ *
+ * Clover POS can be connected to one or more printers. Merchant can select a printer on which
+ * the current receipt should be printed. The selected printer is passed in the bundle extras as
+ * the value of this key
+ */
+ const val EXTRA_PRINTER = "printer"
+
+ /**
+ * Supported ReceiptTypes to be listed in provider's meta-data.
+ * Value defines the mapping of ReceiptType to corresponding PrintJob
+ *
+ * Ex.
+ * ```
+ *
+ * ...
+ *
+ *
+ * ```
+ * @see [StaticBillPrintJob]
+ * @see [StaticCreditPrintJob]
+ * @see [StaticPaymentPrintJob]
+ * @see [StaticRefundPrintJob]
+ * @see [StaticGiftReceiptPrintJob]
+ * @see [TextPrintJob]
+ * @see [StaticOrderPrintJob]
+ * @see [GiftCardPrintJob]
+ * @see [BalanceInquiryPrintJob]
+ * @see [TokenRequestBasedPrintJob]
+ * @see [StaticLabelPrintJob]
+ */
+ enum class ReceiptType(val printJobClass: Class) {
+ BILL(StaticBillPrintJob::class.java),
+ CREDIT(StaticCreditPrintJob::class.java),
+ PAYMENT(StaticPaymentPrintJob::class.java),
+ REFUND(StaticRefundPrintJob::class.java),
+ GIFT(StaticGiftReceiptPrintJob::class.java),
+ TEXT(TextPrintJob::class.java),
+ ORDER(StaticOrderPrintJob::class.java),
+ GIFT_CARD(GiftCardPrintJob::class.java),
+ BALANCE_INQUIRY(BalanceInquiryPrintJob::class.java),
+ TOKEN_REQUEST_BASED(TokenRequestBasedPrintJob::class.java),
+ LABEL(StaticLabelPrintJob::class.java);
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptRegistrationConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptRegistrationConnector.java
index b54834b32..d5c98b8af 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptRegistrationConnector.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/ReceiptRegistrationConnector.java
@@ -30,7 +30,6 @@
import java.util.List;
import java.util.Locale;
-
/**
* A class that encapsulates interaction with
* {@link com.clover.sdk.v1.printer.IReceiptRegistrationService}.
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/PrintJob.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/PrintJob.java
index 4308bc7d2..15beb029a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/PrintJob.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/PrintJob.java
@@ -85,6 +85,13 @@ public abstract class PrintJob implements Parcelable {
/** Force customer tip line on print out even if normally not required */
public static final int FLAG_FORCE_TIP = 1 << 12;
+ /** Indicate this print job is for pay at register, additional instructions will be included in printout */
+ public static final int FLAG_PAY_AT_REGISTER = 1 << 13;
+ /**
+ * Indicate this is a voided item on the print out
+ */
+ public static final int FLAG_PRINT_VOID_RECEIPT = 1 << 14;
+
public abstract static class Builder {
protected int flags = FLAG_NONE;
protected boolean printToAny = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticCreditPrintJob.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticCreditPrintJob.java
index fd13f12ca..46ecb4a4e 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticCreditPrintJob.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticCreditPrintJob.java
@@ -25,15 +25,18 @@
public class StaticCreditPrintJob extends StaticReceiptPrintJob implements Parcelable {
private static final String BUNDLE_KEY_CREDIT_ID = "c";
private static final String BUNDLE_KEY_CREDIT = "cc";
+ private static final String BUNDLE_KEY_ORDER = "o";
public static class Builder extends StaticReceiptPrintJob.Builder {
private String creditId;
private Credit credit;
+ private Order order;
public Builder staticCreditPrintJob(StaticCreditPrintJob pj) {
staticReceiptPrintJob(pj);
this.creditId = pj.creditId;
this.credit = pj.credit;
+ this.order = pj.order;
return this;
}
@@ -48,6 +51,11 @@ public Builder credit(Credit credit) {
return this;
}
+ public Builder order(Order order) {
+ this.order = order;
+ return this;
+ }
+
public StaticCreditPrintJob build() {
return new StaticCreditPrintJob(this);
}
@@ -55,18 +63,21 @@ public StaticCreditPrintJob build() {
public final String creditId;
public final Credit credit;
+ public final Order order;
@Deprecated
public StaticCreditPrintJob(Order order, String creditId, int flags) {
super(order, flags);
this.creditId = creditId;
this.credit = null;
+ this.order = order;
}
protected StaticCreditPrintJob(Builder builder) {
super(builder);
this.creditId = builder.creditId;
this.credit = builder.credit;
+ this.order = builder.order;
}
public static final Creator CREATOR = new Creator() {
@@ -84,6 +95,7 @@ protected StaticCreditPrintJob(Parcel in) {
Bundle bundle = in.readBundle(((Object)this).getClass().getClassLoader()); // needed otherwise BadParcelableException: ClassNotFoundException when unmarshalling
creditId = bundle.getString(BUNDLE_KEY_CREDIT_ID);
credit = bundle.getParcelable(BUNDLE_KEY_CREDIT);
+ order = bundle.getParcelable(BUNDLE_KEY_ORDER);
// Add more data here, but remember old apps might not provide it!
}
@@ -98,6 +110,7 @@ public void writeToParcel(Parcel dest, int flags) {
Bundle bundle = new Bundle();
bundle.putString(BUNDLE_KEY_CREDIT_ID, creditId);
bundle.putParcelable(BUNDLE_KEY_CREDIT, credit);
+ bundle.putParcelable(BUNDLE_KEY_ORDER, order);
dest.writeBundle(bundle);
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticPaymentPrintJob.java b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticPaymentPrintJob.java
index b62e0008c..b0cde8684 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticPaymentPrintJob.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/StaticPaymentPrintJob.java
@@ -22,18 +22,31 @@
import com.clover.sdk.v3.order.Order;
import com.clover.sdk.v3.payments.Payment;
import com.clover.sdk.v3.payments.Refund;
+import com.clover.sdk.v3.payments.TransactionSettings;
+/**
+ * This class is used to represent a payment receipt print job.
+ *
+ * The same class is also used to represent the receipt use case which has multiple refunds.
+ * The flag {@link PrintJob#FLAG_REFUND} is used to identify the usage of StaticPaymentPrintJob class for
+ * this use case. The list of {@link com.clover.sdk.v3.payments.Refund} can be obtained from
+ * {@link Payment#getRefunds()}.
+ *
+ *
Note: For single refund receipt use case {@link StaticRefundPrintJob} will be used
+ */
public class StaticPaymentPrintJob extends StaticReceiptPrintJob implements Parcelable {
private static final String BUNDLE_KEY_PAYMENT = "pp";
private static final String BUNDLE_KEY_PAYMENT_ID = "p";
private static final String BUNDLE_KEY_REFUND = "rp";
+ private static final String BUNDLE_KEY_TRANSACTION_SETTINGS = "ts";
public static class Builder extends StaticReceiptPrintJob.Builder {
protected String paymentId;
protected Payment payment;
protected Refund refund;
+ protected TransactionSettings transactionSettings;
public Builder staticPaymentPrintJob(StaticPaymentPrintJob pj) {
@@ -41,6 +54,7 @@ public Builder staticPaymentPrintJob(StaticPaymentPrintJob pj) {
this.paymentId = pj.paymentId;
this.payment = pj.payment;
this.refund = pj.refund;
+ this.transactionSettings = pj.transactionSettings;
return this;
}
@@ -60,6 +74,11 @@ public Builder payment(Payment payment) {
return this;
}
+ public Builder transactionSettings(TransactionSettings transactionSettings) {
+ this.transactionSettings = transactionSettings;
+ return this;
+ }
+
public StaticPaymentPrintJob build() {
flags |= FLAG_SALE;
return new StaticPaymentPrintJob(this);
@@ -69,6 +88,7 @@ public StaticPaymentPrintJob build() {
public final String paymentId;
public final Payment payment;
public final Refund refund;
+ public final TransactionSettings transactionSettings;
@Deprecated
@@ -77,6 +97,7 @@ public StaticPaymentPrintJob(Order order, String paymentId, int flags) {
this.paymentId = paymentId;
this.refund = null;
this.payment = null;
+ this.transactionSettings = null;
}
protected StaticPaymentPrintJob(Builder builder) {
@@ -84,6 +105,7 @@ protected StaticPaymentPrintJob(Builder builder) {
this.paymentId = builder.paymentId;
this.payment = builder.payment;
this.refund = builder.refund;
+ this.transactionSettings = builder.transactionSettings;
}
public static final Creator CREATOR = new Creator() {
@@ -102,6 +124,7 @@ protected StaticPaymentPrintJob(Parcel in) {
paymentId = bundle.getString(BUNDLE_KEY_PAYMENT_ID);
payment = bundle.getParcelable(BUNDLE_KEY_PAYMENT);
refund = bundle.getParcelable(BUNDLE_KEY_REFUND);
+ transactionSettings = bundle.getParcelable(BUNDLE_KEY_TRANSACTION_SETTINGS);
// Add more data here, but remember old apps might not provide it!
}
@@ -117,6 +140,7 @@ public void writeToParcel(Parcel dest, int flags) {
bundle.putString(BUNDLE_KEY_PAYMENT_ID, paymentId);
bundle.putParcelable(BUNDLE_KEY_PAYMENT, payment);
bundle.putParcelable(BUNDLE_KEY_REFUND, refund);
+ bundle.putParcelable(BUNDLE_KEY_TRANSACTION_SETTINGS, transactionSettings);
dest.writeBundle(bundle);
}
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
new file mode 100644
index 000000000..caa48e103
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/billing/PlanActionFeeRateSummary.java
@@ -0,0 +1,764 @@
+/**
+ * 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.
+ *
+ *
Fields
+ *
+ *
{@link #getDeviceType deviceType}
+ *
{@link #getPlanActionType planActionType}
+ *
{@link #getFeeCategory feeCategory}
+ *
{@link #getFeeCode feeCode}
+ *
{@link #getCurrency currency}
+ *
{@link #getShortDesc shortDesc}
+ *
{@link #getFullDesc fullDesc}
+ *
{@link #getPerItemAmount perItemAmount}
+ *
{@link #getPercentage percentage}
+ *
{@link #getTotalTaxAmount totalTaxAmount}
+ *
{@link #getTax1Amount tax1Amount}
+ *
{@link #getTax2Amount tax2Amount}
+ *
{@link #getTax3Amount tax3Amount}
+ *
{@link #getTax4Amount tax4Amount}
+ *
{@link #getTotalTaxRate totalTaxRate}
+ *
{@link #getTax1Rate tax1Rate}
+ *
{@link #getTax2Rate tax2Rate}
+ *
{@link #getTax3Rate tax3Rate}
+ *
{@link #getTax4Rate tax4Rate}
+ *
{@link #getTotalAmount totalAmount}
+ *
+ */
+@SuppressWarnings("all")
+public class PlanActionFeeRateSummary extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ public java.lang.String getDeviceType() {
+ return genClient.cacheGet(CacheKey.deviceType);
+ }
+
+ public java.lang.String getPlanActionType() {
+ return genClient.cacheGet(CacheKey.planActionType);
+ }
+
+ public java.lang.String getFeeCategory() {
+ return genClient.cacheGet(CacheKey.feeCategory);
+ }
+
+ public java.lang.String getFeeCode() {
+ return genClient.cacheGet(CacheKey.feeCode);
+ }
+
+ public java.lang.String getCurrency() {
+ return genClient.cacheGet(CacheKey.currency);
+ }
+
+ public java.lang.String getShortDesc() {
+ return genClient.cacheGet(CacheKey.shortDesc);
+ }
+
+ public java.lang.String getFullDesc() {
+ return genClient.cacheGet(CacheKey.fullDesc);
+ }
+
+ public java.lang.Double getPerItemAmount() {
+ return genClient.cacheGet(CacheKey.perItemAmount);
+ }
+
+ public java.lang.Double getPercentage() {
+ return genClient.cacheGet(CacheKey.percentage);
+ }
+
+ public java.lang.Double getTotalTaxAmount() {
+ return genClient.cacheGet(CacheKey.totalTaxAmount);
+ }
+
+ public java.lang.Double getTax1Amount() {
+ return genClient.cacheGet(CacheKey.tax1Amount);
+ }
+
+ public java.lang.Double getTax2Amount() {
+ return genClient.cacheGet(CacheKey.tax2Amount);
+ }
+
+ public java.lang.Double getTax3Amount() {
+ return genClient.cacheGet(CacheKey.tax3Amount);
+ }
+
+ public java.lang.Double getTax4Amount() {
+ return genClient.cacheGet(CacheKey.tax4Amount);
+ }
+
+ public java.lang.Double getTotalTaxRate() {
+ return genClient.cacheGet(CacheKey.totalTaxRate);
+ }
+
+ public java.lang.Double getTax1Rate() {
+ return genClient.cacheGet(CacheKey.tax1Rate);
+ }
+
+ public java.lang.Double getTax2Rate() {
+ return genClient.cacheGet(CacheKey.tax2Rate);
+ }
+
+ public java.lang.Double getTax3Rate() {
+ return genClient.cacheGet(CacheKey.tax3Rate);
+ }
+
+ public java.lang.Double getTax4Rate() {
+ return genClient.cacheGet(CacheKey.tax4Rate);
+ }
+
+ public java.lang.Double getTotalAmount() {
+ return genClient.cacheGet(CacheKey.totalAmount);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ deviceType
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ planActionType
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ feeCategory
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ feeCode
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ currency
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ shortDesc
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ fullDesc
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ perItemAmount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ percentage
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ totalTaxAmount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax1Amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax2Amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax3Amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax4Amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ totalTaxRate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax1Rate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax2Rate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax3Rate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ tax4Rate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.class)),
+ totalAmount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.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 PlanActionFeeRateSummary() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected PlanActionFeeRateSummary(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public PlanActionFeeRateSummary(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 PlanActionFeeRateSummary(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 PlanActionFeeRateSummary(PlanActionFeeRateSummary 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 'deviceType' field is set and is not null */
+ public boolean isNotNullDeviceType() {
+ return genClient.cacheValueIsNotNull(CacheKey.deviceType);
+ }
+
+ /** Checks whether the 'planActionType' field is set and is not null */
+ public boolean isNotNullPlanActionType() {
+ return genClient.cacheValueIsNotNull(CacheKey.planActionType);
+ }
+
+ /** Checks whether the 'feeCategory' field is set and is not null */
+ public boolean isNotNullFeeCategory() {
+ return genClient.cacheValueIsNotNull(CacheKey.feeCategory);
+ }
+
+ /** Checks whether the 'feeCode' field is set and is not null */
+ public boolean isNotNullFeeCode() {
+ return genClient.cacheValueIsNotNull(CacheKey.feeCode);
+ }
+
+ /** Checks whether the 'currency' field is set and is not null */
+ public boolean isNotNullCurrency() {
+ return genClient.cacheValueIsNotNull(CacheKey.currency);
+ }
+
+ /** Checks whether the 'shortDesc' field is set and is not null */
+ public boolean isNotNullShortDesc() {
+ return genClient.cacheValueIsNotNull(CacheKey.shortDesc);
+ }
+
+ /** Checks whether the 'fullDesc' field is set and is not null */
+ public boolean isNotNullFullDesc() {
+ return genClient.cacheValueIsNotNull(CacheKey.fullDesc);
+ }
+
+ /** Checks whether the 'perItemAmount' field is set and is not null */
+ public boolean isNotNullPerItemAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.perItemAmount);
+ }
+
+ /** Checks whether the 'percentage' field is set and is not null */
+ public boolean isNotNullPercentage() {
+ return genClient.cacheValueIsNotNull(CacheKey.percentage);
+ }
+
+ /** Checks whether the 'totalTaxAmount' field is set and is not null */
+ public boolean isNotNullTotalTaxAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.totalTaxAmount);
+ }
+
+ /** Checks whether the 'tax1Amount' field is set and is not null */
+ public boolean isNotNullTax1Amount() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax1Amount);
+ }
+
+ /** Checks whether the 'tax2Amount' field is set and is not null */
+ public boolean isNotNullTax2Amount() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax2Amount);
+ }
+
+ /** Checks whether the 'tax3Amount' field is set and is not null */
+ public boolean isNotNullTax3Amount() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax3Amount);
+ }
+
+ /** Checks whether the 'tax4Amount' field is set and is not null */
+ public boolean isNotNullTax4Amount() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax4Amount);
+ }
+
+ /** Checks whether the 'totalTaxRate' field is set and is not null */
+ public boolean isNotNullTotalTaxRate() {
+ return genClient.cacheValueIsNotNull(CacheKey.totalTaxRate);
+ }
+
+ /** Checks whether the 'tax1Rate' field is set and is not null */
+ public boolean isNotNullTax1Rate() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax1Rate);
+ }
+
+ /** Checks whether the 'tax2Rate' field is set and is not null */
+ public boolean isNotNullTax2Rate() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax2Rate);
+ }
+
+ /** Checks whether the 'tax3Rate' field is set and is not null */
+ public boolean isNotNullTax3Rate() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax3Rate);
+ }
+
+ /** Checks whether the 'tax4Rate' field is set and is not null */
+ public boolean isNotNullTax4Rate() {
+ return genClient.cacheValueIsNotNull(CacheKey.tax4Rate);
+ }
+
+ /** Checks whether the 'totalAmount' field is set and is not null */
+ public boolean isNotNullTotalAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.totalAmount);
+ }
+
+
+
+ /** Checks whether the 'deviceType' field has been set, however the value could be null */
+ public boolean hasDeviceType() {
+ return genClient.cacheHasKey(CacheKey.deviceType);
+ }
+
+ /** Checks whether the 'planActionType' field has been set, however the value could be null */
+ public boolean hasPlanActionType() {
+ return genClient.cacheHasKey(CacheKey.planActionType);
+ }
+
+ /** Checks whether the 'feeCategory' field has been set, however the value could be null */
+ public boolean hasFeeCategory() {
+ return genClient.cacheHasKey(CacheKey.feeCategory);
+ }
+
+ /** Checks whether the 'feeCode' field has been set, however the value could be null */
+ public boolean hasFeeCode() {
+ return genClient.cacheHasKey(CacheKey.feeCode);
+ }
+
+ /** 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 'shortDesc' field has been set, however the value could be null */
+ public boolean hasShortDesc() {
+ return genClient.cacheHasKey(CacheKey.shortDesc);
+ }
+
+ /** Checks whether the 'fullDesc' field has been set, however the value could be null */
+ public boolean hasFullDesc() {
+ return genClient.cacheHasKey(CacheKey.fullDesc);
+ }
+
+ /** Checks whether the 'perItemAmount' field has been set, however the value could be null */
+ public boolean hasPerItemAmount() {
+ return genClient.cacheHasKey(CacheKey.perItemAmount);
+ }
+
+ /** Checks whether the 'percentage' field has been set, however the value could be null */
+ public boolean hasPercentage() {
+ return genClient.cacheHasKey(CacheKey.percentage);
+ }
+
+ /** Checks whether the 'totalTaxAmount' field has been set, however the value could be null */
+ public boolean hasTotalTaxAmount() {
+ return genClient.cacheHasKey(CacheKey.totalTaxAmount);
+ }
+
+ /** Checks whether the 'tax1Amount' field has been set, however the value could be null */
+ public boolean hasTax1Amount() {
+ return genClient.cacheHasKey(CacheKey.tax1Amount);
+ }
+
+ /** Checks whether the 'tax2Amount' field has been set, however the value could be null */
+ public boolean hasTax2Amount() {
+ return genClient.cacheHasKey(CacheKey.tax2Amount);
+ }
+
+ /** Checks whether the 'tax3Amount' field has been set, however the value could be null */
+ public boolean hasTax3Amount() {
+ return genClient.cacheHasKey(CacheKey.tax3Amount);
+ }
+
+ /** Checks whether the 'tax4Amount' field has been set, however the value could be null */
+ public boolean hasTax4Amount() {
+ return genClient.cacheHasKey(CacheKey.tax4Amount);
+ }
+
+ /** Checks whether the 'totalTaxRate' field has been set, however the value could be null */
+ public boolean hasTotalTaxRate() {
+ return genClient.cacheHasKey(CacheKey.totalTaxRate);
+ }
+
+ /** Checks whether the 'tax1Rate' field has been set, however the value could be null */
+ public boolean hasTax1Rate() {
+ return genClient.cacheHasKey(CacheKey.tax1Rate);
+ }
+
+ /** Checks whether the 'tax2Rate' field has been set, however the value could be null */
+ public boolean hasTax2Rate() {
+ return genClient.cacheHasKey(CacheKey.tax2Rate);
+ }
+
+ /** Checks whether the 'tax3Rate' field has been set, however the value could be null */
+ public boolean hasTax3Rate() {
+ return genClient.cacheHasKey(CacheKey.tax3Rate);
+ }
+
+ /** Checks whether the 'tax4Rate' field has been set, however the value could be null */
+ public boolean hasTax4Rate() {
+ return genClient.cacheHasKey(CacheKey.tax4Rate);
+ }
+
+ /** Checks whether the 'totalAmount' field has been set, however the value could be null */
+ public boolean hasTotalAmount() {
+ return genClient.cacheHasKey(CacheKey.totalAmount);
+ }
+
+
+ /**
+ * Sets the field 'deviceType'.
+ */
+ public PlanActionFeeRateSummary setDeviceType(java.lang.String deviceType) {
+ return genClient.setOther(deviceType, CacheKey.deviceType);
+ }
+
+ /**
+ * Sets the field 'planActionType'.
+ */
+ public PlanActionFeeRateSummary setPlanActionType(java.lang.String planActionType) {
+ return genClient.setOther(planActionType, CacheKey.planActionType);
+ }
+
+ /**
+ * Sets the field 'feeCategory'.
+ */
+ public PlanActionFeeRateSummary setFeeCategory(java.lang.String feeCategory) {
+ return genClient.setOther(feeCategory, CacheKey.feeCategory);
+ }
+
+ /**
+ * Sets the field 'feeCode'.
+ */
+ public PlanActionFeeRateSummary setFeeCode(java.lang.String feeCode) {
+ return genClient.setOther(feeCode, CacheKey.feeCode);
+ }
+
+ /**
+ * Sets the field 'currency'.
+ */
+ public PlanActionFeeRateSummary setCurrency(java.lang.String currency) {
+ return genClient.setOther(currency, CacheKey.currency);
+ }
+
+ /**
+ * Sets the field 'shortDesc'.
+ */
+ public PlanActionFeeRateSummary setShortDesc(java.lang.String shortDesc) {
+ return genClient.setOther(shortDesc, CacheKey.shortDesc);
+ }
+
+ /**
+ * Sets the field 'fullDesc'.
+ */
+ public PlanActionFeeRateSummary setFullDesc(java.lang.String fullDesc) {
+ return genClient.setOther(fullDesc, CacheKey.fullDesc);
+ }
+
+ /**
+ * Sets the field 'perItemAmount'.
+ */
+ public PlanActionFeeRateSummary setPerItemAmount(java.lang.Double perItemAmount) {
+ return genClient.setOther(perItemAmount, CacheKey.perItemAmount);
+ }
+
+ /**
+ * Sets the field 'percentage'.
+ */
+ public PlanActionFeeRateSummary setPercentage(java.lang.Double percentage) {
+ return genClient.setOther(percentage, CacheKey.percentage);
+ }
+
+ /**
+ * Sets the field 'totalTaxAmount'.
+ */
+ public PlanActionFeeRateSummary setTotalTaxAmount(java.lang.Double totalTaxAmount) {
+ return genClient.setOther(totalTaxAmount, CacheKey.totalTaxAmount);
+ }
+
+ /**
+ * Sets the field 'tax1Amount'.
+ */
+ public PlanActionFeeRateSummary setTax1Amount(java.lang.Double tax1Amount) {
+ return genClient.setOther(tax1Amount, CacheKey.tax1Amount);
+ }
+
+ /**
+ * Sets the field 'tax2Amount'.
+ */
+ public PlanActionFeeRateSummary setTax2Amount(java.lang.Double tax2Amount) {
+ return genClient.setOther(tax2Amount, CacheKey.tax2Amount);
+ }
+
+ /**
+ * Sets the field 'tax3Amount'.
+ */
+ public PlanActionFeeRateSummary setTax3Amount(java.lang.Double tax3Amount) {
+ return genClient.setOther(tax3Amount, CacheKey.tax3Amount);
+ }
+
+ /**
+ * Sets the field 'tax4Amount'.
+ */
+ public PlanActionFeeRateSummary setTax4Amount(java.lang.Double tax4Amount) {
+ return genClient.setOther(tax4Amount, CacheKey.tax4Amount);
+ }
+
+ /**
+ * Sets the field 'totalTaxRate'.
+ */
+ public PlanActionFeeRateSummary setTotalTaxRate(java.lang.Double totalTaxRate) {
+ return genClient.setOther(totalTaxRate, CacheKey.totalTaxRate);
+ }
+
+ /**
+ * Sets the field 'tax1Rate'.
+ */
+ public PlanActionFeeRateSummary setTax1Rate(java.lang.Double tax1Rate) {
+ return genClient.setOther(tax1Rate, CacheKey.tax1Rate);
+ }
+
+ /**
+ * Sets the field 'tax2Rate'.
+ */
+ public PlanActionFeeRateSummary setTax2Rate(java.lang.Double tax2Rate) {
+ return genClient.setOther(tax2Rate, CacheKey.tax2Rate);
+ }
+
+ /**
+ * Sets the field 'tax3Rate'.
+ */
+ public PlanActionFeeRateSummary setTax3Rate(java.lang.Double tax3Rate) {
+ return genClient.setOther(tax3Rate, CacheKey.tax3Rate);
+ }
+
+ /**
+ * Sets the field 'tax4Rate'.
+ */
+ public PlanActionFeeRateSummary setTax4Rate(java.lang.Double tax4Rate) {
+ return genClient.setOther(tax4Rate, CacheKey.tax4Rate);
+ }
+
+ /**
+ * Sets the field 'totalAmount'.
+ */
+ public PlanActionFeeRateSummary setTotalAmount(java.lang.Double totalAmount) {
+ return genClient.setOther(totalAmount, CacheKey.totalAmount);
+ }
+
+
+ /** Clears the 'deviceType' field, the 'has' method for this field will now return false */
+ public void clearDeviceType() {
+ genClient.clear(CacheKey.deviceType);
+ }
+ /** Clears the 'planActionType' field, the 'has' method for this field will now return false */
+ public void clearPlanActionType() {
+ genClient.clear(CacheKey.planActionType);
+ }
+ /** Clears the 'feeCategory' field, the 'has' method for this field will now return false */
+ public void clearFeeCategory() {
+ genClient.clear(CacheKey.feeCategory);
+ }
+ /** Clears the 'feeCode' field, the 'has' method for this field will now return false */
+ public void clearFeeCode() {
+ genClient.clear(CacheKey.feeCode);
+ }
+ /** Clears the 'currency' field, the 'has' method for this field will now return false */
+ public void clearCurrency() {
+ genClient.clear(CacheKey.currency);
+ }
+ /** Clears the 'shortDesc' field, the 'has' method for this field will now return false */
+ public void clearShortDesc() {
+ genClient.clear(CacheKey.shortDesc);
+ }
+ /** Clears the 'fullDesc' field, the 'has' method for this field will now return false */
+ public void clearFullDesc() {
+ genClient.clear(CacheKey.fullDesc);
+ }
+ /** Clears the 'perItemAmount' field, the 'has' method for this field will now return false */
+ public void clearPerItemAmount() {
+ genClient.clear(CacheKey.perItemAmount);
+ }
+ /** Clears the 'percentage' field, the 'has' method for this field will now return false */
+ public void clearPercentage() {
+ genClient.clear(CacheKey.percentage);
+ }
+ /** Clears the 'totalTaxAmount' field, the 'has' method for this field will now return false */
+ public void clearTotalTaxAmount() {
+ genClient.clear(CacheKey.totalTaxAmount);
+ }
+ /** Clears the 'tax1Amount' field, the 'has' method for this field will now return false */
+ public void clearTax1Amount() {
+ genClient.clear(CacheKey.tax1Amount);
+ }
+ /** Clears the 'tax2Amount' field, the 'has' method for this field will now return false */
+ public void clearTax2Amount() {
+ genClient.clear(CacheKey.tax2Amount);
+ }
+ /** Clears the 'tax3Amount' field, the 'has' method for this field will now return false */
+ public void clearTax3Amount() {
+ genClient.clear(CacheKey.tax3Amount);
+ }
+ /** Clears the 'tax4Amount' field, the 'has' method for this field will now return false */
+ public void clearTax4Amount() {
+ genClient.clear(CacheKey.tax4Amount);
+ }
+ /** Clears the 'totalTaxRate' field, the 'has' method for this field will now return false */
+ public void clearTotalTaxRate() {
+ genClient.clear(CacheKey.totalTaxRate);
+ }
+ /** Clears the 'tax1Rate' field, the 'has' method for this field will now return false */
+ public void clearTax1Rate() {
+ genClient.clear(CacheKey.tax1Rate);
+ }
+ /** Clears the 'tax2Rate' field, the 'has' method for this field will now return false */
+ public void clearTax2Rate() {
+ genClient.clear(CacheKey.tax2Rate);
+ }
+ /** Clears the 'tax3Rate' field, the 'has' method for this field will now return false */
+ public void clearTax3Rate() {
+ genClient.clear(CacheKey.tax3Rate);
+ }
+ /** Clears the 'tax4Rate' field, the 'has' method for this field will now return false */
+ public void clearTax4Rate() {
+ genClient.clear(CacheKey.tax4Rate);
+ }
+ /** Clears the 'totalAmount' field, the 'has' method for this field will now return false */
+ public void clearTotalAmount() {
+ genClient.clear(CacheKey.totalAmount);
+ }
+
+
+ /**
+ * 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 PlanActionFeeRateSummary copyChanges() {
+ PlanActionFeeRateSummary copy = new PlanActionFeeRateSummary();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(PlanActionFeeRateSummary src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new PlanActionFeeRateSummary(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public PlanActionFeeRateSummary createFromParcel(android.os.Parcel in) {
+ PlanActionFeeRateSummary instance = new PlanActionFeeRateSummary(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 PlanActionFeeRateSummary[] newArray(int size) {
+ return new PlanActionFeeRateSummary[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return PlanActionFeeRateSummary.class;
+ }
+
+ @Override
+ public PlanActionFeeRateSummary create(org.json.JSONObject jsonObject) {
+ return new PlanActionFeeRateSummary(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean DEVICETYPE_IS_REQUIRED = false;
+ public static final boolean PLANACTIONTYPE_IS_REQUIRED = false;
+ public static final boolean FEECATEGORY_IS_REQUIRED = false;
+ public static final boolean FEECODE_IS_REQUIRED = false;
+ public static final boolean CURRENCY_IS_REQUIRED = false;
+ public static final boolean SHORTDESC_IS_REQUIRED = false;
+ public static final boolean FULLDESC_IS_REQUIRED = false;
+ public static final boolean PERITEMAMOUNT_IS_REQUIRED = false;
+ public static final boolean PERCENTAGE_IS_REQUIRED = false;
+ public static final boolean TOTALTAXAMOUNT_IS_REQUIRED = false;
+ public static final boolean TAX1AMOUNT_IS_REQUIRED = false;
+ public static final boolean TAX2AMOUNT_IS_REQUIRED = false;
+ public static final boolean TAX3AMOUNT_IS_REQUIRED = false;
+ public static final boolean TAX4AMOUNT_IS_REQUIRED = false;
+ public static final boolean TOTALTAXRATE_IS_REQUIRED = false;
+ public static final boolean TAX1RATE_IS_REQUIRED = false;
+ public static final boolean TAX2RATE_IS_REQUIRED = false;
+ public static final boolean TAX3RATE_IS_REQUIRED = false;
+ public static final boolean TAX4RATE_IS_REQUIRED = false;
+ public static final boolean TOTALAMOUNT_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Discount.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Discount.java
index ecaeb95ae..93190400a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Discount.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/Discount.java
@@ -34,6 +34,7 @@
*
{@link #getName name}
*
{@link #getAmount amount}
*
{@link #getPercentage percentage}
+ *
{@link #getType type}
*
*
* @see com.clover.sdk.v3.inventory.IInventoryService
@@ -69,6 +70,13 @@ public java.lang.Long getPercentage() {
return genClient.cacheGet(CacheKey.percentage);
}
+ /**
+ * The type of Discount
+ */
+ public com.clover.sdk.v3.inventory.DiscountType getType() {
+ return genClient.cacheGet(CacheKey.type);
+ }
+
@@ -81,6 +89,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
percentage
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ type
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.inventory.DiscountType.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -183,6 +193,11 @@ public boolean isNotNullPercentage() {
return genClient.cacheValueIsNotNull(CacheKey.percentage);
}
+ /** Checks whether the 'type' field is set and is not null */
+ public boolean isNotNullType() {
+ return genClient.cacheValueIsNotNull(CacheKey.type);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -205,6 +220,11 @@ public boolean hasPercentage() {
return genClient.cacheHasKey(CacheKey.percentage);
}
+ /** Checks whether the 'type' field has been set, however the value could be null */
+ public boolean hasType() {
+ return genClient.cacheHasKey(CacheKey.type);
+ }
+
/**
* Sets the field 'id'.
@@ -234,6 +254,13 @@ public Discount setPercentage(java.lang.Long percentage) {
return genClient.setOther(percentage, CacheKey.percentage);
}
+ /**
+ * Sets the field 'type'.
+ */
+ public Discount setType(com.clover.sdk.v3.inventory.DiscountType type) {
+ return genClient.setOther(type, CacheKey.type);
+ }
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -251,6 +278,10 @@ public void clearAmount() {
public void clearPercentage() {
genClient.clear(CacheKey.percentage);
}
+ /** Clears the 'type' field, the 'has' method for this field will now return false */
+ public void clearType() {
+ genClient.clear(CacheKey.type);
+ }
/**
@@ -322,6 +353,7 @@ public interface Constraints {
public static final boolean PERCENTAGE_IS_REQUIRED = false;
public static final long PERCENTAGE_MIN = 0;
public static final long PERCENTAGE_MAX = 100;
+ public static final boolean TYPE_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/DiscountType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/DiscountType.java
new file mode 100644
index 000000000..38413ded8
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/DiscountType.java
@@ -0,0 +1,58 @@
+/**
+ * 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.inventory;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ * Type of Discount
+ */
+@SuppressWarnings("all")
+public enum DiscountType implements Parcelable {
+ CASH_DISCOUNT, DEFAULT;
+
+ @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 DiscountType createFromParcel(final Parcel source) {
+ return DiscountType.valueOf(source.readString());
+ }
+
+ @Override
+ public DiscountType[] newArray(final int size) {
+ return new DiscountType[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryConnector.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryConnector.java
index 46a5ee708..0d0832873 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryConnector.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryConnector.java
@@ -154,6 +154,14 @@ public Item call(IInventoryService service, ResultStatus status) throws RemoteEx
});
}
+ public Item getPosMenuItem(final String itemId, String menuId) throws ClientException, ServiceException, BindingException, RemoteException {
+ return execute(new ServiceCallable() {
+ public Item call(IInventoryService service, ResultStatus status) throws RemoteException {
+ return service.getPosMenuItem(itemId, menuId, status);
+ }
+ });
+ }
+
public void getItem(final String itemId, Callback callback) {
execute(new ServiceCallable() {
public Item call(IInventoryService service, ResultStatus status) throws RemoteException {
@@ -1400,22 +1408,38 @@ public void getOrderFee(final String orderFeeId, Callback callback) {
execute((service, status) -> service.getOrderFee(orderFeeId, status), callback);
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public OrderFee createOrderFee(final OrderFee orderFee) throws ClientException, ServiceException, BindingException, RemoteException {
return execute((service, status) -> {
return service.createOrderFee(orderFee, status);
});
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public void createOrderFee(final OrderFee orderFee, Callback callback) {
execute((service, status) -> service.createOrderFee(orderFee, status), callback);
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public void updateOrderFee(final OrderFee orderFee) throws ClientException, ServiceException, BindingException, RemoteException {
execute((service, status) -> {
service.updateOrderFee(orderFee, status);
});
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public void updateOrderFee(final OrderFee orderFee, Callback callback) {
execute((service, status) -> {
service.updateOrderFee(orderFee, status);
@@ -1423,12 +1447,20 @@ public void updateOrderFee(final OrderFee orderFee, Callback callback) {
}, callback);
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public void deleteOrderFee(final String orderFeeId) throws ClientException, ServiceException, BindingException, RemoteException {
execute((service, status) -> {
service.deleteOrderFee(orderFeeId, status);
});
}
+ /**
+ * Not available to non-Clover apps.
+ * @y.exclude
+ */
public void deleteOrderFee(final String orderFeeId, Callback callback) {
execute((service, status) -> {
service.deleteOrderFee(orderFeeId, status);
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryContract.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryContract.java
index de2f90543..4e54d45a6 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryContract.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/InventoryContract.java
@@ -1124,6 +1124,12 @@ public interface DiscountColumns {
*/
public static final String PERCENTAGE = "percentage";
+ /**
+ * Discount Type.
+ *
+ * Type: Type: ENUN: DEFAULT, CASH_DISCOUNT
+ */
+ public static final String TYPE = "type";
}
/**
@@ -1697,6 +1703,8 @@ private ItemGroup() {
*/
public static final Uri CONTENT_URI_AND_SAMPLE_ITEMS = Uri.withAppendedPath(AUTHORITY_URI, "item_groups_and_sample_items");
+ public static final Uri CONTENT_URI_AND_SAMPLE_ITEMS_FOR_MENU = Uri.withAppendedPath(AUTHORITY_URI, "menu_item_groups_and_sample_items");
+
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of item groups.
*/
@@ -1739,6 +1747,17 @@ public static Uri contentUriAndSampleItemWithAccount(Account account) {
builder.appendQueryParameter(ACCOUNT_TYPE_PARAM, account.type);
return builder.build();
}
+
+ public static Uri contentUriAndSampleItemForMenuWithToken(String token) {
+ return CONTENT_URI_AND_SAMPLE_ITEMS_FOR_MENU.buildUpon().appendQueryParameter(AUTH_TOKEN_PARAM, token).build();
+ }
+
+ public static Uri contentUriAndSampleItemForMenuWithAccount(Account account) {
+ Uri.Builder builder = CONTENT_URI_AND_SAMPLE_ITEMS_FOR_MENU.buildUpon();
+ builder.appendQueryParameter(ACCOUNT_NAME_PARAM, account.name);
+ builder.appendQueryParameter(ACCOUNT_TYPE_PARAM, account.type);
+ return builder.build();
+ }
}
/**
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ItemOverride.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ItemOverride.java
index d93f23559..194e3362b 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ItemOverride.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ItemOverride.java
@@ -32,6 +32,8 @@
*
*
Fields
*
+ *
{@link #getCosUuid cosUuid}
+ *
{@link #getMenuId menuId}
*
{@link #getId id}
*
{@link #getSortOrder sortOrder}
*
{@link #getPrice price}
@@ -43,6 +45,20 @@
@SuppressWarnings("all")
public class ItemOverride extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+ /**
+ * Unique Clover identifier.
+ */
+ public String getCosUuid() {
+ return genClient.cacheGet(CacheKey.cosUuid);
+ }
+
+ /**
+ * Unique Clover identifier.
+ */
+ public String getMenuId() {
+ return genClient.cacheGet(CacheKey.menuId);
+ }
+
/**
* Unique Clover identifier.
*/
@@ -89,6 +105,10 @@ public Long getDeletedTime() {
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ cosUuid
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ menuId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
id
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
sortOrder
@@ -173,7 +193,21 @@ public org.json.JSONObject getJSONObject() {
@Override
public void validate() {
- genClient.validateCloverId(CacheKey.id, getId());
+ genClient.validateCloverId(CacheKey.cosUuid, getCosUuid());
+
+ genClient.validateLength(CacheKey.menuId, getMenuId(), 127);
+
+ genClient.validateLength(CacheKey.id, getId(), 127);
+ }
+
+ /** Checks whether the 'cosUuid' field is set and is not null */
+ public boolean isNotNullCosUuid() {
+ return genClient.cacheValueIsNotNull(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field is set and is not null */
+ public boolean isNotNullMenuId() {
+ return genClient.cacheValueIsNotNull(CacheKey.menuId);
}
/** Checks whether the 'id' field is set and is not null */
@@ -208,6 +242,16 @@ public boolean isNotNullDeletedTime() {
+ /** Checks whether the 'cosUuid' field has been set, however the value could be null */
+ public boolean hasCosUuid() {
+ return genClient.cacheHasKey(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field has been set, however the value could be null */
+ public boolean hasMenuId() {
+ return genClient.cacheHasKey(CacheKey.menuId);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
return genClient.cacheHasKey(CacheKey.id);
@@ -239,6 +283,20 @@ public boolean hasDeletedTime() {
}
+ /**
+ * Sets the field 'cosUuid'.
+ */
+ public ItemOverride setCosUuid(String cosUuid) {
+ return genClient.setOther(cosUuid, CacheKey.cosUuid);
+ }
+
+ /**
+ * Sets the field 'menuId'.
+ */
+ public ItemOverride setMenuId(String menuId) {
+ return genClient.setOther(menuId, CacheKey.menuId);
+ }
+
/**
* Sets the field 'id'.
*/
@@ -282,6 +340,14 @@ public ItemOverride setDeletedTime(Long deletedTime) {
}
+ /** Clears the 'cosUuid' field, the 'has' method for this field will now return false */
+ public void clearCosUuid() {
+ genClient.clear(CacheKey.cosUuid);
+ }
+ /** Clears the 'menuId' field, the 'has' method for this field will now return false */
+ public void clearMenuId() {
+ genClient.clear(CacheKey.menuId);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
genClient.clear(CacheKey.id);
@@ -368,6 +434,10 @@ public ItemOverride create(org.json.JSONObject jsonObject) {
};
public interface Constraints {
+ public static final boolean COSUUID_IS_REQUIRED = false;
+ public static final long COSUUID_MAX_LEN = 127;
+ public static final boolean MENUID_IS_REQUIRED = false;
+ public static final long MENUID_MAX_LEN = 127;
public static final boolean ID_IS_REQUIRED = false;
public static final long ID_MAX_LEN = 127;
public static final boolean SORTORDER_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/LayoutOverride.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/LayoutOverride.java
index 0d6525031..73171db1a 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/LayoutOverride.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/LayoutOverride.java
@@ -32,6 +32,8 @@
*
*
Fields
*
+ *
{@link #getCosUuid cosUuid}
+ *
{@link #getMenuId menuId}
*
{@link #getId id}
*
{@link #getSortOrder sortOrder}
*
{@link #getColorCode colorCode}
@@ -44,6 +46,20 @@
@SuppressWarnings("all")
public class LayoutOverride extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+ /**
+ * Unique Clover identifier.
+ */
+ public String getCosUuid() {
+ return genClient.cacheGet(CacheKey.cosUuid);
+ }
+
+ /**
+ * Unique Clover identifier.
+ */
+ public String getMenuId() {
+ return genClient.cacheGet(CacheKey.menuId);
+ }
+
/**
* Unique Clover identifier.
*/
@@ -97,6 +113,10 @@ public Long getDeletedTime() {
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ cosUuid
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ menuId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
id
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
sortOrder
@@ -183,11 +203,25 @@ public org.json.JSONObject getJSONObject() {
@Override
public void validate() {
- genClient.validateCloverId(CacheKey.id, getId());
+ genClient.validateCloverId(CacheKey.cosUuid, getCosUuid());
+
+ genClient.validateLength(CacheKey.menuId, getMenuId(), 127);
+
+ genClient.validateLength(CacheKey.id, getId(), 127);
genClient.validateNotNull(CacheKey.sortOrder, getSortOrder());
}
+ /** Checks whether the 'cosUuid' field is set and is not null */
+ public boolean isNotNullCosUuid() {
+ return genClient.cacheValueIsNotNull(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field is set and is not null */
+ public boolean isNotNullMenuId() {
+ return genClient.cacheValueIsNotNull(CacheKey.menuId);
+ }
+
/** Checks whether the 'id' field is set and is not null */
public boolean isNotNullId() {
return genClient.cacheValueIsNotNull(CacheKey.id);
@@ -225,6 +259,16 @@ public boolean isNotNullDeletedTime() {
+ /** Checks whether the 'cosUuid' field has been set, however the value could be null */
+ public boolean hasCosUuid() {
+ return genClient.cacheHasKey(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field has been set, however the value could be null */
+ public boolean hasMenuId() {
+ return genClient.cacheHasKey(CacheKey.menuId);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
return genClient.cacheHasKey(CacheKey.id);
@@ -261,6 +305,20 @@ public boolean hasDeletedTime() {
}
+ /**
+ * Sets the field 'cosUuid'.
+ */
+ public LayoutOverride setCosUuid(String cosUuid) {
+ return genClient.setOther(cosUuid, CacheKey.cosUuid);
+ }
+
+ /**
+ * Sets the field 'menuId'.
+ */
+ public LayoutOverride setMenuId(String menuId) {
+ return genClient.setOther(menuId, CacheKey.menuId);
+ }
+
/**
* Sets the field 'id'.
*/
@@ -311,6 +369,14 @@ public LayoutOverride setDeletedTime(Long deletedTime) {
}
+ /** Clears the 'cosUuid' field, the 'has' method for this field will now return false */
+ public void clearCosUuid() {
+ genClient.clear(CacheKey.cosUuid);
+ }
+ /** Clears the 'menuId' field, the 'has' method for this field will now return false */
+ public void clearMenuId() {
+ genClient.clear(CacheKey.menuId);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
genClient.clear(CacheKey.id);
@@ -401,6 +467,10 @@ public LayoutOverride create(org.json.JSONObject jsonObject) {
};
public interface Constraints {
+ public static final boolean COSUUID_IS_REQUIRED = false;
+ public static final long COSUUID_MAX_LEN = 127;
+ public static final boolean MENUID_IS_REQUIRED = false;
+ public static final long MENUID_MAX_LEN = 127;
public static final boolean ID_IS_REQUIRED = false;
public static final long ID_MAX_LEN = 127;
public static final boolean SORTORDER_IS_REQUIRED = true;
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 803530aa2..9170d35ff 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
@@ -34,6 +34,7 @@
*
*
{@link #getId id}
*
{@link #getName name}
+ *
{@link #getDefaultPosMenu defaultPosMenu}
*
{@link #getModifiedTime modifiedTime}
*
{@link #getCreatedTime createdTime}
*
{@link #getDeletedTime deletedTime}
@@ -45,35 +46,42 @@ public class Menu extends GenericParcelable implements com.clover.sdk.v3.Validat
/**
* Unique Clover identifier.
*/
- public String getId() {
+ public java.lang.String getId() {
return genClient.cacheGet(CacheKey.id);
}
/**
* Name of the menu
*/
- public String getName() {
+ public java.lang.String getName() {
return genClient.cacheGet(CacheKey.name);
}
+ /**
+ * true in case the menu is default POS menu
+ */
+ public java.lang.Boolean getDefaultPosMenu() {
+ return genClient.cacheGet(CacheKey.defaultPosMenu);
+ }
+
/**
* Timestamp when menu was last modified
*/
- public Long getModifiedTime() {
+ public java.lang.Long getModifiedTime() {
return genClient.cacheGet(CacheKey.modifiedTime);
}
/**
* Timestamp when menu was last created
*/
- public Long getCreatedTime() {
+ public java.lang.Long getCreatedTime() {
return genClient.cacheGet(CacheKey.createdTime);
}
/**
* Timestamp when menu was last deleted
*/
- public Long getDeletedTime() {
+ public java.lang.Long getDeletedTime() {
return genClient.cacheGet(CacheKey.deletedTime);
}
@@ -82,15 +90,17 @@ public Long getDeletedTime() {
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
id
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
name
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ defaultPosMenu
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
modifiedTime
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
createdTime
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
deletedTime
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -179,6 +189,11 @@ public boolean isNotNullName() {
return genClient.cacheValueIsNotNull(CacheKey.name);
}
+ /** Checks whether the 'defaultPosMenu' field is set and is not null */
+ public boolean isNotNullDefaultPosMenu() {
+ return genClient.cacheValueIsNotNull(CacheKey.defaultPosMenu);
+ }
+
/** Checks whether the 'modifiedTime' field is set and is not null */
public boolean isNotNullModifiedTime() {
return genClient.cacheValueIsNotNull(CacheKey.modifiedTime);
@@ -206,6 +221,11 @@ public boolean hasName() {
return genClient.cacheHasKey(CacheKey.name);
}
+ /** Checks whether the 'defaultPosMenu' field has been set, however the value could be null */
+ public boolean hasDefaultPosMenu() {
+ return genClient.cacheHasKey(CacheKey.defaultPosMenu);
+ }
+
/** Checks whether the 'modifiedTime' field has been set, however the value could be null */
public boolean hasModifiedTime() {
return genClient.cacheHasKey(CacheKey.modifiedTime);
@@ -225,35 +245,42 @@ public boolean hasDeletedTime() {
/**
* Sets the field 'id'.
*/
- public Menu setId(String id) {
+ public Menu setId(java.lang.String id) {
return genClient.setOther(id, CacheKey.id);
}
/**
* Sets the field 'name'.
*/
- public Menu setName(String name) {
+ public Menu setName(java.lang.String name) {
return genClient.setOther(name, CacheKey.name);
}
+ /**
+ * Sets the field 'defaultPosMenu'.
+ */
+ public Menu setDefaultPosMenu(java.lang.Boolean defaultPosMenu) {
+ return genClient.setOther(defaultPosMenu, CacheKey.defaultPosMenu);
+ }
+
/**
* Sets the field 'modifiedTime'.
*/
- public Menu setModifiedTime(Long modifiedTime) {
+ public Menu setModifiedTime(java.lang.Long modifiedTime) {
return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
}
/**
* Sets the field 'createdTime'.
*/
- public Menu setCreatedTime(Long createdTime) {
+ public Menu setCreatedTime(java.lang.Long createdTime) {
return genClient.setOther(createdTime, CacheKey.createdTime);
}
/**
* Sets the field 'deletedTime'.
*/
- public Menu setDeletedTime(Long deletedTime) {
+ public Menu setDeletedTime(java.lang.Long deletedTime) {
return genClient.setOther(deletedTime, CacheKey.deletedTime);
}
@@ -266,6 +293,10 @@ public void clearId() {
public void clearName() {
genClient.clear(CacheKey.name);
}
+ /** Clears the 'defaultPosMenu' field, the 'has' method for this field will now return false */
+ public void clearDefaultPosMenu() {
+ genClient.clear(CacheKey.defaultPosMenu);
+ }
/** Clears the 'modifiedTime' field, the 'has' method for this field will now return false */
public void clearModifiedTime() {
genClient.clear(CacheKey.modifiedTime);
@@ -344,6 +375,7 @@ public interface Constraints {
public static final long ID_MAX_LEN = 127;
public static final boolean NAME_IS_REQUIRED = true;
public static final long NAME_MAX_LEN = 127;
+ public static final boolean DEFAULTPOSMENU_IS_REQUIRED = false;
public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
public static final boolean CREATEDTIME_IS_REQUIRED = false;
public static final boolean DELETEDTIME_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ModifierOverride.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ModifierOverride.java
index 1b2a47a58..6610addd4 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ModifierOverride.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/inventory/ModifierOverride.java
@@ -32,6 +32,8 @@
*
*
Fields
*
+ *
{@link #getCosUuid cosUuid}
+ *
{@link #getMenuId menuId}
*
{@link #getId id}
*
{@link #getEnabled enabled}
*
{@link #getReasonCode reasonCode}
@@ -44,6 +46,20 @@
@SuppressWarnings("all")
public class ModifierOverride extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+ /**
+ * Unique Clover identifier.
+ */
+ public String getCosUuid() {
+ return genClient.cacheGet(CacheKey.cosUuid);
+ }
+
+ /**
+ * Unique Clover identifier.
+ */
+ public String getMenuId() {
+ return genClient.cacheGet(CacheKey.menuId);
+ }
+
/**
* Unique Clover identifier.
*/
@@ -97,6 +113,10 @@ public Long getDeletedTime() {
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ cosUuid
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
+ menuId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
id
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
enabled
@@ -183,12 +203,26 @@ public org.json.JSONObject getJSONObject() {
@Override
public void validate() {
- genClient.validateCloverId(CacheKey.id, getId());
+ genClient.validateCloverId(CacheKey.cosUuid, getCosUuid());
+
+ genClient.validateLength(CacheKey.menuId, getMenuId(), 127);
+
+ genClient.validateLength(CacheKey.id, getId(), 127);
genClient.validateNotNull(CacheKey.reasonCode, getReasonCode());
genClient.validateLength(CacheKey.reasonCode, getReasonCode(), 127);
}
+ /** Checks whether the 'cosUuid' field is set and is not null */
+ public boolean isNotNullCosUuid() {
+ return genClient.cacheValueIsNotNull(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field is set and is not null */
+ public boolean isNotNullMenuId() {
+ return genClient.cacheValueIsNotNull(CacheKey.menuId);
+ }
+
/** Checks whether the 'id' field is set and is not null */
public boolean isNotNullId() {
return genClient.cacheValueIsNotNull(CacheKey.id);
@@ -226,6 +260,16 @@ public boolean isNotNullDeletedTime() {
+ /** Checks whether the 'cosUuid' field has been set, however the value could be null */
+ public boolean hasCosUuid() {
+ return genClient.cacheHasKey(CacheKey.cosUuid);
+ }
+
+ /** Checks whether the 'menuId' field has been set, however the value could be null */
+ public boolean hasMenuId() {
+ return genClient.cacheHasKey(CacheKey.menuId);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
return genClient.cacheHasKey(CacheKey.id);
@@ -262,6 +306,20 @@ public boolean hasDeletedTime() {
}
+ /**
+ * Sets the field 'cosUuid'.
+ */
+ public ModifierOverride setCosUuid(String cosUuid) {
+ return genClient.setOther(cosUuid, CacheKey.cosUuid);
+ }
+
+ /**
+ * Sets the field 'menuId'.
+ */
+ public ModifierOverride setMenuId(String menuId) {
+ return genClient.setOther(menuId, CacheKey.menuId);
+ }
+
/**
* Sets the field 'id'.
*/
@@ -312,6 +370,14 @@ public ModifierOverride setDeletedTime(Long deletedTime) {
}
+ /** Clears the 'cosUuid' field, the 'has' method for this field will now return false */
+ public void clearCosUuid() {
+ genClient.clear(CacheKey.cosUuid);
+ }
+ /** Clears the 'menuId' field, the 'has' method for this field will now return false */
+ public void clearMenuId() {
+ genClient.clear(CacheKey.menuId);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
genClient.clear(CacheKey.id);
@@ -402,6 +468,10 @@ public ModifierOverride create(org.json.JSONObject jsonObject) {
};
public interface Constraints {
+ public static final boolean COSUUID_IS_REQUIRED = false;
+ public static final long COSUUID_MAX_LEN = 127;
+ public static final boolean MENUID_IS_REQUIRED = false;
+ public static final long MENUID_MAX_LEN = 127;
public static final boolean ID_IS_REQUIRED = false;
public static final long ID_MAX_LEN = 127;
public static final boolean ENABLED_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlan.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlan.java
index 8e5815cdc..d97195224 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlan.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlan.java
@@ -38,22 +38,27 @@
*
@@ -108,6 +113,10 @@ public com.clover.sdk.v3.apps.AppBundle getAppBundle() {
return genClient.cacheGet(CacheKey.appBundle);
}
+ public java.lang.Integer getNumDevicesIncludedWithPrice() {
+ return genClient.cacheGet(CacheKey.numDevicesIncludedWithPrice);
+ }
+
/**
* If true and multiple plans of this code then treat as default plan for reseller. Cannot use word default.
*/
@@ -123,12 +132,19 @@ public java.lang.Boolean getRecommended() {
}
/**
- * Pricing model for plan.
+ * Pricing model for plan. This is calculated based on the plan's flags. This enum is typically used to show appropriate text for the plan's pricing.
*/
public com.clover.sdk.v3.merchant.MerchantPlanPricingModel getPricingModel() {
return genClient.cacheGet(CacheKey.pricingModel);
}
+ /**
+ * User-friendly description of plan pricing for display
+ */
+ public java.lang.String getPricingDescription() {
+ return genClient.cacheGet(CacheKey.pricingDescription);
+ }
+
/**
* Comma separated list of tags.
*/
@@ -137,17 +153,17 @@ public java.util.List getTags() {
}
/**
- * Pricing description of plan.
+ * If true then plan offers by one device get one free.
*/
- public java.lang.String getPricingDescription() {
- return genClient.cacheGet(CacheKey.pricingDescription);
+ public java.lang.Boolean getBogo() {
+ return genClient.cacheGet(CacheKey.bogo);
}
/**
* If true then plan offers by one device get one free.
*/
- public java.lang.Boolean getBogo() {
- return genClient.cacheGet(CacheKey.bogo);
+ public java.lang.Boolean getIncludeAllFeatures() {
+ return genClient.cacheGet(CacheKey.includeAllFeatures);
}
/**
@@ -158,7 +174,7 @@ public java.lang.Long getWeight() {
}
/**
- * List of feature keys this plans supports. Used by plan selection/summary pages.
+ * List of feature keys this plan supports. Used by plan selection/summary pages.
*/
public java.util.List getFeatures() {
return genClient.cacheGet(CacheKey.features);
@@ -171,6 +187,13 @@ public java.util.List getTranslatedFeatures() {
return genClient.cacheGet(CacheKey.translatedFeatures);
}
+ /**
+ * List of MCC codes this plan supports or is restricted to. Used for HIPAA MCC processing.
+ */
+ public java.util.List getMccs() {
+ return genClient.cacheGet(CacheKey.mccs);
+ }
+
/**
* If true then billing will charge monthly fee regardless of device status or count.
*/
@@ -206,10 +229,6 @@ public java.lang.Long getDeactivationTime() {
return genClient.cacheGet(CacheKey.deactivationTime);
}
- public com.clover.sdk.v3.resellers.Reseller getReseller() {
- return genClient.cacheGet(CacheKey.reseller);
- }
-
/**
* Plan Group of this Plan as associated with merchant in context
*/
@@ -217,6 +236,24 @@ public com.clover.sdk.v3.base.Reference getMerchantPlanGroup() {
return genClient.cacheGet(CacheKey.merchantPlanGroup);
}
+ /**
+ * If true and merchant is assigned this plan then merchant cannot self-serve change from the plan.
+ */
+ public java.lang.Boolean getEnforced() {
+ return genClient.cacheGet(CacheKey.enforced);
+ }
+
+ /**
+ * If true and a merchant in same plan group is not assigned this plan then merchant cannot see this plan.
+ */
+ public java.lang.Boolean getHidden() {
+ return genClient.cacheGet(CacheKey.hidden);
+ }
+
+ public com.clover.sdk.v3.billing.PlanActionFeeRateSummary getPlanActionFeeRateSummary() {
+ return genClient.cacheGet(CacheKey.planActionFeeRateSummary);
+ }
+
/**
* Date/time this plan was created.
*/
@@ -251,24 +288,30 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.merchant.Module.JSON_CREATOR)),
appBundle
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.apps.AppBundle.JSON_CREATOR)),
+ numDevicesIncludedWithPrice
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
defaultPlan
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
recommended
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
pricingModel
(com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.merchant.MerchantPlanPricingModel.class)),
- tags
- (com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
pricingDescription
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ tags
+ (com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
bogo
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ includeAllFeatures
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
weight
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
features
(com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
translatedFeatures
(com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
+ mccs
+ (com.clover.sdk.extractors.BasicListExtractionStrategy.instance(java.lang.String.class)),
billToMid
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
type
@@ -279,10 +322,14 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
deactivationTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
- reseller
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.resellers.Reseller.JSON_CREATOR)),
merchantPlanGroup
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
+ enforced
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ hidden
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ planActionFeeRateSummary
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.billing.PlanActionFeeRateSummary.JSON_CREATOR)),
createdTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
modifiedTime
@@ -412,6 +459,11 @@ public boolean isNotNullAppBundle() {
return genClient.cacheValueIsNotNull(CacheKey.appBundle);
}
+ /** Checks whether the 'numDevicesIncludedWithPrice' field is set and is not null */
+ public boolean isNotNullNumDevicesIncludedWithPrice() {
+ return genClient.cacheValueIsNotNull(CacheKey.numDevicesIncludedWithPrice);
+ }
+
/** Checks whether the 'defaultPlan' field is set and is not null */
public boolean isNotNullDefaultPlan() {
return genClient.cacheValueIsNotNull(CacheKey.defaultPlan);
@@ -427,24 +479,29 @@ public boolean isNotNullPricingModel() {
return genClient.cacheValueIsNotNull(CacheKey.pricingModel);
}
- /** Checks whether the 'tags' field is set and is not null and is not empty */
- public boolean isNotEmptyTags() { return isNotNullTags() && !getTags().isEmpty(); }
+ /** Checks whether the 'pricingDescription' field is set and is not null */
+ public boolean isNotNullPricingDescription() {
+ return genClient.cacheValueIsNotNull(CacheKey.pricingDescription);
+ }
/** Checks whether the 'tags' field is set and is not null */
public boolean isNotNullTags() {
return genClient.cacheValueIsNotNull(CacheKey.tags);
}
- /** Checks whether the 'pricingDescription' field is set and is not null */
- public boolean isNotNullPricingDescription() {
- return genClient.cacheValueIsNotNull(CacheKey.pricingDescription);
- }
+ /** Checks whether the 'tags' field is set and is not null and is not empty */
+ public boolean isNotEmptyTags() { return isNotNullTags() && !getTags().isEmpty(); }
/** Checks whether the 'bogo' field is set and is not null */
public boolean isNotNullBogo() {
return genClient.cacheValueIsNotNull(CacheKey.bogo);
}
+ /** Checks whether the 'includeAllFeatures' field is set and is not null */
+ public boolean isNotNullIncludeAllFeatures() {
+ return genClient.cacheValueIsNotNull(CacheKey.includeAllFeatures);
+ }
+
/** Checks whether the 'weight' field is set and is not null */
public boolean isNotNullWeight() {
return genClient.cacheValueIsNotNull(CacheKey.weight);
@@ -466,6 +523,14 @@ public boolean isNotNullTranslatedFeatures() {
/** Checks whether the 'translatedFeatures' field is set and is not null and is not empty */
public boolean isNotEmptyTranslatedFeatures() { return isNotNullTranslatedFeatures() && !getTranslatedFeatures().isEmpty(); }
+ /** Checks whether the 'mccs' field is set and is not null */
+ public boolean isNotNullMccs() {
+ return genClient.cacheValueIsNotNull(CacheKey.mccs);
+ }
+
+ /** Checks whether the 'mccs' field is set and is not null and is not empty */
+ public boolean isNotEmptyMccs() { return isNotNullMccs() && !getMccs().isEmpty(); }
+
/** Checks whether the 'billToMid' field is set and is not null */
public boolean isNotNullBillToMid() {
return genClient.cacheValueIsNotNull(CacheKey.billToMid);
@@ -491,16 +556,26 @@ public boolean isNotNullDeactivationTime() {
return genClient.cacheValueIsNotNull(CacheKey.deactivationTime);
}
- /** Checks whether the 'reseller' field is set and is not null */
- public boolean isNotNullReseller() {
- return genClient.cacheValueIsNotNull(CacheKey.reseller);
- }
-
/** Checks whether the 'merchantPlanGroup' field is set and is not null */
public boolean isNotNullMerchantPlanGroup() {
return genClient.cacheValueIsNotNull(CacheKey.merchantPlanGroup);
}
+ /** Checks whether the 'enforced' field is set and is not null */
+ public boolean isNotNullEnforced() {
+ return genClient.cacheValueIsNotNull(CacheKey.enforced);
+ }
+
+ /** Checks whether the 'hidden' field is set and is not null */
+ public boolean isNotNullHidden() {
+ return genClient.cacheValueIsNotNull(CacheKey.hidden);
+ }
+
+ /** Checks whether the 'planActionFeeRateSummary' field is set and is not null */
+ public boolean isNotNullPlanActionFeeRateSummary() {
+ return genClient.cacheValueIsNotNull(CacheKey.planActionFeeRateSummary);
+ }
+
/** Checks whether the 'createdTime' field is set and is not null */
public boolean isNotNullCreatedTime() {
return genClient.cacheValueIsNotNull(CacheKey.createdTime);
@@ -553,6 +628,11 @@ public boolean hasAppBundle() {
return genClient.cacheHasKey(CacheKey.appBundle);
}
+ /** Checks whether the 'numDevicesIncludedWithPrice' field has been set, however the value could be null */
+ public boolean hasNumDevicesIncludedWithPrice() {
+ return genClient.cacheHasKey(CacheKey.numDevicesIncludedWithPrice);
+ }
+
/** Checks whether the 'defaultPlan' field has been set, however the value could be null */
public boolean hasDefaultPlan() {
return genClient.cacheHasKey(CacheKey.defaultPlan);
@@ -568,21 +648,26 @@ public boolean hasPricingModel() {
return genClient.cacheHasKey(CacheKey.pricingModel);
}
- /** Checks whether the 'tags' field has been set, however the value could be null */
- public boolean hasTags() {
- return genClient.cacheHasKey(CacheKey.tags);
- }
-
/** Checks whether the 'pricingDescription' field has been set, however the value could be null */
public boolean hasPricingDescription() {
return genClient.cacheHasKey(CacheKey.pricingDescription);
}
+ /** Checks whether the 'tags' field has been set, however the value could be null */
+ public boolean hasTags() {
+ return genClient.cacheHasKey(CacheKey.tags);
+ }
+
/** Checks whether the 'bogo' field has been set, however the value could be null */
public boolean hasBogo() {
return genClient.cacheHasKey(CacheKey.bogo);
}
+ /** Checks whether the 'includeAllFeatures' field has been set, however the value could be null */
+ public boolean hasIncludeAllFeatures() {
+ return genClient.cacheHasKey(CacheKey.includeAllFeatures);
+ }
+
/** Checks whether the 'weight' field has been set, however the value could be null */
public boolean hasWeight() {
return genClient.cacheHasKey(CacheKey.weight);
@@ -598,6 +683,11 @@ public boolean hasTranslatedFeatures() {
return genClient.cacheHasKey(CacheKey.translatedFeatures);
}
+ /** Checks whether the 'mccs' field has been set, however the value could be null */
+ public boolean hasMccs() {
+ return genClient.cacheHasKey(CacheKey.mccs);
+ }
+
/** Checks whether the 'billToMid' field has been set, however the value could be null */
public boolean hasBillToMid() {
return genClient.cacheHasKey(CacheKey.billToMid);
@@ -623,16 +713,26 @@ public boolean hasDeactivationTime() {
return genClient.cacheHasKey(CacheKey.deactivationTime);
}
- /** Checks whether the 'reseller' field has been set, however the value could be null */
- public boolean hasReseller() {
- return genClient.cacheHasKey(CacheKey.reseller);
- }
-
/** Checks whether the 'merchantPlanGroup' field has been set, however the value could be null */
public boolean hasMerchantPlanGroup() {
return genClient.cacheHasKey(CacheKey.merchantPlanGroup);
}
+ /** Checks whether the 'enforced' field has been set, however the value could be null */
+ public boolean hasEnforced() {
+ return genClient.cacheHasKey(CacheKey.enforced);
+ }
+
+ /** Checks whether the 'hidden' field has been set, however the value could be null */
+ public boolean hasHidden() {
+ return genClient.cacheHasKey(CacheKey.hidden);
+ }
+
+ /** Checks whether the 'planActionFeeRateSummary' field has been set, however the value could be null */
+ public boolean hasPlanActionFeeRateSummary() {
+ return genClient.cacheHasKey(CacheKey.planActionFeeRateSummary);
+ }
+
/** Checks whether the 'createdTime' field has been set, however the value could be null */
public boolean hasCreatedTime() {
return genClient.cacheHasKey(CacheKey.createdTime);
@@ -704,6 +804,13 @@ public MerchantPlan setAppBundle(com.clover.sdk.v3.apps.AppBundle appBundle) {
return genClient.setRecord(appBundle, CacheKey.appBundle);
}
+ /**
+ * Sets the field 'numDevicesIncludedWithPrice'.
+ */
+ public MerchantPlan setNumDevicesIncludedWithPrice(java.lang.Integer numDevicesIncludedWithPrice) {
+ return genClient.setOther(numDevicesIncludedWithPrice, CacheKey.numDevicesIncludedWithPrice);
+ }
+
/**
* Sets the field 'defaultPlan'.
*/
@@ -726,21 +833,19 @@ public MerchantPlan setPricingModel(com.clover.sdk.v3.merchant.MerchantPlanPrici
}
/**
- * Sets the field 'tags'.
- *
- * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ * Sets the field 'pricingDescription'.
*/
- public MerchantPlan setTags(java.util.List tags) {
- return genClient.setArrayOther(tags, CacheKey.tags);
+ public MerchantPlan setPricingDescription(java.lang.String pricingDescription) {
+ return genClient.setOther(pricingDescription, CacheKey.pricingDescription);
}
/**
- * Sets the field 'pricingDescription'.
+ * Sets the field 'tags'.
*
* Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
*/
- public MerchantPlan setPricingDescription(java.lang.String pricingDescription) {
- return genClient.setOther(pricingDescription, CacheKey.pricingDescription);
+ public MerchantPlan setTags(java.util.List tags) {
+ return genClient.setArrayOther(tags, CacheKey.tags);
}
/**
@@ -750,6 +855,13 @@ public MerchantPlan setBogo(java.lang.Boolean bogo) {
return genClient.setOther(bogo, CacheKey.bogo);
}
+ /**
+ * Sets the field 'includeAllFeatures'.
+ */
+ public MerchantPlan setIncludeAllFeatures(java.lang.Boolean includeAllFeatures) {
+ return genClient.setOther(includeAllFeatures, CacheKey.includeAllFeatures);
+ }
+
/**
* Sets the field 'weight'.
*/
@@ -775,6 +887,15 @@ public MerchantPlan setTranslatedFeatures(java.util.List trans
return genClient.setArrayOther(translatedFeatures, CacheKey.translatedFeatures);
}
+ /**
+ * Sets the field 'mccs'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public MerchantPlan setMccs(java.util.List mccs) {
+ return genClient.setArrayOther(mccs, CacheKey.mccs);
+ }
+
/**
* Sets the field 'billToMid'.
*/
@@ -811,21 +932,35 @@ public MerchantPlan setDeactivationTime(java.lang.Long deactivationTime) {
}
/**
- * Sets the field 'reseller'.
+ * Sets the field 'merchantPlanGroup'.
*
* The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
*/
- public MerchantPlan setReseller(com.clover.sdk.v3.resellers.Reseller reseller) {
- return genClient.setRecord(reseller, CacheKey.reseller);
+ public MerchantPlan setMerchantPlanGroup(com.clover.sdk.v3.base.Reference merchantPlanGroup) {
+ return genClient.setRecord(merchantPlanGroup, CacheKey.merchantPlanGroup);
}
/**
- * Sets the field 'merchantPlanGroup'.
+ * Sets the field 'enforced'.
+ */
+ public MerchantPlan setEnforced(java.lang.Boolean enforced) {
+ return genClient.setOther(enforced, CacheKey.enforced);
+ }
+
+ /**
+ * Sets the field 'hidden'.
+ */
+ public MerchantPlan setHidden(java.lang.Boolean hidden) {
+ return genClient.setOther(hidden, CacheKey.hidden);
+ }
+
+ /**
+ * Sets the field 'planActionFeeRateSummary'.
*
* The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
*/
- public MerchantPlan setMerchantPlanGroup(com.clover.sdk.v3.base.Reference merchantPlanGroup) {
- return genClient.setRecord(merchantPlanGroup, CacheKey.merchantPlanGroup);
+ public MerchantPlan setPlanActionFeeRateSummary(com.clover.sdk.v3.billing.PlanActionFeeRateSummary planActionFeeRateSummary) {
+ return genClient.setRecord(planActionFeeRateSummary, CacheKey.planActionFeeRateSummary);
}
/**
@@ -875,6 +1010,10 @@ public void clearModules() {
public void clearAppBundle() {
genClient.clear(CacheKey.appBundle);
}
+ /** Clears the 'numDevicesIncludedWithPrice' field, the 'has' method for this field will now return false */
+ public void clearNumDevicesIncludedWithPrice() {
+ genClient.clear(CacheKey.numDevicesIncludedWithPrice);
+ }
/** Clears the 'defaultPlan' field, the 'has' method for this field will now return false */
public void clearDefaultPlan() {
genClient.clear(CacheKey.defaultPlan);
@@ -887,19 +1026,23 @@ public void clearRecommended() {
public void clearPricingModel() {
genClient.clear(CacheKey.pricingModel);
}
- /** Clears the 'tags' field, the 'has' method for this field will now return false */
- public void clearTags() {
- genClient.clear(CacheKey.tags);
- }
/** Clears the 'pricingDescription' field, the 'has' method for this field will now return false */
public void clearPricingDescription() {
genClient.clear(CacheKey.pricingDescription);
}
- /** Clears the 'bogo' field, the 'has' method for this field will now return false */
+ /** Clears the 'tags' field, the 'has' method for this field will now return false */
+ public void clearTags() {
+ genClient.clear(CacheKey.tags);
+ }
+ /** Clears the 'tags' field, the 'has' method for this field will now return false */
public void clearBogo() {
genClient.clear(CacheKey.bogo);
}
/** Clears the 'weight' field, the 'has' method for this field will now return false */
+ public void clearIncludeAllFeatures() {
+ genClient.clear(CacheKey.includeAllFeatures);
+ }
+ /** Clears the 'weight' field, the 'has' method for this field will now return false */
public void clearWeight() {
genClient.clear(CacheKey.weight);
}
@@ -911,6 +1054,10 @@ public void clearFeatures() {
public void clearTranslatedFeatures() {
genClient.clear(CacheKey.translatedFeatures);
}
+ /** Clears the 'mccs' field, the 'has' method for this field will now return false */
+ public void clearMccs() {
+ genClient.clear(CacheKey.mccs);
+ }
/** Clears the 'billToMid' field, the 'has' method for this field will now return false */
public void clearBillToMid() {
genClient.clear(CacheKey.billToMid);
@@ -931,14 +1078,22 @@ public void clearActivationTime() {
public void clearDeactivationTime() {
genClient.clear(CacheKey.deactivationTime);
}
- /** Clears the 'reseller' field, the 'has' method for this field will now return false */
- public void clearReseller() {
- genClient.clear(CacheKey.reseller);
- }
/** Clears the 'merchantPlanGroup' field, the 'has' method for this field will now return false */
public void clearMerchantPlanGroup() {
genClient.clear(CacheKey.merchantPlanGroup);
}
+ /** Clears the 'enforced' field, the 'has' method for this field will now return false */
+ public void clearEnforced() {
+ genClient.clear(CacheKey.enforced);
+ }
+ /** Clears the 'hidden' field, the 'has' method for this field will now return false */
+ public void clearHidden() {
+ genClient.clear(CacheKey.hidden);
+ }
+ /** Clears the 'planActionFeeRateSummary' field, the 'has' method for this field will now return false */
+ public void clearPlanActionFeeRateSummary() {
+ genClient.clear(CacheKey.planActionFeeRateSummary);
+ }
/** Clears the 'createdTime' field, the 'has' method for this field will now return false */
public void clearCreatedTime() {
genClient.clear(CacheKey.createdTime);
@@ -1020,23 +1175,28 @@ public interface Constraints {
public static final boolean TRIALEXPIRATIONTIME_IS_REQUIRED = false;
public static final boolean MODULES_IS_REQUIRED = false;
public static final boolean APPBUNDLE_IS_REQUIRED = false;
+ public static final boolean NUMDEVICESINCLUDEDWITHPRICE_IS_REQUIRED = false;
public static final boolean DEFAULTPLAN_IS_REQUIRED = false;
public static final boolean RECOMMENDED_IS_REQUIRED = false;
public static final boolean PRICINGMODEL_IS_REQUIRED = false;
+ public static final boolean PRICINGDESCRIPTION_IS_REQUIRED = false;
public static final boolean TAGS_IS_REQUIRED = false;
- public static final boolean PRICING_DESCRIPTION_IS_REQUIRED = false;
public static final boolean BOGO_IS_REQUIRED = false;
+ public static final boolean INCLUDE_ALL_FEATURES = false;
public static final boolean WEIGHT_IS_REQUIRED = false;
public static final boolean FEATURES_IS_REQUIRED = false;
public static final boolean TRANSLATEDFEATURES_IS_REQUIRED = false;
+ public static final boolean MCCS_IS_REQUIRED = false;
public static final boolean BILLTOMID_IS_REQUIRED = false;
public static final boolean TYPE_IS_REQUIRED = false;
public static final boolean PLANCODE_IS_REQUIRED = false;
public static final long PLANCODE_MAX_LEN = 50;
public static final boolean ACTIVATIONTIME_IS_REQUIRED = false;
public static final boolean DEACTIVATIONTIME_IS_REQUIRED = false;
- public static final boolean RESELLER_IS_REQUIRED = false;
public static final boolean MERCHANTPLANGROUP_IS_REQUIRED = false;
+ public static final boolean ENFORCED_IS_REQUIRED = false;
+ public static final boolean HIDDEN_IS_REQUIRED = false;
+ public static final boolean PLANACTIONFEERATESUMMARY_IS_REQUIRED = false;
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/merchant/MerchantPlanMeta.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanMeta.java
index 32fe1e168..6ab21d94f 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanMeta.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanMeta.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -34,6 +34,7 @@
*
*/
@SuppressWarnings("all")
@@ -55,6 +56,10 @@ public com.clover.sdk.v3.merchant.MerchantPlanRules getRules() {
return genClient.cacheGet(CacheKey.rules);
}
+ public com.clover.sdk.v3.billing.PlanActionFeeRateSummary getPlanActionFeeRateSummary() {
+ return genClient.cacheGet(CacheKey.planActionFeeRateSummary);
+ }
+
@@ -67,6 +72,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.merchant.MerchantPlan.JSON_CREATOR)),
rules
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.merchant.MerchantPlanRules.JSON_CREATOR)),
+ planActionFeeRateSummary
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.billing.PlanActionFeeRateSummary.JSON_CREATOR)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -167,6 +174,11 @@ public boolean isNotNullRules() {
return genClient.cacheValueIsNotNull(CacheKey.rules);
}
+ /** Checks whether the 'planActionFeeRateSummary' field is set and is not null */
+ public boolean isNotNullPlanActionFeeRateSummary() {
+ return genClient.cacheValueIsNotNull(CacheKey.planActionFeeRateSummary);
+ }
+
/** Checks whether the 'merchantPlans' field has been set, however the value could be null */
@@ -189,6 +201,11 @@ public boolean hasRules() {
return genClient.cacheHasKey(CacheKey.rules);
}
+ /** Checks whether the 'planActionFeeRateSummary' field has been set, however the value could be null */
+ public boolean hasPlanActionFeeRateSummary() {
+ return genClient.cacheHasKey(CacheKey.planActionFeeRateSummary);
+ }
+
/**
* Sets the field 'merchantPlans'.
@@ -226,6 +243,15 @@ public MerchantPlanMeta setRules(com.clover.sdk.v3.merchant.MerchantPlanRules ru
return genClient.setRecord(rules, CacheKey.rules);
}
+ /**
+ * Sets the field 'planActionFeeRateSummary'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public MerchantPlanMeta setPlanActionFeeRateSummary(com.clover.sdk.v3.billing.PlanActionFeeRateSummary planActionFeeRateSummary) {
+ return genClient.setRecord(planActionFeeRateSummary, CacheKey.planActionFeeRateSummary);
+ }
+
/** Clears the 'merchantPlans' field, the 'has' method for this field will now return false */
public void clearMerchantPlans() {
@@ -243,6 +269,10 @@ public void clearCurrentMerchantPlan() {
public void clearRules() {
genClient.clear(CacheKey.rules);
}
+ /** Clears the 'planActionFeeRateSummary' field, the 'has' method for this field will now return false */
+ public void clearPlanActionFeeRateSummary() {
+ genClient.clear(CacheKey.planActionFeeRateSummary);
+ }
/**
@@ -306,8 +336,10 @@ public MerchantPlanMeta create(org.json.JSONObject jsonObject) {
public interface Constraints {
public static final boolean MERCHANTPLANS_IS_REQUIRED = false;
+ public static final boolean PERIPHERALS_IS_REQUIRED = false;
public static final boolean CURRENTMERCHANTPLAN_IS_REQUIRED = false;
public static final boolean RULES_IS_REQUIRED = false;
+ public static final boolean PLANACTIONFEERATESUMMARY_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanType.java
index 1bc7c6154..26f68e845 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanType.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/merchant/MerchantPlanType.java
@@ -31,7 +31,7 @@
*/
@SuppressWarnings("all")
public enum MerchantPlanType implements Parcelable {
- PAYMENTS, PAYMENTS_PLUS, REGISTER_LITE, CLASSIC, REGISTER, DINING, QSR;
+ PAYMENTS, PAYMENTS_PLUS, REGISTER_LITE, CLASSIC, REGISTER, SERVICES, RETAIL, DINING, QSR;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrder.java
index 9e03a37c4..b4b289fdb 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrder.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -43,6 +43,7 @@
*
@@ -129,6 +130,10 @@ public java.util.List getLineItems() {
return genClient.cacheGet(CacheKey.lineItems);
}
+ public java.util.List getOrderFeeItems() {
+ return genClient.cacheGet(CacheKey.orderFeeItems);
+ }
+
/**
* Formatted amount remaining
*/
@@ -173,6 +178,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.order.DisplayDiscount.JSON_CREATOR)),
lineItems
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.order.DisplayLineItem.JSON_CREATOR)),
+ orderFeeItems
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.order.DisplayOrderFeeItem.JSON_CREATOR)),
amountRemaining
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
payments
@@ -337,6 +344,14 @@ public boolean isNotNullLineItems() {
/** Checks whether the 'lineItems' field is set and is not null and is not empty */
public boolean isNotEmptyLineItems() { return isNotNullLineItems() && !getLineItems().isEmpty(); }
+ /** Checks whether the 'orderFeeItems' field is set and is not null */
+ public boolean isNotNullOrderFeeItems() {
+ return genClient.cacheValueIsNotNull(CacheKey.orderFeeItems);
+ }
+
+ /** Checks whether the 'orderFeeItems' field is set and is not null and is not empty */
+ public boolean isNotEmptyOrderFeeItems() { return isNotNullOrderFeeItems() && !getOrderFeeItems().isEmpty(); }
+
/** Checks whether the 'amountRemaining' field is set and is not null */
public boolean isNotNullAmountRemaining() {
return genClient.cacheValueIsNotNull(CacheKey.amountRemaining);
@@ -417,6 +432,11 @@ public boolean hasLineItems() {
return genClient.cacheHasKey(CacheKey.lineItems);
}
+ /** Checks whether the 'orderFeeItems' field has been set, however the value could be null */
+ public boolean hasOrderFeeItems() {
+ return genClient.cacheHasKey(CacheKey.orderFeeItems);
+ }
+
/** Checks whether the 'amountRemaining' field has been set, however the value could be null */
public boolean hasAmountRemaining() {
return genClient.cacheHasKey(CacheKey.amountRemaining);
@@ -523,6 +543,15 @@ public DisplayOrder setLineItems(java.util.List orderFeeItems) {
+ return genClient.setArrayRecord(orderFeeItems, CacheKey.orderFeeItems);
+ }
+
/**
* Sets the field 'amountRemaining'.
*/
@@ -592,6 +621,10 @@ public void clearDiscounts() {
public void clearLineItems() {
genClient.clear(CacheKey.lineItems);
}
+ /** Clears the 'orderFeeItems' field, the 'has' method for this field will now return false */
+ public void clearOrderFeeItems() {
+ genClient.clear(CacheKey.orderFeeItems);
+ }
/** Clears the 'amountRemaining' field, the 'has' method for this field will now return false */
public void clearAmountRemaining() {
genClient.clear(CacheKey.amountRemaining);
@@ -682,6 +715,7 @@ public interface Constraints {
public static final boolean SERVICECHARGEAMOUNT_IS_REQUIRED = false;
public static final boolean DISCOUNTS_IS_REQUIRED = false;
public static final boolean LINEITEMS_IS_REQUIRED = false;
+ public static final boolean ORDERFEEITEMS_IS_REQUIRED = false;
public static final boolean AMOUNTREMAINING_IS_REQUIRED = false;
public static final long AMOUNTREMAINING_MAX_LEN = 127;
public static final boolean PAYMENTS_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrderFeeItem.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrderFeeItem.java
new file mode 100644
index 000000000..0cc418e55
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/DisplayOrderFeeItem.java
@@ -0,0 +1,248 @@
+/**
+ * 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.order;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ *
{@link #getName name}
+ *
{@link #getAmount amount}
+ *
+ */
+@SuppressWarnings("all")
+public class DisplayOrderFeeItem extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Optional service charge name (gratuity) applied to this order
+ */
+ public java.lang.String getName() {
+ return genClient.cacheGet(CacheKey.name);
+ }
+
+ /**
+ * Optional service charge amount (gratuity) applied to this order
+ */
+ public java.lang.String getAmount() {
+ return genClient.cacheGet(CacheKey.amount);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ name
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ amount
+ (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 DisplayOrderFeeItem() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected DisplayOrderFeeItem(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public DisplayOrderFeeItem(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 DisplayOrderFeeItem(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 DisplayOrderFeeItem(DisplayOrderFeeItem 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 'name' field is set and is not null */
+ public boolean isNotNullName() {
+ return genClient.cacheValueIsNotNull(CacheKey.name);
+ }
+
+ /** Checks whether the 'amount' field is set and is not null */
+ public boolean isNotNullAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.amount);
+ }
+
+
+
+ /** Checks whether the 'name' field has been set, however the value could be null */
+ public boolean hasName() {
+ return genClient.cacheHasKey(CacheKey.name);
+ }
+
+ /** Checks whether the 'amount' field has been set, however the value could be null */
+ public boolean hasAmount() {
+ return genClient.cacheHasKey(CacheKey.amount);
+ }
+
+
+ /**
+ * Sets the field 'name'.
+ */
+ public DisplayOrderFeeItem setName(java.lang.String name) {
+ return genClient.setOther(name, CacheKey.name);
+ }
+
+ /**
+ * Sets the field 'amount'.
+ */
+ public DisplayOrderFeeItem setAmount(java.lang.String amount) {
+ return genClient.setOther(amount, CacheKey.amount);
+ }
+
+
+ /** Clears the 'name' field, the 'has' method for this field will now return false */
+ public void clearName() {
+ genClient.clear(CacheKey.name);
+ }
+ /** Clears the 'amount' field, the 'has' method for this field will now return false */
+ public void clearAmount() {
+ genClient.clear(CacheKey.amount);
+ }
+
+
+ /**
+ * 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 DisplayOrderFeeItem copyChanges() {
+ DisplayOrderFeeItem copy = new DisplayOrderFeeItem();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(DisplayOrderFeeItem src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new DisplayOrderFeeItem(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public DisplayOrderFeeItem createFromParcel(android.os.Parcel in) {
+ DisplayOrderFeeItem instance = new DisplayOrderFeeItem(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 DisplayOrderFeeItem[] newArray(int size) {
+ return new DisplayOrderFeeItem[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return DisplayOrderFeeItem.class;
+ }
+
+ @Override
+ public DisplayOrderFeeItem create(org.json.JSONObject jsonObject) {
+ return new DisplayOrderFeeItem(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean NAME_IS_REQUIRED = false;
+ public static final boolean AMOUNT_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/FulfillmentInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/FulfillmentInfo.java
new file mode 100644
index 000000000..36ee72868
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/FulfillmentInfo.java
@@ -0,0 +1,538 @@
+/**
+ * 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.order;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ */
+@SuppressWarnings("all")
+public class FulfillmentInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Fulfillment info id
+ */
+ public java.lang.String getId() {
+ return genClient.cacheGet(CacheKey.id);
+ }
+
+ /**
+ * Customer email address
+ */
+ public java.lang.String getCustomerEmailAddress() {
+ return genClient.cacheGet(CacheKey.customerEmailAddress);
+ }
+
+ /**
+ * Customer display name
+ */
+ public java.lang.String getCustomerDisplayName() {
+ return genClient.cacheGet(CacheKey.customerDisplayName);
+ }
+
+ /**
+ * Customer first name
+ */
+ public java.lang.String getCustomerFirstName() {
+ return genClient.cacheGet(CacheKey.customerFirstName);
+ }
+
+ /**
+ * Customer last name
+ */
+ public java.lang.String getCustomerLastName() {
+ return genClient.cacheGet(CacheKey.customerLastName);
+ }
+
+ /**
+ * Customer phone number
+ */
+ public java.lang.String getCustomerPhoneNumber() {
+ return genClient.cacheGet(CacheKey.customerPhoneNumber);
+ }
+
+ /**
+ * If this customer is enrolled in SMS notifications
+ */
+ public java.lang.Boolean getSmsNotificationEnrolled() {
+ return genClient.cacheGet(CacheKey.smsNotificationEnrolled);
+ }
+
+ /**
+ * If this customer is enrolled in email notifications
+ */
+ public java.lang.Boolean getEmailNotificationEnrolled() {
+ return genClient.cacheGet(CacheKey.emailNotificationEnrolled);
+ }
+
+ /**
+ * What language the customer wants their notification to be in
+ */
+ public java.lang.String getCustomerLocale() {
+ return genClient.cacheGet(CacheKey.customerLocale);
+ }
+
+ /**
+ * Timestamp when the fulfillment info was created
+ */
+ public java.lang.Long getCreatedTime() {
+ return genClient.cacheGet(CacheKey.createdTime);
+ }
+
+ /**
+ * Timestamp when the fulfillment info was last modified
+ */
+ 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)),
+ customerEmailAddress
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ customerDisplayName
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ customerFirstName
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ customerLastName
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ customerPhoneNumber
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ smsNotificationEnrolled
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ emailNotificationEnrolled
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ customerLocale
+ (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 FulfillmentInfo() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected FulfillmentInfo(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public FulfillmentInfo(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 FulfillmentInfo(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 FulfillmentInfo(FulfillmentInfo 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());
+ }
+
+ /** Checks whether the 'id' field is set and is not null */
+ public boolean isNotNullId() {
+ return genClient.cacheValueIsNotNull(CacheKey.id);
+ }
+
+ /** Checks whether the 'customerEmailAddress' field is set and is not null */
+ public boolean isNotNullCustomerEmailAddress() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerEmailAddress);
+ }
+
+ /** Checks whether the 'customerDisplayName' field is set and is not null */
+ public boolean isNotNullCustomerDisplayName() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerDisplayName);
+ }
+
+ /** Checks whether the 'customerFirstName' field is set and is not null */
+ public boolean isNotNullCustomerFirstName() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerFirstName);
+ }
+
+ /** Checks whether the 'customerLastName' field is set and is not null */
+ public boolean isNotNullCustomerLastName() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerLastName);
+ }
+
+ /** Checks whether the 'customerPhoneNumber' field is set and is not null */
+ public boolean isNotNullCustomerPhoneNumber() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerPhoneNumber);
+ }
+
+ /** Checks whether the 'smsNotificationEnrolled' field is set and is not null */
+ public boolean isNotNullSmsNotificationEnrolled() {
+ return genClient.cacheValueIsNotNull(CacheKey.smsNotificationEnrolled);
+ }
+
+ /** Checks whether the 'emailNotificationEnrolled' field is set and is not null */
+ public boolean isNotNullEmailNotificationEnrolled() {
+ return genClient.cacheValueIsNotNull(CacheKey.emailNotificationEnrolled);
+ }
+
+ /** Checks whether the 'customerLocale' field is set and is not null */
+ public boolean isNotNullCustomerLocale() {
+ return genClient.cacheValueIsNotNull(CacheKey.customerLocale);
+ }
+
+ /** 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 'customerEmailAddress' field has been set, however the value could be null */
+ public boolean hasCustomerEmailAddress() {
+ return genClient.cacheHasKey(CacheKey.customerEmailAddress);
+ }
+
+ /** Checks whether the 'customerDisplayName' field has been set, however the value could be null */
+ public boolean hasCustomerDisplayName() {
+ return genClient.cacheHasKey(CacheKey.customerDisplayName);
+ }
+
+ /** Checks whether the 'customerFirstName' field has been set, however the value could be null */
+ public boolean hasCustomerFirstName() {
+ return genClient.cacheHasKey(CacheKey.customerFirstName);
+ }
+
+ /** Checks whether the 'customerLastName' field has been set, however the value could be null */
+ public boolean hasCustomerLastName() {
+ return genClient.cacheHasKey(CacheKey.customerLastName);
+ }
+
+ /** Checks whether the 'customerPhoneNumber' field has been set, however the value could be null */
+ public boolean hasCustomerPhoneNumber() {
+ return genClient.cacheHasKey(CacheKey.customerPhoneNumber);
+ }
+
+ /** Checks whether the 'smsNotificationEnrolled' field has been set, however the value could be null */
+ public boolean hasSmsNotificationEnrolled() {
+ return genClient.cacheHasKey(CacheKey.smsNotificationEnrolled);
+ }
+
+ /** Checks whether the 'emailNotificationEnrolled' field has been set, however the value could be null */
+ public boolean hasEmailNotificationEnrolled() {
+ return genClient.cacheHasKey(CacheKey.emailNotificationEnrolled);
+ }
+
+ /** Checks whether the 'customerLocale' field has been set, however the value could be null */
+ public boolean hasCustomerLocale() {
+ return genClient.cacheHasKey(CacheKey.customerLocale);
+ }
+
+ /** 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 FulfillmentInfo setId(java.lang.String id) {
+ return genClient.setOther(id, CacheKey.id);
+ }
+
+ /**
+ * Sets the field 'customerEmailAddress'.
+ */
+ public FulfillmentInfo setCustomerEmailAddress(java.lang.String customerEmailAddress) {
+ return genClient.setOther(customerEmailAddress, CacheKey.customerEmailAddress);
+ }
+
+ /**
+ * Sets the field 'customerDisplayName'.
+ */
+ public FulfillmentInfo setCustomerDisplayName(java.lang.String customerDisplayName) {
+ return genClient.setOther(customerDisplayName, CacheKey.customerDisplayName);
+ }
+
+ /**
+ * Sets the field 'customerFirstName'.
+ */
+ public FulfillmentInfo setCustomerFirstName(java.lang.String customerFirstName) {
+ return genClient.setOther(customerFirstName, CacheKey.customerFirstName);
+ }
+
+ /**
+ * Sets the field 'customerLastName'.
+ */
+ public FulfillmentInfo setCustomerLastName(java.lang.String customerLastName) {
+ return genClient.setOther(customerLastName, CacheKey.customerLastName);
+ }
+
+ /**
+ * Sets the field 'customerPhoneNumber'.
+ */
+ public FulfillmentInfo setCustomerPhoneNumber(java.lang.String customerPhoneNumber) {
+ return genClient.setOther(customerPhoneNumber, CacheKey.customerPhoneNumber);
+ }
+
+ /**
+ * Sets the field 'smsNotificationEnrolled'.
+ */
+ public FulfillmentInfo setSmsNotificationEnrolled(java.lang.Boolean smsNotificationEnrolled) {
+ return genClient.setOther(smsNotificationEnrolled, CacheKey.smsNotificationEnrolled);
+ }
+
+ /**
+ * Sets the field 'emailNotificationEnrolled'.
+ */
+ public FulfillmentInfo setEmailNotificationEnrolled(java.lang.Boolean emailNotificationEnrolled) {
+ return genClient.setOther(emailNotificationEnrolled, CacheKey.emailNotificationEnrolled);
+ }
+
+ /**
+ * Sets the field 'customerLocale'.
+ */
+ public FulfillmentInfo setCustomerLocale(java.lang.String customerLocale) {
+ return genClient.setOther(customerLocale, CacheKey.customerLocale);
+ }
+
+ /**
+ * Sets the field 'createdTime'.
+ */
+ public FulfillmentInfo setCreatedTime(java.lang.Long createdTime) {
+ return genClient.setOther(createdTime, CacheKey.createdTime);
+ }
+
+ /**
+ * Sets the field 'modifiedTime'.
+ */
+ public FulfillmentInfo 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 'customerEmailAddress' field, the 'has' method for this field will now return false */
+ public void clearCustomerEmailAddress() {
+ genClient.clear(CacheKey.customerEmailAddress);
+ }
+ /** Clears the 'customerDisplayName' field, the 'has' method for this field will now return false */
+ public void clearCustomerDisplayName() {
+ genClient.clear(CacheKey.customerDisplayName);
+ }
+ /** Clears the 'customerFirstName' field, the 'has' method for this field will now return false */
+ public void clearCustomerFirstName() {
+ genClient.clear(CacheKey.customerFirstName);
+ }
+ /** Clears the 'customerLastName' field, the 'has' method for this field will now return false */
+ public void clearCustomerLastName() {
+ genClient.clear(CacheKey.customerLastName);
+ }
+ /** Clears the 'customerPhoneNumber' field, the 'has' method for this field will now return false */
+ public void clearCustomerPhoneNumber() {
+ genClient.clear(CacheKey.customerPhoneNumber);
+ }
+ /** Clears the 'smsNotificationEnrolled' field, the 'has' method for this field will now return false */
+ public void clearSmsNotificationEnrolled() {
+ genClient.clear(CacheKey.smsNotificationEnrolled);
+ }
+ /** Clears the 'emailNotificationEnrolled' field, the 'has' method for this field will now return false */
+ public void clearEmailNotificationEnrolled() {
+ genClient.clear(CacheKey.emailNotificationEnrolled);
+ }
+ /** Clears the 'customerLocale' field, the 'has' method for this field will now return false */
+ public void clearCustomerLocale() {
+ genClient.clear(CacheKey.customerLocale);
+ }
+ /** 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 FulfillmentInfo copyChanges() {
+ FulfillmentInfo copy = new FulfillmentInfo();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(FulfillmentInfo src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new FulfillmentInfo(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public FulfillmentInfo createFromParcel(android.os.Parcel in) {
+ FulfillmentInfo instance = new FulfillmentInfo(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 FulfillmentInfo[] newArray(int size) {
+ return new FulfillmentInfo[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return FulfillmentInfo.class;
+ }
+
+ @Override
+ public FulfillmentInfo create(org.json.JSONObject jsonObject) {
+ return new FulfillmentInfo(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ID_IS_REQUIRED = false;
+ public static final long ID_MAX_LEN = 13;
+ public static final boolean CUSTOMEREMAILADDRESS_IS_REQUIRED = false;
+ public static final boolean CUSTOMERDISPLAYNAME_IS_REQUIRED = false;
+ public static final boolean CUSTOMERFIRSTNAME_IS_REQUIRED = false;
+ public static final boolean CUSTOMERLASTNAME_IS_REQUIRED = false;
+ public static final boolean CUSTOMERPHONENUMBER_IS_REQUIRED = false;
+ public static final boolean SMSNOTIFICATIONENROLLED_IS_REQUIRED = false;
+ public static final boolean EMAILNOTIFICATIONENROLLED_IS_REQUIRED = false;
+ public static final boolean CUSTOMERLOCALE_IS_REQUIRED = false;
+ 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/order/LineItem.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItem.java
index b4b69cee8..79d694739 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItem.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItem.java
@@ -68,6 +68,7 @@
*
{@link #getOrderFee orderFee}
*
{@link #getIsOrderFee isOrderFee}
*
{@link #getIsPlatformOrderFee isPlatformOrderFee}
+ *
{@link #getOrderFeeType orderFeeType}
*
*
* @see com.clover.sdk.v3.order.IOrderService
@@ -317,7 +318,13 @@ public java.lang.Boolean getIsPlatformOrderFee() {
return genClient.cacheGet(CacheKey.isPlatformOrderFee);
}
-
+ /**
+ * Used to define the type of order fee line item.
+ * Auto-gratuity enabled orderFee lineItem, has this field set to "AUTO_GRATUITY", otherwise null
+ * */
+ public java.lang.String getOrderFeeType() {
+ return genClient.cacheGet(CacheKey.orderFeeType);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
@@ -397,6 +404,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
isPlatformOrderFee
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ orderFeeType
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -705,6 +714,11 @@ public boolean isNotNullIsPlatformOrderFee() {
}
+ /** Checks whether the 'orderFeeType' field is set and is not null */
+ public boolean isNotNullOrderFeeType() {
+ return genClient.cacheValueIsNotNull(CacheKey.orderFeeType);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
@@ -896,6 +910,10 @@ public boolean hasIsPlatformOrderFee() {
return genClient.cacheHasKey(CacheKey.isPlatformOrderFee);
}
+ /** Checks whether the 'orderFeeType' field has been set, however the value could be null */
+ public boolean hasOrderFeeType() {
+ return genClient.cacheHasKey(CacheKey.orderFeeType);
+ }
/**
* Sets the field 'id'.
@@ -1185,6 +1203,12 @@ public LineItem setIsPlatformOrderFee(java.lang.Boolean isPlatformOrderFee) {
return genClient.setOther(isPlatformOrderFee, CacheKey.isPlatformOrderFee);
}
+ /**
+ * Sets the field 'orderFeeType'.
+ */
+ public LineItem setOrderFeeType(java.lang.String orderFeeType) {
+ return genClient.setOther(orderFeeType, CacheKey.orderFeeType);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -1338,7 +1362,10 @@ public void clearIsOrderFee() {
public void clearIsPlatformOrderFee() {
genClient.clear(CacheKey.isPlatformOrderFee);
}
-
+ /** Clears the 'orderFee' field, the 'has' method for this field will now return false */
+ public void clearOrderFeeType() {
+ genClient.clear(CacheKey.orderFeeType);
+ }
/**
* Returns true if this instance has any changes.
@@ -1450,6 +1477,7 @@ public interface Constraints {
public static final boolean ORDERFEE_IS_REQUIRED = false;
public static final boolean ISORDERFEE_IS_REQUIRED = false;
public static final boolean ISPLATFORMORDERFEE_IS_REQUIRED = false;
+ public static final boolean ORDERFEETYPE_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEvent.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEvent.java
index 88c036eaf..000ade448 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEvent.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEvent.java
@@ -40,6 +40,7 @@
*
*
*/
@SuppressWarnings("all")
@@ -101,6 +102,13 @@ public java.lang.String getDeviceId() {
return genClient.cacheGet(CacheKey.deviceId);
}
+ /**
+ * Used to identify line item info which is used to supports voided items. Can be null for all other event types
+ */
+ public java.lang.String getLineItemInfo() {
+ return genClient.cacheGet(CacheKey.lineItemInfo);
+ }
+
@@ -121,6 +129,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
deviceId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ lineItemInfo
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -246,6 +256,11 @@ public boolean isNotNullDeviceId() {
return genClient.cacheValueIsNotNull(CacheKey.deviceId);
}
+ /** checks whether the 'lineItemInfo' field is set and is not null */
+ public boolean isNotNullLineItemInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.lineItemInfo);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -288,6 +303,13 @@ public boolean hasDeviceId() {
return genClient.cacheHasKey(CacheKey.deviceId);
}
+ /**
+ * Checks whether the 'lineItemInfo' field has been set, however the value could be null
+ */
+ public boolean hasLineItemInfo() {
+ return genClient.cacheHasKey(CacheKey.lineItemInfo);
+ }
+
/**
* Sets the field 'id'.
@@ -347,7 +369,12 @@ public LineItemEvent setDeviceId(java.lang.String deviceId) {
return genClient.setOther(deviceId, CacheKey.deviceId);
}
-
+ /**
+ * Sets the field 'lineItemInfo'.
+ */
+ public LineItemEvent setLineItemInfo(java.lang.String lineItemInfo) {
+ return genClient.setOther(lineItemInfo, CacheKey.lineItemInfo);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
genClient.clear(CacheKey.id);
@@ -381,6 +408,13 @@ public void clearDeviceId() {
genClient.clear(CacheKey.deviceId);
}
+ /**
+ * Clears the 'lineItemInfo' field, the 'has' method for this field will now return false
+ */
+ public void clearLineItemInfo() {
+ genClient.clear(CacheKey.lineItemInfo);
+ }
+
/**
* Returns true if this instance has any changes.
@@ -453,6 +487,7 @@ public interface Constraints {
public static final boolean CREATEDTIME_IS_REQUIRED = false;
public static final boolean PARENTLINEITEMEVENT_IS_REQUIRED = false;
public static final boolean DEVICEID_IS_REQUIRED = false;
+ public static final boolean LINE_ITEM_INFO_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEventContract.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEventContract.java
index ebc6b27d2..8a98e5514 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEventContract.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/LineItemEventContract.java
@@ -211,6 +211,11 @@ private interface LineItemEventColumns {
* Default value is null
*/
String DEVICE_ID = "device_id";
+ /**
+ * A {@link String} line item info has line item info in form of json object string.
+ * The line item info is optional, it need not always be present.
+ */
+ String LINE_ITEM_INFO = "line_item_info";
}
/**
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/Order.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/Order.java
index 68aea8bfb..43f70c96f 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/Order.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/Order.java
@@ -35,9 +35,11 @@
*
@@ -97,6 +99,13 @@ public java.util.List getCustomers() {
return genClient.cacheGet(CacheKey.customers);
}
+ /**
+ * Fulfillment information associated with this order. Contains customer info.
+ */
+ public com.clover.sdk.v3.order.FulfillmentInfo getFulfillmentInfo() {
+ return genClient.cacheGet(CacheKey.fulfillmentInfo);
+ }
+
/**
* The employee who took this order
*/
@@ -118,6 +127,13 @@ public java.lang.String getExternalReferenceId() {
return genClient.cacheGet(CacheKey.externalReferenceId);
}
+ /**
+ * If this order has an invoice, this is the id of that invoice. Null otherwise
+ */
+ public java.lang.String getInvoiceId() {
+ return genClient.cacheGet(CacheKey.invoiceId);
+ }
+
/**
* The net of orders with payment minus the amount collected. Includes refunds, manual refunds, tax, tip, service charge, non-revenue items, paid gift card activations and loads and discounts
*/
@@ -162,7 +178,7 @@ public java.lang.Boolean getIsVat() {
}
/**
- * A String generally describing the state of the order. If no value is set, the state defaults to null, which indicates a hidden order. A hidden order is not displayed in user interfaces and can only be retrieved by its id. When creating an order via the REST API the value must be manually set to "open". When creating an order via the Android SDK the value must be left empty and the value will be updated to "open" and "locked" automatically when actions such as taking payments and adding line items occur. The state value is not checked or enforced by the Clover server, at this time it is used for visualization purposes only.
+ * A String describing the state of the order. There is no restriction on the value but Clover will automatically set the value to "open", "OPEN" and "locked" in certain circumstances such as when an order has a line item added or a payment is taken. If no value is set, the state defaults to null, which indicates a hidden order. A hidden order is not displayed in user interfaces and can only be retrieved by its id. When creating an order via the REST API the value it is strongly recommended the value be set to "open", this is the only situation it is recommended to set this value manually. When creating an order via the Android SDK the value must be left empty and the value will be updated to "open" and "locked" automatically. Developers are discouraged from relying on the value of the state or modifying it other than setting it to "open" during order creation via the REST API.
*/
public java.lang.String getState() {
return genClient.cacheGet(CacheKey.state);
@@ -328,12 +344,16 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
customers
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.customers.Customer.JSON_CREATOR)),
+ fulfillmentInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.order.FulfillmentInfo.JSON_CREATOR)),
employee
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
total
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
externalReferenceId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ invoiceId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
unpaidBalance
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
paymentState
@@ -472,6 +492,8 @@ public void validate() {
genClient.validateLength(CacheKey.currency, getCurrency(), 3);
+ genClient.validateLength(CacheKey.invoiceId, getInvoiceId(), 13);
+
genClient.validateLength(CacheKey.title, getTitle(), 127);
genClient.validateLength(CacheKey.note, getNote(), 2047);
@@ -499,6 +521,11 @@ public boolean isNotNullCustomers() {
/** Checks whether the 'customers' field is set and is not null and is not empty */
public boolean isNotEmptyCustomers() { return isNotNullCustomers() && !getCustomers().isEmpty(); }
+ /** Checks whether the 'fulfillmentInfo' field is set and is not null */
+ public boolean isNotNullFulfillmentInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.fulfillmentInfo);
+ }
+
/** Checks whether the 'employee' field is set and is not null */
public boolean isNotNullEmployee() {
return genClient.cacheValueIsNotNull(CacheKey.employee);
@@ -514,6 +541,11 @@ public boolean isNotNullExternalReferenceId() {
return genClient.cacheValueIsNotNull(CacheKey.externalReferenceId);
}
+ /** Checks whether the 'invoiceId' field is set and is not null */
+ public boolean isNotNullInvoiceId() {
+ return genClient.cacheValueIsNotNull(CacheKey.invoiceId);
+ }
+
/** Checks whether the 'unpaidBalance' field is set and is not null */
public boolean isNotNullUnpaidBalance() {
return genClient.cacheValueIsNotNull(CacheKey.unpaidBalance);
@@ -716,6 +748,11 @@ public boolean hasCustomers() {
return genClient.cacheHasKey(CacheKey.customers);
}
+ /** Checks whether the 'fulfillmentInfo' field has been set, however the value could be null */
+ public boolean hasFulfillmentInfo() {
+ return genClient.cacheHasKey(CacheKey.fulfillmentInfo);
+ }
+
/** Checks whether the 'employee' field has been set, however the value could be null */
public boolean hasEmployee() {
return genClient.cacheHasKey(CacheKey.employee);
@@ -731,6 +768,11 @@ public boolean hasExternalReferenceId() {
return genClient.cacheHasKey(CacheKey.externalReferenceId);
}
+ /** Checks whether the 'invoiceId' field has been set, however the value could be null */
+ public boolean hasInvoiceId() {
+ return genClient.cacheHasKey(CacheKey.invoiceId);
+ }
+
/** Checks whether the 'unpaidBalance' field has been set, however the value could be null */
public boolean hasUnpaidBalance() {
return genClient.cacheHasKey(CacheKey.unpaidBalance);
@@ -910,6 +952,15 @@ public Order setCustomers(java.util.List c
return genClient.setArrayRecord(customers, CacheKey.customers);
}
+ /**
+ * Sets the field 'fulfillmentInfo'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public Order setFulfillmentInfo(com.clover.sdk.v3.order.FulfillmentInfo fulfillmentInfo) {
+ return genClient.setRecord(fulfillmentInfo, CacheKey.fulfillmentInfo);
+ }
+
/**
* Sets the field 'employee'.
*
@@ -933,6 +984,13 @@ public Order setExternalReferenceId(java.lang.String externalReferenceId) {
return genClient.setOther(externalReferenceId, CacheKey.externalReferenceId);
}
+ /**
+ * Sets the field 'invoiceId'.
+ */
+ public Order setInvoiceId(java.lang.String invoiceId) {
+ return genClient.setOther(invoiceId, CacheKey.invoiceId);
+ }
+
/**
* Sets the field 'unpaidBalance'.
*/
@@ -1195,6 +1253,10 @@ public void clearCurrency() {
public void clearCustomers() {
genClient.clear(CacheKey.customers);
}
+ /** Clears the 'fulfillmentInfo' field, the 'has' method for this field will now return false */
+ public void clearFulfillmentInfo() {
+ genClient.clear(CacheKey.fulfillmentInfo);
+ }
/** Clears the 'employee' field, the 'has' method for this field will now return false */
public void clearEmployee() {
genClient.clear(CacheKey.employee);
@@ -1207,6 +1269,10 @@ public void clearTotal() {
public void clearExternalReferenceId() {
genClient.clear(CacheKey.externalReferenceId);
}
+ /** Clears the 'invoiceId' field, the 'has' method for this field will now return false */
+ public void clearInvoiceId() {
+ genClient.clear(CacheKey.invoiceId);
+ }
/** Clears the 'unpaidBalance' field, the 'has' method for this field will now return false */
public void clearUnpaidBalance() {
genClient.clear(CacheKey.unpaidBalance);
@@ -1398,9 +1464,12 @@ public interface Constraints {
public static final boolean CURRENCY_IS_REQUIRED = false;
public static final long CURRENCY_MAX_LEN = 3;
public static final boolean CUSTOMERS_IS_REQUIRED = false;
+ public static final boolean FULFILLMENTINFO_IS_REQUIRED = false;
public static final boolean EMPLOYEE_IS_REQUIRED = false;
public static final boolean TOTAL_IS_REQUIRED = false;
public static final boolean EXTERNALREFERENCEID_IS_REQUIRED = false;
+ public static final boolean INVOICEID_IS_REQUIRED = false;
+ public static final long INVOICEID_MAX_LEN = 13;
public static final boolean UNPAIDBALANCE_IS_REQUIRED = false;
public static final boolean PAYMENTSTATE_IS_REQUIRED = false;
public static final boolean TITLE_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderCalc.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderCalc.java
index 379724de2..d1145d220 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderCalc.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderCalc.java
@@ -435,6 +435,17 @@ public List getTaxSummaries(Collection lines) {
return getCalc().getTaxSummaries(toCalcLines(lines));
}
+ /**
+ * Summarize the taxes for the given line items.
+ * This ignores refunded or exchanged line items.
+ * @param lines for this subset of line items
+ * @param overrideSplitPercent optional. if specified, then assume we're computing a partial payment and this percent is the amount of a partial payment.
+ * @return summary of the given line items at, optionally, the given partial payment percentage
+ */
+ public List getTaxSummaries(final Collection lines, final Decimal overrideSplitPercent) {
+ return getCalc().getTaxSummaries(toCalcLines(lines, overrideSplitPercent));
+ }
+
/**
* Summarize the taxes for the given line items. If an item was refunded, still include it.
* If an item was exchanged, then ignore it.
@@ -504,12 +515,31 @@ public long getOrderFeePrice(LineItem orderFeeLineItem) {
return getCalc().getOrderFeePrice(new CalcLineItem(orderFeeLineItem)).getCents();
}
+ /**
+ * Get an orderFee price for passed LineItems, which will be calculated based on
+ * passed orderFeeLineItem's percentage
+ *
+ * @param lines LineItems to be considered while calculating order fee price
+ * @param orderFeeLineItem order fee line item using which price needs to be calculated
+ * @return long price for given LineItems, calculated using passed orderFeeLineItem
+ */
+ public long getOrderFeePriceForLineItems(final Collection lines, LineItem orderFeeLineItem) {
+ return getCalc().getOrderFeePrice(toCalcLines(lines), new CalcLineItem(orderFeeLineItem)).getCents();
+ }
+
+ /**
+ * @return long total orderFee amount from given line items
+ */
+ public long getTotalOrderFeeFromLineItems(final Collection lines) {
+ return getCalc().getOrderFee(toCalcLines(lines)).getCents();
+ }
+
/**
* Get the total orderFee amount for given order
*
* @return long total of order fees applied to given order
*/
- public long getTotalOrderFees() {
+ public long getTotalOrderFee() {
return getCalc().getOrderFee().getCents();
}
}
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 e3cd3b4de..3bbd9237c 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
@@ -325,6 +325,15 @@ public List call(IOrderServiceV3_1 service, ResultStatus status) throw
});
}
+ public List addMenuFixedPriceLineItems(final String orderId, String menuId, final String itemId, final String binName, final String userData, final int numItems) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable>() {
+ @Override
+ public List call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.addMenuFixedPriceLineItems(orderId, menuId, itemId, binName, userData, numItems, status));
+ }
+ });
+ }
+
public List addPerUnitLineItems(final String orderId, final String itemId, final int unitQuantity, final String binName, final String userData, final int numItems) throws RemoteException, ClientException, ServiceException, BindingException {
return execute(new ServiceCallable>() {
@Override
@@ -334,6 +343,15 @@ public List call(IOrderServiceV3_1 service, ResultStatus status) throw
});
}
+ public List addMenuPerUnitLineItems(final String orderId, String menuId, final String itemId, final int unitQuantity, final String binName, final String userData, final int numItems) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable>() {
+ @Override
+ public List call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.addMenuPerUnitLineItems(orderId, menuId, itemId, unitQuantity, binName, userData, numItems, status));
+ }
+ });
+ }
+
public List addVariablePriceLineItems(final String orderId, final String itemId, final long price, final String binName, final String userData, final int numItems) throws RemoteException, ClientException, ServiceException, BindingException {
return execute(new ServiceCallable>() {
@Override
@@ -343,6 +361,16 @@ public List call(IOrderServiceV3_1 service, ResultStatus status) throw
});
}
+ public List addMenuVariablePriceLineItems(final String orderId, String menuId, final String itemId, final long price, final String binName, final String userData, final int numItems) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable>() {
+ @Override
+ public List call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.addMenuVariablePriceLineItems(orderId, menuId, itemId, price, binName,
+ userData, numItems, status));
+ }
+ });
+ }
+
public LineItem addCustomLineItem(final String orderId, final LineItem lineItem, final boolean isTaxable) throws RemoteException, ClientException, ServiceException, BindingException {
return execute(new ServiceCallable() {
@Override
@@ -962,6 +990,7 @@ public Order call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteE
});
}
+ @Deprecated
public Order deletePreAuth(final String orderId, final String paymentId, final VoidReason voidReason, final VoidExtraData voidExtraData) throws RemoteException, ClientException, ServiceException, BindingException {
return execute(new ServiceCallable() {
@Override
@@ -971,6 +1000,13 @@ public Order call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteE
});
}
+ public Order deletePreAuth2(final String orderId, final Authorization auth, final VoidReason voidReason, final VoidExtraData voidExtraData) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute((service, status) -> {
+ return getValue(service.deletePreAuth2(orderId, auth, voidReason, voidExtraData, status));
+ });
+ }
+
+
public Order voidPreAuthOnline(final String orderId, final String preAuthId, final String iccContainer, final VoidReason voidReason, final String source) throws RemoteException, ClientException, ServiceException, BindingException {
return execute(new ServiceCallable() {
@Override
@@ -1479,4 +1515,59 @@ public Order call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteE
});
}
+ public Order setFulfillmentInfo(final String orderId, final FulfillmentInfo fulfillmentInfo) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute((service, status) -> {
+ return getValue(service.setFulfillmentInfo(orderId, fulfillmentInfo, status));
+ });
+ }
+
+ public Order updateCashDiscount(final String orderId, final List lineItemIds, final Discount cashDiscount) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute((service, status) -> {
+ return getValue(service.updateCashDiscount(orderId, lineItemIds, new DiscountFdParcelable(cashDiscount), status));
+ });
+ }
+ public boolean reopenOrder(final String orderId) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute((service, status) -> {
+ return service.reopenOrder(orderId, status);
+ });
+ }
+
+ /**
+ * Not available to (most) non-Clover apps.
+ * This is a replacement for the methods addPayment2() and addLPMPayment()
+ * It will handle a payment with optional line items so can be used in full POS mode (Register, Dining)
+ * It will also handle both card transactions that have already been processed on server via /v1/pay
+ * or (via createOnServer boolean flag) will POST the transaction to the CreatePayment endpoint on server
+ * Additionally, it will support being called by SiTef apps if a) the device has TRANSACTION_OPERATION_MODE
+ * of SITEF, and b) if the calling package is in RAW_TRANSACTION_SERVICE_WHITELIST
+ *
+ * @y.exclude
+ */
+ public Order addPayment3(final String orderId, final Payment payment, final List lineItems, boolean createOnServer) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable() {
+ @Override
+ public Order call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.addPayment3(orderId, new PaymentFdParcelable(payment), new LineItemListFdParcelable(lineItems), createOnServer, status));
+ }
+ });
+ }
+
+ /**
+ * Not available to (most) non-Clover apps.
+ * This is a replacement for the method refund2(), with passthroughs
+ * It will record a refund locally and also update refund on the server
+ * Additionally, it will support being called by SiTef apps if a) the device has TRANSACTION_OPERATION_MODE
+ * of SITEF, and b) if the calling package is in RAW_TRANSACTION_SERVICE_WHITELIST
+ *
+ * @y.exclude
+ */
+ public Refund addRefund3(final String orderId, final Refund refund, final Map passThroughExtras) throws RemoteException, ClientException, ServiceException, BindingException {
+ return execute(new ServiceCallable() {
+ @Override
+ public Refund call(IOrderServiceV3_1 service, ResultStatus status) throws RemoteException {
+ return getValue(service.addRefund3(orderId, new RefundFdParcelable(refund), passThroughExtras, status));
+ }
+ });
+ }
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/PrintOrder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/PrintOrder.java
index 77a822afb..bcc31481c 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/PrintOrder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/PrintOrder.java
@@ -40,6 +40,8 @@
*
{@link #getModifiedTime modifiedTime}
*
{@link #getDeletedTime deletedTime}
*
{@link #getPrintTime printTime}
+ *
{@link #getClientPrintingTime clientPrintingTime}
+ *
{@link #getErrorMessage errorMessage}
*
*
* @see com.clover.sdk.v3.order.IOrderService
@@ -117,6 +119,20 @@ public java.lang.Long getPrintTime() {
return genClient.cacheGet(CacheKey.printTime);
}
+ /**
+ * Timestamp when the device client starts printing, for internal tracing only.
+ */
+ public java.lang.Long getClientPrintingTime() {
+ return genClient.cacheGet(CacheKey.clientPrintingTime);
+ }
+
+ /**
+ * Error message when device client fails to print the event, for internal tracing only.
+ */
+ public java.lang.String getErrorMessage() {
+ return genClient.cacheGet(CacheKey.errorMessage);
+ }
+
@@ -141,6 +157,10 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
printTime
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ clientPrintingTime
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ errorMessage
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -216,6 +236,8 @@ public void validate() {
genClient.validateLength(CacheKey.id, getId(), 13);
genClient.validateLength(CacheKey.orderSnapshot, getOrderSnapshot(), 5242880);
+
+ genClient.validateLength(CacheKey.errorMessage, getErrorMessage(), 65535);
genClient.validateReferences(CacheKey.orderRef);
}
@@ -269,6 +291,16 @@ public boolean isNotNullPrintTime() {
return genClient.cacheValueIsNotNull(CacheKey.printTime);
}
+ /** Checks whether the 'clientPrintingTime' field is set and is not null */
+ public boolean isNotNullClientPrintingTime() {
+ return genClient.cacheValueIsNotNull(CacheKey.clientPrintingTime);
+ }
+
+ /** Checks whether the 'errorMessage' field is set and is not null */
+ public boolean isNotNullErrorMessage() {
+ return genClient.cacheValueIsNotNull(CacheKey.errorMessage);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -321,6 +353,16 @@ public boolean hasPrintTime() {
return genClient.cacheHasKey(CacheKey.printTime);
}
+ /** Checks whether the 'clientPrintingTime' field has been set, however the value could be null */
+ public boolean hasClientPrintingTime() {
+ return genClient.cacheHasKey(CacheKey.clientPrintingTime);
+ }
+
+ /** Checks whether the 'errorMessage' field has been set, however the value could be null */
+ public boolean hasErrorMessage() {
+ return genClient.cacheHasKey(CacheKey.errorMessage);
+ }
+
/**
* Sets the field 'id'.
@@ -396,6 +438,20 @@ public PrintOrder setPrintTime(java.lang.Long printTime) {
return genClient.setOther(printTime, CacheKey.printTime);
}
+ /**
+ * Sets the field 'clientPrintingTime'.
+ */
+ public PrintOrder setClientPrintingTime(java.lang.Long clientPrintingTime) {
+ return genClient.setOther(clientPrintingTime, CacheKey.clientPrintingTime);
+ }
+
+ /**
+ * Sets the field 'errorMessage'.
+ */
+ public PrintOrder setErrorMessage(java.lang.String errorMessage) {
+ return genClient.setOther(errorMessage, CacheKey.errorMessage);
+ }
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -437,6 +493,14 @@ public void clearDeletedTime() {
public void clearPrintTime() {
genClient.clear(CacheKey.printTime);
}
+ /** Clears the 'clientPrintingTime' field, the 'has' method for this field will now return false */
+ public void clearClientPrintingTime() {
+ genClient.clear(CacheKey.clientPrintingTime);
+ }
+ /** Clears the 'errorMessage' field, the 'has' method for this field will now return false */
+ public void clearErrorMessage() {
+ genClient.clear(CacheKey.errorMessage);
+ }
/**
@@ -511,6 +575,9 @@ public interface Constraints {
public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
public static final boolean DELETEDTIME_IS_REQUIRED = false;
public static final boolean PRINTTIME_IS_REQUIRED = false;
+ public static final boolean CLIENTPRINTINGTIME_IS_REQUIRED = false;
+ public static final boolean ERRORMESSAGE_IS_REQUIRED = false;
+ public static final long ERRORMESSAGE_MAX_LEN = 65535;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidReason.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidReason.java
index 685c58b5f..954262481 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidReason.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidReason.java
@@ -32,7 +32,7 @@
*/
@SuppressWarnings("all")
public enum VoidReason implements Parcelable {
- USER_CANCEL, TRANSPORT_ERROR, REJECT_SIGNATURE, REJECT_PARTIAL_AUTH, NOT_APPROVED, FAILED, AUTH_CLOSED_NEW_CARD, DEVELOPER_PAY_PARTIAL_AUTH, REJECT_DUPLICATE, REJECT_OFFLINE, GIFTCARD_LOAD_FAILED, USER_GIFTCARD_LOAD_CANCEL, DEVELOPER_PAY_TIP_ADJUST_FAILED, USER_CUSTOMER_CANCEL, FRAUD, REJECT_GREATER_APPROVED_AMOUNT, USER_CANCEL_SYNC;
+ USER_CANCEL, TRANSPORT_ERROR, REJECT_SIGNATURE, REJECT_PARTIAL_AUTH, NOT_APPROVED, FAILED, AUTH_CLOSED_NEW_CARD, DEVELOPER_PAY_PARTIAL_AUTH, REJECT_DUPLICATE, REJECT_OFFLINE, GIFTCARD_LOAD_FAILED, USER_GIFTCARD_LOAD_CANCEL, DEVELOPER_PAY_TIP_ADJUST_FAILED, USER_CUSTOMER_CANCEL, FRAUD, REJECT_GREATER_APPROVED_AMOUNT, USER_CANCEL_SYNC, REOPEN_ORDER;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidedLineItemEmployeeData.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidedLineItemEmployeeData.java
new file mode 100644
index 000000000..f5f94a94b
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/VoidedLineItemEmployeeData.java
@@ -0,0 +1,316 @@
+/**
+ * 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.order;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ */
+@SuppressWarnings("all")
+public class VoidedLineItemEmployeeData extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * The employee who performed the event
+ */
+ public com.clover.sdk.v3.employees.Employee getEmployee() {
+ return genClient.cacheGet(CacheKey.employee);
+ }
+
+ /**
+ * sum of price of all the items multiplied with quantity and includes modifiers.
+ */
+ public java.lang.Long getPriceWithQuantityAndModifiersOfRemovedItems() {
+ return genClient.cacheGet(CacheKey.priceWithQuantityAndModifiersOfRemovedItems);
+ }
+
+ /**
+ * gross sale of employee over the reporting period
+ */
+ public java.lang.Long getGrossSaleOfEmployee() {
+ return genClient.cacheGet(CacheKey.grossSaleOfEmployee);
+ }
+
+ /**
+ * removal rate of the employee
+ */
+ public java.lang.Double getItemsRemovalRate() {
+ return genClient.cacheGet(CacheKey.itemsRemovalRate);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ employee
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.employees.Employee.JSON_CREATOR)),
+ priceWithQuantityAndModifiersOfRemovedItems
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ grossSaleOfEmployee
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ itemsRemovalRate
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Double.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 VoidedLineItemEmployeeData() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected VoidedLineItemEmployeeData(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public VoidedLineItemEmployeeData(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 VoidedLineItemEmployeeData(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 VoidedLineItemEmployeeData(VoidedLineItemEmployeeData 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 'employee' field is set and is not null */
+ public boolean isNotNullEmployee() {
+ return genClient.cacheValueIsNotNull(CacheKey.employee);
+ }
+
+ /** Checks whether the 'priceWithQuantityAndModifiersOfRemovedItems' field is set and is not null */
+ public boolean isNotNullPriceWithQuantityAndModifiersOfRemovedItems() {
+ return genClient.cacheValueIsNotNull(CacheKey.priceWithQuantityAndModifiersOfRemovedItems);
+ }
+
+ /** Checks whether the 'grossSaleOfEmployee' field is set and is not null */
+ public boolean isNotNullGrossSaleOfEmployee() {
+ return genClient.cacheValueIsNotNull(CacheKey.grossSaleOfEmployee);
+ }
+
+ /** Checks whether the 'itemsRemovalRate' field is set and is not null */
+ public boolean isNotNullItemsRemovalRate() {
+ return genClient.cacheValueIsNotNull(CacheKey.itemsRemovalRate);
+ }
+
+
+
+ /** Checks whether the 'employee' field has been set, however the value could be null */
+ public boolean hasEmployee() {
+ return genClient.cacheHasKey(CacheKey.employee);
+ }
+
+ /** Checks whether the 'priceWithQuantityAndModifiersOfRemovedItems' field has been set, however the value could be null */
+ public boolean hasPriceWithQuantityAndModifiersOfRemovedItems() {
+ return genClient.cacheHasKey(CacheKey.priceWithQuantityAndModifiersOfRemovedItems);
+ }
+
+ /** Checks whether the 'grossSaleOfEmployee' field has been set, however the value could be null */
+ public boolean hasGrossSaleOfEmployee() {
+ return genClient.cacheHasKey(CacheKey.grossSaleOfEmployee);
+ }
+
+ /** Checks whether the 'itemsRemovalRate' field has been set, however the value could be null */
+ public boolean hasItemsRemovalRate() {
+ return genClient.cacheHasKey(CacheKey.itemsRemovalRate);
+ }
+
+
+ /**
+ * Sets the field 'employee'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public VoidedLineItemEmployeeData setEmployee(com.clover.sdk.v3.employees.Employee employee) {
+ return genClient.setRecord(employee, CacheKey.employee);
+ }
+
+ /**
+ * Sets the field 'priceWithQuantityAndModifiersOfRemovedItems'.
+ */
+ public VoidedLineItemEmployeeData setPriceWithQuantityAndModifiersOfRemovedItems(java.lang.Long priceWithQuantityAndModifiersOfRemovedItems) {
+ return genClient.setOther(priceWithQuantityAndModifiersOfRemovedItems, CacheKey.priceWithQuantityAndModifiersOfRemovedItems);
+ }
+
+ /**
+ * Sets the field 'grossSaleOfEmployee'.
+ */
+ public VoidedLineItemEmployeeData setGrossSaleOfEmployee(java.lang.Long grossSaleOfEmployee) {
+ return genClient.setOther(grossSaleOfEmployee, CacheKey.grossSaleOfEmployee);
+ }
+
+ /**
+ * Sets the field 'itemsRemovalRate'.
+ */
+ public VoidedLineItemEmployeeData setItemsRemovalRate(java.lang.Double itemsRemovalRate) {
+ return genClient.setOther(itemsRemovalRate, CacheKey.itemsRemovalRate);
+ }
+
+
+ /** Clears the 'employee' field, the 'has' method for this field will now return false */
+ public void clearEmployee() {
+ genClient.clear(CacheKey.employee);
+ }
+ /** Clears the 'priceWithQuantityAndModifiersOfRemovedItems' field, the 'has' method for this field will now return false */
+ public void clearPriceWithQuantityAndModifiersOfRemovedItems() {
+ genClient.clear(CacheKey.priceWithQuantityAndModifiersOfRemovedItems);
+ }
+ /** Clears the 'grossSaleOfEmployee' field, the 'has' method for this field will now return false */
+ public void clearGrossSaleOfEmployee() {
+ genClient.clear(CacheKey.grossSaleOfEmployee);
+ }
+ /** Clears the 'itemsRemovalRate' field, the 'has' method for this field will now return false */
+ public void clearItemsRemovalRate() {
+ genClient.clear(CacheKey.itemsRemovalRate);
+ }
+
+
+ /**
+ * 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 VoidedLineItemEmployeeData copyChanges() {
+ VoidedLineItemEmployeeData copy = new VoidedLineItemEmployeeData();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(VoidedLineItemEmployeeData src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new VoidedLineItemEmployeeData(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public VoidedLineItemEmployeeData createFromParcel(android.os.Parcel in) {
+ VoidedLineItemEmployeeData instance = new VoidedLineItemEmployeeData(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 VoidedLineItemEmployeeData[] newArray(int size) {
+ return new VoidedLineItemEmployeeData[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return VoidedLineItemEmployeeData.class;
+ }
+
+ @Override
+ public VoidedLineItemEmployeeData create(org.json.JSONObject jsonObject) {
+ return new VoidedLineItemEmployeeData(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean EMPLOYEE_IS_REQUIRED = false;
+ public static final boolean PRICEWITHQUANTITYANDMODIFIERSOFREMOVEDITEMS_IS_REQUIRED = false;
+ public static final boolean GROSSSALEOFEMPLOYEE_IS_REQUIRED = false;
+ public static final boolean ITEMSREMOVALRATE_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/TransactionData.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/TransactionData.java
index e59dafbf5..76afe1e43 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/TransactionData.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/pay/TransactionData.java
@@ -96,6 +96,7 @@
*
@@ -394,6 +395,10 @@ public java.lang.String getIccIssuerScriptResults() {
return genClient.cacheGet(CacheKey.iccIssuerScriptResults);
}
+ public java.lang.String getIssuerCountryCode() {
+ return genClient.cacheGet(CacheKey.issuerCountryCode);
+ }
+
public java.lang.String getDebugTrack2EquivalentData() {
return genClient.cacheGet(CacheKey.debugTrack2EquivalentData);
}
@@ -646,6 +651,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
iccIssuerScriptResults
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ issuerCountryCode
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
debugTrack2EquivalentData
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
debugApplicationPan
@@ -1108,6 +1115,11 @@ public boolean isNotNullIccIssuerScriptResults() {
return genClient.cacheValueIsNotNull(CacheKey.iccIssuerScriptResults);
}
+ /** Checks whether the 'issuerCountryCode' field is set and is not null */
+ public boolean isNotNullIssuerCountryCode() {
+ return genClient.cacheValueIsNotNull(CacheKey.issuerCountryCode);
+ }
+
/** Checks whether the 'debugTrack2EquivalentData' field is set and is not null */
public boolean isNotNullDebugTrack2EquivalentData() {
return genClient.cacheValueIsNotNull(CacheKey.debugTrack2EquivalentData);
@@ -1585,6 +1597,11 @@ public boolean hasIccIssuerScriptResults() {
return genClient.cacheHasKey(CacheKey.iccIssuerScriptResults);
}
+ /** Checks whether the 'issuerCountryCode' field has been set, however the value could be null */
+ public boolean hasIssuerCountryCode() {
+ return genClient.cacheHasKey(CacheKey.issuerCountryCode);
+ }
+
/** Checks whether the 'debugTrack2EquivalentData' field has been set, however the value could be null */
public boolean hasDebugTrack2EquivalentData() {
return genClient.cacheHasKey(CacheKey.debugTrack2EquivalentData);
@@ -2193,6 +2210,13 @@ public TransactionData setIccIssuerScriptResults(java.lang.String iccIssuerScrip
return genClient.setOther(iccIssuerScriptResults, CacheKey.iccIssuerScriptResults);
}
+ /**
+ * Sets the field 'issuerCountryCode'.
+ */
+ public TransactionData setIssuerCountryCode(java.lang.String issuerCountryCode) {
+ return genClient.setOther(issuerCountryCode, CacheKey.issuerCountryCode);
+ }
+
/**
* Sets the field 'debugTrack2EquivalentData'.
*/
@@ -2661,6 +2685,10 @@ public void clearIccIssuerScripts() {
public void clearIccIssuerScriptResults() {
genClient.clear(CacheKey.iccIssuerScriptResults);
}
+ /** Clears the 'issuerCountryCode' field, the 'has' method for this field will now return false */
+ public void clearIssuerCountryCode() {
+ genClient.clear(CacheKey.issuerCountryCode);
+ }
/** Clears the 'debugTrack2EquivalentData' field, the 'has' method for this field will now return false */
public void clearDebugTrack2EquivalentData() {
genClient.clear(CacheKey.debugTrack2EquivalentData);
@@ -2905,6 +2933,7 @@ public interface Constraints {
public static final boolean ICCISSUERCODETABLEINDEX_IS_REQUIRED = false;
public static final boolean ICCISSUERSCRIPTS_IS_REQUIRED = false;
public static final boolean ICCISSUERSCRIPTRESULTS_IS_REQUIRED = false;
+ public static final boolean ISSUERCOUNTRYCODE_IS_REQUIRED = false;
public static final boolean DEBUGTRACK2EQUIVALENTDATA_IS_REQUIRED = false;
public static final boolean DEBUGAPPLICATIONPAN_IS_REQUIRED = false;
public static final boolean DEBUGAMOUNTAUTHORIZEDBINARY_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/client/model/RequestedElvMode.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/client/model/RequestedElvMode.java
new file mode 100644
index 000000000..a0b812486
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payment/client/model/RequestedElvMode.java
@@ -0,0 +1,58 @@
+/**
+ * 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.client.model;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ * The ELV transaction type. Automatic means the terminal will choose between ELV offline, ELV online, or EMV using a GiroCard.
+ */
+@SuppressWarnings("all")
+public enum RequestedElvMode implements Parcelable {
+ AUTOMATIC, ELV_OFFLINE, ELV_ONLINE, GIROCARD;
+
+ @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 RequestedElvMode createFromParcel(final Parcel source) {
+ return RequestedElvMode.valueOf(source.readString());
+ }
+
+ @Override
+ public RequestedElvMode[] newArray(final int size) {
+ return new RequestedElvMode[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AVSResult.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AVSResult.java
index 49e5189bc..24be5b703 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AVSResult.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AVSResult.java
@@ -31,7 +31,7 @@
*/
@SuppressWarnings("all")
public enum AVSResult implements Parcelable {
- SUCCESS, ZIP_CODE_MATCH, ZIP_CODE_MATCH_ADDRESS_NOT_CHECKED, ADDRESS_MATCH, ADDRESS_MATCH_ZIP_NOT_CHECKED, NEITHER_MATCH, SERVICE_FAILURE, SERVICE_UNAVAILABLE, NOT_CHECKED, ZIP_CODE_NOT_MATCHED_ADDRESS_NOT_CHECKED, ADDRESS_NOT_MATCHED_ZIP_CODE_NOT_CHECKED;
+ SUCCESS, ZIP_CODE_MATCH, ZIP_CODE_MATCH_ADDRESS_NOT_CHECKED, ADDRESS_MATCH, ADDRESS_MATCH_ZIP_NOT_CHECKED, NEITHER_MATCH, SERVICE_FAILURE, SERVICE_UNAVAILABLE, NOT_CHECKED, ZIP_CODE_NOT_MATCHED_ADDRESS_NOT_CHECKED, ADDRESS_NOT_MATCHED_ZIP_CODE_NOT_CHECKED, PARTIAL;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalCharge.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalCharge.java
index 72ab5bed9..ec890f0b7 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalCharge.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalCharge.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -33,9 +33,11 @@
*
{@link #getId id}
*
{@link #getMerchant merchant}
*
{@link #getType type}
+ *
{@link #getName name}
*
{@link #getAmount amount}
*
{@link #getPercentageDecimal percentageDecimal}
*
{@link #getIsCashbackOnly isCashbackOnly}
+ *
{@link #getPretax pretax}
*
{@link #getEnabled enabled}
*
{@link #getModifiedTime modifiedTime}
*
{@link #getDeletedTime deletedTime}
@@ -65,6 +67,13 @@ public com.clover.sdk.v3.payments.AdditionalChargeType getType() {
return genClient.cacheGet(CacheKey.type);
}
+ /**
+ * Will be used for order fees to display name set by merchant
+ */
+ public java.lang.String getName() {
+ return genClient.cacheGet(CacheKey.name);
+ }
+
/**
* Optional flat charge amount
*/
@@ -86,6 +95,13 @@ public java.lang.Boolean getIsCashbackOnly() {
return genClient.cacheGet(CacheKey.isCashbackOnly);
}
+ /**
+ * If this charge should be applied pretax
+ */
+ public java.lang.Boolean getPretax() {
+ return genClient.cacheGet(CacheKey.pretax);
+ }
+
/**
* If this charge is enabled
*/
@@ -112,24 +128,28 @@ public java.lang.Long getDeletedTime() {
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)),
merchant
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.merchant.Merchant.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.merchant.Merchant.JSON_CREATOR)),
type
- (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.AdditionalChargeType.class)),
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.AdditionalChargeType.class)),
+ name
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
amount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
percentageDecimal
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
isCashbackOnly
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ pretax
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
enabled
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
modifiedTime
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
deletedTime
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
- ;
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -223,6 +243,11 @@ public boolean isNotNullType() {
return genClient.cacheValueIsNotNull(CacheKey.type);
}
+ /** Checks whether the 'name' field is set and is not null */
+ public boolean isNotNullName() {
+ return genClient.cacheValueIsNotNull(CacheKey.name);
+ }
+
/** Checks whether the 'amount' field is set and is not null */
public boolean isNotNullAmount() {
return genClient.cacheValueIsNotNull(CacheKey.amount);
@@ -238,6 +263,11 @@ public boolean isNotNullIsCashbackOnly() {
return genClient.cacheValueIsNotNull(CacheKey.isCashbackOnly);
}
+ /** Checks whether the 'pretax' field is set and is not null */
+ public boolean isNotNullPretax() {
+ return genClient.cacheValueIsNotNull(CacheKey.pretax);
+ }
+
/** Checks whether the 'enabled' field is set and is not null */
public boolean isNotNullEnabled() {
return genClient.cacheValueIsNotNull(CacheKey.enabled);
@@ -270,6 +300,11 @@ public boolean hasType() {
return genClient.cacheHasKey(CacheKey.type);
}
+ /** Checks whether the 'name' field has been set, however the value could be null */
+ public boolean hasName() {
+ return genClient.cacheHasKey(CacheKey.name);
+ }
+
/** Checks whether the 'amount' field has been set, however the value could be null */
public boolean hasAmount() {
return genClient.cacheHasKey(CacheKey.amount);
@@ -285,6 +320,11 @@ public boolean hasIsCashbackOnly() {
return genClient.cacheHasKey(CacheKey.isCashbackOnly);
}
+ /** Checks whether the 'pretax' field has been set, however the value could be null */
+ public boolean hasPretax() {
+ return genClient.cacheHasKey(CacheKey.pretax);
+ }
+
/** Checks whether the 'enabled' field has been set, however the value could be null */
public boolean hasEnabled() {
return genClient.cacheHasKey(CacheKey.enabled);
@@ -324,6 +364,13 @@ public AdditionalCharge setType(com.clover.sdk.v3.payments.AdditionalChargeType
return genClient.setOther(type, CacheKey.type);
}
+ /**
+ * Sets the field 'name'.
+ */
+ public AdditionalCharge setName(java.lang.String name) {
+ return genClient.setOther(name, CacheKey.name);
+ }
+
/**
* Sets the field 'amount'.
*/
@@ -345,6 +392,13 @@ public AdditionalCharge setIsCashbackOnly(java.lang.Boolean isCashbackOnly) {
return genClient.setOther(isCashbackOnly, CacheKey.isCashbackOnly);
}
+ /**
+ * Sets the field 'pretax'.
+ */
+ public AdditionalCharge setPretax(java.lang.Boolean pretax) {
+ return genClient.setOther(pretax, CacheKey.pretax);
+ }
+
/**
* Sets the field 'enabled'.
*/
@@ -379,6 +433,10 @@ public void clearMerchant() {
public void clearType() {
genClient.clear(CacheKey.type);
}
+ /** Clears the 'name' field, the 'has' method for this field will now return false */
+ public void clearName() {
+ genClient.clear(CacheKey.name);
+ }
/** Clears the 'amount' field, the 'has' method for this field will now return false */
public void clearAmount() {
genClient.clear(CacheKey.amount);
@@ -391,6 +449,10 @@ public void clearPercentageDecimal() {
public void clearIsCashbackOnly() {
genClient.clear(CacheKey.isCashbackOnly);
}
+ /** Clears the 'pretax' field, the 'has' method for this field will now return false */
+ public void clearPretax() {
+ genClient.clear(CacheKey.pretax);
+ }
/** Clears the 'enabled' field, the 'has' method for this field will now return false */
public void clearEnabled() {
genClient.clear(CacheKey.enabled);
@@ -469,12 +531,14 @@ public interface Constraints {
public static final long ID_MAX_LEN = 13;
public static final boolean MERCHANT_IS_REQUIRED = false;
public static final boolean TYPE_IS_REQUIRED = false;
+ public static final boolean NAME_IS_REQUIRED = false;
public static final boolean AMOUNT_IS_REQUIRED = false;
public static final long AMOUNT_MIN = 0;
public static final boolean PERCENTAGEDECIMAL_IS_REQUIRED = false;
public static final long PERCENTAGEDECIMAL_MIN = 0;
public static final long PERCENTAGEDECIMAL_MAX = 1000000;
public static final boolean ISCASHBACKONLY_IS_REQUIRED = false;
+ public static final boolean PRETAX_IS_REQUIRED = false;
public static final boolean ENABLED_IS_REQUIRED = false;
public static final boolean MODIFIEDTIME_IS_REQUIRED = false;
public static final boolean DELETEDTIME_IS_REQUIRED = false;
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeAmount.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeAmount.java
index 017ef3c5d..db6be4ef6 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeAmount.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeAmount.java
@@ -33,6 +33,7 @@
*
{@link #getId id}
*
{@link #getAmount amount}
*
{@link #getRate rate}
+ *
{@link #getPretax pretax}
*
{@link #getType type}
*
*/
@@ -60,6 +61,13 @@ public java.lang.Long getRate() {
return genClient.cacheGet(CacheKey.rate);
}
+ /**
+ * If this charge was applied pretax
+ */
+ public java.lang.Boolean getPretax() {
+ return genClient.cacheGet(CacheKey.pretax);
+ }
+
/**
* The type of additional charge
*/
@@ -72,13 +80,15 @@ public com.clover.sdk.v3.payments.AdditionalChargeType getType() {
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)),
amount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
rate
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ pretax
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
type
- (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.AdditionalChargeType.class)),
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.AdditionalChargeType.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -173,6 +183,11 @@ public boolean isNotNullRate() {
return genClient.cacheValueIsNotNull(CacheKey.rate);
}
+ /** Checks whether the 'pretax' field is set and is not null */
+ public boolean isNotNullPretax() {
+ return genClient.cacheValueIsNotNull(CacheKey.pretax);
+ }
+
/** Checks whether the 'type' field is set and is not null */
public boolean isNotNullType() {
return genClient.cacheValueIsNotNull(CacheKey.type);
@@ -195,6 +210,11 @@ public boolean hasRate() {
return genClient.cacheHasKey(CacheKey.rate);
}
+ /** Checks whether the 'pretax' field has been set, however the value could be null */
+ public boolean hasPretax() {
+ return genClient.cacheHasKey(CacheKey.pretax);
+ }
+
/** Checks whether the 'type' field has been set, however the value could be null */
public boolean hasType() {
return genClient.cacheHasKey(CacheKey.type);
@@ -222,6 +242,13 @@ public AdditionalChargeAmount setRate(java.lang.Long rate) {
return genClient.setOther(rate, CacheKey.rate);
}
+ /**
+ * Sets the field 'pretax'.
+ */
+ public AdditionalChargeAmount setPretax(java.lang.Boolean pretax) {
+ return genClient.setOther(pretax, CacheKey.pretax);
+ }
+
/**
* Sets the field 'type'.
*/
@@ -242,6 +269,10 @@ public void clearAmount() {
public void clearRate() {
genClient.clear(CacheKey.rate);
}
+ /** Clears the 'pretax' field, the 'has' method for this field will now return false */
+ public void clearPretax() {
+ genClient.clear(CacheKey.pretax);
+ }
/** Clears the 'type' field, the 'has' method for this field will now return false */
public void clearType() {
genClient.clear(CacheKey.type);
@@ -315,6 +346,7 @@ public interface Constraints {
public static final boolean RATE_IS_REQUIRED = false;
public static final long RATE_MIN = 0;
public static final long RATE_MAX = 1000000;
+ public static final boolean PRETAX_IS_REQUIRED = false;
public static final boolean TYPE_IS_REQUIRED = false;
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeType.java
index 70212b9ac..3bc3dffe4 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeType.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/AdditionalChargeType.java
@@ -32,7 +32,7 @@
*/
@SuppressWarnings("all")
public enum AdditionalChargeType implements Parcelable {
- INTERAC, CREDIT_SURCHARGE, CONVENIENCE_FEE, INTERAC_V2, DELIVERY_FEE;
+ INTERAC, CREDIT_SURCHARGE, CONVENIENCE_FEE, INTERAC_V2, DELIVERY_FEE, CASH_DISCOUNT, VISA_CREDIT, VISA_DEBIT, VISA_INTERNATIONAL, MASTERCARD_CREDIT, MASTERCARD_DEBIT, MASTERCARD_INTERNATIONAL, AMEX, EFTPOS, JCB, DINERS, UNIONPAY_CREDIT, UNIONPAY_DEBIT, DISCOVER;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Authorization.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Authorization.java
index a280ae677..8c8381bbf 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Authorization.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Authorization.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -46,6 +46,8 @@
*
*
*/
@SuppressWarnings("all")
@@ -157,6 +159,17 @@ public java.lang.String getAcquirerTerminalId() {
return genClient.cacheGet(CacheKey.acquirerTerminalId);
}
+ public java.lang.Boolean getReverse() {
+ return genClient.cacheGet(CacheKey.reverse);
+ }
+
+ /**
+ * Reconciliation ID of the terminal. Required to perform EOD.
+ */
+ public java.lang.String getReconciliationId() {
+ return genClient.cacheGet(CacheKey.reconciliationId);
+ }
+
@@ -193,7 +206,11 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
acquirerTerminalId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
- ;
+ reverse
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ reconciliationId
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -361,6 +378,16 @@ public boolean isNotNullAcquirerTerminalId() {
return genClient.cacheValueIsNotNull(CacheKey.acquirerTerminalId);
}
+ /** Checks whether the 'reverse' field is set and is not null */
+ public boolean isNotNullReverse() {
+ return genClient.cacheValueIsNotNull(CacheKey.reverse);
+ }
+
+ /** Checks whether the 'reconciliationId' field is set and is not null */
+ public boolean isNotNullReconciliationId() {
+ return genClient.cacheValueIsNotNull(CacheKey.reconciliationId);
+ }
+
/** Checks whether the 'id' field has been set, however the value could be null */
@@ -443,6 +470,16 @@ public boolean hasAcquirerTerminalId() {
return genClient.cacheHasKey(CacheKey.acquirerTerminalId);
}
+ /** Checks whether the 'reverse' field has been set, however the value could be null */
+ public boolean hasReverse() {
+ return genClient.cacheHasKey(CacheKey.reverse);
+ }
+
+ /** Checks whether the 'reconciliationId' field has been set, however the value could be null */
+ public boolean hasReconciliationId() {
+ return genClient.cacheHasKey(CacheKey.reconciliationId);
+ }
+
/**
* Sets the field 'id'.
@@ -562,6 +599,20 @@ public Authorization setAcquirerTerminalId(java.lang.String acquirerTerminalId)
return genClient.setOther(acquirerTerminalId, CacheKey.acquirerTerminalId);
}
+ /**
+ * Sets the field 'reverse'.
+ */
+ public Authorization setReverse(java.lang.Boolean reverse) {
+ return genClient.setOther(reverse, CacheKey.reverse);
+ }
+
+ /**
+ * Sets the field 'reconciliationId'.
+ */
+ public Authorization setReconciliationId(java.lang.String reconciliationId) {
+ return genClient.setOther(reconciliationId, CacheKey.reconciliationId);
+ }
+
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -627,6 +678,14 @@ public void clearTransactionSequenceCounter() {
public void clearAcquirerTerminalId() {
genClient.clear(CacheKey.acquirerTerminalId);
}
+ /** Clears the 'reverse' field, the 'has' method for this field will now return false */
+ public void clearReverse() {
+ genClient.clear(CacheKey.reverse);
+ }
+ /** Clears the 'reconciliationId' field, the 'has' method for this field will now return false */
+ public void clearReconciliationId() {
+ genClient.clear(CacheKey.reconciliationId);
+ }
/**
@@ -711,6 +770,8 @@ public interface Constraints {
public static final boolean ADDITIONALCHARGES_IS_REQUIRED = false;
public static final boolean TRANSACTIONSEQUENCECOUNTER_IS_REQUIRED = false;
public static final boolean ACQUIRERTERMINALID_IS_REQUIRED = false;
+ public static final boolean REVERSE_IS_REQUIRED = false;
+ public static final boolean RECONCILIATIONID_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/BatchTotalStats.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/BatchTotalStats.java
index 38f0e8821..1acae450b 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/BatchTotalStats.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/BatchTotalStats.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -37,6 +37,7 @@
*
{@link #getGiftCardCashOuts giftCardCashOuts}
*
{@link #getTax tax}
*
{@link #getTips tips}
+ *
{@link #getSurcharge surcharge}
*
*/
@SuppressWarnings("all")
@@ -70,25 +71,30 @@ public com.clover.sdk.v3.payments.BatchTotalType getTips() {
return genClient.cacheGet(CacheKey.tips);
}
+ public com.clover.sdk.v3.payments.BatchTotalType getSurcharge() {
+ return genClient.cacheGet(CacheKey.surcharge);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
sales
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
refunds
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
net
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
giftCardLoads
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
giftCardCashOuts
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
tax
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
tips
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
- ;
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ surcharge
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -197,6 +203,10 @@ public boolean isNotNullTips() {
return genClient.cacheValueIsNotNull(CacheKey.tips);
}
+ /** Checks whether the 'surcharge' field is set and is not null */
+ public boolean isNotNullSurcharge() {
+ return genClient.cacheValueIsNotNull(CacheKey.surcharge);
+ }
/** Checks whether the 'sales' field has been set, however the value could be null */
@@ -234,6 +244,10 @@ public boolean hasTips() {
return genClient.cacheHasKey(CacheKey.tips);
}
+ /** Checks whether the 'surcharge' field has been set, however the value could be null */
+ public boolean hasSurcharge() {
+ return genClient.cacheHasKey(CacheKey.surcharge);
+ }
/**
* Sets the field 'sales'.
@@ -298,6 +312,14 @@ public BatchTotalStats setTips(com.clover.sdk.v3.payments.BatchTotalType tips) {
return genClient.setRecord(tips, CacheKey.tips);
}
+ /**
+ * Sets the field 'surcharge'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public BatchTotalStats setSurcharge(com.clover.sdk.v3.payments.BatchTotalType surcharge) {
+ return genClient.setRecord(surcharge, CacheKey.surcharge);
+ }
/** Clears the 'sales' field, the 'has' method for this field will now return false */
public void clearSales() {
@@ -327,6 +349,10 @@ public void clearTax() {
public void clearTips() {
genClient.clear(CacheKey.tips);
}
+ /** Clears the 'surcharge' field, the 'has' method for this field will now return false */
+ public void clearSurcharge() {
+ genClient.clear(CacheKey.surcharge);
+ }
/**
@@ -396,6 +422,7 @@ public interface Constraints {
public static final boolean GIFTCARDCASHOUTS_IS_REQUIRED = false;
public static final boolean TAX_IS_REQUIRED = false;
public static final boolean TIPS_IS_REQUIRED = false;
+ public static final boolean SURCHARGE_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardTransactionConstants.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardTransactionConstants.java
index 6ab00e79a..6bb83e788 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardTransactionConstants.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardTransactionConstants.java
@@ -66,8 +66,11 @@ public class CardTransactionConstants {
public static final String IPG_RESPONSE_CODE = "responseCode";
public static final String IPG_PROMOTIONAL_MESSAGE = "promotionalMessage";
public static final String NETWORK_TRANS_ID = "networkTransId";
- public static final String INDIA_TERMINAL_ID = "terminalId";
+ public static final String TERMINAL_ID = "terminalId";
public static final String AMEX_SE_ID = "amexServiceEstablishmentNumber";
public static final String TRANSACTION_CERTIFICATE = "transactionCertificate";
public static final String ORIGINAL_AMOUNT = "orig_amt";
+ public static final String NETWORK_EXTRA_CARD = "card";
+ public static final String POS_ENTRY_MODE = "posEntryMode";
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardType.java
index e8374eb84..3471b6d15 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardType.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CardType.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -31,7 +31,7 @@
*/
@SuppressWarnings("all")
public enum CardType implements Parcelable {
- VISA, MC, AMEX, DISCOVER, DINERS_CLUB, JCB, MAESTRO, SOLO, LASER, CHINA_UNION_PAY, CARTE_BLANCHE, UNKNOWN, GIFT_CARD, EBT, GIROCARD, INTERAC, RUPAY, OTHER;
+ VISA, MC, AMEX, DISCOVER, DINERS_CLUB, JCB, MAESTRO, SOLO, LASER, CHINA_UNION_PAY, CARTE_BLANCHE, UNKNOWN, GIFT_CARD, EBT, GIROCARD, INTERAC, RUPAY, EFTPOS, OTHER;
@Override
public int describeContents() {
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PaymentBatchInfo.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CloseoutBatchInfo.java
similarity index 76%
rename from clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PaymentBatchInfo.java
rename to clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CloseoutBatchInfo.java
index efbb4124d..5fd9ed058 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PaymentBatchInfo.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/CloseoutBatchInfo.java
@@ -35,7 +35,7 @@
*
*/
@SuppressWarnings("all")
-public class PaymentBatchInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+public class CloseoutBatchInfo extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
public String getBatchUuid() {
return genClient.cacheGet(CacheKey.batchUuid);
@@ -70,13 +70,13 @@ public com.clover.sdk.extractors.ExtractionStrategy getExtractionStrategy() {
}
}
- private final GenericClient genClient;
+ private final GenericClient genClient;
/**
* Constructs a new empty instance.
*/
- public PaymentBatchInfo() {
- genClient = new GenericClient(this);
+ public CloseoutBatchInfo() {
+ genClient = new GenericClient(this);
}
@Override
@@ -87,14 +87,14 @@ protected GenericClient getGenericClient() {
/**
* Constructs a new empty instance.
*/
- protected PaymentBatchInfo(boolean noInit) {
+ protected CloseoutBatchInfo(boolean noInit) {
genClient = null;
}
/**
* Constructs a new instance from the given JSON String.
*/
- public PaymentBatchInfo(String json) throws IllegalArgumentException {
+ public CloseoutBatchInfo(String json) throws IllegalArgumentException {
this();
genClient.initJsonObject(json);
}
@@ -103,7 +103,7 @@ public PaymentBatchInfo(String json) throws IllegalArgumentException {
* 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 PaymentBatchInfo(org.json.JSONObject jsonObject) {
+ public CloseoutBatchInfo(org.json.JSONObject jsonObject) {
this();
genClient.setJsonObject(jsonObject);
}
@@ -111,7 +111,7 @@ public PaymentBatchInfo(org.json.JSONObject jsonObject) {
/**
* Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
*/
- public PaymentBatchInfo(PaymentBatchInfo src) {
+ public CloseoutBatchInfo(CloseoutBatchInfo src) {
this();
if (src.genClient.getJsonObject() != null) {
genClient.setJsonObject(com.clover.sdk.v3.JsonHelper.deepCopy(src.genClient.getJSONObject()));
@@ -157,14 +157,14 @@ public boolean hasBatchModifiedTime() {
/**
* Sets the field 'batchUuid'.
*/
- public PaymentBatchInfo setBatchUuid(String batchUuid) {
+ public CloseoutBatchInfo setBatchUuid(String batchUuid) {
return genClient.setOther(batchUuid, CacheKey.batchUuid);
}
/**
* Sets the field 'batchModifiedTime'.
*/
- public PaymentBatchInfo setBatchModifiedTime(Long batchModifiedTime) {
+ public CloseoutBatchInfo setBatchModifiedTime(Long batchModifiedTime) {
return genClient.setOther(batchModifiedTime, CacheKey.batchModifiedTime);
}
@@ -196,8 +196,8 @@ public void resetChangeLog() {
/**
* Create a copy of this instance that contains only fields that were set after the constructor was called.
*/
- public PaymentBatchInfo copyChanges() {
- PaymentBatchInfo copy = new PaymentBatchInfo();
+ public CloseoutBatchInfo copyChanges() {
+ CloseoutBatchInfo copy = new CloseoutBatchInfo();
copy.mergeChanges(this);
copy.resetChangeLog();
return copy;
@@ -206,35 +206,35 @@ public PaymentBatchInfo copyChanges() {
/**
* Copy all the changed fields from the given source to this instance.
*/
- public void mergeChanges(PaymentBatchInfo src) {
+ public void mergeChanges(CloseoutBatchInfo src) {
if (src.genClient.getChangeLog() != null) {
- genClient.mergeChanges(new PaymentBatchInfo(src).getJSONObject(), src.genClient);
+ genClient.mergeChanges(new CloseoutBatchInfo(src).getJSONObject(), src.genClient);
}
}
- public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
@Override
- public PaymentBatchInfo createFromParcel(android.os.Parcel in) {
- PaymentBatchInfo instance = new PaymentBatchInfo(com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR.createFromParcel(in).unwrap());
+ public CloseoutBatchInfo createFromParcel(android.os.Parcel in) {
+ CloseoutBatchInfo instance = new CloseoutBatchInfo(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 PaymentBatchInfo[] newArray(int size) {
- return new PaymentBatchInfo[size];
+ public CloseoutBatchInfo[] newArray(int size) {
+ return new CloseoutBatchInfo[size];
}
};
- public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
- public Class getCreatedClass() {
- return PaymentBatchInfo.class;
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CloseoutBatchInfo.class;
}
@Override
- public PaymentBatchInfo create(org.json.JSONObject jsonObject) {
- return new PaymentBatchInfo(jsonObject);
+ public CloseoutBatchInfo create(org.json.JSONObject jsonObject) {
+ return new CloseoutBatchInfo(jsonObject);
}
};
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Credit.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Credit.java
index 3f5845392..4aadf41df 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Credit.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Credit.java
@@ -55,6 +55,7 @@
*
*
*/
@SuppressWarnings("all")
@@ -211,6 +212,12 @@ public java.util.Map getCreditAttributes() {
return genClient.cacheGet(CacheKey.creditAttributes);
}
+ /**
+ * Information about the Batch used for credits
+ */
+ public com.clover.sdk.v3.payments.CloseoutBatchInfo getCloseoutBatchInfo() {
+ return genClient.cacheGet(CacheKey.closeoutBatchInfo);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
@@ -264,7 +271,9 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
creditAttributes
(com.clover.sdk.extractors.MapExtractionStrategy.instance()),
- ;
+ closeoutBatchInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.CloseoutBatchInfo.JSON_CREATOR)),
+ ;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -478,6 +487,10 @@ public boolean isNotNullCreditAttributes() {
/** Checks whether the 'creditAttributes' field is set and is not null and is not empty */
public boolean isNotEmptyCreditAttributes() { return isNotNullCreditAttributes() && !getCreditAttributes().isEmpty(); }
+ /** Checks whether the 'closeoutBatchInfo' field is set and is not null */
+ public boolean isNotNullCloseoutBatchInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.closeoutBatchInfo);
+ }
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
@@ -604,6 +617,11 @@ public boolean hasCreditAttributes() {
return genClient.cacheHasKey(CacheKey.creditAttributes);
}
+ /** Checks whether the 'closeoutBatchInfo' field has been set, however the value could be null */
+ public boolean hasCloseoutBatchInfo() {
+ return genClient.cacheHasKey(CacheKey.closeoutBatchInfo);
+ }
+
/**
* Sets the field 'id'.
*/
@@ -807,6 +825,16 @@ public Credit setCreditAttributes(java.util.Map{@link #getOceanGatewayInfo oceanGatewayInfo}
*
*
*/
@SuppressWarnings("all")
@@ -355,8 +355,8 @@ public com.clover.sdk.v3.payments.PaymentEmiInfo getEmiInfo() {
/**
* Information about the Batch used for payments
*/
- public com.clover.sdk.v3.payments.PaymentBatchInfo getPaymentBatchInfo() {
- return genClient.cacheGet(CacheKey.paymentBatchInfo);
+ public com.clover.sdk.v3.payments.CloseoutBatchInfo getCloseoutBatchInfo() {
+ return genClient.cacheGet(CacheKey.closeoutBatchInfo);
}
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
@@ -448,8 +448,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.TerminalManagementComponent.JSON_CREATOR)),
emiInfo
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.PaymentEmiInfo.JSON_CREATOR)),
- paymentBatchInfo
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.PaymentBatchInfo.JSON_CREATOR)),
+ closeoutBatchInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.CloseoutBatchInfo.JSON_CREATOR)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -775,9 +775,9 @@ public boolean isNotNullEmiInfo() {
return genClient.cacheValueIsNotNull(CacheKey.emiInfo);
}
- /** Checks whether the 'paymentBatchInfo' field is set and is not null */
- public boolean isNotNullPaymentBatchInfo() {
- return genClient.cacheValueIsNotNull(CacheKey.paymentBatchInfo);
+ /** Checks whether the 'closeoutBatchInfo' field is set and is not null */
+ public boolean isNotNullCloseoutBatchInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.closeoutBatchInfo);
}
@@ -1001,9 +1001,9 @@ public boolean hasEmiInfo() {
return genClient.cacheHasKey(CacheKey.emiInfo);
}
- /** Checks whether the 'paymentBatchInfo' field has been set, however the value could be null */
- public boolean hasPaymentBatchInfo() {
- return genClient.cacheHasKey(CacheKey.paymentBatchInfo);
+ /** Checks whether the 'closeoutBatchInfo' field has been set, however the value could be null */
+ public boolean hasCloseoutBatchInfo() {
+ return genClient.cacheHasKey(CacheKey.closeoutBatchInfo);
}
/**
@@ -1369,12 +1369,12 @@ public Payment setEmiInfo(com.clover.sdk.v3.payments.PaymentEmiInfo emiInfo) {
}
/**
- * Sets the field 'paymentBatchInfo'.
+ * Sets the field 'closeoutBatchInfo'.
*
* The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
*/
- public Payment setPaymentBatchInfo(com.clover.sdk.v3.payments.PaymentBatchInfo paymentBatchInfo) {
- return genClient.setRecord(paymentBatchInfo, CacheKey.paymentBatchInfo);
+ public Payment setCloseoutBatchInfo(com.clover.sdk.v3.payments.CloseoutBatchInfo closeoutBatchInfo) {
+ return genClient.setRecord(closeoutBatchInfo, CacheKey.closeoutBatchInfo);
}
@@ -1554,9 +1554,9 @@ public void clearTerminalManagementComponents() {
public void clearEmiInfo() {
genClient.clear(CacheKey.emiInfo);
}
- /** Clears the 'paymentBatchInfo' field, the 'has' method for this field will now return false */
- public void clearPaymentBatchInfo() {
- genClient.clear(CacheKey.paymentBatchInfo);
+ /** Clears the 'closeoutBatchInfo' field, the 'has' method for this field will now return false */
+ public void clearCloseoutBatchInfo() {
+ genClient.clear(CacheKey.closeoutBatchInfo);
}
/**
@@ -1666,7 +1666,7 @@ public interface Constraints {
public static final boolean OCEANGATEWAYINFO_IS_REQUIRED = false;
public static final boolean TERMINALMANAGEMENTCOMPONENTS_IS_REQUIRED = false;
public static final boolean EMIINFO_IS_REQUIRED = false;
- public static final boolean PAYMENTBATCHINFO_IS_REQUIRED = false;
+ public static final boolean CLOSEOUTBATCHINFO_IS_REQUIRED = false;
}
}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PreAuthType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PreAuthType.java
new file mode 100644
index 000000000..ca1989db6
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/PreAuthType.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 PreAuthType implements Parcelable {
+ PREAUTH, BAR_TAB;
+
+ @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 PreAuthType createFromParcel(final Parcel source) {
+ return PreAuthType.valueOf(source.readString());
+ }
+
+ @Override
+ public PreAuthType[] newArray(final int size) {
+ return new PreAuthType[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Refund.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Refund.java
index 06da9af88..061272acb 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Refund.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/Refund.java
@@ -60,6 +60,7 @@
*
{@link #getStatus status}
*
{@link #getOceanGatewayInfo oceanGatewayInfo}
*
{@link #getReason reason}
+ *
{@link #getCloseoutBatchInfo closeoutBatchInfo}
*
*/
@SuppressWarnings("all")
@@ -248,8 +249,12 @@ public java.lang.String getReason() {
return genClient.cacheGet(CacheKey.reason);
}
-
-
+ /**
+ * Information about the Batch used for payments
+ */
+ public com.clover.sdk.v3.payments.CloseoutBatchInfo getCloseoutBatchInfo() {
+ return genClient.cacheGet(CacheKey.closeoutBatchInfo);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
id
@@ -312,6 +317,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.OceanGatewayInfo.JSON_CREATOR)),
reason
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ closeoutBatchInfo
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.CloseoutBatchInfo.JSON_CREATOR)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -556,7 +563,10 @@ public boolean isNotNullReason() {
return genClient.cacheValueIsNotNull(CacheKey.reason);
}
-
+ /** Checks whether the 'closeoutBatchInfo' field is set and is not null */
+ public boolean isNotNullCloseoutBatchInfo() {
+ return genClient.cacheValueIsNotNull(CacheKey.closeoutBatchInfo);
+ }
/** Checks whether the 'id' field has been set, however the value could be null */
public boolean hasId() {
@@ -708,6 +718,10 @@ public boolean hasReason() {
return genClient.cacheHasKey(CacheKey.reason);
}
+ /** Checks whether the 'closeoutBatchInfo' field has been set, however the value could be null */
+ public boolean hasCloseoutBatchInfo() {
+ return genClient.cacheHasKey(CacheKey.closeoutBatchInfo);
+ }
/**
* Sets the field 'id'.
@@ -949,6 +963,14 @@ public Refund setReason(java.lang.String reason) {
return genClient.setOther(reason, CacheKey.reason);
}
+ /**
+ * Sets the field 'closeoutBatchInfo'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public Refund setCloseoutBatchInfo(com.clover.sdk.v3.payments.CloseoutBatchInfo closeoutBatchInfo) {
+ return genClient.setRecord(closeoutBatchInfo, CacheKey.closeoutBatchInfo);
+ }
/** Clears the 'id' field, the 'has' method for this field will now return false */
public void clearId() {
@@ -1070,7 +1092,10 @@ public void clearOceanGatewayInfo() {
public void clearReason() {
genClient.clear(CacheKey.reason);
}
-
+ /** Clears the 'closeoutBatchInfo' field, the 'has' method for this field will now return false */
+ public void clearCloseoutBatchInfo() {
+ genClient.clear(CacheKey.closeoutBatchInfo);
+ }
/**
* Returns true if this instance has any changes.
@@ -1163,6 +1188,7 @@ public interface Constraints {
public static final boolean OCEANGATEWAYINFO_IS_REQUIRED = false;
public static final boolean REASON_IS_REQUIRED = false;
public static final long REASON_MAX_LEN = 255;
+ public static final boolean CLOSEOUTBATCHINFO_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/ServerTotalStats.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/ServerTotalStats.java
index e4071eb60..d9affbccd 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/ServerTotalStats.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/ServerTotalStats.java
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
- *
+ *
* DO NOT EDIT DIRECTLY
*/
@@ -39,6 +39,7 @@
*
{@link #getGiftCardCashOuts giftCardCashOuts}
*
{@link #getTax tax}
*
{@link #getTips tips}
+ *
{@link #getSurcharge surcharge}
*
*/
@SuppressWarnings("all")
@@ -83,29 +84,34 @@ public com.clover.sdk.v3.payments.BatchTotalType getTips() {
return genClient.cacheGet(CacheKey.tips);
}
-
+ public com.clover.sdk.v3.payments.BatchTotalType getSurcharge() {
+ return genClient.cacheGet(CacheKey.surcharge);
+ }
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
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)),
sales
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
refunds
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
net
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
giftCardLoads
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
giftCardCashOuts
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
tax
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
tips
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
- ;
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ surcharge
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.payments.BatchTotalType.JSON_CREATOR)),
+ ;
+
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -225,6 +231,10 @@ public boolean isNotNullTips() {
return genClient.cacheValueIsNotNull(CacheKey.tips);
}
+ /** Checks whether the 'surcharge' field is set and is not null */
+ public boolean isNotNullSurcharge() {
+ return genClient.cacheValueIsNotNull(CacheKey.surcharge);
+ }
/** Checks whether the 'employeeId' field has been set, however the value could be null */
@@ -272,6 +282,10 @@ public boolean hasTips() {
return genClient.cacheHasKey(CacheKey.tips);
}
+ /** Checks whether the 'surcharge' field has been set, however the value could be null */
+ public boolean hasSurcharge() {
+ return genClient.cacheHasKey(CacheKey.surcharge);
+ }
/**
* Sets the field 'employeeId'.
@@ -350,6 +364,15 @@ public ServerTotalStats setTips(com.clover.sdk.v3.payments.BatchTotalType tips)
return genClient.setRecord(tips, CacheKey.tips);
}
+ /**
+ * Sets the field 'surcharge'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public ServerTotalStats setSurcharge(com.clover.sdk.v3.payments.BatchTotalType surcharge) {
+ return genClient.setRecord(surcharge, CacheKey.surcharge);
+ }
+
/** Clears the 'employeeId' field, the 'has' method for this field will now return false */
public void clearEmployeeId() {
@@ -387,7 +410,10 @@ public void clearTax() {
public void clearTips() {
genClient.clear(CacheKey.tips);
}
-
+ /** Clears the 'surcharge' field, the 'has' method for this field will now return false */
+ public void clearSurcharge() {
+ genClient.clear(CacheKey.surcharge);
+ }
/**
* Returns true if this instance has any changes.
@@ -459,6 +485,7 @@ public interface Constraints {
public static final boolean GIFTCARDCASHOUTS_IS_REQUIRED = false;
public static final boolean TAX_IS_REQUIRED = false;
public static final boolean TIPS_IS_REQUIRED = false;
+ public static final boolean SURCHARGE_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 d6f081891..bba5c54d9 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
@@ -35,6 +35,7 @@
*
*
*/
@SuppressWarnings("all")
@@ -112,6 +120,13 @@ public java.lang.Integer getInstallmentsQuantity() {
return genClient.cacheGet(CacheKey.installmentsQuantity);
}
+ /**
+ * Name of the type of installments
+ */
+ public java.lang.String getInstallmentsType() {
+ return genClient.cacheGet(CacheKey.installmentsType);
+ }
+
/**
* AR Installments: plan alphanum code
*/
@@ -294,6 +309,13 @@ public java.lang.String getApplicationPanSequenceNumber() {
return genClient.cacheGet(CacheKey.applicationPanSequenceNumber);
}
+ /**
+ * Counter maintained by the application in the ICC
+ */
+ public java.lang.String getApplicationTransactionCounter() {
+ return genClient.cacheGet(CacheKey.applicationTransactionCounter);
+ }
+
/**
* Contains the reason why the transaction should be reversed in the host. It has to be mapped in server with the expected value by the corresponding gateway
*/
@@ -350,10 +372,10 @@ public com.clover.sdk.v3.payments.SepaElvTransactionInfo getSepaElvTransactionIn
/**
* Client card type should be used only limited purpose only and should not be confused with cardType in other objects.
- This is a read only field and must not to be overwritten on server or client once set on client.
- This is set on client only for MSR tx for now as the AIDs are not identified for MSR.
- For few MSR tx, the card type was identified incorrectly on client side, and also on server side based on the bin match.
- In order to get the correct card types, this client card type will be sent to the server
+ This is a read only field and must not to be overwritten on server or client once set on client.
+ This is set on client only for MSR tx for now as the AIDs are not identified for MSR.
+ For few MSR tx, the card type was identified incorrectly on client side, and also on server side based on the bin match.
+ In order to get the correct card types, this client card type will be sent to the server
*/
public com.clover.sdk.v3.payments.CardType getClientCardType() {
return genClient.cacheGet(CacheKey.clientCardType);
@@ -377,6 +399,48 @@ public java.util.List getPrin
return genClient.cacheGet(CacheKey.printMessages);
}
+ /**
+ * Defines if payment amount was approved but cashback amount was declined.
+ */
+ public java.lang.Boolean getIsPartialApprovedCashbackTransaction() {
+ return genClient.cacheGet(CacheKey.isPartialApprovedCashbackTransaction);
+ }
+
+ /**
+ * Name of the acquirer which processed the transaction
+ */
+ public java.lang.String getAcquirer() {
+ return genClient.cacheGet(CacheKey.acquirer);
+ }
+
+ /**
+ * Unique transaction number generated by SiTef platform
+ */
+ public java.lang.String getNsuSiTef() {
+ return genClient.cacheGet(CacheKey.nsuSiTef);
+ }
+
+ /**
+ * Unique transaction number generated by Host
+ */
+ public java.lang.String getNsuHost() {
+ return genClient.cacheGet(CacheKey.nsuHost);
+ }
+
+ /**
+ * SiTef customer receipt content
+ */
+ public java.lang.String getSiTefCustomerReceipt() {
+ return genClient.cacheGet(CacheKey.siTefCustomerReceipt);
+ }
+
+ /**
+ * SiTef merchant receipt content
+ */
+ public java.lang.String getSiTefMerchantReceipt() {
+ return genClient.cacheGet(CacheKey.siTefMerchantReceipt);
+ }
+
@@ -391,6 +455,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
installmentsQuantity
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ installmentsType
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
installmentsPlanCode
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
installmentsPlanId
@@ -443,6 +509,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
applicationPanSequenceNumber
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ applicationTransactionCounter
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
reversalReason
(com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.ReversalReason.class)),
isTokenBasedTx
@@ -469,6 +537,18 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
printMessages
(com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.payments.DisplayAndPrintMessage.JSON_CREATOR)),
+ isPartialApprovedCashbackTransaction
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ acquirer
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ nsuSiTef
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ nsuHost
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ siTefCustomerReceipt
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ siTefMerchantReceipt
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -577,6 +657,11 @@ public boolean isNotNullInstallmentsQuantity() {
return genClient.cacheValueIsNotNull(CacheKey.installmentsQuantity);
}
+ /** Checks whether the 'installmentsType' field is set and is not null */
+ public boolean isNotNullInstallmentsType() {
+ return genClient.cacheValueIsNotNull(CacheKey.installmentsType);
+ }
+
/** Checks whether the 'installmentsPlanCode' field is set and is not null */
public boolean isNotNullInstallmentsPlanCode() {
return genClient.cacheValueIsNotNull(CacheKey.installmentsPlanCode);
@@ -707,6 +792,11 @@ public boolean isNotNullApplicationPanSequenceNumber() {
return genClient.cacheValueIsNotNull(CacheKey.applicationPanSequenceNumber);
}
+ /** Checks whether the 'applicationTransactionCounter' field is set and is not null */
+ public boolean isNotNullApplicationTransactionCounter() {
+ return genClient.cacheValueIsNotNull(CacheKey.applicationTransactionCounter);
+ }
+
/** Checks whether the 'reversalReason' field is set and is not null */
public boolean isNotNullReversalReason() {
return genClient.cacheValueIsNotNull(CacheKey.reversalReason);
@@ -775,6 +865,36 @@ public boolean isNotNullPrintMessages() {
/** Checks whether the 'printMessages' field is set and is not null and is not empty */
public boolean isNotEmptyPrintMessages() { return isNotNullPrintMessages() && !getPrintMessages().isEmpty(); }
+ /** Checks whether the 'isPartialApprovedCashbackTransaction' field is set and is not null */
+ public boolean isNotNullIsPartialApprovedCashbackTransaction() {
+ return genClient.cacheValueIsNotNull(CacheKey.isPartialApprovedCashbackTransaction);
+ }
+
+ /** Checks whether the 'acquirer' field is set and is not null */
+ public boolean isNotNullAcquirer() {
+ return genClient.cacheValueIsNotNull(CacheKey.acquirer);
+ }
+
+ /** Checks whether the 'nsuSiTef' field is set and is not null */
+ public boolean isNotNullNsuSiTef() {
+ return genClient.cacheValueIsNotNull(CacheKey.nsuSiTef);
+ }
+
+ /** Checks whether the 'nsuHost' field is set and is not null */
+ public boolean isNotNullNsuHost() {
+ return genClient.cacheValueIsNotNull(CacheKey.nsuHost);
+ }
+
+ /** Checks whether the 'siTefCustomerReceipt' field is set and is not null */
+ public boolean isNotNullSiTefCustomerReceipt() {
+ return genClient.cacheValueIsNotNull(CacheKey.siTefCustomerReceipt);
+ }
+
+ /** Checks whether the 'siTefMerchantReceipt' field is set and is not null */
+ public boolean isNotNullSiTefMerchantReceipt() {
+ return genClient.cacheValueIsNotNull(CacheKey.siTefMerchantReceipt);
+ }
+
/** Checks whether the 'languageIndicator' field has been set, however the value could be null */
@@ -802,6 +922,11 @@ public boolean hasInstallmentsQuantity() {
return genClient.cacheHasKey(CacheKey.installmentsQuantity);
}
+ /** Checks whether the 'installmentsType' field has been set, however the value could be null */
+ public boolean hasInstallmentsType() {
+ return genClient.cacheHasKey(CacheKey.installmentsType);
+ }
+
/** Checks whether the 'installmentsPlanCode' field has been set, however the value could be null */
public boolean hasInstallmentsPlanCode() {
return genClient.cacheHasKey(CacheKey.installmentsPlanCode);
@@ -932,6 +1057,11 @@ public boolean hasApplicationPanSequenceNumber() {
return genClient.cacheHasKey(CacheKey.applicationPanSequenceNumber);
}
+ /** Checks whether the 'applicationTransactionCounter' field has been set, however the value could be null */
+ public boolean hasApplicationTransactionCounter() {
+ return genClient.cacheHasKey(CacheKey.applicationTransactionCounter);
+ }
+
/** Checks whether the 'reversalReason' field has been set, however the value could be null */
public boolean hasReversalReason() {
return genClient.cacheHasKey(CacheKey.reversalReason);
@@ -997,6 +1127,36 @@ public boolean hasPrintMessages() {
return genClient.cacheHasKey(CacheKey.printMessages);
}
+ /** Checks whether the 'isPartialApprovedCashbackTransaction' field has been set, however the value could be null */
+ public boolean hasIsPartialApprovedCashbackTransaction() {
+ return genClient.cacheHasKey(CacheKey.isPartialApprovedCashbackTransaction);
+ }
+
+ /** Checks whether the 'acquirer' field has been set, however the value could be null */
+ public boolean hasAcquirer() {
+ return genClient.cacheHasKey(CacheKey.acquirer);
+ }
+
+ /** Checks whether the 'nsuSiTef' field has been set, however the value could be null */
+ public boolean hasNsuSiTef() {
+ return genClient.cacheHasKey(CacheKey.nsuSiTef);
+ }
+
+ /** Checks whether the 'nsuHost' field has been set, however the value could be null */
+ public boolean hasNsuHost() {
+ return genClient.cacheHasKey(CacheKey.nsuHost);
+ }
+
+ /** Checks whether the 'siTefCustomerReceipt' field has been set, however the value could be null */
+ public boolean hasSiTefCustomerReceipt() {
+ return genClient.cacheHasKey(CacheKey.siTefCustomerReceipt);
+ }
+
+ /** Checks whether the 'siTefMerchantReceipt' field has been set, however the value could be null */
+ public boolean hasSiTefMerchantReceipt() {
+ return genClient.cacheHasKey(CacheKey.siTefMerchantReceipt);
+ }
+
/**
* Sets the field 'languageIndicator'.
@@ -1033,6 +1193,13 @@ public TransactionInfo setInstallmentsQuantity(java.lang.Integer installmentsQua
return genClient.setOther(installmentsQuantity, CacheKey.installmentsQuantity);
}
+ /**
+ * Sets the field 'installmentsType'.
+ */
+ public TransactionInfo setInstallmentsType(java.lang.String installmentsType) {
+ return genClient.setOther(installmentsType, CacheKey.installmentsType);
+ }
+
/**
* Sets the field 'installmentsPlanCode'.
*/
@@ -1217,6 +1384,13 @@ public TransactionInfo setApplicationPanSequenceNumber(java.lang.String applicat
return genClient.setOther(applicationPanSequenceNumber, CacheKey.applicationPanSequenceNumber);
}
+ /**
+ * Sets the field 'applicationTransactionCounter'.
+ */
+ public TransactionInfo setApplicationTransactionCounter(java.lang.String applicationTransactionCounter) {
+ return genClient.setOther(applicationTransactionCounter, CacheKey.applicationTransactionCounter);
+ }
+
/**
* Sets the field 'reversalReason'.
*/
@@ -1316,6 +1490,48 @@ public TransactionInfo setPrintMessages(java.util.List{@link #getRemoteConfirmationRequired remoteConfirmationRequired}
*
*
*/
@SuppressWarnings("all")
@@ -174,62 +176,80 @@ public java.lang.Boolean getEnableKioskMode() {
return genClient.cacheGet(CacheKey.enableKioskMode);
}
+ /**
+ * Type of pre-authorization transaction. If left empty a regular pre-auth is assumed.
+ */
+ public com.clover.sdk.v3.payments.PreAuthType getPreAuthType() {
+ return genClient.cacheGet(CacheKey.preAuthType);
+ }
+
+ /**
+ * If set, this will be the time threshold for inactivity on the receipt screen (in seconds).
+ */
+ public java.lang.Long getReceiptSelectionTimeoutThreshold() {
+ return genClient.cacheGet(CacheKey.receiptSelectionTimeoutThreshold);
+ }
+
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
cardEntryMethods
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
disableCashBack
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
cloverShouldHandleReceipts
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
forcePinEntryOnSwipe
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
disableRestartTransactionOnFailure
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
allowOfflinePayment
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
approveOfflinePaymentWithoutPrompt
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
forceOfflinePayment
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
signatureThreshold
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
signatureEntryLocation
- (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.DataEntryLocation.class)),
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.DataEntryLocation.class)),
tipMode
- (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.TipMode.class)),
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.TipMode.class)),
tippableAmount
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
disableReceiptSelection
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
disableDuplicateCheck
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
autoAcceptPaymentConfirmations
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
autoAcceptSignature
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
returnResultOnTransactionComplete
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
tipSuggestions
- (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.merchant.TipSuggestion.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.merchant.TipSuggestion.JSON_CREATOR)),
cashbackSuggestions
- (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.merchant.CashbackSuggestion.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.merchant.CashbackSuggestion.JSON_CREATOR)),
regionalExtras
- (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
+ (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
disableCreditSurcharge
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
receiptOptions
- (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
+ (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
remoteReceipts
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
remoteConfirmationRequired
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
tenderOptions
- (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
+ (com.clover.sdk.extractors.MapExtractionStrategy.instance()),
enableKioskMode
- (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Boolean.class)),
+ preAuthType
+ (com.clover.sdk.extractors.EnumExtractionStrategy.instance(com.clover.sdk.v3.payments.PreAuthType.class)),
+ receiptSelectionTimeoutThreshold
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -449,6 +469,16 @@ public boolean isNotNullEnableKioskMode() {
return genClient.cacheValueIsNotNull(CacheKey.enableKioskMode);
}
+ /** Checks whether the 'preAuthType' field is set and is not null */
+ public boolean isNotNullPreAuthType() {
+ return genClient.cacheValueIsNotNull(CacheKey.preAuthType);
+ }
+
+ /** Checks whether the 'receiptSelectionTimeoutThreshold' field is set and is not null */
+ public boolean isNotNullReceiptSelectionTimeoutThreshold() {
+ return genClient.cacheValueIsNotNull(CacheKey.receiptSelectionTimeoutThreshold);
+ }
+
/** Checks whether the 'cardEntryMethods' field has been set, however the value could be null */
@@ -581,6 +611,16 @@ public boolean hasEnableKioskMode() {
return genClient.cacheHasKey(CacheKey.enableKioskMode);
}
+ /** Checks whether the 'preAuthType' field has been set, however the value could be null */
+ public boolean hasPreAuthType() {
+ return genClient.cacheHasKey(CacheKey.preAuthType);
+ }
+
+ /** Checks whether the 'receiptSelectionTimeoutThreshold' field has been set, however the value could be null */
+ public boolean hasReceiptSelectionTimeoutThreshold() {
+ return genClient.cacheHasKey(CacheKey.receiptSelectionTimeoutThreshold);
+ }
+
/**
* Sets the field 'cardEntryMethods'.
@@ -768,6 +808,20 @@ public TransactionSettings setEnableKioskMode(java.lang.Boolean enableKioskMode)
return genClient.setOther(enableKioskMode, CacheKey.enableKioskMode);
}
+ /**
+ * Sets the field 'preAuthType'.
+ */
+ public TransactionSettings setPreAuthType(com.clover.sdk.v3.payments.PreAuthType preAuthType) {
+ return genClient.setOther(preAuthType, CacheKey.preAuthType);
+ }
+
+ /**
+ * Sets the field 'receiptSelectionTimeoutThreshold'.
+ */
+ public TransactionSettings setReceiptSelectionTimeoutThreshold(java.lang.Long receiptSelectionTimeoutThreshold) {
+ return genClient.setOther(receiptSelectionTimeoutThreshold, CacheKey.receiptSelectionTimeoutThreshold);
+ }
+
/** Clears the 'cardEntryMethods' field, the 'has' method for this field will now return false */
public void clearCardEntryMethods() {
@@ -873,6 +927,14 @@ public void clearTenderOptions() {
public void clearEnableKioskMode() {
genClient.clear(CacheKey.enableKioskMode);
}
+ /** Clears the 'preAuthType' field, the 'has' method for this field will now return false */
+ public void clearPreAuthType() {
+ genClient.clear(CacheKey.preAuthType);
+ }
+ /** Clears the 'receiptSelectionTimeoutThreshold' field, the 'has' method for this field will now return false */
+ public void clearReceiptSelectionTimeoutThreshold() {
+ genClient.clear(CacheKey.receiptSelectionTimeoutThreshold);
+ }
/**
@@ -961,6 +1023,8 @@ public interface Constraints {
public static final boolean REMOTECONFIRMATIONREQUIRED_IS_REQUIRED = false;
public static final boolean TENDEROPTIONS_IS_REQUIRED = false;
public static final boolean ENABLEKIOSKMODE_IS_REQUIRED = false;
+ public static final boolean PREAUTHTYPE_IS_REQUIRED = false;
+ public static final boolean RECEIPTSELECTIONTIMEOUTTHRESHOLD_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CapturePreAuthRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CapturePreAuthRequestIntentBuilder.java
index d489e2bdf..afcfcdfc7 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CapturePreAuthRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CapturePreAuthRequestIntentBuilder.java
@@ -389,4 +389,38 @@ public static NoReceiptOption Disable() {
}
}
+ public static class Response {
+ /**
+ * The payment as a result of the capturing the pre-authorization
+ */
+ public static final String PAYMENT = Intents.EXTRA_PAYMENT;
+ /**
+ * If taken, customer's signature.
+ */
+ public static final String SIGNATURE = Intents.EXTRA_SIGNATURE;
+ /**
+ * The customer's entered email/phone number from the customer facing receipt screen.
+ */
+ public static final String ENTERED_RECEIPT_VALUE = Intents.EXTRA_ENTERED_RECEIPT_VALUE;
+ /**
+ * The type of receipt requested by the customer.
+ * e.g., SMS, Email, Print, No Receipt
+ */
+ public static final String RECEIPT_DELIVERY_TYPE = Intents.EXTRA_RECEIPT_DELIVERY_TYPE;
+ /**
+ * The status of the customer's receipt delivery. If cloverShouldHandleReceipts is true, then it will
+ * return PROCESSED. If cloverShouldHandleReceipts is false, then it will return REQUESTED.
+ */
+ public static final String RECEIPT_DELIVERY_STATUS = Intents.EXTRA_RECEIPT_DELIVERY_STATUS;
+ /**
+ * If the customer chose to opt into marketing communication on the receipt screen.
+ * @see MarketingDecision
+ */
+ public static final String OPTED_INTO_MARKETING = Intents.EXTRA_OPTED_INTO_MARKETING;
+ /**
+ * If capturing the pre-authorization fails for any reason, there will be failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CloseoutRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CloseoutRequestIntentBuilder.java
new file mode 100644
index 000000000..ef48678be
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CloseoutRequestIntentBuilder.java
@@ -0,0 +1,117 @@
+package com.clover.sdk.v3.payments.api;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import com.clover.sdk.v1.Intents;
+
+/**
+ * Use the CloseoutRequestIntentBuilder to build an intent for a merchant to closeout transactions.
+ * Before a closeout can be successful, the merchant must be approved for manual closeout before using, as well as
+ * open payments must have a tip amount set. Optionally, through TipOptions, you can choose to set a zero amount
+ * for all remaining open payments, to leave preauths open, and for Clover to handle tips.
+ *
+ */
+public class CloseoutRequestIntentBuilder extends BaseIntentBuilder {
+ private TipOptions tipOptions;
+ private Boolean leavePreauthsOpen;
+
+ /**
+ * The ability to customize how tips are handled for the Closeout request.
+ * TipOptions include: ZeroOutOpenTips, PromptForOpenPayments
+ * @param tipOptions
+ * @return the CloseoutRequestIntentBuilder object with tipOptions set.
+ */
+ public CloseoutRequestIntentBuilder tipOptions(TipOptions tipOptions) {
+ this.tipOptions = tipOptions;
+ return this;
+ }
+
+ /**
+ * The ability to leave preauths open. By default, closeout will fail if there are preauths open.
+ * @param leavePreauthsOpen
+ * @return the CloseoutRequestIntentBuilder object with leavePreauthsOpen set.
+ */
+ public CloseoutRequestIntentBuilder leavePreauthsOpen(Boolean leavePreauthsOpen) {
+ this.leavePreauthsOpen = leavePreauthsOpen;
+ return this;
+ }
+
+ public Intent build(Context context) {
+ if (context == null) {
+ throw new IllegalArgumentException("context must be populated with a non null value");
+ }
+
+ Intent i = super.build(context);
+ i.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.CloseoutRequestHandler"));
+
+ if (leavePreauthsOpen != null) {
+ i.putExtra(Intents.EXTRA_LEAVE_PREAUTHS_OPEN, leavePreauthsOpen);
+ }
+ if (tipOptions != null) {
+ if (tipOptions.tipOption != null) {
+ i.putExtra(Intents.EXTRA_OPEN_PAYMENT_OPTIONS, tipOptions.tipOption);
+ }
+ }
+ return i;
+ }
+
+ /**
+ * The TipOptions class gives the integrator the ability to customize how tips will be handled
+ * with the CloseoutRequestIntentBuilder
+ *
+ */
+ public static class TipOptions {
+ private final String tipOption;
+
+ private TipOptions(String tipOption) {
+ this.tipOption = tipOption;
+ }
+
+ /**
+ * TipOptions that will set all open tips to zero before queuing closeout
+ * @return
+ */
+ public static TipOptions ZeroOutOpenTips() {
+ return new TipOptions(OpenPaymentOption.ZERO_OUT_OPEN_TIPS);
+ }
+
+ /**
+ * TipOptions that will open the default Clover Tips app, if there are any open tips, before
+ * queuing closeout
+ * @return
+ */
+ public static TipOptions PromptForOpenPayments() {
+ return new TipOptions(OpenPaymentOption.PROMPT_FOR_OPEN_PAYMENTS);
+ }
+
+ /**
+ * TipOptions that will return a list of payment IDs of payments that have open tips, if any.
+ * When open tip payments are present, a closeout will not be queued.
+ * @return
+ */
+ public static TipOptions ReturnOpenPayments() {
+ return new TipOptions(OpenPaymentOption.RETURN_OPEN_TIP_PAYMENTS);
+ }
+ }
+
+ public static class Response {
+ /**
+ * The result of the closeout request.
+ * @see CloseoutResult
+ */
+ public static final String CLOSEOUT_RESULT = Intents.EXTRA_CLOSEOUT_RESULT;
+ /**
+ * If the closeout was successful, the resulting Batch.
+ */
+ public static final String BATCH = Intents.EXTRA_CLOSEOUT_BATCH;
+ /**
+ * If the closeout fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ /**
+ * If there are open payments in the current Batch, there will be a list of payment IDs.
+ */
+ public static final String PAYMENT_IDS = Intents.EXTRA_PAYMENT_IDS;
+ }
+}
\ No newline at end of file
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CreditRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CreditRequestIntentBuilder.java
index 8d2a84ac6..0d0d32b0c 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CreditRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/CreditRequestIntentBuilder.java
@@ -315,4 +315,34 @@ public static NoReceiptOption Disable() {
}
}
}
+
+
+ public static class Response {
+ /**
+ * The resulting Credit object.
+ */
+ public static final String CREDIT = Intents.EXTRA_CREDIT;
+ /**
+ * The customer's entered email/phone number from the customer facing receipt screen.
+ */
+ public static final String ENTERED_RECEIPT_VALUE = Intents.EXTRA_ENTERED_RECEIPT_VALUE;
+ /**
+ * The type of receipt requested by the customer.
+ * e.g., SMS, Email, Print, No Receipt
+ */
+ public static final String RECEIPT_DELIVERY_TYPE = Intents.EXTRA_RECEIPT_DELIVERY_TYPE;
+ /**
+ * The status of the customer's receipt delivery. If cloverShouldHandleReceipts is true, then it will
+ * return PROCESSED. If cloverShouldHandleReceipts is false, then it will return REQUESTED.
+ */
+ public static final String RECEIPT_DELIVERY_STATUS = Intents.EXTRA_RECEIPT_DELIVERY_STATUS;
+ /**
+ * If the customer chose to opt into marketing communication on the receipt screen.
+ */
+ public static final String OPTED_INTO_MARKETING = Intents.EXTRA_OPTED_INTO_MARKETING;
+ /**
+ * If the Credit request fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/IncrementalAuthRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/IncrementalAuthRequestIntentBuilder.java
index fa273e864..a0d896747 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/IncrementalAuthRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/IncrementalAuthRequestIntentBuilder.java
@@ -35,4 +35,16 @@ public Intent build(Context context) {
return i;
}
+
+
+ public static class Response {
+ /**
+ * The resulting incremented Authorization object.
+ */
+ public static final String AUTHORIZATION_INCREMENT = Intents.EXTRA_AUTHORIZATION_INCREMENT;
+ /**
+ * If incrementing the pre-authorization fails for any reason, there will be failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/KioskPayRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/KioskPayRequestIntentBuilder.java
new file mode 100644
index 000000000..c6e7ae8f0
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/KioskPayRequestIntentBuilder.java
@@ -0,0 +1,539 @@
+package com.clover.sdk.v3.payments.api;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+
+import com.clover.sdk.v1.Intents;
+import com.clover.sdk.v3.payments.ReceiptOptionType;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Use the KioskPayRequestIntentBuilder class to initiate Kiosk mode payments on a Clover Kiosk.
+ * Making a request using KioskPayRequestIntentBuilder can result in:
+ * 1. A fully paid order/full amount collected.
+ * 2. No active payments, including voiding any partial payments if collected.
+ */
+public class KioskPayRequestIntentBuilder extends BaseIntentBuilder {
+ private Long amount;
+ private String externalReferenceId;
+
+ private String orderId;
+
+ private Long taxAmount;
+
+ private Boolean allowPartialPayments;
+
+ private TipOptions tipOptions;
+
+ private ReceiptOptions receiptOptions;
+
+ private SignatureOptions signatureOptions;
+
+ private OfflineOptions offlineOptions;
+
+
+
+ private KioskPayRequestIntentBuilder() {}
+
+ /**
+ * Creates an instance of the KioskPayRequestIntentBuilder class.
+ * This is to be used when Clover orders aren't being used, and only when a payment amount is being requested.
+ * @param amount
+ * @param externalReferenceId
+ */
+ public KioskPayRequestIntentBuilder(long amount, String externalReferenceId) {
+ this.amount = amount;
+ this.externalReferenceId = externalReferenceId;
+ }
+
+ /**
+ * Creates an instance of the KioskPayRequestIntentBuilder class.
+ * This is to be used when an Order has already been created to be paid for.
+ * @param orderId
+ */
+ public KioskPayRequestIntentBuilder(String orderId) {
+ this.orderId = orderId;
+ }
+
+ /**
+ * Sets the field 'taxAmount'.
+ * NOTE: This will not affect the total amount.
+ * @param taxAmount
+ * @return KioskPayRequestIntentBuilder object with new taxAmount
+ */
+ public KioskPayRequestIntentBuilder taxAmount(long taxAmount) {
+ this.taxAmount = taxAmount;
+ return this;
+ }
+
+ /**
+ * Sets the field 'allowPartialPayments'.
+ * This informs Clover to accept a payment that only partially pays for an Order.
+ * NOTE: This is true by default.
+ * @param allowPartialPayments
+ * @return
+ */
+ public KioskPayRequestIntentBuilder allowPartialPayments(boolean allowPartialPayments) {
+ this.allowPartialPayments = allowPartialPayments;
+ return this;
+ }
+
+ /**
+ * Sets TipOptions on the KioskPayRequestIntentBuilder object.
+ * @see TipOptions
+ * @param tipOptions
+ * @return
+ */
+ public KioskPayRequestIntentBuilder tipOptions(TipOptions tipOptions) {
+ this.tipOptions = tipOptions;
+ return this;
+ }
+
+ /**
+ * Sets ReceiptOptions on the KioskPayRequestIntentBuilder object.
+ * @see ReceiptOptions
+ * @param receiptOptions
+ * @return
+ */
+ public KioskPayRequestIntentBuilder receiptOptions(ReceiptOptions receiptOptions) {
+ this.receiptOptions = receiptOptions;
+ return this;
+ }
+
+ /**
+ * Sets SignatureOptions on the KioskPayRequestIntentBuilder object.
+ * @see SignatureOptions
+ * @param signatureOptions
+ * @return
+ */
+ public KioskPayRequestIntentBuilder signatureOptions(SignatureOptions signatureOptions) {
+ this.signatureOptions = signatureOptions;
+ return this;
+ }
+
+ /**
+ * Sets OfflineOptions on the KioskPayRequestIntentBuilder object.
+ * @see OfflineOptions
+ * @param offlineOptions
+ * @return
+ */
+ public KioskPayRequestIntentBuilder offlineOptions(OfflineOptions offlineOptions) {
+ this.offlineOptions = offlineOptions;
+ return this;
+ }
+
+ /**
+ * Returns a single-use Intent to be used by Integrator POS to initiate a Kiosk payment
+ * @param context
+ * @return Intent to be used to initiate a Kiosk payment
+ * @throws IllegalArgumentException
+ */
+ public Intent build(Context context) throws IllegalArgumentException {
+ if (context == null) {
+ throw new IllegalArgumentException("context must be populated with a non null value");
+ }
+ if (amount != null && amount.longValue() <= 0L) {
+ throw new IllegalArgumentException("amount cannot be less than or equal to zero");
+ }
+ if (externalReferenceId != null && externalReferenceId.isEmpty()) {
+ throw new IllegalArgumentException("externalReferenceId must be populated with a non-empty value");
+ }
+ Intent i = super.build(context);
+ i.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.KioskPayRequestHandler"));
+
+ if (amount != null) {
+ i.putExtra(Intents.EXTRA_AMOUNT, amount);
+ }
+ if (orderId != null) {
+ i.putExtra(Intents.EXTRA_ORDER_ID, orderId);
+ }
+ if (externalReferenceId != null) {
+ i.putExtra(Intents.EXTRA_EXTERNAL_REFERENCE_ID, externalReferenceId);
+ }
+ if (taxAmount != null) {
+ i.putExtra(Intents.EXTRA_TAX_AMOUNT, taxAmount);
+ }
+ if (allowPartialPayments != null) {
+ i.putExtra(Intents.EXTRA_ALLOW_PARTIAL_AUTH, allowPartialPayments);
+ }
+ if (tipOptions != null) {
+ if (tipOptions.tipAmount != null) {
+ i.putExtra(Intents.EXTRA_TIP_AMOUNT, tipOptions.tipAmount);
+ }
+ if (tipOptions.tipSuggestions != null) {
+ List suggestions = new ArrayList<>();
+ for (com.clover.sdk.v3.payments.api.TipSuggestion tipSuggestion : tipOptions.tipSuggestions) {
+ suggestions.add(tipSuggestion.getV3TipSuggestion());
+ }
+ i.putExtra(Intents.EXTRA_TIP_SUGGESTIONS, (Serializable) suggestions);
+ }
+ if (tipOptions.baseAmount != null) {
+ i.putExtra(Intents.EXTRA_TIPPABLE_AMOUNT, tipOptions.baseAmount);
+ }
+ }
+ if (receiptOptions != null) {
+ if (receiptOptions.providedReceiptOptions != null) {
+ Map enabledReceiptOptions = new HashMap<>();
+ for (ReceiptOptions.ReceiptOption providedReceiptOption : receiptOptions.providedReceiptOptions) {
+ if (providedReceiptOption.enabled) {
+ String value;
+ if (providedReceiptOption.value != null) {
+ value = providedReceiptOption.value;
+ } else {
+ //We need a string value because GenericClient in TransactionSettings will filter out null values
+ value = "";
+ }
+ enabledReceiptOptions.put(providedReceiptOption.type, value);
+ }
+ }
+ i.putExtra(Intents.EXTRA_ENABLED_RECEIPT_OPTIONS, (Serializable) enabledReceiptOptions);
+ //All Receipt Options were disabled, so skip the receipt screen
+ i.putExtra(Intents.EXTRA_SKIP_RECEIPT_SCREEN, !(enabledReceiptOptions.size() > 0));
+
+ }
+ if (receiptOptions.cloverShouldHandleReceipts != null) {
+ i.putExtra(Intents.EXTRA_REMOTE_RECEIPTS, !receiptOptions.cloverShouldHandleReceipts);
+ }
+ }
+ if (signatureOptions != null) {
+ if (signatureOptions.signatureThreshold != null) {
+ i.putExtra(Intents.EXTRA_SIGNATURE_THRESHOLD, signatureOptions.signatureThreshold);
+ }
+ }
+ if (offlineOptions != null) {
+ if (offlineOptions.allowOfflinePayment != null) {
+ i.putExtra(Intents.EXTRA_ALLOW_OFFLINE_PAYMENT, offlineOptions.allowOfflinePayment);
+ }
+ if (offlineOptions.approveOfflinePaymentWithoutPrompt != null) {
+ i.putExtra(Intents.EXTRA_APPROVE_OFFLINE_PAYMENT_WITHOUT_PROMPT, offlineOptions.approveOfflinePaymentWithoutPrompt);
+ }
+ if (offlineOptions.forceOfflinePayment != null) {
+ i.putExtra(Intents.EXTRA_FORCE_OFFLINE, offlineOptions.forceOfflinePayment);
+ }
+ }
+
+ return i;
+ }
+
+
+ /**
+ * Tip options that allow the Integrator to control tipping on a per-transaction level.
+ * tipAmount - A provided tip amount that will be used as the Payment's tipAmount, bypassing customer selection.
+ * baseAmount - The amount to be tipped on (perhaps less than the transaction's total amount)
+ * tipSuggestions - Provides the ability to override the default amounts and labels of Tip Suggestions. (Maximum of 4)
+ */
+ public static class TipOptions {
+ private final Long tipAmount;
+ private final List tipSuggestions;
+ private final Long baseAmount;
+
+ private TipOptions(Long tipAmount, Long baseAmount, List tipSuggestions) {
+ this.tipAmount = tipAmount;
+ this.baseAmount = baseAmount;
+ this.tipSuggestions = tipSuggestions;
+ }
+
+ /**
+ * No tip will be taken and tipAmount will default to 0.
+ */
+ public static TipOptions Disable() {
+ return new TipOptions(0L, null, null);
+ }
+
+ /**
+ * Tips will be provided by Integrator.
+ */
+ public static TipOptions Provided(long tipAmount) {
+ return new TipOptions(tipAmount, null, null);
+ }
+
+ /**
+ * Customers will be prompted to tip.
+ * @param baseAmount - Optional amount used to compute percentage based tip options
+ * @param tipSuggestions - Optional list of TipSuggestions for this transaction
+ */
+ public static TipOptions PromptCustomer(Long baseAmount, List tipSuggestions) {
+ return new TipOptions(null, baseAmount, tipSuggestions);
+ }
+ }
+
+ /**
+ * Receipt options that allow the Integrator to control the receipt selection on a per-transaction level.
+ */
+ public static class ReceiptOptions {
+ private List providedReceiptOptions;
+ private Boolean cloverShouldHandleReceipts;
+
+ private ReceiptOptions() {}
+ /**
+ * Create ReceiptOptions with the default list of options displaying, with an option to have
+ * the Clover default receipt processing or not.
+ * @param cloverShouldHandleReceipts - true-Clover will process a default Clover receipt(default), or
+ * false-will return the object with a REQUESTED value if a default
+ * Clover receipt isn't desired. For SMS and Email, an additional
+ * field containing the sms number or email address will also
+ * be returned.
+ * @return
+ */
+ public static ReceiptOptions Default(boolean cloverShouldHandleReceipts) {
+ return new ReceiptOptions(cloverShouldHandleReceipts, null, null, null, null);
+ }
+
+ /**
+ * This will cause the UI flow to skip the receipt selection screen and no customer receipt will be
+ * processed
+ * @return
+ */
+ public static ReceiptOptions SkipReceiptSelection() {
+ return new ReceiptOptions(true, ReceiptOptions.SmsReceiptOption.Disable(), ReceiptOptions.EmailReceiptOption.Disable(), ReceiptOptions.PrintReceiptOption.Disable(), ReceiptOptions.NoReceiptOption.Disable());
+ }
+
+ /**
+ * Builds a ReceiptOptions where some options may be specified
+ * @param cloverShouldHandleReceipts - true-Clover will process a default Clover receipt(default), or
+ * false-will return the object with a REQUESTED value if a default
+ * Clover receipt isn't desired. For SMS and Email, an additional
+ * field containing the sms number or email address will also
+ * be returned.
+ * @param smsReceiptOption - @see SmsReceiptOption
+ * @param emailReceiptOption - @see EmailReceiptOptions
+ * @param printReceiptOption - @see PrintReceiptOption
+ * @param noReceiptOption - @see NoReceiptOption
+ * @return
+ */
+ public static ReceiptOptions Instance(Boolean cloverShouldHandleReceipts, ReceiptOptions.SmsReceiptOption smsReceiptOption, ReceiptOptions.EmailReceiptOption emailReceiptOption, ReceiptOptions.PrintReceiptOption printReceiptOption, ReceiptOptions.NoReceiptOption noReceiptOption) {
+ return new ReceiptOptions(cloverShouldHandleReceipts, smsReceiptOption, emailReceiptOption, printReceiptOption, noReceiptOption);
+ }
+ private ReceiptOptions(Boolean cloverShouldHandleReceipts, ReceiptOptions.SmsReceiptOption smsReceiptOption, ReceiptOptions.EmailReceiptOption emailReceiptOption, ReceiptOptions.PrintReceiptOption printReceiptOption, ReceiptOptions.NoReceiptOption noReceiptOption) {
+ this.cloverShouldHandleReceipts = cloverShouldHandleReceipts;
+ //if all receipt options are null, then providedReceiptOptions will be null (default behavior)
+ if (smsReceiptOption != null || emailReceiptOption != null || printReceiptOption != null || noReceiptOption != null) {
+ this.providedReceiptOptions = new ArrayList<>();
+ if (smsReceiptOption != null) {
+ this.providedReceiptOptions.add(smsReceiptOption);
+ }
+ if (emailReceiptOption != null) {
+ this.providedReceiptOptions.add(emailReceiptOption);
+ }
+ if (printReceiptOption != null) {
+ this.providedReceiptOptions.add(printReceiptOption);
+ }
+ if (noReceiptOption != null) {
+ this.providedReceiptOptions.add(noReceiptOption);
+ }
+ }
+ }
+
+ private static class ReceiptOption {
+ protected boolean enabled;
+ protected String type;
+ protected String value;
+ }
+
+ /**
+ * SmsReceiptOption that allows the Integrator to control the Sms receipt option.
+ */
+ public static class SmsReceiptOption extends ReceiptOptions.ReceiptOption {
+
+ private SmsReceiptOption(String sms, boolean enabled) {
+ this.type = ReceiptOptionType.SMS;
+ this.value = sms;
+ this.enabled = enabled;
+ }
+ /**
+ * The Sms Receipt option will be displayed, with an optional sms number provided
+ * @param sms - optional sms number that will pre-fill the number field
+ * @return
+ */
+ public static ReceiptOptions.SmsReceiptOption Enable(String sms) {
+ return new ReceiptOptions.SmsReceiptOption(sms, true);
+ }
+ /**
+ * The Sms Receipt option will not be displayed
+ * @return
+ */
+ public static ReceiptOptions.SmsReceiptOption Disable() {
+ return new ReceiptOptions.SmsReceiptOption(null, false);
+ }
+
+ }
+
+ /**
+ * EmailReceiptOption that allows the Integrator to control the Email receipt option.
+ */
+ public static class EmailReceiptOption extends ReceiptOptions.ReceiptOption {
+
+ private EmailReceiptOption(String email, boolean enable) {
+ this.type = ReceiptOptionType.EMAIL;
+ this.value = email;
+ this.enabled = enable;
+ }
+ /**
+ * The Email Receipt option will be displayed, with an optional email address provided
+ * @param email - optional email address that will pre-fill the email address field
+ * @return
+ */
+ public static ReceiptOptions.EmailReceiptOption Enable(String email) {
+ return new ReceiptOptions.EmailReceiptOption(email, true);
+ }
+ /**
+ * The Email Receipt option will not be displayed
+ * @return
+ */
+ public static ReceiptOptions.EmailReceiptOption Disable() {
+ return new ReceiptOptions.EmailReceiptOption(null, false);
+ }
+ }
+
+ /**
+ * PrintReceiptOption that allows the Integrator to control the Print receipt option.
+ */
+ public static class PrintReceiptOption extends ReceiptOptions.ReceiptOption {
+
+ private PrintReceiptOption(boolean enable){
+ this.type = ReceiptOptionType.PRINT;
+ this.enabled = enable;
+ }
+ /**
+ * The Print Receipt option will be displayed
+ * @return
+ */
+ public static ReceiptOptions.PrintReceiptOption Enable() {
+ return new ReceiptOptions.PrintReceiptOption(true);
+ }
+ /**
+ * The Print Receipt option will not be displayed
+ * @return
+ */
+ public static ReceiptOptions.PrintReceiptOption Disable() {
+ return new ReceiptOptions.PrintReceiptOption(false);
+ }
+ }
+
+ /**
+ * PrintReceiptOption that allows the Integrator to control the Print receipt option.
+ */
+ public static class NoReceiptOption extends ReceiptOptions.ReceiptOption {
+ private NoReceiptOption(boolean enable) {
+ this.type = ReceiptOptionType.NO_RECEIPT;
+ this.enabled = enable;
+ }
+ /**
+ * The No Receipt option will be displayed
+ * @return
+ */
+ public static ReceiptOptions.NoReceiptOption Enable() {
+ return new ReceiptOptions.NoReceiptOption(true);
+ }
+ /**
+ * The No Receipt option will not be displayed on the customer screen
+ * note: This will only hide the No Receipt option from the customer screen
+ * @return
+ */
+ public static ReceiptOptions.NoReceiptOption Disable() {
+ return new ReceiptOptions.NoReceiptOption(false);
+ }
+ }
+ }
+
+ /**
+ * Signature options that allow the Integrator to control how the signature is collected on a per-transaction level.
+ */
+ public static class SignatureOptions {
+ private final Long signatureThreshold;
+
+ private SignatureOptions(Long signatureThreshold) {
+ this.signatureThreshold = signatureThreshold;
+ }
+
+ /**
+ * No signature will be collected
+ */
+ public static SignatureOptions Disable() {
+ return new SignatureOptions(Long.MAX_VALUE);
+ }
+
+ /**
+ * Customer will be prompted (on screen or on paper) for signature
+ */
+ public static SignatureOptions PromptCustomer(Long signatureThreshold) {
+ return new SignatureOptions(signatureThreshold);
+ }
+ }
+
+ /**
+ * Offline options that allow the Integrator to control a transaction's offline state on a per-transaction level.
+ */
+ public static class OfflineOptions {
+ private final Boolean allowOfflinePayment;
+ private final Boolean approveOfflinePaymentWithoutPrompt;
+ private final Boolean forceOfflinePayment;
+
+ private OfflineOptions(Boolean allowOfflinePayment, Boolean approveOfflinePaymentWithoutPrompt, Boolean forceOfflinePayment) {
+ this.allowOfflinePayment = allowOfflinePayment;
+ this.approveOfflinePaymentWithoutPrompt = approveOfflinePaymentWithoutPrompt;
+ this.forceOfflinePayment = forceOfflinePayment;
+ }
+
+ /**
+ * Offline option that can be used per transaction
+ * @param allowOfflinePayment - if merchant is configured, will enable an offline payment
+ * @param approveOfflinePaymentWithoutPrompt - if an offline payment is needed, it will allow it without
+ * prompting the merchant
+ * @param forceOfflinePayment - take the payment offline, even if the device is online
+ * @return
+ */
+ public static OfflineOptions Instance(Boolean allowOfflinePayment, Boolean approveOfflinePaymentWithoutPrompt, Boolean forceOfflinePayment) {
+ return new OfflineOptions(allowOfflinePayment, approveOfflinePaymentWithoutPrompt, forceOfflinePayment);
+ }
+ }
+
+ public static class Response {
+ /**
+ * The resulting payments.
+ */
+ public final static String PAYMENTS = Intents.EXTRA_PAYMENTS;
+
+ /**
+ * The resulting Order.
+ */
+ public final static String ORDER = Intents.EXTRA_ORDER;
+ /**
+ * The customer's entered email/phone number from the customer facing receipt screen.
+ */
+ public static final String ENTERED_RECEIPT_VALUE = Intents.EXTRA_ENTERED_RECEIPT_VALUE;
+ /**
+ * The type of receipt requested by the customer.
+ * e.g., SMS, Email, Print, No Receipt
+ */
+ public static final String RECEIPT_DELIVERY_TYPE = Intents.EXTRA_RECEIPT_DELIVERY_TYPE;
+ /**
+ * The status of the customer's receipt delivery. If cloverShouldHandleReceipts is true, then it will
+ * return PROCESSED. If cloverShouldHandleReceipts is false, then it will return REQUESTED.
+ */
+ public static final String RECEIPT_DELIVERY_STATUS = Intents.EXTRA_RECEIPT_DELIVERY_STATUS;
+ /**
+ * If the customer chose to opt into marketing communication on the receipt screen.
+ */
+ public static final String OPTED_INTO_MARKETING = Intents.EXTRA_OPTED_INTO_MARKETING;
+ /**
+ * If taken, customer's signature.
+ */
+ public static final String SIGNATURE = Intents.EXTRA_SIGNATURE;
+
+ /**
+ * IDs of the payments voided, if any.
+ */
+ public static final String VOIDED_PAYMENT_IDS = Intents.EXTRA_VOIDED_PAYMENT_IDS;
+ /**
+ * If the payments fail for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/OpenPaymentOption.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/OpenPaymentOption.java
new file mode 100644
index 000000000..e161f3437
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/OpenPaymentOption.java
@@ -0,0 +1,12 @@
+package com.clover.sdk.v3.payments.api;
+
+public class OpenPaymentOption {
+
+ public static final String PROMPT_FOR_OPEN_PAYMENTS = "PROMPT_FOR_OPEN_PAYMENTS";
+
+ public static final String ZERO_OUT_OPEN_TIPS = "ZERO_OUT_OPEN_TIPS";
+
+ public static final String RETURN_OPEN_TIP_PAYMENTS = "RETURN_OPEN_TIP_PAYMENTS";
+
+ public static final String ADJUST_OPEN_PAYMENT = "ADJUST_OPEN_PAYMENT";
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRefundRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRefundRequestIntentBuilder.java
deleted file mode 100644
index 787ef899f..000000000
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRefundRequestIntentBuilder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.clover.sdk.v3.payments.api;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import com.clover.sdk.v1.Intents;
-
-/**
- * Use the PaymentRefundRequestIntentBuilder class to initiate a payment refund on an Android device.
- */
-public class PaymentRefundRequestIntentBuilder extends BaseIntentBuilder {
- private String paymentId;
- private Long amount;
-
- private PaymentRefundRequestIntentBuilder() {}
-
- /**
- * Creates an instance of the PaymentRefundRequestIntentBuilder class
- * @param paymentId
- */
- public PaymentRefundRequestIntentBuilder(String paymentId) {
- this.paymentId = paymentId;
- }
-
- /**
- * Sets the amount to be refunded
- * @param amount
- * @return PaymentRefundRequestIntentBuilder object with new amount
- */
- public PaymentRefundRequestIntentBuilder amount(Long amount) {
- this.amount = amount;
- return this;
- }
-
- /**
- * Builder method to create an Intent to be used by Integrator POS to initiate a payment refund.
- * @param context
- * @return
- */
- public Intent build(Context context) {
- if (context == null) {
- throw new IllegalArgumentException("Activity context must be populated with a non null value");
- }
- if (paymentId == null) {
- throw new IllegalArgumentException("paymentId must be populated with a non null value");
- }
- Intent i = super.build(context);
- i.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.PaymentRefundRequestHandler"));
- i.putExtra(Intents.EXTRA_PAYMENT_ID, paymentId);
- i.putExtra(Intents.EXTRA_AMOUNT, amount);
-
- return i;
- }
-}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRequestIntentBuilder.java
index 615452528..5ac922174 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PaymentRequestIntentBuilder.java
@@ -716,4 +716,62 @@ public static TenderOptions Disable() {
return new TenderOptions(true, true);
}
}
+
+ public static class Response {
+ /**
+ * The resulting payment.
+ */
+ public final static String PAYMENT = Intents.EXTRA_PAYMENT;
+ /**
+ * The customer's entered email/phone number from the customer facing receipt screen.
+ */
+ public static final String ENTERED_RECEIPT_VALUE = Intents.EXTRA_ENTERED_RECEIPT_VALUE;
+ /**
+ * The type of receipt requested by the customer.
+ * e.g., SMS, Email, Print, No Receipt
+ */
+ public static final String RECEIPT_DELIVERY_TYPE = Intents.EXTRA_RECEIPT_DELIVERY_TYPE;
+ /**
+ * The status of the customer's receipt delivery. If cloverShouldHandleReceipts is true, then it will
+ * return PROCESSED. If cloverShouldHandleReceipts is false, then it will return REQUESTED.
+ */
+ public static final String RECEIPT_DELIVERY_STATUS = Intents.EXTRA_RECEIPT_DELIVERY_STATUS;
+ /**
+ * If the customer chose to opt into marketing communication on the receipt screen.
+ */
+ public static final String OPTED_INTO_MARKETING = Intents.EXTRA_OPTED_INTO_MARKETING;
+ /**
+ * If taken, customer's signature.
+ */
+ public static final String SIGNATURE = Intents.EXTRA_SIGNATURE;
+ /**
+ * If a cash payment is taken, the amount of change due to customer.
+ */
+ public static final String CHANGE_DUE = Intents.EXTRA_CHANGE_DUE;
+ /**
+ * If tokenizing the card is requested, this will return the type of Token.
+ */
+ public static final String TOKEN_TYPE = Intents.EXTRA_TOKEN_TYPE;
+ /**
+ * The token to be used for EComm transactions.
+ */
+ public static final String TOKEN = Intents.EXTRA_TOKEN;
+ /**
+ * Card information for the tokenized card. This should consist of information such as:
+ * first6, last4, expiration month, expiration year.
+ */
+ public static final String CARD = Intents.EXTRA_CARD;
+ /**
+ * If tokenizing the card fails, the reason will be present.
+ */
+ public static final String REASON = Intents.EXTRA_REASON;
+ /**
+ * If the customer confirmation of saving their card is suppressed.
+ */
+ public static final String SUPPRESS_CONFIRMATION = Intents.EXTRA_SUPPRESS_CONFIRMATION;
+ /**
+ * If the payment fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PreAuthRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PreAuthRequestIntentBuilder.java
index c67f8edb8..69aed5d18 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PreAuthRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/PreAuthRequestIntentBuilder.java
@@ -152,4 +152,36 @@ public static TokenizeOptions Instance(boolean suppressConfirmation) {
return new TokenizeOptions(suppressConfirmation);
}
}
+
+ public static class Response {
+ /**
+ * The payment as a result of the pre-authorization
+ */
+ public final static String PAYMENT = Intents.EXTRA_PAYMENT;
+ /**
+ * If tokenizing the card is requested, this will return the type of Token.
+ */
+ public static final String TOKEN_TYPE = Intents.EXTRA_TOKEN_TYPE;
+ /**
+ * The token to be used for EComm transactions.
+ */
+ public static final String TOKEN = Intents.EXTRA_TOKEN;
+ /**
+ * Card information for the tokenized card. This should consist of information such as:
+ * first6, last4, expiration month, expiration year.
+ */
+ public static final String CARD = Intents.EXTRA_CARD;
+ /**
+ * If tokenizing the card fails, the reason will be present.
+ */
+ public static final String REASON = Intents.EXTRA_REASON;
+ /**
+ * If the customer confirmation of saving their card is suppressed.
+ */
+ public static final String SUPPRESS_CONFIRMATION = Intents.EXTRA_SUPPRESS_CONFIRMATION;
+ /**
+ * If the pre-authorization fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReadCardRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReadCardRequestIntentBuilder.java
index af3feb577..55b06a771 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReadCardRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReadCardRequestIntentBuilder.java
@@ -58,4 +58,15 @@ public static CardOptions Instance(Set cardEntryMethods) {
return new CardOptions(cardEntryMethods);
}
}
+
+ public static class Response {
+ /**
+ * The resulting card data, such as track data and card holder information.
+ */
+ public static final String CARD_DATA = Intents.EXTRA_CARD_DATA;
+ /**
+ * If the card read fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RequestTipIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RequestTipIntentBuilder.java
index 57bbd9dce..9f3827f16 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RequestTipIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RequestTipIntentBuilder.java
@@ -70,4 +70,15 @@ public Intent build(Context context) {
return i;
}
+
+ public static class Response {
+ /**
+ * The selected tip amount.
+ */
+ public static final String TIP_AMOUNT = Intents.EXTRA_TIP_AMOUNT;
+ /**
+ * If requesting tip fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveCreditRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveCreditRequestIntentBuilder.java
index def64eff4..f7f2f0743 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveCreditRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveCreditRequestIntentBuilder.java
@@ -33,4 +33,15 @@ public Intent build(Context context) {
return i;
}
+
+ public static class Response {
+ /**
+ * The retrieved Credit object.
+ */
+ public static final String CREDIT = Intents.EXTRA_CREDIT;
+ /**
+ * If retrieving the credit fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveOpenPaymentsRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveOpenPaymentsRequestIntentBuilder.java
new file mode 100644
index 000000000..b7d26fb61
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveOpenPaymentsRequestIntentBuilder.java
@@ -0,0 +1,45 @@
+package com.clover.sdk.v3.payments.api;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+
+import com.clover.sdk.v1.Intents;
+
+/**
+ * Use the RetrieveOpenPaymentsRequestIntentBuilder class to retrieve a list of payment IDs
+ * of tip-adjustable payments.
+ */
+public class RetrieveOpenPaymentsRequestIntentBuilder extends BaseIntentBuilder {
+
+
+ /**
+ * Builder method to create an Intent to be by an Integrator POS to retrieve a list of payment IDs of tip-adjustable payments.
+ * @param context
+ * @return Android Intent to be used to retrieve a list of payment IDs of tip-adjustable payments.
+ */
+ public Intent build(Context context) {
+ if (context == null) {
+ throw new IllegalArgumentException("context must be populated with a non null value");
+ }
+ Intent i = super.build(context);
+ i.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.RetrieveOpenPaymentsRequestHandler"));
+
+ return i;
+ }
+
+ public static class Response {
+ /**
+ * If there are open payments, the retrieved payment IDs will be returned.
+ */
+ public static final String PAYMENT_IDS = Intents.EXTRA_PAYMENT_IDS;
+ /**
+ * If there are no open payments returned, the reason will be provided.
+ */
+ public static final String REASON = Intents.EXTRA_REASON;
+ /**
+ * If retrieving open payments fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
+}
\ 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 dc31434a4..28844cdf8 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
@@ -41,4 +41,23 @@ public Intent build(Context context) {
return i;
}
+
+ public static class Response {
+ /**
+ * If an external Payment ID is sent in, it will be returned.
+ */
+ public static final String EXTERNAL_PAYMENT_ID = Intents.EXTRA_EXTERNAL_PAYMENT_ID;
+ /**
+ * If a Payment ID is sent in, it will be returned.
+ */
+ public static final String PAYMENT_ID = Intents.EXTRA_PAYMENT_ID;
+ /**
+ * The retrieved payment.
+ */
+ public static final String PAYMENT = Intents.EXTRA_PAYMENT;
+ /**
+ * If retrieving the payment fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePendingPaymentsRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePendingPaymentsRequestIntentBuilder.java
index e85ec7be1..5a6526e66 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePendingPaymentsRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrievePendingPaymentsRequestIntentBuilder.java
@@ -4,6 +4,8 @@
import android.content.Context;
import android.content.Intent;
+import com.clover.sdk.v1.Intents;
+
/**
* Use the RetrievePendingPaymentsRequestIntentBuilder class to retrieve a list of pending (offline) payments
*/
@@ -28,4 +30,16 @@ public Intent build(Context context) {
return i;
}
+
+
+ public static class Response {
+ /**
+ * A list of retrieved pending payments.
+ */
+ public static final String PAYMENTS = Intents.EXTRA_PAYMENTS;
+ /**
+ * If retrieving pending payments fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveRefundRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveRefundRequestIntentBuilder.java
index fba4d04c9..b55bc6398 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveRefundRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/RetrieveRefundRequestIntentBuilder.java
@@ -33,4 +33,15 @@ public Intent build(Context context) {
return i;
}
+
+ public static class Response {
+ /**
+ * The retrieved refund.
+ */
+ public static final String REFUND = Intents.EXTRA_REFUND;
+ /**
+ * If retrieving the refund fails, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReversePaymentRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReversePaymentRequestIntentBuilder.java
index f05da92cc..1f920cb58 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReversePaymentRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/ReversePaymentRequestIntentBuilder.java
@@ -53,4 +53,28 @@ public Intent build(Context context) {
}
return i;
}
+
+ public static class Response {
+ /**
+ * The result of reversing the payment.
+ * @see ReversePaymentResult
+ */
+ public static final String REVERSE_PAYMENT_RESULT = Intents.EXTRA_REVERSE_PAYMENT_RESULT;
+ /**
+ * The ID of the payment to be reversed.
+ */
+ public static final String PAYMENT_ID = Intents.EXTRA_PAYMENT_ID;
+ /**
+ * If refunded, the resulting Refund object.
+ */
+ public static final String REFUND = Intents.EXTRA_REFUND;
+ /**
+ * If refunded, the Tender object.
+ */
+ public static final String TENDER = Intents.EXTRA_TENDER;
+ /**
+ * If reversing the payment fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/SelectReceiptRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/SelectReceiptRequestIntentBuilder.java
index f0fa889c8..18ac07ef8 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/SelectReceiptRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/SelectReceiptRequestIntentBuilder.java
@@ -288,4 +288,42 @@ public Intent build(Context context) {
return i;
}
+
+ public static class Response {
+ /**
+ * The payment the receipt was selected for.
+ */
+ public final static String PAYMENT = Intents.EXTRA_PAYMENT;
+ /**
+ * The credit the receipt was selected for.
+ */
+ public final static String CREDIT = Intents.EXTRA_CREDIT;
+ /**
+ * The refund the receipt was selected for.
+ */
+ public final static String REFUND = Intents.EXTRA_REFUND;
+ /**
+ * The customer's entered email/phone number from the customer facing receipt screen.
+ */
+ public static final String ENTERED_RECEIPT_VALUE = Intents.EXTRA_ENTERED_RECEIPT_VALUE;
+ /**
+ * The status of the customer's receipt delivery. If cloverShouldHandleReceipts is true, then it will
+ * return PROCESSED. If cloverShouldHandleReceipts is false, then it will return REQUESTED.
+ */
+ public static final String RECEIPT_DELIVERY_STATUS = Intents.EXTRA_RECEIPT_DELIVERY_STATUS;
+ /**
+ * The type of receipt requested by the customer.
+ * e.g., SMS, Email, Print, No Receipt
+ */
+ public static final String RECEIPT_DELIVERY_TYPE = Intents.EXTRA_RECEIPT_DELIVERY_TYPE;
+ /**
+ * If the customer chose to opt into marketing communication on the receipt screen.
+ */
+ public static final String OPTED_INTO_MARKETING = Intents.EXTRA_OPTED_INTO_MARKETING;
+ /**
+ * If selecting a receipt fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
+
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TipAdjustRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TipAdjustRequestIntentBuilder.java
index 709d04373..636dad4f5 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TipAdjustRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TipAdjustRequestIntentBuilder.java
@@ -80,4 +80,23 @@ public Intent build(Context context) throws IllegalArgumentException {
return i;
}
+
+ public static class Response {
+ /**
+ * If only one payment tip adjusted, the ID of the payment tip adjusted.
+ */
+ public static final String PAYMENT_ID = Intents.EXTRA_PAYMENT_ID;
+ /**
+ * If only one payment tip adjusted, the tip amount selected.
+ */
+ public static final String TIP_AMOUNT = Intents.EXTRA_TIP_AMOUNT;
+ /**
+ * A map of payment IDs and tipAmounts of payments tip adjusted.
+ */
+ public static final String TIP_AMOUNTS = Intents.EXTRA_TIP_AMOUNTS;
+ /**
+ * If tip adjusting fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TokenizeCardRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TokenizeCardRequestIntentBuilder.java
index 8b4009eb1..4db4406fa 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TokenizeCardRequestIntentBuilder.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/TokenizeCardRequestIntentBuilder.java
@@ -71,4 +71,41 @@ public static CardOptions Instance(Set cardEntryMethods) {
return new CardOptions(cardEntryMethods);
}
}
+
+
+ public static class Response {
+ /**
+ * If tokenizing the card is requested, this will return the type of Token.
+ */
+ public static final String TOKEN_TYPE = Intents.EXTRA_TOKEN_TYPE;
+ /**
+ * The token to be used for EComm transactions.
+ */
+ public static final String TOKEN = Intents.EXTRA_TOKEN;
+ /**
+ * Card information for the tokenized card. This should consist of information such as:
+ * first6, last4, expiration month, expiration year.
+ */
+ public static final String CARD = Intents.EXTRA_CARD;
+ /**
+ * If tokenizing the card fails, the reason will be present.
+ */
+ public static final String REASON = Intents.EXTRA_REASON;
+ /**
+ * If the customer confirmation of saving their card is suppressed.
+ */
+ public static final String SUPPRESS_CONFIRMATION = Intents.EXTRA_SUPPRESS_CONFIRMATION;
+ /**
+ * If legacy vault card is requested, the resulting Vaulted Card.
+ */
+ public static final String VAULTED_CARD = Intents.EXTRA_VAULTED_CARD;
+ /**
+ * If legacy vault card is requested, the resulting card data such as track data and card holder information.
+ */
+ public static final String CARD_DATA = Intents.EXTRA_CARD_DATA;
+ /**
+ * If tokenizing or vaulting the card fails for any reason, there will be a failure message sent.
+ */
+ public static final String FAILURE_MESSAGE = Intents.EXTRA_FAILURE_MESSAGE;
+ }
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/VoidPreAuthRequestIntentBuilder.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/VoidPreAuthRequestIntentBuilder.java
deleted file mode 100644
index 8f8cc6428..000000000
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/payments/api/VoidPreAuthRequestIntentBuilder.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.clover.sdk.v3.payments.api;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import com.clover.sdk.v1.Intents;
-
-public class VoidPreAuthRequestIntentBuilder extends BaseIntentBuilder {
- private String paymentId;
-
- private VoidPreAuthRequestIntentBuilder() {}
-
- public VoidPreAuthRequestIntentBuilder(String paymentId) {
- this.paymentId = paymentId;
- }
-
- public VoidPreAuthRequestIntentBuilder paymentId(String paymentId) {
- this.paymentId = paymentId;
- return this;
- }
-
- public Intent build(Context context) {
- if (context == null) {
- throw new IllegalArgumentException("Activity context must be populated with a non null value");
- }
- if (paymentId == null) {
- throw new IllegalArgumentException("paymentId must be populated with a non null value");
- }
- Intent i = super.build(context);
- i.setComponent(new ComponentName("com.clover.payment.builder.pay", "com.clover.payment.builder.pay.handler.VoidPreAuthRequestHandler"));
- i.putExtra(Intents.EXTRA_PAYMENT_ID, paymentId);
- return i;
- }
-}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByDevice.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByDevice.java
new file mode 100644
index 000000000..e181aa0b1
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByDevice.java
@@ -0,0 +1,257 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Total and details on cash added or removed from cash drawer, grouped by device
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getDevice device}
+ *
+ */
+@SuppressWarnings("all")
+public class CashAdjustmentsByDevice extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Details on cash added or removed from cash drawer for each employee
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * The device that initiated these events
+ */
+ public com.clover.sdk.v3.device.Device getDevice() {
+ return genClient.cacheGet(CacheKey.device);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.report.CashAdjustmentsByEmployee.JSON_CREATOR)),
+ device
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.device.Device.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 CashAdjustmentsByDevice() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CashAdjustmentsByDevice(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CashAdjustmentsByDevice(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 CashAdjustmentsByDevice(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 CashAdjustmentsByDevice(CashAdjustmentsByDevice 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'device' field is set and is not null */
+ public boolean isNotNullDevice() {
+ return genClient.cacheValueIsNotNull(CacheKey.device);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'device' field has been set, however the value could be null */
+ public boolean hasDevice() {
+ return genClient.cacheHasKey(CacheKey.device);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public CashAdjustmentsByDevice setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'device'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public CashAdjustmentsByDevice setDevice(com.clover.sdk.v3.device.Device device) {
+ return genClient.setRecord(device, CacheKey.device);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'device' field, the 'has' method for this field will now return false */
+ public void clearDevice() {
+ genClient.clear(CacheKey.device);
+ }
+
+
+ /**
+ * 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 CashAdjustmentsByDevice copyChanges() {
+ CashAdjustmentsByDevice copy = new CashAdjustmentsByDevice();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CashAdjustmentsByDevice src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CashAdjustmentsByDevice(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CashAdjustmentsByDevice createFromParcel(android.os.Parcel in) {
+ CashAdjustmentsByDevice instance = new CashAdjustmentsByDevice(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 CashAdjustmentsByDevice[] newArray(int size) {
+ return new CashAdjustmentsByDevice[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CashAdjustmentsByDevice.class;
+ }
+
+ @Override
+ public CashAdjustmentsByDevice create(org.json.JSONObject jsonObject) {
+ return new CashAdjustmentsByDevice(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ROWS_IS_REQUIRED = false;
+ public static final boolean DEVICE_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByEmployee.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByEmployee.java
new file mode 100644
index 000000000..6fd21ecb6
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsByEmployee.java
@@ -0,0 +1,257 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Total and details on cash added or removed from cash drawer for an employee
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getEmployee employee}
+ *
+ */
+@SuppressWarnings("all")
+public class CashAdjustmentsByEmployee extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Details on cash added or removed from cash drawer for this employee
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * The employee who performed the event
+ */
+ public com.clover.sdk.v3.employees.Employee getEmployee() {
+ return genClient.cacheGet(CacheKey.employee);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.cash.CashEvent.JSON_CREATOR)),
+ employee
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.employees.Employee.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 CashAdjustmentsByEmployee() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CashAdjustmentsByEmployee(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CashAdjustmentsByEmployee(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 CashAdjustmentsByEmployee(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 CashAdjustmentsByEmployee(CashAdjustmentsByEmployee 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'employee' field is set and is not null */
+ public boolean isNotNullEmployee() {
+ return genClient.cacheValueIsNotNull(CacheKey.employee);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'employee' field has been set, however the value could be null */
+ public boolean hasEmployee() {
+ return genClient.cacheHasKey(CacheKey.employee);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public CashAdjustmentsByEmployee setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'employee'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public CashAdjustmentsByEmployee setEmployee(com.clover.sdk.v3.employees.Employee employee) {
+ return genClient.setRecord(employee, CacheKey.employee);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'employee' field, the 'has' method for this field will now return false */
+ public void clearEmployee() {
+ genClient.clear(CacheKey.employee);
+ }
+
+
+ /**
+ * 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 CashAdjustmentsByEmployee copyChanges() {
+ CashAdjustmentsByEmployee copy = new CashAdjustmentsByEmployee();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CashAdjustmentsByEmployee src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CashAdjustmentsByEmployee(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CashAdjustmentsByEmployee createFromParcel(android.os.Parcel in) {
+ CashAdjustmentsByEmployee instance = new CashAdjustmentsByEmployee(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 CashAdjustmentsByEmployee[] newArray(int size) {
+ return new CashAdjustmentsByEmployee[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CashAdjustmentsByEmployee.class;
+ }
+
+ @Override
+ public CashAdjustmentsByEmployee create(org.json.JSONObject jsonObject) {
+ return new CashAdjustmentsByEmployee(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ROWS_IS_REQUIRED = false;
+ public static final boolean EMPLOYEE_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsDeviceGroups.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsDeviceGroups.java
new file mode 100644
index 000000000..ee752eeb5
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/CashAdjustmentsDeviceGroups.java
@@ -0,0 +1,255 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Total and details on cash added or removed from cash drawer, grouped by device
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getTotal total}
+ *
+ */
+@SuppressWarnings("all")
+public class CashAdjustmentsDeviceGroups extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Details on cash added or removed from cash drawer, grouped by device
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * Total of cash added or removed from the drawer in the cash adjustments section
+ */
+ public java.lang.Long getTotal() {
+ return genClient.cacheGet(CacheKey.total);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.report.CashAdjustmentsByDevice.JSON_CREATOR)),
+ total
+ (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 CashAdjustmentsDeviceGroups() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected CashAdjustmentsDeviceGroups(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public CashAdjustmentsDeviceGroups(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 CashAdjustmentsDeviceGroups(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 CashAdjustmentsDeviceGroups(CashAdjustmentsDeviceGroups 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'total' field is set and is not null */
+ public boolean isNotNullTotal() {
+ return genClient.cacheValueIsNotNull(CacheKey.total);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'total' field has been set, however the value could be null */
+ public boolean hasTotal() {
+ return genClient.cacheHasKey(CacheKey.total);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public CashAdjustmentsDeviceGroups setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'total'.
+ */
+ public CashAdjustmentsDeviceGroups setTotal(java.lang.Long total) {
+ return genClient.setOther(total, CacheKey.total);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'total' field, the 'has' method for this field will now return false */
+ public void clearTotal() {
+ genClient.clear(CacheKey.total);
+ }
+
+
+ /**
+ * 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 CashAdjustmentsDeviceGroups copyChanges() {
+ CashAdjustmentsDeviceGroups copy = new CashAdjustmentsDeviceGroups();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(CashAdjustmentsDeviceGroups src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new CashAdjustmentsDeviceGroups(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public CashAdjustmentsDeviceGroups createFromParcel(android.os.Parcel in) {
+ CashAdjustmentsDeviceGroups instance = new CashAdjustmentsDeviceGroups(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 CashAdjustmentsDeviceGroups[] newArray(int size) {
+ return new CashAdjustmentsDeviceGroups[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return CashAdjustmentsDeviceGroups.class;
+ }
+
+ @Override
+ public CashAdjustmentsDeviceGroups create(org.json.JSONObject jsonObject) {
+ return new CashAdjustmentsDeviceGroups(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ROWS_IS_REQUIRED = false;
+ public static final boolean TOTAL_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummary.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummary.java
new file mode 100644
index 000000000..75ce4c96a
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummary.java
@@ -0,0 +1,378 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Summary of each type of service charge or additional charge.
+ *
+ *
Fields
+ *
+ *
{@link #getStartTimestamp startTimestamp}
+ *
{@link #getType type}
+ *
{@link #getAmount amount}
+ *
{@link #getAmountCollected amountCollected}
+ *
{@link #getNumOrders numOrders}
+ *
{@link #getName name}
+ *
+ */
+@SuppressWarnings("all")
+public class ChargeSummary extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Beginning of the time period for this summary.
+ */
+ public java.lang.Long getStartTimestamp() {
+ return genClient.cacheGet(CacheKey.startTimestamp);
+ }
+
+ /**
+ * The type of additional charge.
+ */
+ public java.lang.String getType() {
+ return genClient.cacheGet(CacheKey.type);
+ }
+
+ /**
+ * Amount of service charge owed and amount of additional charge paid minus the amount of all charges refunded, excluding any amount of service charge refunded that was later repaid.
+ */
+ public java.lang.Long getAmount() {
+ return genClient.cacheGet(CacheKey.amount);
+ }
+
+ /**
+ * Amount of all charges paid minus the amount of all charges refunded, excluding any amount of service charge refunded that was later repaid.
+ */
+ public java.lang.Long getAmountCollected() {
+ return genClient.cacheGet(CacheKey.amountCollected);
+ }
+
+ /**
+ * Number of orders that the charges apply to.
+ */
+ public java.lang.Integer getNumOrders() {
+ return genClient.cacheGet(CacheKey.numOrders);
+ }
+
+ /**
+ * Used for identifying the name of the order fee as set by the merchant.
+ */
+ public java.lang.String getName() {
+ return genClient.cacheGet(CacheKey.name);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ startTimestamp
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ type
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
+ amount
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ amountCollected
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ numOrders
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
+ name
+ (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 ChargeSummary() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected ChargeSummary(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public ChargeSummary(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 ChargeSummary(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 ChargeSummary(ChargeSummary 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 'startTimestamp' field is set and is not null */
+ public boolean isNotNullStartTimestamp() {
+ return genClient.cacheValueIsNotNull(CacheKey.startTimestamp);
+ }
+
+ /** Checks whether the 'type' field is set and is not null */
+ public boolean isNotNullType() {
+ return genClient.cacheValueIsNotNull(CacheKey.type);
+ }
+
+ /** Checks whether the 'amount' field is set and is not null */
+ public boolean isNotNullAmount() {
+ return genClient.cacheValueIsNotNull(CacheKey.amount);
+ }
+
+ /** Checks whether the 'amountCollected' field is set and is not null */
+ public boolean isNotNullAmountCollected() {
+ return genClient.cacheValueIsNotNull(CacheKey.amountCollected);
+ }
+
+ /** Checks whether the 'numOrders' field is set and is not null */
+ public boolean isNotNullNumOrders() {
+ return genClient.cacheValueIsNotNull(CacheKey.numOrders);
+ }
+
+ /** Checks whether the 'name' field is set and is not null */
+ public boolean isNotNullName() {
+ return genClient.cacheValueIsNotNull(CacheKey.name);
+ }
+
+
+
+ /** Checks whether the 'startTimestamp' field has been set, however the value could be null */
+ public boolean hasStartTimestamp() {
+ return genClient.cacheHasKey(CacheKey.startTimestamp);
+ }
+
+ /** Checks whether the 'type' field has been set, however the value could be null */
+ public boolean hasType() {
+ return genClient.cacheHasKey(CacheKey.type);
+ }
+
+ /** 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 'amountCollected' field has been set, however the value could be null */
+ public boolean hasAmountCollected() {
+ return genClient.cacheHasKey(CacheKey.amountCollected);
+ }
+
+ /** Checks whether the 'numOrders' field has been set, however the value could be null */
+ public boolean hasNumOrders() {
+ return genClient.cacheHasKey(CacheKey.numOrders);
+ }
+
+ /** Checks whether the 'name' field has been set, however the value could be null */
+ public boolean hasName() {
+ return genClient.cacheHasKey(CacheKey.name);
+ }
+
+
+ /**
+ * Sets the field 'startTimestamp'.
+ */
+ public ChargeSummary setStartTimestamp(java.lang.Long startTimestamp) {
+ return genClient.setOther(startTimestamp, CacheKey.startTimestamp);
+ }
+
+ /**
+ * Sets the field 'type'.
+ */
+ public ChargeSummary setType(java.lang.String type) {
+ return genClient.setOther(type, CacheKey.type);
+ }
+
+ /**
+ * Sets the field 'amount'.
+ */
+ public ChargeSummary setAmount(java.lang.Long amount) {
+ return genClient.setOther(amount, CacheKey.amount);
+ }
+
+ /**
+ * Sets the field 'amountCollected'.
+ */
+ public ChargeSummary setAmountCollected(java.lang.Long amountCollected) {
+ return genClient.setOther(amountCollected, CacheKey.amountCollected);
+ }
+
+ /**
+ * Sets the field 'numOrders'.
+ */
+ public ChargeSummary setNumOrders(java.lang.Integer numOrders) {
+ return genClient.setOther(numOrders, CacheKey.numOrders);
+ }
+
+ /**
+ * Sets the field 'name'.
+ */
+ public ChargeSummary setName(java.lang.String name) {
+ return genClient.setOther(name, CacheKey.name);
+ }
+
+
+ /** Clears the 'startTimestamp' field, the 'has' method for this field will now return false */
+ public void clearStartTimestamp() {
+ genClient.clear(CacheKey.startTimestamp);
+ }
+ /** Clears the 'type' field, the 'has' method for this field will now return false */
+ public void clearType() {
+ genClient.clear(CacheKey.type);
+ }
+ /** Clears the 'amount' field, the 'has' method for this field will now return false */
+ public void clearAmount() {
+ genClient.clear(CacheKey.amount);
+ }
+ /** Clears the 'amountCollected' field, the 'has' method for this field will now return false */
+ public void clearAmountCollected() {
+ genClient.clear(CacheKey.amountCollected);
+ }
+ /** Clears the 'numOrders' field, the 'has' method for this field will now return false */
+ public void clearNumOrders() {
+ genClient.clear(CacheKey.numOrders);
+ }
+ /** Clears the 'name' field, the 'has' method for this field will now return false */
+ public void clearName() {
+ genClient.clear(CacheKey.name);
+ }
+
+
+ /**
+ * 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 ChargeSummary copyChanges() {
+ ChargeSummary copy = new ChargeSummary();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(ChargeSummary src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new ChargeSummary(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public ChargeSummary createFromParcel(android.os.Parcel in) {
+ ChargeSummary instance = new ChargeSummary(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 ChargeSummary[] newArray(int size) {
+ return new ChargeSummary[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return ChargeSummary.class;
+ }
+
+ @Override
+ public ChargeSummary create(org.json.JSONObject jsonObject) {
+ return new ChargeSummary(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean STARTTIMESTAMP_IS_REQUIRED = false;
+ public static final boolean TYPE_IS_REQUIRED = false;
+ public static final boolean AMOUNT_IS_REQUIRED = false;
+ public static final boolean AMOUNTCOLLECTED_IS_REQUIRED = false;
+ public static final boolean NUMORDERS_IS_REQUIRED = false;
+ public static final boolean NAME_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummarySection.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummarySection.java
new file mode 100644
index 000000000..2f1007aa8
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ChargeSummarySection.java
@@ -0,0 +1,257 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ * Combines a collection of charge rows with a total.
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getTotal total}
+ *
+ */
+@SuppressWarnings("all")
+public class ChargeSummarySection extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Summary of each type of service charge or additional charge.
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * The sum of the above rows.
+ */
+ public com.clover.sdk.v3.report.ChargeSummary getTotal() {
+ return genClient.cacheGet(CacheKey.total);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.report.ChargeSummary.JSON_CREATOR)),
+ total
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.report.ChargeSummary.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 ChargeSummarySection() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected ChargeSummarySection(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public ChargeSummarySection(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 ChargeSummarySection(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 ChargeSummarySection(ChargeSummarySection 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'total' field is set and is not null */
+ public boolean isNotNullTotal() {
+ return genClient.cacheValueIsNotNull(CacheKey.total);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'total' field has been set, however the value could be null */
+ public boolean hasTotal() {
+ return genClient.cacheHasKey(CacheKey.total);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public ChargeSummarySection setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'total'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public ChargeSummarySection setTotal(com.clover.sdk.v3.report.ChargeSummary total) {
+ return genClient.setRecord(total, CacheKey.total);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'total' field, the 'has' method for this field will now return false */
+ public void clearTotal() {
+ genClient.clear(CacheKey.total);
+ }
+
+
+ /**
+ * 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 ChargeSummarySection copyChanges() {
+ ChargeSummarySection copy = new ChargeSummarySection();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(ChargeSummarySection src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new ChargeSummarySection(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public ChargeSummarySection createFromParcel(android.os.Parcel in) {
+ ChargeSummarySection instance = new ChargeSummarySection(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 ChargeSummarySection[] newArray(int size) {
+ return new ChargeSummarySection[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return ChargeSummarySection.class;
+ }
+
+ @Override
+ public ChargeSummarySection create(org.json.JSONObject jsonObject) {
+ return new ChargeSummarySection(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ROWS_IS_REQUIRED = false;
+ public static final boolean TOTAL_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ComparisonType.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ComparisonType.java
new file mode 100644
index 000000000..8c7343400
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/ComparisonType.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.report;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+
+/**
+ * This is an auto-generated Clover data enum.
+ */
+@SuppressWarnings("all")
+public enum ComparisonType implements Parcelable {
+ PREVIOUS_PERIOD, SAME_PERIOD_LAST_WEEK, SAME_PERIOD_LAST_MONTH, SAME_PERIOD_LAST_YEAR, NO_COMPARISON;
+
+ @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 ComparisonType createFromParcel(final Parcel source) {
+ return ComparisonType.valueOf(source.readString());
+ }
+
+ @Override
+ public ComparisonType[] newArray(final int size) {
+ return new ComparisonType[size];
+ }
+ };
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSection.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSection.java
new file mode 100644
index 000000000..8d7850b29
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSection.java
@@ -0,0 +1,255 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getTotal total}
+ *
+ */
+@SuppressWarnings("all")
+public class DeviceCashSection extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Detail on every cash event in the Device Cash Summary section
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * Total of cash sales, cash back and adjustments to cash drawer in the device cash section
+ */
+ public com.clover.sdk.v3.report.DeviceCashSummaryRow getTotal() {
+ return genClient.cacheGet(CacheKey.total);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.report.DeviceCashSummaryRow.JSON_CREATOR)),
+ total
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.report.DeviceCashSummaryRow.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 DeviceCashSection() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected DeviceCashSection(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public DeviceCashSection(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 DeviceCashSection(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 DeviceCashSection(DeviceCashSection 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'total' field is set and is not null */
+ public boolean isNotNullTotal() {
+ return genClient.cacheValueIsNotNull(CacheKey.total);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'total' field has been set, however the value could be null */
+ public boolean hasTotal() {
+ return genClient.cacheHasKey(CacheKey.total);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public DeviceCashSection setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'total'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public DeviceCashSection setTotal(com.clover.sdk.v3.report.DeviceCashSummaryRow total) {
+ return genClient.setRecord(total, CacheKey.total);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'total' field, the 'has' method for this field will now return false */
+ public void clearTotal() {
+ genClient.clear(CacheKey.total);
+ }
+
+
+ /**
+ * 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 DeviceCashSection copyChanges() {
+ DeviceCashSection copy = new DeviceCashSection();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(DeviceCashSection src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new DeviceCashSection(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public DeviceCashSection createFromParcel(android.os.Parcel in) {
+ DeviceCashSection instance = new DeviceCashSection(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 DeviceCashSection[] newArray(int size) {
+ return new DeviceCashSection[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator JSON_CREATOR = new com.clover.sdk.JSONifiable.Creator() {
+ public Class getCreatedClass() {
+ return DeviceCashSection.class;
+ }
+
+ @Override
+ public DeviceCashSection create(org.json.JSONObject jsonObject) {
+ return new DeviceCashSection(jsonObject);
+ }
+ };
+
+ public interface Constraints {
+ public static final boolean ROWS_IS_REQUIRED = false;
+ public static final boolean TOTAL_IS_REQUIRED = false;
+ }
+
+}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSummaryRow.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSummaryRow.java
index 423c36259..bfc678d2f 100644
--- a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSummaryRow.java
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DeviceCashSummaryRow.java
@@ -42,6 +42,7 @@
*
{@link #getNet net}
*
{@link #getNetTips netTips}
*
{@link #getExpectedDeposit expectedDeposit}
+ *
{@link #getQuantity quantity}
*
*/
@SuppressWarnings("all")
@@ -50,7 +51,7 @@ public class DeviceCashSummaryRow extends GenericParcelable implements com.clove
/**
* The device that this summary is for. For the total row, this field will be null. A 128-bit UUID, not a normal base-13 Clover ID.
*/
- public com.clover.sdk.v3.base.Reference getDevice() {
+ public com.clover.sdk.v3.device.Device getDevice() {
return genClient.cacheGet(CacheKey.device);
}
@@ -117,12 +118,19 @@ public java.lang.Long getExpectedDeposit() {
return genClient.cacheGet(CacheKey.expectedDeposit);
}
+ /**
+ * Count of how many relevant cash activities appeared in the period.
+ */
+ public java.lang.Integer getQuantity() {
+ return genClient.cacheGet(CacheKey.quantity);
+ }
+
private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
device
- (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.base.Reference.JSON_CREATOR)),
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.device.Device.JSON_CREATOR)),
cashSalesAmount
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
cashPaymentAmount
@@ -141,6 +149,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
expectedDeposit
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Long.class)),
+ quantity
+ (com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
;
private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
@@ -265,6 +275,11 @@ public boolean isNotNullExpectedDeposit() {
return genClient.cacheValueIsNotNull(CacheKey.expectedDeposit);
}
+ /** Checks whether the 'quantity' field is set and is not null */
+ public boolean isNotNullQuantity() {
+ return genClient.cacheValueIsNotNull(CacheKey.quantity);
+ }
+
/** Checks whether the 'device' field has been set, however the value could be null */
@@ -317,13 +332,18 @@ public boolean hasExpectedDeposit() {
return genClient.cacheHasKey(CacheKey.expectedDeposit);
}
+ /** Checks whether the 'quantity' field has been set, however the value could be null */
+ public boolean hasQuantity() {
+ return genClient.cacheHasKey(CacheKey.quantity);
+ }
+
/**
* Sets the field 'device'.
*
* The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
*/
- public DeviceCashSummaryRow setDevice(com.clover.sdk.v3.base.Reference device) {
+ public DeviceCashSummaryRow setDevice(com.clover.sdk.v3.device.Device device) {
return genClient.setRecord(device, CacheKey.device);
}
@@ -390,6 +410,13 @@ public DeviceCashSummaryRow setExpectedDeposit(java.lang.Long expectedDeposit) {
return genClient.setOther(expectedDeposit, CacheKey.expectedDeposit);
}
+ /**
+ * Sets the field 'quantity'.
+ */
+ public DeviceCashSummaryRow setQuantity(java.lang.Integer quantity) {
+ return genClient.setOther(quantity, CacheKey.quantity);
+ }
+
/** Clears the 'device' field, the 'has' method for this field will now return false */
public void clearDevice() {
@@ -431,6 +458,10 @@ public void clearNetTips() {
public void clearExpectedDeposit() {
genClient.clear(CacheKey.expectedDeposit);
}
+ /** Clears the 'quantity' field, the 'has' method for this field will now return false */
+ public void clearQuantity() {
+ genClient.clear(CacheKey.quantity);
+ }
/**
@@ -503,6 +534,7 @@ public interface Constraints {
public static final boolean NET_IS_REQUIRED = false;
public static final boolean NETTIPS_IS_REQUIRED = false;
public static final boolean EXPECTEDDEPOSIT_IS_REQUIRED = false;
+ public static final boolean QUANTITY_IS_REQUIRED = false;
}
}
diff --git a/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DynamicCurrencyConversionSection.java b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DynamicCurrencyConversionSection.java
new file mode 100644
index 000000000..725c6589b
--- /dev/null
+++ b/clover-android-sdk/src/main/java/com/clover/sdk/v3/report/DynamicCurrencyConversionSection.java
@@ -0,0 +1,255 @@
+/**
+ * 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.report;
+
+import com.clover.sdk.GenericClient;
+import com.clover.sdk.GenericParcelable;
+
+/**
+ * This is an auto-generated Clover data object.
+ *
+ *
Fields
+ *
+ *
{@link #getRows rows}
+ *
{@link #getLocalCurrencyTotal localCurrencyTotal}
+ *
+ */
+@SuppressWarnings("all")
+public class DynamicCurrencyConversionSection extends GenericParcelable implements com.clover.sdk.v3.Validator, com.clover.sdk.JSONifiable {
+
+ /**
+ * Summary for each foreign currency that has an associated payment in the report period
+ */
+ public java.util.List getRows() {
+ return genClient.cacheGet(CacheKey.rows);
+ }
+
+ /**
+ * Total of dynamic currency conversion expressed in local currency
+ */
+ public com.clover.sdk.v3.report.ReportPaymentsV2Row getLocalCurrencyTotal() {
+ return genClient.cacheGet(CacheKey.localCurrencyTotal);
+ }
+
+
+
+
+ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
+ rows
+ (com.clover.sdk.extractors.RecordListExtractionStrategy.instance(com.clover.sdk.v3.report.DynamicCurrencyConversionSummaryRow.JSON_CREATOR)),
+ localCurrencyTotal
+ (com.clover.sdk.extractors.RecordExtractionStrategy.instance(com.clover.sdk.v3.report.ReportPaymentsV2Row.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 DynamicCurrencyConversionSection() {
+ genClient = new GenericClient(this);
+ }
+
+ @Override
+ protected GenericClient getGenericClient() {
+ return genClient;
+ }
+
+ /**
+ * Constructs a new empty instance.
+ */
+ protected DynamicCurrencyConversionSection(boolean noInit) {
+ genClient = null;
+ }
+
+ /**
+ * Constructs a new instance from the given JSON String.
+ */
+ public DynamicCurrencyConversionSection(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 DynamicCurrencyConversionSection(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 DynamicCurrencyConversionSection(DynamicCurrencyConversionSection 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 'rows' field is set and is not null */
+ public boolean isNotNullRows() {
+ return genClient.cacheValueIsNotNull(CacheKey.rows);
+ }
+
+ /** Checks whether the 'rows' field is set and is not null and is not empty */
+ public boolean isNotEmptyRows() { return isNotNullRows() && !getRows().isEmpty(); }
+
+ /** Checks whether the 'localCurrencyTotal' field is set and is not null */
+ public boolean isNotNullLocalCurrencyTotal() {
+ return genClient.cacheValueIsNotNull(CacheKey.localCurrencyTotal);
+ }
+
+
+
+ /** Checks whether the 'rows' field has been set, however the value could be null */
+ public boolean hasRows() {
+ return genClient.cacheHasKey(CacheKey.rows);
+ }
+
+ /** Checks whether the 'localCurrencyTotal' field has been set, however the value could be null */
+ public boolean hasLocalCurrencyTotal() {
+ return genClient.cacheHasKey(CacheKey.localCurrencyTotal);
+ }
+
+
+ /**
+ * Sets the field 'rows'.
+ *
+ * Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
+ */
+ public DynamicCurrencyConversionSection setRows(java.util.List rows) {
+ return genClient.setArrayRecord(rows, CacheKey.rows);
+ }
+
+ /**
+ * Sets the field 'localCurrencyTotal'.
+ *
+ * The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
+ */
+ public DynamicCurrencyConversionSection setLocalCurrencyTotal(com.clover.sdk.v3.report.ReportPaymentsV2Row localCurrencyTotal) {
+ return genClient.setRecord(localCurrencyTotal, CacheKey.localCurrencyTotal);
+ }
+
+
+ /** Clears the 'rows' field, the 'has' method for this field will now return false */
+ public void clearRows() {
+ genClient.clear(CacheKey.rows);
+ }
+ /** Clears the 'localCurrencyTotal' field, the 'has' method for this field will now return false */
+ public void clearLocalCurrencyTotal() {
+ genClient.clear(CacheKey.localCurrencyTotal);
+ }
+
+
+ /**
+ * 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 DynamicCurrencyConversionSection copyChanges() {
+ DynamicCurrencyConversionSection copy = new DynamicCurrencyConversionSection();
+ copy.mergeChanges(this);
+ copy.resetChangeLog();
+ return copy;
+ }
+
+ /**
+ * Copy all the changed fields from the given source to this instance.
+ */
+ public void mergeChanges(DynamicCurrencyConversionSection src) {
+ if (src.genClient.getChangeLog() != null) {
+ genClient.mergeChanges(new DynamicCurrencyConversionSection(src).getJSONObject(), src.genClient);
+ }
+ }
+
+ public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() {
+ @Override
+ public DynamicCurrencyConversionSection createFromParcel(android.os.Parcel in) {
+ DynamicCurrencyConversionSection instance = new DynamicCurrencyConversionSection(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 DynamicCurrencyConversionSection[] newArray(int size) {
+ return new DynamicCurrencyConversionSection[size];
+ }
+ };
+
+ public static final com.clover.sdk.JSONifiable.Creator