Package com.clover.sdk.v1.customer
Class ICustomerService.Default
- java.lang.Object
-
- com.clover.sdk.v1.customer.ICustomerService.Default
-
- All Implemented Interfaces:
IInterface
,ICustomerService
- Enclosing interface:
- ICustomerService
public static class ICustomerService.Default extends Object implements ICustomerService
Default implementation for ICustomerService.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.clover.sdk.v1.customer.ICustomerService
ICustomerService.Default, ICustomerService.Stub
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Address
addAddress(String customerId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus)
Creates an address and adds it to the specified customerCard
addCard(String customerId, Card card, ResultStatus resultStatus)
Creates a new vaulted credit/debit card record and adds it to the specified customerEmailAddress
addEmailAddress(String customerId, String emailAddress, ResultStatus resultStatus)
Creates a new email address and adds it to the specified customerPhoneNumber
addPhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus)
Creates a new phone number and adds it to the specified customerIBinder
asBinder()
Customer
createCustomer(String firstName, String lastName, boolean marketingAllowed, ResultStatus resultStatus)
Creates a new customer for the merchant bound to the service.void
deleteAddress(String customerId, String addressId, ResultStatus resultStatus)
Deletes a given address from the customer.void
deleteCard(String customerId, String cardId, ResultStatus resultStatus)
Deletes a given card record from the customer.void
deleteCustomer(String customerId, ResultStatus resultStatus)
Deletes a given customer from the merchant.void
deleteEmailAddress(String customerId, String emailAddressId, ResultStatus resultStatus)
Deletes a given email address from the customer.void
deletePhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus)
Deletes a given phone number from the customer.Customer
getCustomer(String customerId, ResultStatus resultStatus)
Returns a single customer for the merchant bound to the service.List<Customer>
getCustomers(String query, ResultStatus resultStatus)
Get a list of customers for the merchant bound to the service.void
setAddress(String customerId, String addressId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus)
Updates a given address on a customer.void
setCard(String customerId, String cardId, Card card, ResultStatus resultStatus)
Updates a given debit/credit card record for a customer.void
setEmailAddress(String customerId, String emailAddressId, String emailAddress, ResultStatus resultStatus)
Updates a given email address on a customer.void
setMarketingAllowed(String customerId, boolean marketingAllowed, ResultStatus resultStatus)
Update the marketing allowed value on a given customer.void
setName(String customerId, String firstName, String lastName, ResultStatus resultStatus)
Update the name on the given customer.void
setPhoneNumber(String customerId, String phoneNumberId, String phoneNumber, ResultStatus resultStatus)
Updates a given phone number on a customer.
-
-
-
Method Detail
-
getCustomers
public List<Customer> getCustomers(String query, ResultStatus resultStatus) throws RemoteException
Get a list of customers for the merchant bound to the service.- Specified by:
getCustomers
in interfaceICustomerService
- Parameters:
query
- A string that we be used to match the first name, last name or phone number against.- Returns:
- A list of
Customer
objects, ornull
if the service call fails. - Throws:
RemoteException
-
getCustomer
public Customer getCustomer(String customerId, ResultStatus resultStatus) throws RemoteException
Returns a single customer for the merchant bound to the service.This call will return immediately with the local version of the customer if one exists on the device, it will then contact the server to check for an updated version. If a new version exists a
CustomerIntent.ACTION_CUSTOMER_UPDATE
broadcast will be sent.If no local version of the customer is available then the service will go directly to the server to fetch the customer.
- Specified by:
getCustomer
in interfaceICustomerService
- Parameters:
id
- The id of the customer being requested.- Returns:
- A
Customer
object. - Throws:
RemoteException
-
createCustomer
public Customer createCustomer(String firstName, String lastName, boolean marketingAllowed, ResultStatus resultStatus) throws RemoteException
Creates a new customer for the merchant bound to the service.This call will return immediately with the new customer.
- Specified by:
createCustomer
in interfaceICustomerService
- Parameters:
firstName
- The first name of the customer, can be null.lastName
- The last name of the customer, can be null.marketingAllowed
- A boolean value of whether or not the customer has authorized direct marketing. Please set to false unless you have explicitly asked the customer.- Returns:
- A
Customer
object. - Throws:
RemoteException
-
setName
public void setName(String customerId, String firstName, String lastName, ResultStatus resultStatus) throws RemoteException
Update the name on the given customer.- Specified by:
setName
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.firstName
- The first name of the customer, can be null.lastName
- The last name of the customer, can be null.- Throws:
RemoteException
-
setMarketingAllowed
public void setMarketingAllowed(String customerId, boolean marketingAllowed, ResultStatus resultStatus) throws RemoteException
Update the marketing allowed value on a given customer.- Specified by:
setMarketingAllowed
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.marketingAllowed
- A boolean value of whether or not the customer has authorized direct marketing. Please set to false unless you have explicitly asked the customer.- Throws:
RemoteException
-
addPhoneNumber
public PhoneNumber addPhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
Creates a new phone number and adds it to the specified customerThis call will return immediately with the new phone number object.
- Specified by:
addPhoneNumber
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.phoneNumber
- The phone number.- Returns:
- A
PhoneNumber
object. - Throws:
RemoteException
-
setPhoneNumber
public void setPhoneNumber(String customerId, String phoneNumberId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
Updates a given phone number on a customer.- Specified by:
setPhoneNumber
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.phoneNumber
- The new phone number.- Throws:
RemoteException
-
deletePhoneNumber
public void deletePhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
Deletes a given phone number from the customer.- Specified by:
deletePhoneNumber
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.- Throws:
RemoteException
-
addEmailAddress
public EmailAddress addEmailAddress(String customerId, String emailAddress, ResultStatus resultStatus) throws RemoteException
Creates a new email address and adds it to the specified customerThis call will return immediately with the new email address object..
- Specified by:
addEmailAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.emailAddress
- The email address.- Returns:
- A
EmailAddress
object. - Throws:
RemoteException
-
setEmailAddress
public void setEmailAddress(String customerId, String emailAddressId, String emailAddress, ResultStatus resultStatus) throws RemoteException
Updates a given email address on a customer.- Specified by:
setEmailAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.emailAddressId
- The id of the email address.emailAddress
- The new email address.- Throws:
RemoteException
-
deleteEmailAddress
public void deleteEmailAddress(String customerId, String emailAddressId, ResultStatus resultStatus) throws RemoteException
Deletes a given email address from the customer.- Specified by:
deleteEmailAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.emailAddressId
- The id of the email address.- Throws:
RemoteException
-
addAddress
public Address addAddress(String customerId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus) throws RemoteException
Creates an address and adds it to the specified customerThis call will return immediately with the new address object.
- Specified by:
addAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.address1
- The first row of an address.address2
- The second row of an address.address3
- The third row of an address.city
- The city.state
- The state.zip
- The zip (postal code).- Returns:
- A
Address
object. - Throws:
RemoteException
-
setAddress
public void setAddress(String customerId, String addressId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus) throws RemoteException
Updates a given address on a customer.- Specified by:
setAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.addressId
- The id of the email address.address1
- The first row of an address.address2
- The second row of an address.address3
- The third row of an address.city
- The city.state
- The state.zip
- The zip (postal code).- Throws:
RemoteException
-
deleteAddress
public void deleteAddress(String customerId, String addressId, ResultStatus resultStatus) throws RemoteException
Deletes a given address from the customer.- Specified by:
deleteAddress
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.addressId
- The id of the address.- Throws:
RemoteException
-
deleteCustomer
public void deleteCustomer(String customerId, ResultStatus resultStatus) throws RemoteException
Deletes a given customer from the merchant.- Specified by:
deleteCustomer
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.- Throws:
RemoteException
-
addCard
public Card addCard(String customerId, Card card, ResultStatus resultStatus) throws RemoteException
Creates a new vaulted credit/debit card record and adds it to the specified customerThis call will return immediately with the new Card object
- Specified by:
addCard
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.card
- The card info.- Returns:
- A
Card
object. - Throws:
RemoteException
-
setCard
public void setCard(String customerId, String cardId, Card card, ResultStatus resultStatus) throws RemoteException
Updates a given debit/credit card record for a customer.- Specified by:
setCard
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.cardId
- The id of the credit/debit card.card
- The new card info.- Throws:
RemoteException
-
deleteCard
public void deleteCard(String customerId, String cardId, ResultStatus resultStatus) throws RemoteException
Deletes a given card record from the customer.- Specified by:
deleteCard
in interfaceICustomerService
- Parameters:
customerId
- The id of the customer.cardId
- The id of the credit/debit card.- Throws:
RemoteException
-
asBinder
public IBinder asBinder()
- Specified by:
asBinder
in interfaceIInterface
-
-