dalenys/php-merchant-api
Composer 安装命令:
composer require dalenys/php-merchant-api
包简介
Dalenys PHP merchant API
关键字:
README 文档
README
[Dalenys Merchant API] (http://developer.dalenys.com/)
A simple PHP implementation of the Dalenys payment platform API.
Installing
Composer
You can easily install this library by adding the following lines to your composer.json file
{
"require": {
"dalenys/php-merchant-api": "2.*"
}
}
or by using this command line in a terminal at the root of your project
composer require dalenys/php-merchant-api 1.*
Manual install
You can install this library manually by simply cloning it to your project and including scripts/autoload.php
Using
Building a simple payment form
Here is the code sample for implementing a simple 10€ payment form
<?php define('DALENYS_IDENTIFIER', 'YOUR ACCOUNT IDENTIFIER'); define('DALENYS_PASSWORD', 'YOUR ACCOUNT PASSWORD'); // Just implement DALENYS_IDENTIFIER and DALENYS_PASSWORD as defined $dalenys = Dalenys_Api_ClientBuilder::buildProductionFormClient(DALENYS_IDENTIFIER, DALENYS_PASSWORD); echo $dalenys->buildPaymentFormButton(10000, 'order_123', 'user_123456', 'Payment sample');
Payment options
You can specify some additional options to the buildPaymentFormButton method. The most useful options are:
- CREATEALIAS = yes/no => Ask for the creation of a rebilling alias (allowing one click payments or subscription like payments)
- 3DSECURE = yes/no => Ask for 3DSECURE authentication
- CARDFULLNAME => When set the card holder inputs will be filled with specified data
For the full list of options you can read the Dalenys documentation
Sandbox environment
You can easily test your integration with the sandbox environment. This environment will simulate payments without processing any real money move. You just have to use another builder method:
<?php $dalenys = Dalenys_Api_ClientBuilder::buildSandboxFormClient(DALENYS_IDENTIFIER, DALENYS_PASSWORD);
Transaction edition
You can edit a transaction: capturing or refunding an authorization. You should use the direct link AP:
<?php $dalenys = Dalenys_Api_ClientBuilder::buildSandboxDirectLinkClient(DALENYS_IDENTIFIER, DALENYS_PASSWORD); $dalenys->capture('A1234', 'order_42', 'capturing a transaction');
Testing
- First you have to copy tests/ftests/config.php.dist to tests/ftests/config.php
- Then run
composer tests
If you want to run only the unit or functional test suites:
composer utests or composer ftests
Documentation
-
The documentation is available in doc folder.
- Ensure to download the phar package
-
You can generate it with https://www.phpdoc.org/ by running
composer doc
dalenys/php-merchant-api 适用场景与选型建议
dalenys/php-merchant-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 223.27k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 04 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「payment」 「psp」 「visa」 「mastercard」 「american express」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dalenys/php-merchant-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dalenys/php-merchant-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dalenys/php-merchant-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Buckaroo BPE3 API client for PHP. PSR-0 Compliant.
Buckaroo BPE3 API client for PHP. PSR-4 Compatible.
The Payum extension. It provides PAYONE payment integration.
A derivative of lynck PHP library for an easier implementation of lynck`s Web-API
PHP Systempay PSP client
DigiWallet Bank Payments PHP SDK
统计信息
- 总下载量: 223.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-04-23