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

public class Payment extends com.google.api.client.json.GenericJson implements ConvertibleContent
Payments are a record of the payments made on invoices.
See Also:
  • 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:
    • getAccountingSystemId

      public String getAccountingSystemId()
      Get unique identifier of business the payment exists on.
      Returns:
      Accounting System Id
    • getAmount

      public Money getAmount()
      The amount of the payment.
      Returns:
    • setAmount

      public void setAmount(Money amount)
      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

      public LocalDate 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

      public void setDate(LocalDate date)
      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

      public String 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

      public String getNote()
      Notes on payment, often used for credit card reference number.
      Returns:
    • setNote

      public void setNote(String note)
      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

      public Payment.PaymentType getType()
      Type of payment made.
      Returns:
      Eg. “Check”, “Credit”, “Cash”
    • setType

      public void setType(Payment.PaymentType type)
      Type of payment made;
      Parameters:
      type - Eg. “Check”, “Credit”, “Cash”
    • getUpdated

      public ZonedDateTime 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

      public VisState getVisState()
      Get the visibility state: active, deleted, or archived

      Returns:
      Enum of the visibility state.
      See Also:
    • setVisState

      public void setVisState(VisState visState)
      Set the visibility state of the client.

      Parameters:
      visState - VisState value
      See Also:
    • getContent

      public Map<String,Object> 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 interface ConvertibleContent
      Returns: