Struct mpesa::services::C2bRegisterBuilder [−][src]
pub struct C2bRegisterBuilder<'a> { /* fields omitted */ }
Expand description
C2B Register builder
Implementations
impl<'a> C2bRegisterBuilder<'a>
[src]
impl<'a> C2bRegisterBuilder<'a>
[src]pub fn new(client: &'a Mpesa) -> C2bRegisterBuilder<'a>
[src]
pub fn new(client: &'a Mpesa) -> C2bRegisterBuilder<'a>
[src]Creates a new C2B Builder
pub fn validation_url(self, validation_url: &'a str) -> C2bRegisterBuilder<'a>
[src]
pub fn validation_url(self, validation_url: &'a str) -> C2bRegisterBuilder<'a>
[src]Adds ValidationURL
for the client. This is a required field
Error
If ValidationURL
is invalid or not provided
pub fn confirmation_url(
self,
confirmation_url: &'a str
) -> C2bRegisterBuilder<'a>
[src]
pub fn confirmation_url(
self,
confirmation_url: &'a str
) -> C2bRegisterBuilder<'a>
[src]Adds ConfirmationUrl
for the client. This is a required field
Error
If ConfirmationUrl
is invalid or not provided
pub fn response_type(
self,
response_type: ResponseType
) -> C2bRegisterBuilder<'a>
[src]
pub fn response_type(
self,
response_type: ResponseType
) -> C2bRegisterBuilder<'a>
[src]Adds ResponseType
for timeout. Will default to ResponseType::Complete
if not explicitly provided
pub fn short_code(self, short_code: &'a str) -> C2bRegisterBuilder<'a>
[src]
pub fn short_code(self, short_code: &'a str) -> C2bRegisterBuilder<'a>
[src]pub fn send(self) -> MpesaResult<C2bRegisterResponse>
[src]
pub fn send(self) -> MpesaResult<C2bRegisterResponse>
[src]C2B Register API
Registers the the 3rd party’s confirmation and validation URLs to M-Pesa
Registering maps these URLs to the 3rd party shortcode. Whenever M-Pesa receives a transaction on the shortcode, M-Pesa triggers a validation request against the validation URL and the 3rd party system responds to M-Pesa with a validation response (either a success or an error code). See more here
The response expected is the success code the 3rd party
A successful request returns a serde_json::Value
type
Errors
Returns a MpesaError
on failure