Package com.clover.sdk.v3.payments
Class PurchaseCardL3
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.payments.PurchaseCardL3
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class PurchaseCardL3 extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PurchaseCardL3.Constraints
-
Nested classes/interfaces inherited from interface com.clover.sdk.JSONifiable
JSONifiable.Creator<T>
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<PurchaseCardL3>
CREATOR
static JSONifiable.Creator<PurchaseCardL3>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description PurchaseCardL3()
Constructs a new empty instance.protected
PurchaseCardL3(boolean noInit)
Constructs a new empty instance.PurchaseCardL3(PurchaseCardL3 src)
Constructs a new instance that is a deep copy of the source instance.PurchaseCardL3(String json)
Constructs a new instance from the given JSON String.PurchaseCardL3(JSONObject jsonObject)
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearLevel3LineItems()
Clears the 'level3LineItems' field, the 'has' method for this field will now return falsevoid
clearMagneticStripeInd()
Clears the 'magneticStripeInd' field, the 'has' method for this field will now return falsevoid
clearServiceCode()
Clears the 'serviceCode' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.PurchaseCardL3
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.protected GenericClient
getGenericClient()
JSONObject
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.List<Level3LineItem>
getLevel3LineItems()
List of line items constituting the order using Level3 Purchase cardBoolean
getMagneticStripeInd()
If the card was swiped via magnetic strip reader for payment, set this indicator true.String
getServiceCode()
Service code extracted from the track data in Field 35.boolean
hasLevel3LineItems()
Checks whether the 'level3LineItems' field has been set, however the value could be nullboolean
hasMagneticStripeInd()
Checks whether the 'magneticStripeInd' field has been set, however the value could be nullboolean
hasServiceCode()
Checks whether the 'serviceCode' field has been set, however the value could be nullboolean
isNotEmptyLevel3LineItems()
Checks whether the 'level3LineItems' field is set and is not null and is not emptyboolean
isNotNullLevel3LineItems()
Checks whether the 'level3LineItems' field is set and is not nullboolean
isNotNullMagneticStripeInd()
Checks whether the 'magneticStripeInd' field is set and is not nullboolean
isNotNullServiceCode()
Checks whether the 'serviceCode' field is set and is not nullvoid
mergeChanges(PurchaseCardL3 src)
Copy all the changed fields from the given source to this instance.void
resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.PurchaseCardL3
setLevel3LineItems(List<Level3LineItem> level3LineItems)
Sets the field 'level3LineItems'.PurchaseCardL3
setMagneticStripeInd(Boolean magneticStripeInd)
Sets the field 'magneticStripeInd'.PurchaseCardL3
setServiceCode(String serviceCode)
Sets the field 'serviceCode'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<PurchaseCardL3> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<PurchaseCardL3> JSON_CREATOR
-
-
Constructor Detail
-
PurchaseCardL3
public PurchaseCardL3()
Constructs a new empty instance.
-
PurchaseCardL3
protected PurchaseCardL3(boolean noInit)
Constructs a new empty instance.
-
PurchaseCardL3
public PurchaseCardL3(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
PurchaseCardL3
public PurchaseCardL3(JSONObject jsonObject)
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.
-
PurchaseCardL3
public PurchaseCardL3(PurchaseCardL3 src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getServiceCode
public String getServiceCode()
Service code extracted from the track data in Field 35. For all card types, Service code is mandatory for all merchants who directly settle through First Data.
-
getMagneticStripeInd
public Boolean getMagneticStripeInd()
If the card was swiped via magnetic strip reader for payment, set this indicator true. Also serviceCode will be mandatory if this is true
-
getLevel3LineItems
public List<Level3LineItem> getLevel3LineItems()
List of line items constituting the order using Level3 Purchase card
-
getGenericClient
protected GenericClient getGenericClient()
- Specified by:
getGenericClient
in classGenericParcelable
-
getJSONObject
public JSONObject 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.- Specified by:
getJSONObject
in interfaceJSONifiable
-
isNotNullServiceCode
public boolean isNotNullServiceCode()
Checks whether the 'serviceCode' field is set and is not null
-
isNotNullMagneticStripeInd
public boolean isNotNullMagneticStripeInd()
Checks whether the 'magneticStripeInd' field is set and is not null
-
isNotNullLevel3LineItems
public boolean isNotNullLevel3LineItems()
Checks whether the 'level3LineItems' field is set and is not null
-
isNotEmptyLevel3LineItems
public boolean isNotEmptyLevel3LineItems()
Checks whether the 'level3LineItems' field is set and is not null and is not empty
-
hasServiceCode
public boolean hasServiceCode()
Checks whether the 'serviceCode' field has been set, however the value could be null
-
hasMagneticStripeInd
public boolean hasMagneticStripeInd()
Checks whether the 'magneticStripeInd' field has been set, however the value could be null
-
hasLevel3LineItems
public boolean hasLevel3LineItems()
Checks whether the 'level3LineItems' field has been set, however the value could be null
-
setServiceCode
public PurchaseCardL3 setServiceCode(String serviceCode)
Sets the field 'serviceCode'.
-
setMagneticStripeInd
public PurchaseCardL3 setMagneticStripeInd(Boolean magneticStripeInd)
Sets the field 'magneticStripeInd'.
-
setLevel3LineItems
public PurchaseCardL3 setLevel3LineItems(List<Level3LineItem> level3LineItems)
Sets the field 'level3LineItems'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
clearServiceCode
public void clearServiceCode()
Clears the 'serviceCode' field, the 'has' method for this field will now return false
-
clearMagneticStripeInd
public void clearMagneticStripeInd()
Clears the 'magneticStripeInd' field, the 'has' method for this field will now return false
-
clearLevel3LineItems
public void clearLevel3LineItems()
Clears the 'level3LineItems' field, the 'has' method for this field will now return false
-
containsChanges
public boolean containsChanges()
Returns true if this instance has any changes.
-
resetChangeLog
public void resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
-
copyChanges
public PurchaseCardL3 copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(PurchaseCardL3 src)
Copy all the changed fields from the given source to this instance.
-
-