gdbhosale/paywitheasebuzz-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

gdbhosale/paywitheasebuzz-php

Composer 安装命令:

composer require gdbhosale/paywitheasebuzz-php

包简介

PHP Package integration kit for pay with easebuzz pay.easebuzz.in

README 文档

README

PHP Laravel package for Easebuzz Payment Gateway pay.easebuzz.in

Software Requirement

Setup php kits on test/development/production environment install below software

  1. PHP 5.5 or above

Easebuzz Documentation for kit integration

https://docs.easebuzz.in/

Installation

A. Install via composer

composer require gdbhosale/paywitheasebuzz-php

B. Usage:

use Easebuzz\Easebuzz;

$MERCHANT_KEY = "10PBP71ABZ2";
$SALT = "ABC55E8IBW";         
$ENV = "test";   // set enviroment name : test / development / production

$easebuzzObj = new Easebuzz($MERCHANT_KEY, $SALT, $ENV);

Easebuzz API calls:

  1. Initiate Payment API

    POST Format and call initiatePaymentAPI

    $postData = array ( 
        "txnid" => "T3SAT0B5OL", 
        "amount" => "100.0", 
        "firstname" => "jitendra", 
        "email" => "test@gmail.com", 
        "phone" => "1231231235", 
        "productinfo" => "Laptop", 
        "surl" => "http://localhost:3000/response.php", 
        "furl" => "http://localhost:3000/response.php", 
        "udf1" => "aaaa", 
        "udf2" => "aaaa", 
        "udf3" => "aaaa", 
        "udf4" => "aaaa", 
        "udf5" => "aaaa", 
        "address1" => "aaaa", 
        "address2" => "aaaa", 
        "city" => "aaaa", 
        "state" => "aaaa", 
        "country" => "aaaa", 
        "zipcode" => "123123" 
    );
    
    $easebuzzObj->initiatePaymentAPI($postData);    
    

    Advanced Parameter:

    • "sub_merchant_id" : - Mandatory parameter if you are using sub-aggregator feature otherwise not mandatory.Here Pass sub-aggregator id.You can create sub aggregator from Easebuzz dashboard web portal."

    • "unique_id" : - Mandatory parameter if you are using customer save card feature otherwise not mandatory. This is customer’s unique id. You need to enable save card feature from the Easebuzz dashboard web portal.

    • "split_payments" : - Mandatory parameter if you are using split payment feature otherwise not mandatory.You need to pass here payment slots in JSON format like {"label_HDFC": 100,"label_icici":100}, Please use label provided by Easebuzz team.

      e.g. "split_payments" => { "axisaccount" : 100, "hdfcaccount" : 100}
      
  2. Transaction API

    POST Format and call transaction API

    $postData = array ( 
        "txnid" => "TZIF0SS24C",
        "amount" => "1.03",
        "email" => "test@gmail.com",
        "phone" => "1231231235"
    );
    
    $result = $easebuzzObj->transactionAPI($postData);    
    
  3. Transaction API (by date)

    POST Format and call transactionDateAPI

    $postData = array( 
        "merchant_email" => "jitendra@gmail.com",
        "transaction_date" => "06-06-2018" 
    );
    
    $result = $easebuzzObj->transactionDateAPI($postData);
    
  4. Refund API

    POST Format and call refundAPI

    $postData = array( 
        "txnid" => "ASD20088",
        "refund_amount" => "1.03",
        "phone" => "1231231235",
        "email" => "test@gmail.com",
        "amount" => "1.03" 
    );
    
    $result = $easebuzzObj->refundAPI($postData);    
    
  5. Payout API

    POST Format and call payoutAPI

    $postData = array( 
        "merchant_email" => "jitendra@gmail.com",
        "payout_date" => "08-06-2018" 
    );
    
    $result = $easebuzzObj->payoutAPI($postData);
    
  6. Handle Initiate Payment API response

    Note:- initiate payment API response will get for success URL or failure URL

    1. Import Easebuzz library
      use Easebuzz\Easebuzz;
      
    2. set $SALT
      $SALT = "ABC55E8IBW";
      
    3. create Easebuzz class object and pass $SALT.
      $easebuzzObj = new Easebuzz($MERCHANT_KEY = null, $SALT, $ENV = null);
      
    4. call Easebuzz class methods or functions
      $result = $easebuzzObj->easebuzzResponse($_POST);
      
  7. If the server is not supporting the header():-

    Note:- Please follow the below steps.

    1. Go to the path easebuzz-lib/payment.php

    2. Open the payment.php file

    3. Goto the function _paymentResponse($result) and un-comment the below code.

      function _paymentResponse($result){
      
          if ($result->status === 1){
              // first way (comment below line)
              // header( 'Location:' . $result->data );
      
              // second way (un-comment below code)
              echo "
              <script type='text/javascript'>
                      window.location ='".$result->data."'
              </script>
              ";
      
      
              exit(); 
          }else{
              //echo '<h3>'.$result['data'].'</h3>';
              print_r(json_encode($result));
          }
      }
      
  8. If you have to enable ease checkout (iframe) in php kit :-

    Note:- Please follow the below steps.*

    1. Go to the path easebuzz-lib/easebuzz_payment_gateway.php

    2. Open the easebuzz_payment_gateway.php file

    3. Go to the function initiatePaymentAPI($params, $redirect=False) change in below code.

      public function initiatePaymentAPI($params, $redirect=False) {
          return initiate_payment($params, $redirect, $this->MERCHANT_KEY, $this->SALT, $this->ENV);
      }
      
    4. $redirect parameter as False for ease checkout (iframe).

    5. $redirect parameter as True for Hosted checkout .

gdbhosale/paywitheasebuzz-php 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-08