Struct mpesa::services::SingleInvoiceBuilder
source · pub struct SingleInvoiceBuilder<'mpesa, Env: ApiEnvironment> { /* private fields */ }
Implementations§
source§impl<'mpesa, Env: ApiEnvironment> SingleInvoiceBuilder<'mpesa, Env>
impl<'mpesa, Env: ApiEnvironment> SingleInvoiceBuilder<'mpesa, Env>
sourcepub fn new(client: &'mpesa Mpesa<Env>) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn new(client: &'mpesa Mpesa<Env>) -> SingleInvoiceBuilder<'mpesa, Env>
Creates a new Bill Manager Single Invoice Builder
sourcepub fn amount<Number: Into<f64>>(
self,
amount: Number
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn amount<Number: Into<f64>>( self, amount: Number ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds amount
sourcepub fn account_reference(
self,
account_refernce: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn account_reference( self, account_refernce: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds account_reference
sourcepub fn billed_full_name(
self,
billed_full_name: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn billed_full_name( self, billed_full_name: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds billed_full_name
sourcepub fn billed_period(
self,
billed_period: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn billed_period( self, billed_period: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds billed_period
; must be in the format "Month Year"
e.g. "March 2023"
sourcepub fn billed_phone_number(
self,
billed_phone_number: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn billed_phone_number( self, billed_phone_number: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds billed_phone_number
; must be in the format 0722XXXXXX
sourcepub fn due_date(
self,
due_date: DateTime<Utc>
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn due_date( self, due_date: DateTime<Utc> ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds due_date
sourcepub fn external_reference(
self,
external_reference: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn external_reference( self, external_reference: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds external_reference
sourcepub fn invoice_items(
self,
invoice_items: Vec<InvoiceItem<'mpesa>>
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn invoice_items( self, invoice_items: Vec<InvoiceItem<'mpesa>> ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds invoice_items
sourcepub fn invoice_name(
self,
invoice_name: &'mpesa str
) -> SingleInvoiceBuilder<'mpesa, Env>
pub fn invoice_name( self, invoice_name: &'mpesa str ) -> SingleInvoiceBuilder<'mpesa, Env>
Adds invoice_name
sourcepub async fn send(self) -> MpesaResult<SingleInvoiceResponse>
pub async fn send(self) -> MpesaResult<SingleInvoiceResponse>
Bill Manager Single Invoice API
Creates and sends invoices to your customers
A successful request returns a SingleInvoiceResponse
type
Errors
Returns an MpesaError
on failure
Trait Implementations§
Auto Trait Implementations§
impl<'mpesa, Env> !RefUnwindSafe for SingleInvoiceBuilder<'mpesa, Env>
impl<'mpesa, Env> !Send for SingleInvoiceBuilder<'mpesa, Env>
impl<'mpesa, Env> !Sync for SingleInvoiceBuilder<'mpesa, Env>
impl<'mpesa, Env> Unpin for SingleInvoiceBuilder<'mpesa, Env>
impl<'mpesa, Env> !UnwindSafe for SingleInvoiceBuilder<'mpesa, Env>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more