alejobit/placetopay-pse-php
Composer 安装命令:
composer require alejobit/placetopay-pse-php
包简介
Use PlacetoPay PSE service in your PHP project
README 文档
README
Use PlacetoPay PSE service in your PHP project
Requirements
Installattion
Add alejobit/placetopay-pse-php as a require dependency in your composer.json file:
composer require alejobit/placetopay-pse-php
For the best operation of the client it is necessary to implement a caching library compatible with the standard PSR-6.
If your project does not have a compatible implementation, you can proceed to install the following library:
composer require symfony/cache
Usage
Create a PSE client instance, note that the $login and $tranKey are given by PlacetoPay to be able to perform transactions on behalf of a collection site
use PlacetoPay\PSE\PSE; $pse = new PSE($login, $tranKey);
Setting the PSR-6 cache adapter instance (which must implement Psr\Cache\CacheItemPoolInterface)
$pse->setCacheAdapter(CacheItemPoolInterface $cacheAdapter);
Obtains the list of banks available for the trading establishment in the PSE system of ACH Colombia
This method returns a PlacetoPay\PSE\Struct\ArrayOfBanks object (which implements \Iterator and \Countable interfaces)
$bankList = $pse->getBankList();
Create transactions with the createTransaction() and createTransactionMultiCredit() methods:
$transaction = $pse->createTransaction(); $multiCreditTransaction = $pse->createTransactionMultiCredit();
Load the transaction information as follows:
$transaction->setBankCode($bank->getCode()); $transaction->setBankInterface(Bank::PERSONAL_INTERFACE); $transaction->setReturnURL('https://www.placetopay.com'); $transaction->setReference(md5('reference')); $transaction->setDescription('Description of transaction'); $transaction->setLanguage('ES'); $transaction->setCurrency('COP'); $transaction->setTotalAmount(12345.6); $transaction->setTaxAmount(0.0); $transaction->setDevolutionBase(0.0); $transaction->setTipAmount(0.0); $transaction->setPayer(array( 'documentType' => 'CC', 'document' => '123456789', 'firstName' => 'Foo', 'lastName' => 'Bar', 'company' => 'PlacetoPay', 'emailAddress' => 'info@placetopay.com', 'address' => 'Calle 53 No. 45 – 112 OF. 1901', 'city' => 'Medellín', 'province' => 'Antioquia', 'country' => 'CO', 'phone' => '+57 (4) 444 2310', 'mobile' => '+57 (4) 444 2310', )); $transaction->setIpAddress('127.0.0.1'); $transaction->addAdditionalData('name', 'value');
MultiCredit transactions have an additional method to add credit concepts of the same as follows
$multiCreditTransaction->addCreditConcept(array( 'entityCode'=> '123456', 'serviceCode' => '654321', 'amountValue' => 12345.6, 'taxValue' => 0.0, 'description' => 'Description of credit concept', ));
Once loaded all the necessary data is sent the transaction with the method send()
The send() method return a PlacetoPay\PSE\Struct\PSETransactionResponse with the result of the operation
$response = $transaction->send()
To obtain the information of a specific transaction can use the method getTransactionInformation($id) passing the unique identifier of the transaction to consult
$transactionInfo = $pse->getTransactionInformation($response->getTransactionId());
Related project
- PlacetoPay PSE Pimple Service Provider, this library is compatible with Pimple based projects, such as the Silex micro-framework
alejobit/placetopay-pse-php 适用场景与选型建议
alejobit/placetopay-pse-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.55k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 12 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alejobit/placetopay-pse-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alejobit/placetopay-pse-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-26