Struct paystack::ChargeBodyBuilder
source · pub struct ChargeBodyBuilder { /* private fields */ }
Expand description
Builder for ChargeBody
.
Implementations§
source§impl ChargeBodyBuilder
impl ChargeBodyBuilder
sourcepub fn amount(&mut self, value: String) -> &mut Self
pub fn amount(&mut self, value: String) -> &mut Self
Amount should be in the smallest unit of the currency e.g. kobo if in NGN and cents if in USD
Valid authorization code to charge
sourcepub fn reference(&mut self, value: Option<String>) -> &mut Self
pub fn reference(&mut self, value: Option<String>) -> &mut Self
Unique transaction reference. Only -
, .
, =
and alphanumeric characters allowed.
sourcepub fn currency(&mut self, value: Option<Currency>) -> &mut Self
pub fn currency(&mut self, value: Option<Currency>) -> &mut Self
Currency in which amount should be charged.
sourcepub fn metadata(&mut self, value: Option<String>) -> &mut Self
pub fn metadata(&mut self, value: Option<String>) -> &mut Self
Stringified JSON object. Add a custom_fields attribute which has an array of objects if you would like the fields to be added to your transaction when displayed on the dashboard. Sample: {“custom_fields”:[{“display_name”:“Cart ID”,“variable_name”: “cart_id”,“value”: “8393”}]}
sourcepub fn channel(&mut self, value: Option<Vec<Channel>>) -> &mut Self
pub fn channel(&mut self, value: Option<Vec<Channel>>) -> &mut Self
Send us ‘card’ or ‘bank’ or ‘card’,‘bank’ as an array to specify what options to show the user paying
sourcepub fn subaccount(&mut self, value: Option<String>) -> &mut Self
pub fn subaccount(&mut self, value: Option<String>) -> &mut Self
The code for the subaccount that owns the payment. e.g. ACCT_8f4s1eq7ml6rlzj
sourcepub fn transaction_charge(&mut self, value: Option<u32>) -> &mut Self
pub fn transaction_charge(&mut self, value: Option<u32>) -> &mut Self
A flat fee to charge the subaccount for this transaction in the subunit of the supported currency. This overrides the split percentage set when the subaccount was created. Ideally, you will need to use this if you are splitting in flat rates (since subaccount creation only allows for percentage split).
sourcepub fn bearer(&mut self, value: Option<String>) -> &mut Self
pub fn bearer(&mut self, value: Option<String>) -> &mut Self
Who bears Paystack charges? account or subaccount (defaults to account).
sourcepub fn queue(&mut self, value: Option<bool>) -> &mut Self
pub fn queue(&mut self, value: Option<bool>) -> &mut Self
If you are making a scheduled charge call, it is a good idea to queue them so the processing system does not get overloaded causing transaction processing errors. Send queue:true to take advantage of our queued charging.
sourcepub fn build(&self) -> Result<ChargeBody, ChargeBodyBuilderError>
pub fn build(&self) -> Result<ChargeBody, ChargeBodyBuilderError>
Trait Implementations§
source§impl Clone for ChargeBodyBuilder
impl Clone for ChargeBodyBuilder
source§fn clone(&self) -> ChargeBodyBuilder
fn clone(&self) -> ChargeBodyBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more