Struct paystack::SubaccountEndpoints
source · pub struct SubaccountEndpoints<'a> { /* private fields */ }
Expand description
A struct to hold all functions in the subaccount API route
Implementations§
source§impl<'a> SubaccountEndpoints<'a>
impl<'a> SubaccountEndpoints<'a>
sourcepub fn new(key: &'a str) -> SubaccountEndpoints<'a>
pub fn new(key: &'a str) -> SubaccountEndpoints<'a>
Constructor for the subaccount object
sourcepub async fn create_subaccount(
&self,
body: CreateSubaccountBody
) -> PaystackResult<CreateSubaccountResponse>
pub async fn create_subaccount( &self, body: CreateSubaccountBody ) -> PaystackResult<CreateSubaccountResponse>
Create a subaccount on your integration
Takes in the following parameters - body: subaccount to create.
sourcepub async fn list_subaccounts(
&self,
per_page: Option<u32>,
page: Option<u32>,
from: Option<&str>,
to: Option<&str>
) -> PaystackResult<ListSubaccountsResponse>
pub async fn list_subaccounts( &self, per_page: Option<u32>, page: Option<u32>, from: Option<&str>, to: Option<&str> ) -> PaystackResult<ListSubaccountsResponse>
List subaccounts available on your integration
Take in the following parameters
- perPage: Specify how many records you want to retrieve per page. If not specify we use a default value of 50.
- page: Specify exactly what page you want to retrieve. If not specify we use a default value of 1.
- from: A timestamp from which to start listing subaccounts e.g. 2016-09-24T00:00:05.000Z
, 2016-09-21
- to: A timestamp at which to stop listing subaccounts e.g. 2016-09-24T00:00:05.000Z
, 2016-09-21
sourcepub async fn fetch_subaccount(
&self,
id_or_code: &str
) -> PaystackResult<FetchSubaccountResponse>
pub async fn fetch_subaccount( &self, id_or_code: &str ) -> PaystackResult<FetchSubaccountResponse>
Get details of a subaccount on your integration.
Takes the following parameters:
- id_or_code: The subaccount ID
or code
you want to fetch
sourcepub async fn update_subaccount(
&self,
id_or_code: &str,
body: CreateSubaccountBody
) -> PaystackResult<CreateSubaccountResponse>
pub async fn update_subaccount( &self, id_or_code: &str, body: CreateSubaccountBody ) -> PaystackResult<CreateSubaccountResponse>
Update a subaccount details on your integration.
Takes the following parameters: - id_or_code: Subaccount’s ID or code. - body: Subaccount modification payload
Trait Implementations§
source§impl<'a> Clone for SubaccountEndpoints<'a>
impl<'a> Clone for SubaccountEndpoints<'a>
source§fn clone(&self) -> SubaccountEndpoints<'a>
fn clone(&self) -> SubaccountEndpoints<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more