crefopay/php-clientlibrary
Composer 安装命令:
composer require crefopay/php-clientlibrary
包简介
A PHP library for an easier implementation of lynck's/CrefoPay`s Web-API
README 文档
README
PHP Client Library for the CrefoPay API. Based on the API Documentation found here: https://docs.crefopay.de/api/ For questions regarding this library please send an email to service@crefopay.de
Known Issues
The following issues are known and will be added in coming versions:
- No issues reported
Installing the Library
Copy the two folders src and vendor to the library path of your project.
Register the path of the library in your application and use the composer autoloader in your code:
require_once 'vendor/autoload.php';
Using the Library
For extensive information, please refer to the docs of this repository
Requests
The Library for requests is split in three parts:
```Upg\Library\Request\Objects``` contains classes for the JSON objects that are documented in the API documentation.
If a request has a property that requires a JSON object please pass in the appropriately populated ```Upg\Library\Request\Objects``` class for that property.
All properties in the request and JSON objects have getters and setters. For example, to set a field called userType on the request or object you would call `setUserType` and to get it you would call `getUserType`.
### Sending requests ###
Once you have populated a request object with the appropriate values simply create an instance of a ```Upg\Library\Api```
class for the appropriate method call. Pass in a config object and the request you want to send. Then call the
`sendRequest()` method to send the response. This method might raise an Exception or provide an object of the class SuccessResponse.
The exceptions which can be raised are in ```Upg\Library\Api\Exception```.
For any parsed responses you will have access to an ```Upg\Library\Response\SuccessResponse``` or ```Upg\Library\Response\FailureResponse``` object.
The SuccessResponse object is returned if no exception is thrown.
The FailureResponse object is returned in a ```Upg\Library\Api\Exception\ApiError``` exception.
## Handling MNS notifications ##
The library provides a helper class to validate MNS notifications:
```Upg\Library\Mns\Handler```
It takes the following as a constructor:
* $config: The config object for the integration
* $data: The data from the post variables which should be an associated array of the MNS callback
* $processor: An instance of a class which implements the ```Upg\Library\Mns\ProcessorInterface```, which the method will invoke after validation.
The processor object should implement `sendData` to get data from the handler and a `run` method which executes your callback after successful validation.
The processor callback should avoid processing the request, instead it should save it to a database for asynchronous processing via a cron script.
If you use the handler class to save a MNS to the database for later processing you can assume the MNS is perfectly valid with out checking the MAC.
Please note the MNS call must always return a 200 response to CrefoPay otherwise the CrefoPay system will retry to send this notification and eventually lock the MNS queue for your system.
## Working on the library ##
If you want to contribute to the library, please note that all code should be written according to the **PSR2 standard**.
There are many tools to conform to this standard, e.g. PHP-Codesniffer or PHP Coding Standards Fixer.
We will also specify a contributing guideline in the future.
crefopay/php-clientlibrary 适用场景与选型建议
crefopay/php-clientlibrary 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 85.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「library」 「payments」 「crefopay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 crefopay/php-clientlibrary 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 crefopay/php-clientlibrary 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 crefopay/php-clientlibrary 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A derivative of lynck PHP library for an easier implementation of lynck`s Web-API
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
Inbox pattern process implementation for your Laravel Applications
Core library that defines common interfaces used by the rest of the intahwebz..
Amqp classes
统计信息
- 总下载量: 85.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-12