Package net.amcintosh.freshbooks.models
Class Payment
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
net.amcintosh.freshbooks.models.Payment
- All Implemented Interfaces:
Cloneable,Map<String,,Object> ConvertibleContent
Payments are a record of the payments made on invoices.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.FlagsNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet unique identifier of business the payment exists on.The amount of the payment.longlongId of client who made the payment.Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.longThe id of a related credit resource.getDate()Date the payment was made.The payment processor (gateway) used to make the payment, if any.longgetId()The unique id (across this business) for the payment.longThe id of a related Invoice resource.getNote()Notes on payment, often used for credit card reference number.longlongId of related overpayment Credit if relevant.longThe unique id (across this business) for the payment.getType()Type of payment made.Get the time of last modification to the payment.Get the visibility state: active, deleted, or archivedbooleanIf the payment was converted from a Credit on a Client's account.booleanWhether to send the client a notification of this payment.voidThe amount of the payment.voidsetBulkPaymentId(long bulkPaymentId) voidsetCreditId(long creditId) The id of a related Credit resource.voidDate the payment was made.voidsetFromCredit(boolean fromCredit) If the payment was converted from a Credit on a Client's account.voidsetInvoiceId(long invoiceId) The id of a related Invoice resource.voidNotes on payment, often used for credit card reference number.voidsetOrderId(long orderId) voidsetSendClientNotification(boolean sendClientNotification) Whether to send the client a notification of this payment.voidsetType(Payment.PaymentType type) Type of payment made;voidsetVisState(VisState visState) Set the visibility state of the client.Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, set, setFactory, toPrettyString, toStringMethods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeysMethods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Payment
public Payment()
-
-
Method Details
-
getId
public long getId()The unique id (across this business) for the payment.- Returns:
-
getPaymentId
public long getPaymentId()The unique id (across this business) for the payment.
Notes:- This is the same as
getId. - The API parameter is
logIdbecause internally this resource is called "payment log", but this is a terrible name from an API perspective, so we'll hide it with paymentId here.
- Returns:
- This is the same as
-
getAccountingSystemId
Get unique identifier of business the payment exists on.- Returns:
- Accounting System Id
-
getAmount
The amount of the payment.- Returns:
-
setAmount
The amount of the payment.- Parameters:
amount-
-
getBulkPaymentId
public long getBulkPaymentId() -
setBulkPaymentId
public void setBulkPaymentId(long bulkPaymentId) -
getClientId
public long getClientId()Id of client who made the payment.- Returns:
-
getCreditId
public long getCreditId()The id of a related credit resource.- Returns:
-
setCreditId
public void setCreditId(long creditId) The id of a related Credit resource.- Parameters:
creditId-
-
getDate
Date the payment was made.
The API returns this in YYYY-MM-DD format. It is converted to a LocalDate.- Returns:
- converted LocalDate object
-
setDate
Date the payment was made.
This is sent to the API in YYYY-MM-DD format.- Parameters:
date-
-
isFromCredit
public boolean isFromCredit()If the payment was converted from a Credit on a Client's account.- Returns:
-
setFromCredit
public void setFromCredit(boolean fromCredit) If the payment was converted from a Credit on a Client's account.- Parameters:
fromCredit-
-
getGateway
The payment processor (gateway) used to make the payment, if any.- Returns:
- Eg. "Stripe"
-
getInvoiceId
public long getInvoiceId()The id of a related Invoice resource.- Returns:
-
setInvoiceId
public void setInvoiceId(long invoiceId) The id of a related Invoice resource.- Parameters:
invoiceId-
-
getNote
Notes on payment, often used for credit card reference number.- Returns:
-
setNote
Notes on payment, often used for credit card reference number.
Do not store actual credit card numbers here.- Parameters:
note- "Ref #ABC123"
-
getOrderId
public long getOrderId() -
setOrderId
public void setOrderId(long orderId) -
getOverpaymentId
public long getOverpaymentId()Id of related overpayment Credit if relevant.- Returns:
-
isSendClientNotification
public boolean isSendClientNotification()Whether to send the client a notification of this payment.- Returns:
-
setSendClientNotification
public void setSendClientNotification(boolean sendClientNotification) Whether to send the client a notification of this payment.- Parameters:
sendClientNotification-
-
getType
Type of payment made.- Returns:
- Eg. “Check”, “Credit”, “Cash”
-
setType
Type of payment made;- Parameters:
type- Eg. “Check”, “Credit”, “Cash”
-
getUpdated
Get the time of last modification to the payment.
Note: The API returns this data in "US/Eastern", but it is converted here to UTC.- Returns:
- Updated time in UTC
-
getVisState
Get the visibility state: active, deleted, or archived- Returns:
- Enum of the visibility state.
- See Also:
-
setVisState
Set the visibility state of the client.- Parameters:
visState- VisState value- See Also:
-
getContent
Description copied from interface:ConvertibleContentReturn the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContentin interfaceConvertibleContent- Returns:
-