pub struct CustomersEndpoints<T: HttpClient + Default> { /* private fields */ }Expand description
A struct to hold all the functions of the customers API endpoint
Implementations§
Source§impl<T: HttpClient + Default> CustomersEndpoints<T>
impl<T: HttpClient + Default> CustomersEndpoints<T>
Sourcepub async fn create_customer(
&self,
create_customer_request: CreateCustomerRequest,
) -> PaystackResult<CustomerResponseData>
pub async fn create_customer( &self, create_customer_request: CreateCustomerRequest, ) -> PaystackResult<CustomerResponseData>
Create customer on your integration
It takes the following parameters:
- create_customer_request: contains the information about the customer to be created.
It should be built with CreateCustomerRequestBuilder.
Sourcepub async fn list_customers(
&self,
per_page: Option<u8>,
page: Option<u8>,
) -> PaystackResult<Vec<CustomerResponseData>>
pub async fn list_customers( &self, per_page: Option<u8>, page: Option<u8>, ) -> PaystackResult<Vec<CustomerResponseData>>
List customers available on your integration
It takes the following parameters:
- per_page: Specify how many records you want to retreive per page. If not specified, default value of 50.
- page: Specify exactly waht page you want to retreive. If not specified, default value of 1.
Sourcepub async fn fetch_customer(
&self,
email_or_code: String,
) -> PaystackResult<CustomerResponseData>
pub async fn fetch_customer( &self, email_or_code: String, ) -> PaystackResult<CustomerResponseData>
Get details of a customer on your integration.
It takes the following parameters:
- email_or_code: An emailor customer code for the customer you want to fetch.
Sourcepub async fn update_customer(
&self,
customer_code: String,
update_customer_request: UpdateCustomerRequest,
) -> PaystackResult<CustomerResponseData>
pub async fn update_customer( &self, customer_code: String, update_customer_request: UpdateCustomerRequest, ) -> PaystackResult<CustomerResponseData>
Update a customer’s details on your integration
It takes the following parameters:
- customer_code: The customer’s code
- update_customer_request: The data to update the customer with.
It should be created with the UpdateCustomerRequestBuilder struct.
Sourcepub async fn validate_customer(
&self,
customer_code: String,
customer_validation_request: ValidateCustomerRequest,
) -> PaystackResult<PhantomData<String>>
pub async fn validate_customer( &self, customer_code: String, customer_validation_request: ValidateCustomerRequest, ) -> PaystackResult<PhantomData<String>>
Validate a customer’s identity
It takes in the following parameters:
- customer_code: email, or customer code of customer to be identified.
- customer_validation_request: The data to validate the customer with.
It should be created with the ValidateCustomerRequestBuilder struct.
Sourcepub async fn whitelist_or_blacklist_customer(
&self,
customer_code: String,
risk_action: RiskAction,
) -> PaystackResult<CustomerResponseData>
pub async fn whitelist_or_blacklist_customer( &self, customer_code: String, risk_action: RiskAction, ) -> PaystackResult<CustomerResponseData>
Whitelist or blacklist a customer on your integration
It takes in the following parameters:
- customer_code: Customer’s code, or email address.
- risk_action: One of the possible risk actions for the customer.
Deactivate an authorization when the card needs to be forgotten
It takes the following parameters:
- authorization_code: Authorization code to be deactivated.
Trait Implementations§
Source§impl<T: Clone + HttpClient + Default> Clone for CustomersEndpoints<T>
impl<T: Clone + HttpClient + Default> Clone for CustomersEndpoints<T>
Source§fn clone(&self) -> CustomersEndpoints<T>
fn clone(&self) -> CustomersEndpoints<T>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more