Struct mpesa::services::AccountBalanceBuilder[][src]

pub struct AccountBalanceBuilder<'a> { /* fields omitted */ }

Implementations

impl<'a> AccountBalanceBuilder<'a>[src]

pub fn new(
    client: &'a Mpesa,
    initiator_name: &'a str
) -> AccountBalanceBuilder<'a>
[src]

Creates a new AccountBalanceBuilder. Requires an initiator_name, the credential/ username used to authenticate the transaction request

pub fn command_id(self, command_id: CommandId) -> AccountBalanceBuilder<'a>[src]

Adds a CommandId, the unique command passed to the MPESA system. Defaults to CommandId::AccountBalance if not passed explicitly.

Errors

If CommandId is invalid

pub fn party_a(self, party_a: &'a str) -> AccountBalanceBuilder<'a>[src]

Adds PartyA, the shortcode of the organization receiving the transaction. This is a required field.

Errors

If Party A is not provided or invalid

pub fn identifier_type(
    self,
    identifier_type: IdentifierTypes
) -> AccountBalanceBuilder<'a>
[src]

Adds the ReceiverIdentifierType, the type of organization receiving the transaction. Defaults to IdentifierTypes::ShortCode if not passed explicitly

Errors

If invalid ReceiverIdentifierType is provided

pub fn remarks(self, remarks: &'a str) -> AccountBalanceBuilder<'a>[src]

Adds Remarks, a comment sent along transaction. Optional field that defaults to "None" if no value is provided

pub fn timeout_url(self, timeout_url: &'a str) -> AccountBalanceBuilder<'a>[src]

Error

If QueueTimeoutUrl is invalid or not provided

pub fn result_url(self, result_url: &'a str) -> AccountBalanceBuilder<'a>[src]

Error

If ResultUrl is invalid or not provided

pub fn urls(
    self,
    timeout_url: &'a str,
    result_url: &'a str
) -> AccountBalanceBuilder<'a>
[src]

👎 Deprecated

Adds QueueTimeoutUrl and ResultUrl. This is a required field

Error

If either QueueTimeoutUrl and ResultUrl is invalid or not provided

pub fn send(self) -> MpesaResult<AccountBalanceResponse>[src]

AccountBalance API

Enquire the balance on an M-Pesa BuyGoods (Till Number). A successful request returns a serde_json::Value type. See more here

Errors

Returns a MpesaError on failure

Trait Implementations

impl<'a> Debug for AccountBalanceBuilder<'a>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.