Crates.io | shurjopay-plugin |
lib.rs | shurjopay-plugin |
version | 0.1.1 |
source | src |
created_at | 2023-01-01 12:40:02.230033 |
updated_at | 2023-01-01 13:22:35.312709 |
description | Rust plugin for for quick integration of shurjopay API |
homepage | |
repository | https://github.com/shurjopay-plugins/sp-plugin-rust |
max_upload_size | |
id | 748838 |
size | 49,925 |
Official shurjoPay Rust Crate (plugin) for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by ShurjoMukhi Limited.
This plugin package can be used with any rust application or framework (e.g. yew, rocket etc). It makes it easy for developers to integrate with shurjoPay v2.1 with just three API calls:
Also it reduces many of the things that you had to do manually
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.
[dependencies]
shurjopay-plugin = "0.1.1"
use shurjopay_plugin::Shurjopay::ShurjopayPlugin;
let mut sp_instance = ShurjopayPlugin::new();
you can configure ShurjopayPlugin two ways
sp_instance.set_config_from_env_file();
in this way you need to configure .env file in this way.
keep the .toml and .env file in the same directiory
# .env
SP_USERNAME="sp_sandbox"
SP_PASSWORD="pyyk97hu&6u6"
POST_DEFAULT_ADDRESS="https://sandbox.shurjopayment.com"
DEFAULT_RETURN_URL="https://sandbox.shurjopayment.com/response"
DEFAULT_CANCEL_URL="https://sandbox.shurjopayment.com/response"
sp_instance.set_all_config(
"sp_sandbox".to_string(), // SP_USERNAME
"pyyk97hu&6u6".to_string(), // SP_PASSWORD
"https://sandbox.shurjopayment.com".to_string(), // POST_DEFAULT_ADDRESS
"https://sandbox.shurjopayment.com/response".to_string(), // DEFAULT_RETURN_URL
"https://sandbox.shurjopayment.com/response".to_string(), // DEFAULT_CANCEL_URL
);
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);
shurjoPay Rust Crate (plugin) API documentation plugin API documentation
Rust example application showing usage of the Rust crate.
Sample applications and projects in many different languages and frameworks showing shurjopay integration.
shurjoPay Postman site illustrating the request and response flow using the sandbox system.
shurjopay Plugins home page on github
This code is under the MIT open source License.