定制 abettini/pagonline 二次开发

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

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

abettini/pagonline

Composer 安装命令:

composer require abettini/pagonline

包简介

PagOnline API Library with Laravel integration

README 文档

README

This library can be used with PagOnline Payment Gateway and it can be easily integrated in Laravel.

With this package I'm trying to improve the crappy IGFS CG PHP Library provided by PagOnline Payment gateway.

PHP Version Latest Stable Version Total Downloads Build Status Coverage Status Scrutinizer Code Quality

Basic Usage

Demo scripts can be found in tests/demo, example Init Request:

<?php 

require __DIR__.'/vendor/autoload.php';

$init = new \PagOnline\Init\IgfsCgInit();
$init->serverURL = "https://payment-gateway-example.com/IGFS_CG_SERVICES/services";
$init->tid = "MY-TID-CODE";
$init->kSig = '1234567890987654321';
$init->shopID = 'my-transaction-id';
$init->shopUserRef = "email@example.org";
$init->trType = "AUTH";
$init->currencyCode = "EUR";
$init->amount = 500; // Amount without comma (500 = 5,00)
$init->langID = "IT";
$init->notifyURL = "http://my-domain.tld/verify.php";
$init->errorURL = "http://my-domain.tld/error.php";
$init->addInfo1 = 'myFirstAddintionalInfo';

// if you need to edit http client parameters...
$init->setRequestTimeout(10); // Seconds
$init->setConnectTimeout(5); // Seconds
$init->setHttpProxy('tcp://some.proxy'); // Proxy server for requests
$init->setHttpAuthUser('username'); // HTTP Basic Auth username
$init->setHttpAuthPass('password'); // HTTP Basic Auth password

if (!$init->execute()) {
    // Something went wrong
} else {
    // Redirect user to payment gateway
    header("location: ".$init->redirectURL);
}

Usage in Laravel

Using Laravel 5.5+, the PagOnline service provider is automagically loaded at startup. It loads the config file and the Factory Facade that can be used to create IgfsCg class instances.

Using Laravel auto-discovery feature you don't need to do that, anyway you can use artisan command vendor:publish
to copy pagonline.php config file for older Laravel versions:

php artisan vendor:publish --provider="PagOnline\Laravel\PagOnlineServiceProvider"

You also need to register the PagOnline Service Provider (PagOnline\Laravel\PagOnlineServiceProvider).

Facade usage

use IgfsCg;
use PagOnline\Actions;

[...]

class MyController 
{
    public function mySuperMethod()
    {
        $igfsCgInit = IgfsCg::make(Actions::IGFS_CG_INIT);
        // Do something
    }
}

.env file configuration

Set the following environment variables in your .env file:

  • PAGONLINE_SERVER_URL payment gateway server url (default: null)
  • PAGONLINE_REQUEST_TIMEOUT maximum timeout in seconds for completing a request (default: 15)
  • PAGONLINE_CONNECT_TIMEOUT maximum timeout in seconds for connecting to the server (default: 5)
  • PAGONLINE_TERMINAL_ID identifier provided by the payment gateway (default: null)
  • PAGONLINE_SIGNATURE_KEY signature key provided by the payment gateway (default: null)
  • PAGONLINE_CURRENCY_CODE currency code (default: EUR)
  • PAGONLINE_LANGUAGE_ID language code (default: IT)

TODO

  • Unit Tests

Contributing

If you want to contribute to this project, please use php-cs-fixer to format your code to PSR standards and rules specified in the configuration file .php_cs.dist provided in this repository. Thank you!

abettini/pagonline 适用场景与选型建议

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

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

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

围绕 abettini/pagonline 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-03-02