{"id":19407632,"url":"https://github.com/shurjopay-plugins/sp-plugin-rust","last_synced_at":"2025-04-24T09:31:42.435Z","repository":{"id":65148739,"uuid":"548028127","full_name":"shurjopay-plugins/sp-plugin-rust","owner":"shurjopay-plugins","description":"shurjoPay plugin for Rust language and frameworks","archived":false,"fork":false,"pushed_at":"2023-01-01T13:31:24.000Z","size":99,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T04:06:50.762Z","etag":null,"topics":["cargo","payment-gateway","payments","rust","rust-lang","shurjomukhi","shurjopay"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shurjopay-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-08T19:42:17.000Z","updated_at":"2023-04-26T10:17:06.000Z","dependencies_parsed_at":"2023-01-02T01:20:17.203Z","dependency_job_id":null,"html_url":"https://github.com/shurjopay-plugins/sp-plugin-rust","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shurjopay-plugins","download_url":"https://codeload.github.com/shurjopay-plugins/sp-plugin-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250600712,"owners_count":21457015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","payment-gateway","payments","rust","rust-lang","shurjomukhi","shurjopay"],"created_at":"2024-11-10T12:03:17.517Z","updated_at":"2025-04-24T09:31:42.186Z","avatar_url":"https://github.com/shurjopay-plugins.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![alt text](https://shurjopay.com.bd/dev/images/shurjoPay.png) Shurjopay Rust Crate (plugin)\n\n[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)]()\n[![Crate](https://badgen.net/crates/v/shurjopay-plugin)](https://crates.io/crates/shurjopay-plugin)\n[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://github.com/shurjopay-plugins/shurjopay-plugin)\n[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://docs.rs/shurjopay-plugin)\n[![API](https://docs.rs/rand/badge.svg)](https://docs.rs/shurjopay-plugin)\n[![Minimum rustc version](https://img.shields.io/badge/rust-1.63+-red)](https://www.rust-lang.org/)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n\nOfficial shurjoPay Rust Crate (plugin) for merchants or service providers to connect with [**_shurjoPay_**](https://shurjopay.com.bd) Payment Gateway v2.1 developed and maintained by [_**ShurjoMukhi Limited**_](https://shurjomukhi.com.bd).\n\nThis plugin package can be used with any rust application or framework (e.g. yew, rocket etc).\nIt makes it easy for developers to integrate with shurjoPay v2.1 with just three API calls:\n\n1. **makePayment**: create and send payment request\n1. **verifyPayment**: verify payment status at shurjoPay\n1. **paymentStatus**: Check payment details and status\n\nAlso it reduces many of the things that you had to do manually\n\n- Handles http request and request errors\n- JSON serialization and deserialization\n- Authentication during checkout and verification of payments\n\n## Audience\n\nThis 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.\n\n# How to use this shurjoPay Plugin\n\n#### To integrate the shurjoPay Payment Gateway in your Rust project do the following tasks sequentially.\n\n#### Step 1: Cargo.toml file Configuration\n\n```toml\n[dependencies]\nshurjopay-plugin = \"0.1.1\"\n```\n\n#### Step 2: Import Crate into your project\n```rust\nuse shurjopay_plugin::Shurjopay::ShurjopayPlugin;\n```\n#### Step 3: Create a new instance of ShurjopayPlugin\n```rust\nlet mut sp_instance = ShurjopayPlugin::new();\n```\n#### Step 4: Setting configuration of ShurjopayPlugin\n\nyou can configure ShurjopayPlugin two ways\n\n* Option 1: configure plugin using .env file\n\n```rust\nsp_instance.set_config_from_env_file();\n```\nin this way you need to configure .env file in this way.\n\n**keep the .toml and .env file in the same directiory** \n\n```rust\n# .env\nSP_USERNAME=\"sp_sandbox\"\nSP_PASSWORD=\"pyyk97hu\u00266u6\"\nPOST_DEFAULT_ADDRESS=\"https://sandbox.shurjopayment.com\"\nDEFAULT_RETURN_URL=\"https://sandbox.shurjopayment.com/response\"\nDEFAULT_CANCEL_URL=\"https://sandbox.shurjopayment.com/response\"\n```\n\n* Option 2: Configure plugin using this function\n```rust\nsp_instance.set_all_config(\n        \"sp_sandbox\".to_string(),                                   // SP_USERNAME\n        \"pyyk97hu\u00266u6\".to_string(),                                 // SP_PASSWORD\n        \"https://sandbox.shurjopayment.com\".to_string(),            // POST_DEFAULT_ADDRESS\n        \"https://sandbox.shurjopayment.com/response\".to_string(),   // DEFAULT_RETURN_URL\n        \"https://sandbox.shurjopayment.com/response\".to_string(),   // DEFAULT_CANCEL_URL\n        );\n```\n\n#### Step 5: To intiate make payment fisrt you need configure payment request object using the following function and pass the object into make_payment_no_auto_redirect() function\n```rust\nlet payment_req_obj = sp_instance.make_payment_request_object(\n    \"786\".to_string(),              // amount\n    \"abc123\".to_string(),           // order_id\n    \"BDT\".to_string(),              // currency\n    \"Mahmudul Islam\".to_string(),   // customer_name\n    \"Dhaka\".to_string(),            // customer_address\n    \"01800000000\".to_string(),      // customer_phone\n    \"Dhaka\".to_string(),            // customer_city\n    \"1203\".to_string(),             // customer_post_code\n    );\n```\n\n```rust\nlet checkout_url = sp_instance.make_payment(payment_req_obj); \n```\n\n## References\n1. [shurjoPay Rust Crate (plugin) API documentation](https://docs.rs/sp-plugin-rust) plugin API documentation\n2. [Rust example application](https://github.com/shurjopay-plugins/sp-plugin-usage-examples/tree/dev/rust-app-rust-plugin) showing usage of the Rust crate.\n3. [Sample applications and projects](https://github.com/shurjopay-plugins/sp-plugin-usage-examples) in many different languages and frameworks showing shurjopay integration.\n4. [shurjoPay Postman site](https://documenter.getpostman.com/view/6335853/U16dS8ig) illustrating the request and response flow using the sandbox system.\n5. [shurjopay Plugins](https://github.com/shurjopay-plugins) home page on github\n\n\n## License\nThis code is under the [MIT open source License](LICENSE).\n#### Please [contact](https://shurjopay.com.bd/#contacts) with shurjoPay team for more detail.\n### Copyright ©️2022 [ShurjoMukhi Limited](https://shurjopay.com.bd/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-rust/lists"}