public interface ICustomerService extends IInterface
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);
For more information about bound services, refer to
the Android documentation:
Bound Services
CustomerConnector
class, which handles binding and
asynchronous invocation of service methods.
CustomerIntent
,
CloverAccount
,
CustomerConnector
Modifier and Type | Interface and Description |
---|---|
static class |
ICustomerService.Default
Default implementation for ICustomerService.
|
static class |
ICustomerService.Stub
Local-side IPC implementation stub class.
|
Modifier and Type | Method and 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 customer
|
Card |
addCard(String customerId,
Card card,
ResultStatus resultStatus)
Creates a new vaulted credit/debit card record and adds it to the specified customer
|
EmailAddress |
addEmailAddress(String customerId,
String emailAddress,
ResultStatus resultStatus)
Creates a new email address and adds it to the specified customer
|
PhoneNumber |
addPhoneNumber(String customerId,
String phoneNumber,
ResultStatus resultStatus)
Creates a new phone number and adds it to the specified customer
|
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.
|
asBinder
List<Customer> getCustomers(String query, ResultStatus resultStatus) throws RemoteException
query
- A string that we be used to match the first name, last name or phone number against.Customer
objects, or null
if the service call fails.RemoteException
Customer getCustomer(String customerId, ResultStatus resultStatus) throws RemoteException
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.
id
- The id of the customer being requested.Customer
object.RemoteException
Customer createCustomer(String firstName, String lastName, boolean marketingAllowed, ResultStatus resultStatus) throws RemoteException
This call will return immediately with the new customer.
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.Customer
object.RemoteException
void setName(String customerId, String firstName, String lastName, ResultStatus resultStatus) throws RemoteException
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.RemoteException
void setMarketingAllowed(String customerId, boolean marketingAllowed, ResultStatus resultStatus) throws RemoteException
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.RemoteException
PhoneNumber addPhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
This call will return immediately with the new phone number object.
customerId
- The id of the customer.phoneNumber
- The phone number.PhoneNumber
object.RemoteException
void setPhoneNumber(String customerId, String phoneNumberId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.phoneNumber
- The new phone number.RemoteException
void deletePhoneNumber(String customerId, String phoneNumber, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.phoneNumberId
- The id of the phone number.RemoteException
EmailAddress addEmailAddress(String customerId, String emailAddress, ResultStatus resultStatus) throws RemoteException
This call will return immediately with the new email address object..
customerId
- The id of the customer.emailAddress
- The email address.EmailAddress
object.RemoteException
void setEmailAddress(String customerId, String emailAddressId, String emailAddress, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.emailAddressId
- The id of the email address.emailAddress
- The new email address.RemoteException
void deleteEmailAddress(String customerId, String emailAddressId, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.emailAddressId
- The id of the email address.RemoteException
Address addAddress(String customerId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus) throws RemoteException
This call will return immediately with the new address object.
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).Address
object.RemoteException
void setAddress(String customerId, String addressId, String address1, String address2, String address3, String city, String state, String zip, ResultStatus resultStatus) throws RemoteException
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).RemoteException
void deleteAddress(String customerId, String addressId, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.addressId
- The id of the address.RemoteException
void deleteCustomer(String customerId, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.RemoteException
Card addCard(String customerId, Card card, ResultStatus resultStatus) throws RemoteException
This call will return immediately with the new Card object
customerId
- The id of the customer.card
- The card info.Card
object.RemoteException
void setCard(String customerId, String cardId, Card card, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.cardId
- The id of the credit/debit card.card
- The new card info.RemoteException
void deleteCard(String customerId, String cardId, ResultStatus resultStatus) throws RemoteException
customerId
- The id of the customer.cardId
- The id of the credit/debit card.RemoteException