Zarinpal payment gateway api
This's a rust implementation of zarinpal payment gateway api client.
Installation
cargo add zarinpal
Usage example
Here's how you can get started with the crate
Initialize client
use *;
async
Request a basic payment
// ~~~ sniff ~~~
let request = zarinpal
.request_payment
.build
.await?;
Verify a payment
// ~~~ sniff ~~~
let verified = zarinpal
.verify_payment
.build
.await?;
Request payment with metadata
// ~~~ sniff ~~~
let request_2 = zarinpal
.request_payment
.metadata
.build
.await?;
Change currency in a payment
// ~~~ sniff ~~~
let request_3 = zarinpal
.request_payment
.currency // Tomans
.build
.await?;
Payment request with wages
// ~~~ sniff ~~~
let request_4 = zarinpal
.request_payment
.wages
.build
.await?;
Unverified payments
Revert a list of 100 recent unverified payments.
// ~~~ sniff ~~~
let unverified_payments = zarinpal.unverified_requests.build.await?;
for unverified in unverified_payments.authorities
Happy making money 🔥