Class Credit

    • Constructor Detail

      • Credit

        public Credit()
        Constructs a new empty instance.
      • Credit

        protected Credit​(boolean noInit)
        Constructs a new empty instance.
      • Credit

        public Credit​(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.
      • Credit

        public Credit​(Credit src)
        Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
    • Method Detail

      • getId

        public String getId()
        Unique identifier
      • getOrderRef

        public Reference getOrderRef()
        The order with which the credit is associated
      • getDevice

        public Reference getDevice()
        Device which processed this credit, a 128-bit UUID, not a normal base-13 Clover ID.
      • getTender

        public Tender getTender()
        The tender type associated with this payment, e.g. credit card, cash, etc.
      • getEmployee

        public Reference getEmployee()
        The employee who processed the payment
      • getCustomers

        public Customer getCustomers()
        Customer who received the credit/refund
      • getAmount

        public Long getAmount()
        Amount paid
      • getTaxAmount

        public Long getTaxAmount()
        Amount paid in tax
      • getCreatedTime

        public Long getCreatedTime()
        Time payment was recorded on server
      • getClientCreatedTime

        public Long getClientCreatedTime()
      • getCardTransaction

        public CardTransaction getCardTransaction()
        Information about the card used for credit/debit card payments
      • getVoided

        public Boolean getVoided()
      • getVoidReason

        public String getVoidReason()
      • getDccInfo

        public DCCInfo getDccInfo()
        Dynamic Currency Conversion information
      • getTransactionSettings

        public TransactionSettings getTransactionSettings()
        Per transaction settings for the payment
      • getGermanInfo

        public GermanInfo getGermanInfo()
        German region-specific information
      • getAppTracking

        public AppTracking getAppTracking()
        Tracking information for the app that created this credit.
      • getResult

        public Result getResult()
      • getReason

        public String getReason()
        Reason why the credit was initiated
      • getTransactionInfo

        public TransactionInfo getTransactionInfo()
        Transaction information
      • getMerchant

        public Reference getMerchant()
      • getExternalReferenceId

        public String getExternalReferenceId()
        The external reference id if associated with the credit
      • 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 interface JSONifiable
      • isNotNullId

        public boolean isNotNullId()
        Checks whether the 'id' field is set and is not null
      • isNotNullOrderRef

        public boolean isNotNullOrderRef()
        Checks whether the 'orderRef' field is set and is not null
      • isNotNullDevice

        public boolean isNotNullDevice()
        Checks whether the 'device' field is set and is not null
      • isNotNullTender

        public boolean isNotNullTender()
        Checks whether the 'tender' field is set and is not null
      • isNotNullEmployee

        public boolean isNotNullEmployee()
        Checks whether the 'employee' field is set and is not null
      • isNotNullCustomers

        public boolean isNotNullCustomers()
        Checks whether the 'customers' field is set and is not null
      • isNotNullAmount

        public boolean isNotNullAmount()
        Checks whether the 'amount' field is set and is not null
      • isNotNullTaxAmount

        public boolean isNotNullTaxAmount()
        Checks whether the 'taxAmount' field is set and is not null
      • isNotNullTaxRates

        public boolean isNotNullTaxRates()
        Checks whether the 'taxRates' field is set and is not null
      • isNotEmptyTaxRates

        public boolean isNotEmptyTaxRates()
        Checks whether the 'taxRates' field is set and is not null and is not empty
      • isNotNullCreatedTime

        public boolean isNotNullCreatedTime()
        Checks whether the 'createdTime' field is set and is not null
      • isNotNullClientCreatedTime

        public boolean isNotNullClientCreatedTime()
        Checks whether the 'clientCreatedTime' field is set and is not null
      • isNotNullCardTransaction

        public boolean isNotNullCardTransaction()
        Checks whether the 'cardTransaction' field is set and is not null
      • isNotNullVoided

        public boolean isNotNullVoided()
        Checks whether the 'voided' field is set and is not null
      • isNotNullVoidReason

        public boolean isNotNullVoidReason()
        Checks whether the 'voidReason' field is set and is not null
      • isNotNullDccInfo

        public boolean isNotNullDccInfo()
        Checks whether the 'dccInfo' field is set and is not null
      • isNotNullTransactionSettings

        public boolean isNotNullTransactionSettings()
        Checks whether the 'transactionSettings' field is set and is not null
      • isNotNullCreditRefunds

        public boolean isNotNullCreditRefunds()
        Checks whether the 'creditRefunds' field is set and is not null
      • isNotEmptyCreditRefunds

        public boolean isNotEmptyCreditRefunds()
        Checks whether the 'creditRefunds' field is set and is not null and is not empty
      • isNotNullGermanInfo

        public boolean isNotNullGermanInfo()
        Checks whether the 'germanInfo' field is set and is not null
      • isNotNullAppTracking

        public boolean isNotNullAppTracking()
        Checks whether the 'appTracking' field is set and is not null
      • isNotNullResult

        public boolean isNotNullResult()
        Checks whether the 'result' field is set and is not null
      • isNotNullReason

        public boolean isNotNullReason()
        Checks whether the 'reason' field is set and is not null
      • isNotNullTransactionInfo

        public boolean isNotNullTransactionInfo()
        Checks whether the 'transactionInfo' field is set and is not null
      • isNotNullMerchant

        public boolean isNotNullMerchant()
        Checks whether the 'merchant' field is set and is not null
      • isNotNullExternalReferenceId

        public boolean isNotNullExternalReferenceId()
        Checks whether the 'externalReferenceId' field is set and is not null
      • isNotNullCreditAttributes

        public boolean isNotNullCreditAttributes()
        Checks whether the 'creditAttributes' field is set and is not null
      • isNotEmptyCreditAttributes

        public boolean isNotEmptyCreditAttributes()
        Checks whether the 'creditAttributes' field is set and is not null and is not empty
      • hasId

        public boolean hasId()
        Checks whether the 'id' field has been set, however the value could be null
      • hasOrderRef

        public boolean hasOrderRef()
        Checks whether the 'orderRef' field has been set, however the value could be null
      • hasDevice

        public boolean hasDevice()
        Checks whether the 'device' field has been set, however the value could be null
      • hasTender

        public boolean hasTender()
        Checks whether the 'tender' field has been set, however the value could be null
      • hasEmployee

        public boolean hasEmployee()
        Checks whether the 'employee' field has been set, however the value could be null
      • hasCustomers

        public boolean hasCustomers()
        Checks whether the 'customers' field has been set, however the value could be null
      • hasAmount

        public boolean hasAmount()
        Checks whether the 'amount' field has been set, however the value could be null
      • hasTaxAmount

        public boolean hasTaxAmount()
        Checks whether the 'taxAmount' field has been set, however the value could be null
      • hasTaxRates

        public boolean hasTaxRates()
        Checks whether the 'taxRates' field has been set, however the value could be null
      • hasCreatedTime

        public boolean hasCreatedTime()
        Checks whether the 'createdTime' field has been set, however the value could be null
      • hasClientCreatedTime

        public boolean hasClientCreatedTime()
        Checks whether the 'clientCreatedTime' field has been set, however the value could be null
      • hasCardTransaction

        public boolean hasCardTransaction()
        Checks whether the 'cardTransaction' field has been set, however the value could be null
      • hasVoided

        public boolean hasVoided()
        Checks whether the 'voided' field has been set, however the value could be null
      • hasVoidReason

        public boolean hasVoidReason()
        Checks whether the 'voidReason' field has been set, however the value could be null
      • hasDccInfo

        public boolean hasDccInfo()
        Checks whether the 'dccInfo' field has been set, however the value could be null
      • hasTransactionSettings

        public boolean hasTransactionSettings()
        Checks whether the 'transactionSettings' field has been set, however the value could be null
      • hasCreditRefunds

        public boolean hasCreditRefunds()
        Checks whether the 'creditRefunds' field has been set, however the value could be null
      • hasGermanInfo

        public boolean hasGermanInfo()
        Checks whether the 'germanInfo' field has been set, however the value could be null
      • hasAppTracking

        public boolean hasAppTracking()
        Checks whether the 'appTracking' field has been set, however the value could be null
      • hasResult

        public boolean hasResult()
        Checks whether the 'result' field has been set, however the value could be null
      • hasReason

        public boolean hasReason()
        Checks whether the 'reason' field has been set, however the value could be null
      • hasTransactionInfo

        public boolean hasTransactionInfo()
        Checks whether the 'transactionInfo' field has been set, however the value could be null
      • hasMerchant

        public boolean hasMerchant()
        Checks whether the 'merchant' field has been set, however the value could be null
      • hasExternalReferenceId

        public boolean hasExternalReferenceId()
        Checks whether the 'externalReferenceId' field has been set, however the value could be null
      • hasCreditAttributes

        public boolean hasCreditAttributes()
        Checks whether the 'creditAttributes' field has been set, however the value could be null
      • setId

        public Credit setId​(String id)
        Sets the field 'id'.
      • setOrderRef

        public Credit setOrderRef​(Reference orderRef)
        Sets the field 'orderRef'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setDevice

        public Credit setDevice​(Reference device)
        Sets the field 'device'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setTender

        public Credit setTender​(Tender tender)
        Sets the field 'tender'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setEmployee

        public Credit setEmployee​(Reference employee)
        Sets the field 'employee'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setCustomers

        public Credit setCustomers​(Customer customers)
        Sets the field 'customers'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setAmount

        public Credit setAmount​(Long amount)
        Sets the field 'amount'.
      • setTaxAmount

        public Credit setTaxAmount​(Long taxAmount)
        Sets the field 'taxAmount'.
      • setTaxRates

        public Credit setTaxRates​(List<TaxableAmountRate> taxRates)
        Sets the field 'taxRates'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setCreatedTime

        public Credit setCreatedTime​(Long createdTime)
        Sets the field 'createdTime'.
      • setClientCreatedTime

        public Credit setClientCreatedTime​(Long clientCreatedTime)
        Sets the field 'clientCreatedTime'.
      • setCardTransaction

        public Credit setCardTransaction​(CardTransaction cardTransaction)
        Sets the field 'cardTransaction'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setVoided

        public Credit setVoided​(Boolean voided)
        Sets the field 'voided'.
      • setVoidReason

        public Credit setVoidReason​(String voidReason)
        Sets the field 'voidReason'.
      • setDccInfo

        public Credit setDccInfo​(DCCInfo dccInfo)
        Sets the field 'dccInfo'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setTransactionSettings

        public Credit setTransactionSettings​(TransactionSettings transactionSettings)
        Sets the field 'transactionSettings'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setCreditRefunds

        public Credit setCreditRefunds​(List<CreditRefund> creditRefunds)
        Sets the field 'creditRefunds'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setGermanInfo

        public Credit setGermanInfo​(GermanInfo germanInfo)
        Sets the field 'germanInfo'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setAppTracking

        public Credit setAppTracking​(AppTracking appTracking)
        Sets the field 'appTracking'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setResult

        public Credit setResult​(Result result)
        Sets the field 'result'.
      • setReason

        public Credit setReason​(String reason)
        Sets the field 'reason'.
      • setTransactionInfo

        public Credit setTransactionInfo​(TransactionInfo transactionInfo)
        Sets the field 'transactionInfo'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setMerchant

        public Credit setMerchant​(Reference merchant)
        Sets the field 'merchant'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setExternalReferenceId

        public Credit setExternalReferenceId​(String externalReferenceId)
        Sets the field 'externalReferenceId'.
      • setCreditAttributes

        public Credit setCreditAttributes​(Map<String,​String> creditAttributes)
        Sets the field 'creditAttributes'.
      • clearId

        public void clearId()
        Clears the 'id' field, the 'has' method for this field will now return false
      • clearOrderRef

        public void clearOrderRef()
        Clears the 'orderRef' field, the 'has' method for this field will now return false
      • clearDevice

        public void clearDevice()
        Clears the 'device' field, the 'has' method for this field will now return false
      • clearTender

        public void clearTender()
        Clears the 'tender' field, the 'has' method for this field will now return false
      • clearEmployee

        public void clearEmployee()
        Clears the 'employee' field, the 'has' method for this field will now return false
      • clearCustomers

        public void clearCustomers()
        Clears the 'customers' field, the 'has' method for this field will now return false
      • clearAmount

        public void clearAmount()
        Clears the 'amount' field, the 'has' method for this field will now return false
      • clearTaxAmount

        public void clearTaxAmount()
        Clears the 'taxAmount' field, the 'has' method for this field will now return false
      • clearTaxRates

        public void clearTaxRates()
        Clears the 'taxRates' field, the 'has' method for this field will now return false
      • clearCreatedTime

        public void clearCreatedTime()
        Clears the 'createdTime' field, the 'has' method for this field will now return false
      • clearClientCreatedTime

        public void clearClientCreatedTime()
        Clears the 'clientCreatedTime' field, the 'has' method for this field will now return false
      • clearCardTransaction

        public void clearCardTransaction()
        Clears the 'cardTransaction' field, the 'has' method for this field will now return false
      • clearVoided

        public void clearVoided()
        Clears the 'voided' field, the 'has' method for this field will now return false
      • clearVoidReason

        public void clearVoidReason()
        Clears the 'voidReason' field, the 'has' method for this field will now return false
      • clearDccInfo

        public void clearDccInfo()
        Clears the 'dccInfo' field, the 'has' method for this field will now return false
      • clearTransactionSettings

        public void clearTransactionSettings()
        Clears the 'transactionSettings' field, the 'has' method for this field will now return false
      • clearCreditRefunds

        public void clearCreditRefunds()
        Clears the 'creditRefunds' field, the 'has' method for this field will now return false
      • clearGermanInfo

        public void clearGermanInfo()
        Clears the 'germanInfo' field, the 'has' method for this field will now return false
      • clearAppTracking

        public void clearAppTracking()
        Clears the 'appTracking' field, the 'has' method for this field will now return false
      • clearResult

        public void clearResult()
        Clears the 'result' field, the 'has' method for this field will now return false
      • clearReason

        public void clearReason()
        Clears the 'reason' field, the 'has' method for this field will now return false
      • clearTransactionInfo

        public void clearTransactionInfo()
        Clears the 'transactionInfo' field, the 'has' method for this field will now return false
      • clearMerchant

        public void clearMerchant()
        Clears the 'merchant' field, the 'has' method for this field will now return false
      • clearExternalReferenceId

        public void clearExternalReferenceId()
        Clears the 'externalReferenceId' field, the 'has' method for this field will now return false
      • clearCreditAttributes

        public void clearCreditAttributes()
        Clears the 'creditAttributes' 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 Credit copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

        public void mergeChanges​(Credit src)
        Copy all the changed fields from the given source to this instance.