Class CustomerHandler


  • public class CustomerHandler
    extends Object
    Handles the Customer API Mollie docs
    Author:
    Wout Schoovaerts
    • 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 object
        params - A map of query parameters
        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 id
        params - 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 id
        params - A map of query parameters
        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 id
        body - 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 id
        body - PaymentRequest object
        params - A map of query parameters
        Returns:
        PaymentResponse object
        Throws:
        MollieException - when something went wrong