alt text Shurjopay Rust Crate (plugin)

Test Status Crate Book API API Minimum rustc version MIT licensed

Official shurjoPay Rust Crate (plugin) for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by shurjoMukhi Limited.

It handles many of the things that most people need to do manually

📝 NOTE For shurjoPay live engine integration's all necessary credential will be given to merchant after subscription completed on shurjoPay gateway.

Audience

This document is intended for the developers and technical personnel of merchants and service providers who want to integrate the shurjoPay online payment gateway using python.

How to use this shurjoPay Plugin

To integrate the shurjoPay Payment Gateway in your Rust project do the following tasks sequentially.

step:1 Cargo.toml file Configuration

toml [dependencies] shurjopay-plugin = "0.1.0"

step:2 Import Crate into your project

use shurjopay_plugin::Shurjopay::ShurjopayPlugin;

step:3 creating a new instance of Shurjopayplugin

let mut sp_instance = ShurjopayPlugin::new();

Configure Shurjopay

step:4 setting configuration of Shurjopayplugin

you can configure ShurjopayPlugin two ways

keep the .toml and .env file in the same directiory

```

.env

SPUSERNAME="spsandbox" SPPASSWORD="pyyk97hu&6u6" POSTDEFAULTADDRESS="https://sandbox.shurjopayment.com" DEFAULTRETURNURL="https://sandbox.shurjopayment.com/response" DEFAULTCANCEL_URL="https://sandbox.shurjopayment.com/response" ```

Make Payment

step:5 To intiate make payment fisrt you need configure payment request object using the following function and pass the object into makepaymentnoautoredirect() function

let payment_req_obj = sp_instance.make_payment_request_object( "786".to_string(), // amount "abc123".to_string(), // order_id "BDT".to_string(), // currency "Mahmudul Islam".to_string(), // customer_name "Dhaka".to_string(), // customer_address "01800000000".to_string(), // customer_phone "Dhaka".to_string(), // customer_city "1203".to_string(), // customer_post_code );

let checkout_url = sp_instance.make_payment(payment_req_obj);

Verify Payment

step:6 to verify payment you need use this function

``` let orderid = Some("sp63935da67dfd3".tostring());

let response = spinstance.verifypayment(order_id); println!("verify Payment Response: {:?}",response);

if response.issome() { println!("{:#?}", response.unwrap().clone().spmessage.unwrap()); } ```

References

  1. shurjoPay Rust Crate (plugin) API documentation plugin API documentation
  2. Rust example application showing usage of the Rust crate.
  3. Sample applications and projects in many different languages and frameworks showing shurjopay integration.
  4. shurjoPay Postman site illustrating the request and response flow using the sandbox system.
  5. shurjopay Plugins home page on github

License

This code is under the MIT open source License.

Please contact with shurjoPay team for more detail.

Copyright ©️2022 ShurjoMukhi Limited