Official shurjoPay JavaScript package (plugin) for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by ShurjoMukhi Limited.
This plugin package is compatible with any TypeScript or JavaScript application or framework, including React, Vue.js, Angular, Next.js, and more. Also it makes it easy for developers to integrate with shurjoPay v2.1 with just three API calls:
- makePayment: create and send payment processing request
- verifyPayment: verify payment status at shurjoPay
Also reduces many of the things that you had to do manually
- Handles http request and errors
- JSON serialization and deserialization
- Authentication during checkout and verification of payments
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 javascript.
To integrate the shurjoPay Payment Gateway in your JavaScript project do the following tasks sequentially.
Step 1: Copy and paste the lib folder from the plugin into the root directory of your project environment.
Step 2: Copy and paste the shurjopay_config.js file from the plugin into the root directory of your project environment.
Checkout this react project to see this plugin in action.
Step 3: Set up the configuration parameters correctly in the shurjopay_config.js file for the shurjopay plugin within your application.
e.g. SP_ENDPOINT Url, SP_USERNAME, SP_PASSWORD, SP_PREFIX for the order id and SP_RETURN_URL.
Create a shurjopay_config.js in the project directory with text similar like below:
const shurjopay_config = {
SP_ENDPOINT: "https://sandbox.shurjopayment.com",
SP_USERNAME: "sp_sandbox",
SP_PASSWORD: "pyyk97hu&6u6",
SP_PREFIX: "sp",
SP_RETURN_URL: "https://<your.app.com>/shurjopay-response",
};
export { shurjopay_config };
import { makePayment } from "../lib/shurjoPay";
const form_data = {
prefix: "NOK",
currency: "BDT",
customer_name: "Md Wali Mosnad Ayshik",
customer_phone: "01775XXXXXX",
customer_email: "Ayshikmee@gmail.com",
customer_address: "123 Street, Dhaka",
customer_city: "Dhaka",
customer_state: "Dhaka",
customer_postcode: "1212",
customer_country: "Bangladesh",
shipping_address: "123 Street, Dhaka",
shipping_city: "Dhaka",
shipping_country: "Bangladesh",
received_person_name: "Ayshik",
shipping_phone_number: "017XXXXXXXX",
amount: 100,
};
const merchantOrderId = `your order id`;
const makePayment = await makePayment(merchantOrderId, form_data);
const verifyPayment_details = await verifyPayment(order_id as string);
- Next sample project showing usage of the javascript plugin.
- Vanilla javascript sample project to get your feet wet with shurjopay.
- 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.
Please contact with shurjoPay team for more detail.
Copyright ©️2022 ShurjoMukhi Limited.