Class ReferralCustomerService
java.lang.Object
com.easypost.service.ReferralCustomerService
-
Method Summary
Modifier and TypeMethodDescriptionaddBankAccountFromStripe(String referralApiKey, String financialConnectionsId, Map<String, Object> mandateData, PaymentMethod.Priority priority) Add a bank account to EasyPost for a ReferralCustomer.addCreditCardFromStripe(String referralApiKey, String paymentMethodId, PaymentMethod.Priority priority) Add a credit card to EasyPost for a ReferralCustomer with a payment method ID from Stripe.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.Retrieve EasyPost Stripe API key.voidupdateEmail(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.
-
addCreditCardFromStripe
public PaymentMethodObject addCreditCardFromStripe(String referralApiKey, String paymentMethodId, PaymentMethod.Priority priority) throws EasyPostException Add a credit card to EasyPost for a ReferralCustomer with a payment method ID from Stripe. This function requires the ReferralCustomer User's API key.- Parameters:
referralApiKey- API key of the referral user.paymentMethodId- Payment method ID from Stripe.priority- Priority of the credit card (e.g., "primary" or "secondary").- Returns:
- PaymentMethodObject object.
- Throws:
EasyPostException- when the request fails.
-
addBankAccountFromStripe
public PaymentMethodObject addBankAccountFromStripe(String referralApiKey, String financialConnectionsId, Map<String, Object> mandateData, PaymentMethod.Priority priority) throws EasyPostExceptionAdd a bank account to EasyPost for a ReferralCustomer. This function requires the ReferralCustomer User's API key.- Parameters:
referralApiKey- API key of the referral user.financialConnectionsId- Financial connections ID from Stripe.mandateData- Mandate data for the bank account.priority- Priority of the bank account (e.g., "primary" or "secondary").- Returns:
- PaymentMethodObject object.
- Throws:
EasyPostException- when the request fails.
-
retrieveEasypostStripeApiKey
Retrieve EasyPost Stripe API key.- Returns:
- EasyPost Stripe API key.
- Throws:
EasyPostException- when the request fails.
-