Class Payments
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.AccountingResource
net.amcintosh.freshbooks.resources.Payments
-
Field Summary
Fields inherited from class net.amcintosh.freshbooks.resources.api.Resource
freshBooksClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new payment from the provided data.Create a new payment from the provided Payment model.Delete the payment with the corresponding id.Get a single payment with the corresponding id.get(String accountId, long paymentId, IncludesQueryBuilder builder) Get a single payment with the corresponding id.protected StringgetPath()Get a list of payments using the query strings generated by the QueryBuilder list.list(String accountId, List<QueryBuilder> builders) Get a list of payments using the query strings generated by the QueryBuilder list.Update the payment with the corresponding id.Update the payment with the corresponding id.Methods inherited from class net.amcintosh.freshbooks.resources.api.AccountingResource
getResourceType, getUrl, getUrl, getUrl, getUrl, handleListRequest, handleRequest, handleRequestMethods inherited from class net.amcintosh.freshbooks.resources.api.Resource
buildQueryString
-
Constructor Details
-
Payments
-
-
Method Details
-
getPath
- Specified by:
getPathin classAccountingResource
-
list
Get a list of payments using the query strings generated by the QueryBuilder list.- Parameters:
accountId- Id of the account- Returns:
- PaymentList containing payments and pagination details
- Throws:
FreshBooksException- If the call is not successful
-
list
Get a list of payments using the query strings generated by the QueryBuilder list.- Parameters:
accountId- Id of the accountbuilders- List of QueryBuilders- Returns:
- PaymentList containing payments and pagination details
- Throws:
FreshBooksException- If the call is not successful
-
get
Get a single payment with the corresponding id.- Parameters:
accountId- The alpha-numeric account idpaymentId- Id of the resource to return- Returns:
- The Payment
- Throws:
FreshBooksException- If the call is not successful
-
get
public Payment get(String accountId, long paymentId, IncludesQueryBuilder builder) throws FreshBooksException Get a single payment with the corresponding id.- Parameters:
accountId- The alpha-numeric account idpaymentId- Id of the resource to returnbuilder- IncludesQueryBuilder object for including additional data, sub-resources, etc.- Returns:
- The Payment
- Throws:
FreshBooksException- If the call is not successful
-
create
Create a new payment from the provided Payment model. Makes a POST call against the payment resource endpoint. This calls `payment.getContent()` to get a hash map of data.- Parameters:
accountId- The alpha-numeric account iddata- Payment model with create data- Returns:
- The created Payment
- Throws:
FreshBooksException- If the call is not successful
-
create
Create a new payment from the provided data. Makes a POST call against the payment resource endpoint.- Parameters:
accountId- The alpha-numeric account iddata- Map of create data- Returns:
- The created Payment
- Throws:
FreshBooksException- If the call is not successful
-
update
Update the payment with the corresponding id. Makes a PUT call against the payment resource endpoint.- Parameters:
accountId- The alpha-numeric account idpaymentId- Id of the resource to returndata- Payment model with updated data- Returns:
- The updated Payment
- Throws:
FreshBooksException- If the call is not successful
-
update
public Payment update(String accountId, long paymentId, Map<String, Object> data) throws FreshBooksExceptionUpdate the payment with the corresponding id. Makes a PUT call against the payment resource endpoint.- Parameters:
accountId- The alpha-numeric account idpaymentId- Id of the resource to updatedata- Map of data to change- Returns:
- The updated Payment
- Throws:
FreshBooksException- If the call is not successful
-
delete
Delete the payment with the corresponding id. Makes a PUT call against the payment resource endpoint with a `vis_state` of deleted.
Note: Most FreshBooks resources are soft-deleted,- Parameters:
accountId- The alpha-numeric account idpaymentId- Id of the resource to update- Returns:
- The deleted Payment
- Throws:
FreshBooksException- If the call is not successful- See Also:
-