pub struct PaymentBuilder { /* private fields */ }Expand description
Building blocks for initiating a Paystack Payment
Implementations§
Source§impl PaymentBuilder
impl PaymentBuilder
Sourcepub fn init_payment(email: String, amount: f64, key: Secret<String>) -> Self
pub fn init_payment(email: String, amount: f64, key: Secret<String>) -> Self
Initiate your PaymentBuilder taking in the basic requirements as args.
key can be derived using the cred_from_env
Sourcepub fn amount(&self) -> f64
pub fn amount(&self) -> f64
Amount in the subunit of the supported currency you are debiting customer. Do not pass this if creating subscriptions.
Sourcepub fn currency(&mut self, currency: Currency)
pub fn currency(&mut self, currency: Currency)
On of the supported currency [ NGN, USD, GHS, ZAR, KES]. The charge should be performed in. It defaults to your integration currency.
Sourcepub fn metadata(&mut self, metadata: String)
pub fn metadata(&mut self, metadata: String)
Object containing any extra information you want recorded with the transaction. Fields within the custom_field object will show up on merchant receipt and within the transaction information on the Paystack Dashboard.
Sourcepub fn label(&mut self, label: String)
pub fn label(&mut self, label: String)
String that replaces customer email as shown on the checkout form
Sourcepub fn reference(&mut self, reference: String)
pub fn reference(&mut self, reference: String)
Unique case sensitive transaction reference. Only -,., =and alphanumeric characters allowed. If you do not pass this parameter, Paystack will generate a unique reference for you.
Sourcepub fn mobile_money(&mut self, mobile_money: MobileMoney)
pub fn mobile_money(&mut self, mobile_money: MobileMoney)
Set your mobile money data
Sourcepub fn bank_transfer(&mut self, bank_transfer: BankTransfer)
pub fn bank_transfer(&mut self, bank_transfer: BankTransfer)
Set your bank transfer data
Sourcepub fn add_fallback(&self, f: fn())
pub fn add_fallback(&self, f: fn())
Add runtime funtions such as callback, onClose and onBankTransferConfirmationPending