paytrail/paytrail-php-sdk
Composer 安装命令:
composer require paytrail/paytrail-php-sdk
包简介
PHP Software Development Kit for Paytrail payment service
README 文档
README
PHP Software Development Kit for Paytrail payment service
Paytrail Payment Service
Paytrail is a payment gateway that offers 20+ payment methods for Finnish customers.
The payment gateway provides all the popular payment methods with one simple integration. The provided payment methods include, but are not limited to, credit cards, online banking and mobile payments.
To use the payment service, you need to sign up for a Paytrail account. Transaction fees will be charged for every transaction. Transaction cost may vary from merchant to merchant, based on what is agreed upon with Paytrail when negotiating your contract. For more information and registration, please visit our website or contact asiakaspalvelu@paytrail.com directly.
Requirements
General requirements
- PHP version >= 7.3
- ext-curl PHP cURL extension
- ext-json PHP JSON extension
Development requirements
- PHPUnit - A programmer-oriented testing framework for running unit tests in PHP.
- Guzzle 7 or 6 - PHP HTTP client for performing HTTP request.
Guzzle
PHP-SDK will use Guzzle 6 or 7, if in present application, otherwise it will fall back to cURL. Guzzle is still used as dev dependency to make testing easier.
Using Guzzle is recommended on applications using PHP-SDK.
Installation
Install with Composer:
composer require paytrail/paytrail-php-sdk
The package uses PSR-4 autoloader. Activate autoloading by requiring the Composer autoloader:
require 'vendor/autoload.php';
Note the path to the vendor directory is relative to your project.
Folder contents & descriptions
| Folder/File | Content/Description |
|---|---|
| examples | Examples |
| src/Exception | Exception classes and functions |
| src/Interfaces | Interface classes and functions for all the related classes to implement |
| src/Model | Model classes and functions |
| src/Request | Request classes and functions |
| src/Response | Response classes and functions |
| src/Util | Utility/trait classes and functions |
| src/Client.php | Client class and functions |
| tests/unit | PHP unit tests |
Basic functionalities
The Paytrail PHP-SDK supports most of the functionalities of the Paytrail Payment API.
Some of the key features are:
Payments and refunds
Tokenized credit cards and payments
- Creating Add card form request
- Creating Get token request
- Creating Customer Initiated Transactions (CIT) or Merchant Initiated Transactions (MIT)
Shop-in-Shop
- Creating Shop-in-Shop payment request
Settlements
Reports
Methods
List of Client::class methods
| Method | Description |
|---|---|
| getPaymentProviders() | Get a list of payment providers |
| getGroupedPaymentProviders() | Returns an array of grouped payment providers fields |
| createPayment() | Create payment |
| createShopInShopPayment() | Create SiS payment |
| getPaymentStatus() | Request payment status |
| refund() | Create refund |
| emailRefund() | Create email refund |
| createAddCardFormRequest() | Save card details |
| createGetTokenRequest() | Request card token |
| createCitPaymentCharge() | Create CiT payment |
| createCitPaymentAuthorizationHold() | Create CiT authorization hold |
| createCitPaymentCommit() | Commit CiT authorization hold |
| createMitPaymentCharge() | Create MiT payment |
| createMitPaymentAuthorizationHold() | Create MiT authorization hold |
| createMitPaymentCommit() | Commit MiT authorization hold |
| revertPaymentAuthorizationHold() | Revert existing Mit or CiT authorization hold |
| activateInvoice() | Activate pending invoice (Walley / Klarna) |
| cancelInvoice() | Cancel pending invoice (Currently only Klarna) |
| getSettlements() [Deprecated] | Deprecated Request settlements |
| requestSettlements() | Request settlements |
| requestPaymentReport() | Request payment report |
| requestPaymentReportBySettlement() | Request payment report by settlement ID |
| createPaymentAndAddCard() | Create payment and save card details |
Disclaimer: This open source project is made available to assist coders in getting started with our API. However, we do not provide any warranty or guarantee that the code will work as intended and offer limited support for it. Use at your own risk.
paytrail/paytrail-php-sdk 适用场景与选型建议
paytrail/paytrail-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 485.51k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2021 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment service provider」 「paytrail」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 paytrail/paytrail-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 paytrail/paytrail-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 paytrail/paytrail-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Time provider, providing consistent current date, time, datetime and timezone across the request.
An Zend Expressive module for loading ZF2 or ZF3 modules.
A fast and intuitive dependency injection container.
Registry service.
Planning Center OAuth2 Provider for Laravel Socialite
Data provider for yii2
统计信息
- 总下载量: 485.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 27
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-11