Class ReferralCustomerService
Class representing a set of referral customer-related beta functionality.
Inherited Members
Namespace: EasyPost.Services.Beta
Assembly: EasyPost.dll
Syntax
public class ReferralCustomerService : EasyPostService, IEasyPostService
  Constructors
| Improve this Doc View SourceReferralCustomerService(EasyPostClient)
Initializes a new instance of the ReferralCustomerService class.
Declaration
public ReferralCustomerService(EasyPostClient client)
  Parameters
| Type | Name | Description | 
|---|---|---|
| EasyPostClient | client | The EasyPostClient to tie to this service and use for API calls.  | 
      
Methods
| Improve this Doc View SourceAddPaymentMethod(AddPaymentMethod, CancellationToken)
Add a Stripe payment method to a ReferralCustomer This function should be called against a Client configured with the ReferralCustomer's API key. This function will fail if called against a non-Referral Customer Client. Related API documentation.
Declaration
public async Task<PaymentMethod> AddPaymentMethod(AddPaymentMethod parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AddPaymentMethod | parameters | AddPaymentMethod parameter set.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentMethod> | A PaymentMethod object.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ApiError | When the request fails.  | 
      
AddPaymentMethod(String, String, PaymentMethod.Priority, CancellationToken)
Add a Stripe payment method to a ReferralCustomer This function should be called against a Client configured with the ReferralCustomer's API key. This function will fail if called against a non-Referral Customer Client. Related API documentation.
Declaration
public async Task<PaymentMethod> AddPaymentMethod(string stripeCustomerId, string paymentMethodReference, PaymentMethod.Priority priority = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | stripeCustomerId | Unique customer ID provided by Stripe.  | 
      
| System.String | paymentMethodReference | ID of the card or bank account provided by Stripe.  | 
      
| PaymentMethod.Priority | priority | Which priority to save this payment method as on EasyPost.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentMethod> | A PaymentMethod object.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ApiError | When the request fails.  | 
      
CreateBankAccountClientSecret(CancellationToken)
Creates a client secret to use with Stripe when adding a bank account. Related API documentation.
Declaration
public async Task<StripeClientSecret> CreateBankAccountClientSecret(CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<StripeClientSecret> | A StripeClientSecret object containing the client secret.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ApiError | When the request fails.  | 
      
CreateBankAccountClientSecret(Nullable<String>, CancellationToken)
Creates a client secret to use with Stripe when adding a bank account. Related API documentation.
Declaration
public async Task<StripeClientSecret> CreateBankAccountClientSecret(string? returnUrl, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<System.String> | returnUrl | Optional return URL for the bank account setup.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<StripeClientSecret> | A StripeClientSecret object containing the client secret.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ApiError | When the request fails.  | 
      
CreateCreditCardClientSecret(CancellationToken)
Creates a client secret to use with Stripe when adding a credit card. Related API documentation.
Declaration
public async Task<StripeClientSecret> CreateCreditCardClientSecret(CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<StripeClientSecret> | A StripeClientSecret object containing the client secret.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ApiError | When the request fails.  | 
      
RefundByAmount(RefundByAmount, CancellationToken)
Refund a ReferralCustomer's wallet by a specified amount. Refund will be issued to the user's original payment method. Related API documentation.
Declaration
public async Task<PaymentRefund> RefundByAmount(RefundByAmount parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RefundByAmount | parameters | RefundByAmount parameter set.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentRefund> | A PaymentRefund object.  | 
      
RefundByAmount(Int32, CancellationToken)
Refund a ReferralCustomer's wallet by a specified amount. Refund will be issued to the user's original payment method. Related API documentation.
Declaration
public async Task<PaymentRefund> RefundByAmount(int amount, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | amount | Amount in cents to refund the Referral Customer.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentRefund> | A PaymentRefund object.  | 
      
RefundByPaymentLog(RefundByPaymentLog, CancellationToken)
Refund a ReferralCustomer's wallet for a specified payment log entry. Refund will be issued to the user's original payment method. Related API documentation.
Declaration
public async Task<PaymentRefund> RefundByPaymentLog(RefundByPaymentLog parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RefundByPaymentLog | parameters | RefundByPaymentLog parameter set.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentRefund> | A PaymentRefund object.  | 
      
RefundByPaymentLog(String, CancellationToken)
Refund a ReferralCustomer's wallet for a specified payment log entry. Refund will be issued to the user's original payment method. Related API documentation.
Declaration
public async Task<PaymentRefund> RefundByPaymentLog(string paymentLogId, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | paymentLogId | Payment log ID to refund.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<PaymentRefund> | A PaymentRefund object.  |