Class ReferralCustomerService
java.lang.Object
com.easypost.service.ReferralCustomerService
-
Method Summary
Modifier and TypeMethodDescriptionaddCreditCardToUser
(String referralApiKey, String number, int expirationMonth, int expirationYear, String cvc) Add credit card to a referral user.addCreditCardToUser
(String referralApiKey, String number, int expirationMonth, int expirationYear, String cvc, PaymentMethod.Priority priority) Add credit card to a referral user.List all Referral objects.Create a Referral Customer object from parameter map.getNextPage
(ReferralCustomerCollection collection) Get the next page of an ReferralCustomerCollection.getNextPage
(ReferralCustomerCollection collection, Integer pageSize) Get the next page of an ReferralCustomerCollection.void
updateEmail
(String email, String userId) Update a Referral object email.
-
Method Details
-
create
Create a Referral Customer object from parameter map. This function requires the Partner User's API key.- Parameters:
params
- Map of the referral user parameters.- Returns:
- Referral object.
- Throws:
EasyPostException
- when the request fails.
-
updateEmail
Update a Referral object email. This function requires the Partner User's API key.- Parameters:
email
- Email of the referral user to update.userId
- ID of the referral user to update.- Throws:
EasyPostException
- when the request fails.
-
all
List all Referral objects. This function requires the Partner User's API key.- Parameters:
params
- Map of parameters.- Returns:
- ReferralCustomerCollection object.
- Throws:
EasyPostException
- when the request fails.
-
getNextPage
public ReferralCustomerCollection getNextPage(ReferralCustomerCollection collection) throws EndOfPaginationError Get the next page of an ReferralCustomerCollection.- Parameters:
collection
- ReferralCustomerCollection to get next page of.- Returns:
- ReferralCustomerCollection object.
- Throws:
EndOfPaginationError
- when there are no more pages to retrieve.
-
getNextPage
public ReferralCustomerCollection getNextPage(ReferralCustomerCollection collection, Integer pageSize) throws EndOfPaginationError Get the next page of an ReferralCustomerCollection.- Parameters:
collection
- ReferralCustomerCollection to get next page of.pageSize
- The number of results to return on the next page.- Returns:
- ReferralCustomerCollection object.
- Throws:
EndOfPaginationError
- when there are no more pages to retrieve.
-
addCreditCardToUser
public PaymentMethodObject addCreditCardToUser(String referralApiKey, String number, int expirationMonth, int expirationYear, String cvc) throws EasyPostException Add credit card to a referral user. This function requires the Referral User's API key.- Parameters:
referralApiKey
- API key of the referral user.number
- Credit card number.expirationMonth
- Expiration month of the credit card.expirationYear
- Expiration year of the credit card.cvc
- CVC of the credit card.- Returns:
- PaymentMethodObject object.
- Throws:
EasyPostException
- when the request fails.
-
addCreditCardToUser
public PaymentMethodObject addCreditCardToUser(String referralApiKey, String number, int expirationMonth, int expirationYear, String cvc, PaymentMethod.Priority priority) throws EasyPostException Add credit card to a referral user. This function requires the Referral User's API key.- Parameters:
referralApiKey
- API key of the referral user.number
- Credit card number.expirationMonth
- Expiration month of the credit card.expirationYear
- Expiration year of the credit card.cvc
- CVC of the credit card.priority
- Priority of this credit card.- Returns:
- PaymentMethodObject object.
- Throws:
EasyPostException
- when the request fails.
-