Struct paystack::Subaccount
source · pub struct Subaccount { /* private fields */ }Expand description
A struct to hold all functions in the subaccount API route
Implementations§
source§impl Subaccount
impl Subaccount
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<String>,
to: Option<String>
) -> PaystackResult<ListSubaccountsResponse>
pub async fn list_subaccounts( &self, per_page: Option<u32>, page: Option<u32>, from: Option<String>, to: Option<String> ) -> 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: String
) -> PaystackResult<FetchSubaccountResponse>
pub async fn fetch_subaccount( &self, id_or_code: String ) -> 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: String,
body: CreateSubaccountBody
) -> PaystackResult<CreateSubaccountResponse>
pub async fn update_subaccount( &self, id_or_code: String, 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 Clone for Subaccount
impl Clone for Subaccount
source§fn clone(&self) -> Subaccount
fn clone(&self) -> Subaccount
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more