webgriffe/lib-unicredit-imprese 问题修复 & 功能扩展

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

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

webgriffe/lib-unicredit-imprese

Composer 安装命令:

composer require webgriffe/lib-unicredit-imprese

包简介

README 文档

README

Run Status

This library provides an integration with the WebServices of Unicredit PagOnline Imprese payment gateway. It was developed by following the technical documentation v.07 of 07/02/2017 provided by Unicredit.

Installation

In order to use this library you have to import it through composer:

composer require webgriffe/lib-unicredit-imprese

Usage

Payment Initialization

First of all, get an instance of the Webgriffe\LibUnicreditImprese\Client class. Then, before starting the actual payment, call the init() method to set a few basic values, such as whether the library must work in test mode or live mode, the ksig key (provided by Unicredit), the terminal id (provided by Unicredit) and the WSDL URL (which changes between the live and test environments). This call will prepare the client for the actual work.

After executing the init() call, you can call the paymentInit() method to initiate an actual payment request. This method takes a number of arguments including the transaction type (authorize-only or authorize-and-capture), the payment amount, the payment page language code, the payment currency and so on. The notifyUrl argument is the URL that Unicredit will redirect the customer to if the payment is succesful. However, if a serious error occurs, the customer will be redirected to the error URL.

The paymentInit() method takes care to format all arguments in the correct way, sign them using the secret ksig value and send them to Unicredit. Afterwards the returning response is received and parsed, and the result of this operation is a Webgriffe\LibUnicreditImprese\PaymentInit\Response object. This ibject contains the outcome of the paymentInit() operation; If an error occurred, the getError() and getErrorDesc() methods of this object van be used to check what error occurred. If there was no error, then Unicredit will return a payment id and a redirect URL, which can be accessed using the getPaymentId() and getRedirectUrl() methods of the Response object.

If the paymentInit() operation is succesful, then the payment id contained in the response should be saved and the user should be redirected to the URL provided by Unicredit. This will take the user to a page where he/she will be asked to provide the actual payment information required to complete the transaction (credit card number and the like).

After this phase, if an error occurs, then the user is redirected to the error URL. Otherwise he/she is redirected to the notify URL. In the latter case it's necessary to verify the payment outcome manually, even if the customer reaches the notify URL.

Payment verification

To verify the status of a payment it's possible to use the paymentVerify() method. This method requires a shop-id (a manually-generated transaction identifier, usually an order id) and the payment id that was provided by Unicredit with the paymentInit() call.

With these values the paymentVerify() method can check the state of the corresponding payment, returning it as a Webgriffe\LibUnicreditImprese\PaymentVerify\Response object. Once again, the getError() and getErrorDesc() methods can be used to check for errors, but here it's possibile to use the getRc(), getTranId(), getAuthCode(), getEnrStatus() and getAuthStatus() methods to retrieve pieces of information from the verification result.

Unlike other payment gateways, Unicredit does not perform a server-to-server call to notify about payment approvals. Instead it is the responsibility of the merchant to periodically check the status of each payment. This can be easily done using the aforementioned paymentVerify() method.

Contributing

Fork this repository, make your changes and submit a pull request. Please run the tests and the coding standards checks before submitting a pull request. You can do it with:

composer install
vendor/bin/phpspec run
vendor/bin/phpcs

License

This library is under the MIT license. See the complete license in the LICENSE file.

Credits

Developed by Webgriffe®.

webgriffe/lib-unicredit-imprese 适用场景与选型建议

webgriffe/lib-unicredit-imprese 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.47k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 webgriffe/lib-unicredit-imprese 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2017-03-21