定制 shurjomukhi/shurjopay-plugin-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shurjomukhi/shurjopay-plugin-php

Composer 安装命令:

composer require shurjomukhi/shurjopay-plugin-php

包简介

shurjoPay is a online payment gateway and easy payment solution

README 文档

README

Made With Test Status NPM version

Official shurjoPay PHP 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 PHP application or framework (e.g. Laravel, Lumen, CodeIgniter, Symfony, CakePHP, Yii etc). Use this plugin in your CMS (Wordpress, Magento, Joomla, OpenCart, Drupal etc) projects or checkour our dedicated plugins for the renowned CMS. It makes it easy for developers to integrate with shurjoPay v2.1 with just three API calls:

  1. authenticate: Authenticate merchants and generate token
  2. makePayment: Create and send payment request
  3. verifyPayment: Verify payment status at shurjoPay

Also reduces many of the things that you had to do manually

  • Handles http request and errors
  • Log generation at your prefarable path
  • Authentication during checkout and verification of payments

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 PHP.

How to use this shurjoPay Plugin

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

Add the shurjopay-plugin-php as your project dependency.

$ composer require shurjomukhi/shurjopay-plugin-php

Setup parameters for shurjopay plugin correctly in your application in a config file as shown below.

# shurjopay merchant username
SP_USERNAME='sp_sandbox'
# shurjopay merchant password
SP_PASSWORD='pyyk97hu&6u6'
# Merchant prefix used to generate order id
SP_PREFIX='NOK'
# shurjopay payment gateway API endpoint
SHURJOPAY_API='https://sandbox.shurjopayment.com'
# URL to redirect after completion of a payment. Sample: https://sandbox.shurjopayment.com/response
SP_CALLBACK='http://localhost/your-php-app/return.php'
# Log location of shurjopay php plugin
SP_LOG_LOCATION='/var/log/shurjopay'
# CURLOPT_SSL_VERIFYPEER=0 only for local and non-SSL environment 
CURLOPT_SSL_VERIFYPEER=1

Note: Remember to use live credentials in config file before going in production.

Now, create instance of Shurjopay with ShurjopayConfig. To read the parameters from config or env file, you may use the ShurjopayEnvReader.

Check out test class to view an example.

$env = new ShurjopayEnvReader(__DIR__ . '/_env');
$sp_instance = new Shurjopay($env->getConfig());

After that, initiate a payment request to shurjoPay using our plugin in your application. Below is a basic example code snippet.

$request = new PaymentRequest();
# All the data will come from user end.
$request->currency = 'BDT';
$request->amount = 100;
$request->discountAmount = 0;
$request->discPercent = 0;
$request->customerName = 'Abdul Mannan';
$request->customerPhone = '01712345678';
$request->customerEmail = 'test@gmail.com';
$request->customerAddress = 'Dhaka';
$request->customerCity = 'Dhaka';
$request->customerState = 'Dhaka';
$request->customerPostcode = '1209';
$request->customerCountry = 'Bangladesh';
$request->shippingAddress = 'Sirajganj';
$request->shippingCity = 'Dhaka';
$request->shippingCountry = 'Bangladesh';
$request->receivedPersonName = 'Jalil Mia';
$request->shippingPhoneNumber = '01712345678';
# Custom data can be sent using these value[1-4] fields which will be returned back to you in response. Any type of data can be passed on; e.g. string, integer, array etc.
$request->value1 = array("val1", "val2", "val3");
$request->value2 = 'value2';
$request->value3 = 'value3';
$request->value4 = 'value4';

$sp_instance->makePayment($request);

Payment verification can be done after each transaction with shurjopay order id.

$sp_instance->verifyPayment($order_id);

Check our documentation on verify for more details.

References

  1. PHP sample project showing usage of the PHP plugin.
  2. Laravel sample project using PHP plugin to get your feet wet with shurjopay.
  3. OpenCart plugin
  4. OpenCart sample project
  5. Sample applications and projects in many different languages and frameworks showing shurjopay integration.
  6. shurjoPay Postman site illustrating the request and response flow using the sandbox system.
  7. 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 ©️2023 ShurjoMukhi Limited.

shurjomukhi/shurjopay-plugin-php 适用场景与选型建议

shurjomukhi/shurjopay-plugin-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.03k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2023 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「codeigniter」 「payments」 「laravel」 「symphony」 「payment-gateway」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 shurjomukhi/shurjopay-plugin-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 shurjomukhi/shurjopay-plugin-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 shurjomukhi/shurjopay-plugin-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-18