承接 zoodpay/laravel-package 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

zoodpay/laravel-package

Composer 安装命令:

composer require zoodpay/laravel-package

包简介

Laravel Package for processing payments through ZoodPay BNPL.

README 文档

README

Software License Total Downloads

Install

composer require zoodpay/laravel-package

Usage

Check that ZoodpayServiceProvider is added in the config/app.php, or Manually add it.

 'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
     ...
 ZoodPay\ZoodpayServiceProvider::class,
]

Add zoodpay credentials to the config/services.php config file as below.

return [

    ...
 'zoodpay' => [
        'merchant_key' => "",
        'merchant_secret' => "",
        'merchant_salt' => "",
        'merchant_api_url' => "",
        'merchant_api_ver' => "",
        'market_code' => "",
        'currency' =>"",
        'success_url' => "",
        'error_url' => "" ,
        'pending_url' => ""
    ]

Available functions:

//Return the ZoodPay Config settings
$this->app->zoodpay->getAPISettings()

//Fetch the merchant configuration. 
$this->app->zoodpay->getZoodPayLimit()

//To verify if ZoodPay need to be shown in Checkout Page
$this->app->zoodpay->availableZoodPayService($amount)

//Fetch the credit balance of a customer.
$this->app->zoodpay->getCreditBalance($phone_number)

//Return ZoodPay Signature for Transaction Signature Verification 
$this->app->zoodpay->getResponseSignature($amount, $merchant_reference_no, $transaction_id)

//Return ZoodPay Refund Signature for Refund Signature Verification 
$this->app->zoodpay->getRefundResponseSignature($merchant_refund_reference, $refund_amount, $status, $refund_id)

/*
 * Create Transaction Using ZoodPay, it will return ZoodPay API response.
 * Initiate the Models and set Values
 * $billing = new Model\BillingShippingInfo();
 * $customer = new Model\CustomerInfo();
 * $items[] = new Model\ItemsInfo();
 * $order = new Model\OrderInfo();
 * $shippingService = new Model\ShippingServiceInfo();
 * $shipping = $billing;
 * 
*/
$this->app->zoodpay->createTransaction($billing, $customer, $items, $order, $shipping, $shippingService)


/*
 * Set Delivery Date for the Paid Transaction,  it will return ZoodPay API response.
 * Init the Model and set Values
 * Model\DeliveryDate();
 * 
 * */
$this->app->zoodpay->setDeliveryDate($deliveryModel);

/*
 * Create Refund for the Paid Transaction,  it will return ZoodPay API response.
 * Init the Model and set Values
 * Model\CreateRefund()
 * 
 * */
$this->app->zoodpay->createRefund($refundModel);

/*
 * Get Refund Status by Refund id,  it will return ZoodPay API response.
 * Init the Model and set Values
 * Model\CreateRefund()
 * 
 * */
$this->app->zoodpay->getRefundStatusById($refund_id);

Process: ZoodPay Flow ZoodPay Flow

/* 1)
 * To check if ZoodPay need to be Shown in Checkout Page, call this function
 * and based on the available response show the corresponding service
*/
$this->app->zoodpay->availableZoodPayService($amount)

/* 2)
 * User Select ZoodPay Service and Click Pay, Prepare the request and Create Transaction 
 * and function will return ZoodPay API response.  
 * Initiate the Models and set Values
 * $billing = new Model\BillingShippingInfo();
 * $customer = new Model\CustomerInfo();
 * $items[] = new Model\ItemsInfo();
 * $order = new Model\OrderInfo();
 * $shippingService = new Model\ShippingServiceInfo();
 * $shipping = $billing;
 * 
 * API Response :
 * 
 * Transaction created: {"session_token":"YYYYYYYYYYYYYYYYYYYY","transaction_id":"407879856581528","expiry_time":"2021-12-22T16:58:49Z","payment_url":"https://b2c.zoodpay.com/index.php?XXXXXXXXXXXXXXXXXXXXXXXXXXXX","signature":"96496a0ae20cf58d936d195fd1d0b19526201313f7af97aae3e99610e314294dc3d66c9d3881d06994af273b25bb115bf5eef5b21806f24b5bd61b37f2387be7"}
 * 

 * 
*/
$this->app->zoodpay->createTransaction($billing, $customer, $items, $order, $shipping, $shippingService);


/*
 * 3)
 * Verify the Signature by  Calling below function and if the signature match, 
 * do necessary changes and save transaction_id as reference and redirect user to ZoodPay UI .
 * 
 * */
 $this->app->zoodpay->getResponseSignature($amount, $merchant_reference_no, $transaction_id)
 

/*
 * 4)
 * User will be redirected to the Callback Http/Controller/Callback.php, 
 * change your Order Status Accordingly in each Action. 
 */
 
 /*
  * 5)
 * Set Delivery Date for the Paid Transaction,  it will return ZoodPay API response.
 * Init the Model and set Values
 * Model\DeliveryDate();
 * 
 * */
$this->app->zoodpay->setDeliveryDate($deliveryModel);
 
 
 /*
  * 6)
 * Create Refund for the Paid Transaction,  it will return ZoodPay API response.
 * Init the Model and set Values
 * Model\CreateRefund()
 * 
 * */
$this->app->zoodpay->createRefund($refundModel);

Testing

Run the tests with: load the phpunit.xml and change

$ /usr/bin/php /path to laravel/vendor/phpunit/phpunit/phpunit --configuration /path to laravel/packages/zoodpay-laravel/phpunit.xml

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Security

If you discover any security-related issues, please email mohammadali.namazi@zoodpay.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

zoodpay/laravel-package 适用场景与选型建议

zoodpay/laravel-package 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 zoodpay/laravel-package 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-17