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 classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested 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
-
Method Summary
Modifier and TypeMethodDescriptionGet unique identifier of business the payment exists on.The amount of the payment.long
long
Id of client who made the payment.Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.long
The id of a related credit resource.getDate()
Date the payment was made.The payment processor (gateway) used to make the payment, if any.long
getId()
The unique id (across this business) for the payment.long
The id of a related Invoice resource.getNote()
Notes on payment, often used for credit card reference number.long
long
Id of related overpayment Credit if relevant.long
The 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 archivedboolean
If the payment was converted from a Credit on a Client's account.boolean
Whether to send the client a notification of this payment.void
The amount of the payment.void
setBulkPaymentId
(long bulkPaymentId) void
setCreditId
(long creditId) The id of a related Credit resource.void
Date the payment was made.void
setFromCredit
(boolean fromCredit) If the payment was converted from a Credit on a Client's account.void
setInvoiceId
(long invoiceId) The id of a related Invoice resource.void
Notes on payment, often used for credit card reference number.void
setOrderId
(long orderId) void
setSendClientNotification
(boolean sendClientNotification) Whether to send the client a notification of this payment.void
setType
(Payment.PaymentType type) Type of payment made;void
setVisState
(VisState visState) Set the visibility state of the client.Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, set, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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
logId
because 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:ConvertibleContent
Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContent
in interfaceConvertibleContent
- Returns:
-