Class CustomerHandler
- java.lang.Object
-
- be.woutschoovaerts.mollie.handler.recurring.CustomerHandler
-
public class CustomerHandler extends Object
Handles the Customer API Mollie docs- Author:
- Wout Schoovaerts
-
-
Constructor Summary
Constructors Constructor Description CustomerHandler(RestService restService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomerResponse
createCustomer(CustomerRequest body)
Creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features.CustomerResponse
createCustomer(CustomerRequest body, QueryParams params)
Creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features.PaymentResponse
createCustomerPayment(String customerId, PaymentRequest body)
Creates a payment for the customer.PaymentResponse
createCustomerPayment(String customerId, PaymentRequest body, QueryParams params)
Creates a payment for the customer.void
deleteCustomer(String customerId)
Delete a customer.void
deleteCustomer(String customerId, QueryParams params)
Delete a customer.CustomerResponse
getCustomer(String customerId)
Retrieve a single customer by its ID.CustomerResponse
getCustomer(String customerId, QueryParams params)
Retrieve a single customer by its ID.Pagination<PaymentListResponse>
listCustomerPayments(String customerId)
Retrieve all payments linked to the customer.Pagination<PaymentListResponse>
listCustomerPayments(String customerId, QueryParams params)
Retrieve all payments linked to the customer.Pagination<CustomerListResponse>
listCustomers()
Retrieve all customers created.Pagination<CustomerListResponse>
listCustomers(QueryParams params)
Retrieve all customers created.CustomerResponse
updateCustomer(String customerId, CustomerRequest body)
Update an existing customer.CustomerResponse
updateCustomer(String customerId, CustomerRequest body, QueryParams params)
Update an existing customer.
-
-
-
Constructor Detail
-
CustomerHandler
public CustomerHandler(RestService restService)
-
-
Method Detail
-
createCustomer
public CustomerResponse createCustomer(CustomerRequest body) throws MollieException
Creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features.- Parameters:
body
- CustomerRequest object- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
createCustomer
public CustomerResponse createCustomer(CustomerRequest body, QueryParams params) throws MollieException
Creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features.- Parameters:
body
- CustomerRequest objectparams
- A map of query parameters- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
getCustomer
public CustomerResponse getCustomer(String customerId) throws MollieException
Retrieve a single customer by its ID.- Parameters:
customerId
- a customer id- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
getCustomer
public CustomerResponse getCustomer(String customerId, QueryParams params) throws MollieException
Retrieve a single customer by its ID.- Parameters:
customerId
- a customer idparams
- A map of query parameters- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
updateCustomer
public CustomerResponse updateCustomer(String customerId, CustomerRequest body) throws MollieException
Update an existing customer.- Parameters:
body
- CustomerRequest object- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
updateCustomer
public CustomerResponse updateCustomer(String customerId, CustomerRequest body, QueryParams params) throws MollieException
Update an existing customer.- Parameters:
body
- CustomerRequest objectparams
- A map of query parameters- Returns:
- CustomerResponse object
- Throws:
MollieException
- when something went wrong
-
deleteCustomer
public void deleteCustomer(String customerId) throws MollieException
Delete a customer. All mandates and subscriptions created for this customer will be canceled as well.- Parameters:
customerId
- a customer id- Throws:
MollieException
- when something went wrong
-
deleteCustomer
public void deleteCustomer(String customerId, QueryParams params) throws MollieException
Delete a customer. All mandates and subscriptions created for this customer will be canceled as well.- Parameters:
customerId
- a customer idparams
- A map of query parameters- Throws:
MollieException
- when something went wrong
-
listCustomers
public Pagination<CustomerListResponse> listCustomers() throws MollieException
Retrieve all customers created.The results are paginated.
- Returns:
- paginated list of CustomerResponse objects
- Throws:
MollieException
- when something went wrong
-
listCustomers
public Pagination<CustomerListResponse> listCustomers(QueryParams params) throws MollieException
Retrieve all customers created.The results are paginated.
- Parameters:
params
- A map of query parameters- Returns:
- paginated list of CustomerResponse objects
- Throws:
MollieException
- when something went wrong
-
createCustomerPayment
public PaymentResponse createCustomerPayment(String customerId, PaymentRequest body) throws MollieException
Creates a payment for the customer.Linking customers to payments enables a number of Mollie Checkout features
- Parameters:
customerId
- a customer idbody
- PaymentRequest object- Returns:
- PaymentResponse object
- Throws:
MollieException
- when something went wrong
-
createCustomerPayment
public PaymentResponse createCustomerPayment(String customerId, PaymentRequest body, QueryParams params) throws MollieException
Creates a payment for the customer.Linking customers to payments enables a number of Mollie Checkout features
- Parameters:
customerId
- a customer idbody
- PaymentRequest objectparams
- A map of query parameters- Returns:
- PaymentResponse object
- Throws:
MollieException
- when something went wrong
-
listCustomerPayments
public Pagination<PaymentListResponse> listCustomerPayments(String customerId) throws MollieException
Retrieve all payments linked to the customer.- Parameters:
customerId
- a customer id- Returns:
- paginated list of PaymentResponse objects
- Throws:
MollieException
- when something went wrong
-
listCustomerPayments
public Pagination<PaymentListResponse> listCustomerPayments(String customerId, QueryParams params) throws MollieException
Retrieve all payments linked to the customer.- Parameters:
customerId
- a customer idparams
- A map of query parameters- Returns:
- paginated list of PaymentResponse objects
- Throws:
MollieException
- when something went wrong
-
-