com.braintreegateway
Class CustomerGateway

java.lang.Object
  extended by com.braintreegateway.CustomerGateway

public class CustomerGateway
extends Object

Provides methods to create, delete, find, and update Customer objects. This class does not need to be instantiated directly. Instead, use BraintreeGateway.customer() to get an instance of this class:

 BraintreeGateway gateway = new BraintreeGateway(...);
 gateway.customer().create(...)
 
For more detailed information on Customers, see http://www.braintreepaymentsolutions.com/gateway/customer-api


Field Summary
private  Configuration configuration
           
private  Http http
           
 
Constructor Summary
CustomerGateway(Http http, Configuration configuration)
           
 
Method Summary
 ResourceCollection<Customer> all()
          Finds all Customers and returns a ResourceCollection.
 Result<Customer> confirmTransparentRedirect(String queryString)
          Deprecated. 
 Result<Customer> create(CustomerRequest request)
          Creates a Customer.
 Result<Customer> delete(String id)
          Deletes a Customer by id.
(package private)  List<Customer> fetchCustomers(CustomerSearchRequest query, List<String> ids)
           
 Customer find(String id)
          Finds a Customer by id.
 ResourceCollection<Customer> search(CustomerSearchRequest query)
          Finds all Transactions that match the query and returns a ResourceCollection.
 String transparentRedirectURLForCreate()
          Deprecated. 
 String transparentRedirectURLForUpdate()
          Deprecated. 
 Result<Customer> update(String id, CustomerRequest request)
          Updates a Customer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 a ResourceCollection.

Returns:
a ResourceCollection.

fetchCustomers

List<Customer> fetchCustomers(CustomerSearchRequest query,
                              List<String> ids)

confirmTransparentRedirect

@Deprecated
public Result<Customer> confirmTransparentRedirect(String queryString)
Deprecated. 

Please use gateway.transparentRedirect().confirmCustomer() instead


create

public Result<Customer> create(CustomerRequest request)
Creates a Customer.

Parameters:
request - the request.
Returns:
a Result.

delete

public Result<Customer> delete(String id)
Deletes a Customer by id.

Parameters:
id - the id of the Customer.
Returns:
a Result.

find

public Customer find(String id)
Finds a Customer by id.

Parameters:
id - the id of the Customer.
Returns:
the Customer or raises a NotFoundException.

search

public ResourceCollection<Customer> search(CustomerSearchRequest query)
Finds all Transactions that match the query and returns a ResourceCollection. See: http://www.braintreepaymentsolutions.com/gateway/transaction-api#searching

Returns:
a ResourceCollection.

transparentRedirectURLForCreate

@Deprecated
public String transparentRedirectURLForCreate()
Deprecated. 

Please use gateway.transparentRedirect().url() instead


transparentRedirectURLForUpdate

@Deprecated
public String transparentRedirectURLForUpdate()
Deprecated. 

Please use gateway.transparentRedirect().url() instead


update

public Result<Customer> update(String id,
                               CustomerRequest request)
Updates a Customer.

Parameters:
id - the id of the Customer.
request - the request.
Returns:
a Result.


Copyright © 2013. All Rights Reserved.