Package com.clover.sdk.v1.customer
Interface ICustomerService
-
- All Superinterfaces:
IInterface
- All Known Implementing Classes:
ICustomerService.Default
,ICustomerService.Stub
public interface ICustomerService extends IInterface
An interface for interacting with the Clover customer service. The customer service is a bound AIDL service. Bind to this service as follows:Intent serviceIntent = new Intent(CustomerIntent.ACTION_CUSTOMER_SERVICE); serviceIntent.putExtra(Intents.EXTRA_ACCOUNT, CloverAccount.getAccount(context)); serviceIntent.putExtra(Intents.EXTRA_VERSION, 1); context.bindService(serviceIntent);
You may also interact with the customer service through theCustomerConnector
class, which handles binding and asynchronous invocation of service methods.- See Also:
CustomerIntent
,CloverAccount
,CustomerConnector
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ICustomerService.Default
Default implementation for ICustomerService.static class
ICustomerService.Stub
Local-side IPC implementation stub class.
-
Method Summary
All Methods Instance Methods Abstract 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 customerCustomer
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.-
Methods inherited from interface android.os.IInterface
asBinder
-
-
-
-
Method Detail
-
getCustomers
List<Customer> getCustomers(String query, ResultStatus resultStatus) throws RemoteException
Get a list of customers for the merchant bound to the service.- 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
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.
- Parameters:
id
- The id of the customer being requested.- Returns:
- A
Customer
object. - Throws:
RemoteException
-
createCustomer
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.
- 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
void setName(String customerId, String firstName, String lastName, ResultStatus resultStatus) throws RemoteException
Update the name on the given customer.- 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
void setMarketingAllowed(String customerId, boolean marketingAllowed, ResultStatus resultStatus) throws RemoteException
Update the marketing allowed value on a given customer.- 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
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.
- Parameters:
customerId
- The id of the customer.phoneNumber
- The phone number.- Returns:
- A
PhoneNumber
object. - Throws:
RemoteException
-
setPhoneNumber
void setPhoneNumber(String customerId, String phoneNumberId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
Updates a given phone number on a customer.- Parameters:
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.phoneNumber
- The new phone number.- Throws:
RemoteException
-
deletePhoneNumber
void deletePhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
Deletes a given phone number from the customer.- Parameters:
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.- Throws:
RemoteException
-
addEmailAddress
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..
- Parameters:
customerId
- The id of the customer.emailAddress
- The email address.- Returns:
- A
EmailAddress
object. - Throws:
RemoteException
-
setEmailAddress
void setEmailAddress(String customerId, String emailAddressId, String emailAddress, ResultStatus resultStatus) throws RemoteException
Updates a given email address on a customer.- Parameters:
customerId
- The id of the customer.emailAddressId
- The id of the email address.emailAddress
- The new email address.- Throws:
RemoteException
-
deleteEmailAddress
void deleteEmailAddress(String customerId, String emailAddressId, ResultStatus resultStatus) throws RemoteException
Deletes a given email address from the customer.- Parameters:
customerId
- The id of the customer.emailAddressId
- The id of the email address.- Throws:
RemoteException
-
addAddress
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.
- 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
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.- 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
void deleteAddress(String customerId, String addressId, ResultStatus resultStatus) throws RemoteException
Deletes a given address from the customer.- Parameters:
customerId
- The id of the customer.addressId
- The id of the address.- Throws:
RemoteException
-
deleteCustomer
void deleteCustomer(String customerId, ResultStatus resultStatus) throws RemoteException
Deletes a given customer from the merchant.- Parameters:
customerId
- The id of the customer.- Throws:
RemoteException
-
addCard
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
- Parameters:
customerId
- The id of the customer.card
- The card info.- Returns:
- A
Card
object. - Throws:
RemoteException
-
setCard
void setCard(String customerId, String cardId, Card card, ResultStatus resultStatus) throws RemoteException
Updates a given debit/credit card record for a customer.- Parameters:
customerId
- The id of the customer.cardId
- The id of the credit/debit card.card
- The new card info.- Throws:
RemoteException
-
deleteCard
void deleteCard(String customerId, String cardId, ResultStatus resultStatus) throws RemoteException
Deletes a given card record from the customer.- Parameters:
customerId
- The id of the customer.cardId
- The id of the credit/debit card.- Throws:
RemoteException
-
-