Package com.braintreegateway
Class CustomerGateway
- java.lang.Object
-
- com.braintreegateway.CustomerGateway
-
public class CustomerGateway extends Object
Provides methods to create, delete, find, and updateCustomerobjects. This class does not need to be instantiated directly. Instead, useBraintreeGateway.customer()to get an instance of this class:BraintreeGateway gateway = new BraintreeGateway(...); gateway.customer().create(...)
For more detailed information onCustomers, see https://developer.paypal.com/braintree/docs/reference/response/customer/java
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfigurationprivate Httphttp
-
Constructor Summary
Constructors Constructor Description CustomerGateway(Http http, Configuration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceCollection<Customer>all()Finds all Customers and returns aResourceCollection.Result<Customer>create(CustomerRequest request)Creates aCustomer.Result<Customer>delete(String id)Deletes aCustomerby id.(package private) List<Customer>fetchCustomers(CustomerSearchRequest query, List<String> ids)Customerfind(String id)Finds aCustomerby id.Customerfind(String id, String associationFilterId)Finds aCustomerby id.ResourceCollection<Customer>search(CustomerSearchRequest query)Finds all Transactions that match the query and returns aResourceCollection.Result<Customer>update(String id, CustomerRequest request)Updates aCustomer.
-
-
-
Field Detail
-
configuration
private Configuration configuration
-
http
private Http http
-
-
Constructor Detail
-
CustomerGateway
public CustomerGateway(Http http, Configuration configuration)
-
-
Method Detail
-
all
public ResourceCollection<Customer> all()
Finds all Customers and returns aResourceCollection.- Returns:
- a
ResourceCollection.
-
fetchCustomers
List<Customer> fetchCustomers(CustomerSearchRequest query, List<String> ids)
-
create
public Result<Customer> create(CustomerRequest request)
Creates aCustomer.- Parameters:
request- the request.- Returns:
- a
Result.
-
find
public Customer find(String id)
Finds aCustomerby id.- Parameters:
id- the id of theCustomer.- Returns:
- the
Customeror raises aNotFoundException.
-
find
public Customer find(String id, String associationFilterId)
Finds aCustomerby id.- Parameters:
id- the id of theCustomer.associationFilterId- the id of the association filter to use.- Returns:
- the
Customeror raises aNotFoundException.
-
search
public ResourceCollection<Customer> search(CustomerSearchRequest query)
Finds all Transactions that match the query and returns aResourceCollection. See: https://developer.paypal.com/braintree/docs/reference/request/transaction/search/java- Parameters:
query- the request query to use for search- Returns:
- a
ResourceCollection.
-
-