superbrave/omnipay-docdata-payments
Composer 安装命令:
composer require superbrave/omnipay-docdata-payments
包简介
Docdata Payments support for Omnipay payment processing library
README 文档
README
Docdata/CM Payments support for Omnipay payment processing library.
This package is geared towards the Webdirect method of handling orders in Docdata Payments (now CM payments).
Authorize data
Generic
public function getAuthorizeData() { $card = new CreditCard(); // Omnipay CC model $card->setTitle(null); $card->setFirstName($invoice->getCustomerFirstname()); $card->setLastName($invoice->getCustomerLastname()); $card->setEmail($invoice->getCustomerEmailAddress()); $card->setGender('U'); // U, F, M $card->setPhone(null); $card->setBillingFirstName($invoice->getCustomerFirstname()); $card->setBillingLastName($invoice->getCustomerLastname()); $card->setBillingAddress1($formatedAddress['street']); $card->setBillingAddress2($formatedAddress['houseNumber']); $card->setBillingPostcode($address->getPostalCode()); $card->setBillingCity(mb_substr($address->getCity(), 0, 35)); // max 35 $card->setBillingCountry(strtoupper($address->getCountry())); $card->setBillingTitle(null); $card->setBillingState(null); $data = [ 'description' => sprintf('Invoice #%s', $invoice->getReference()), 'paymentProfile' => $this->getDocDataPaymentProfile(), // set in Docdata backoffice 'paymentDays' => self::DOCDATA_INVOICE_VALIDITY_DAYS, // own choice 'transactionId' => sprintf('%s _ %s', $invoice->getReference(), Uuid::uuid4()), // shown to customer. Needs to be unique 'currency' => 'EUR', // capitalized 'amount' => 100, 'shopperId' => $invoice->getCustomerReference(), 'language' => 'en', // lowercase 'card' => $card, 'houseNumberAddition' => $formatedAddress['houseNumberAddition'], 'paymentMethod' => 'IDEAL', ]; /* Payment methods (defined by docdata) * https://www.cmpayments.com/file_uploads/API_Integration_Manual.pdf #figure 9 * * BanContact => 'MISTERCASH' * Bank_transfer => 'BANK_TRANSFER' * Elv => 'ELV' * Eps => 'EPS' * Giropay => 'GIROPAY' * Ideal => 'IDEAL' * Sofort => 'SOFORT_UEBERWEISUNG' */ return $data; }
Ideal
Ideal has some special quirks. Add the issuer to the getAuthorizeData method thusly:
$data['paymentInputType'] = 'iDealPaymentInput'; $data['paymentInput'] = [ 'issuerId' => $request['issuerId'], ];
IssuerId is set by Docdata and not documented in the implementation manual.
iban => docdata code // bank name
----------------------------------------------------
'ABNANL2A' => 'ABNAMRO' // ABN AMRO
'ASNBNL21' => 'ASN' // ASN
'BUNQNL2A' => 'BUNQ' // Bunq
'HANDNL2A' => 'HAND' // Svenska Handelsbanken
'INGBNL2A' => 'ING' // ING
'KNABNL2H' => 'KNAB' // Knab
'MOYONL21' => 'MOYO' // MoneYou
'RABONL2U' => 'RABO' // RABO
'RBRBNL21' => 'REGIOBANK' // Regiobank
'SNSBNL2A' => 'SNS' // SNS
'TRIONL2U' => 'TRIODOS' // Triodos
'FVLBNL22' => 'VANLANSCHOT' // Van Lanschot
CompleteAuthorize
Some payment methods require (most, or a lot) of information also sent on the Authorize call, so getting the same data and adding the transactionReference is the most foolproof way.
public function getCompleteAuthorizeData(): array { $data = $this->getAuthorizeData(); $data['transactionReference'] = $paymentTransaction->getReference(); $data['authorizationResultType'] = 'iDealAuthorizationResult'; // differs per payment method $data['authorizationResult'] = []; // same here return $data; }
Creditcards
Docdata can handle CC data if you don't want to store or handle the user input (Protip: don't handle them). To handle this in the package you should use the OnePageCheckoutGateway. This way the code will still create the order in docdata, and try to capture it, but not expect you to send the card holder, cc number, etc.
The webdirect flow uses the WebdirectGateway.
superbrave/omnipay-docdata-payments 适用场景与选型建议
superbrave/omnipay-docdata-payments 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.45k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 12 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「soap」 「payment」 「pay」 「gateway」 「merchant」 「purchase」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 superbrave/omnipay-docdata-payments 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 superbrave/omnipay-docdata-payments 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 superbrave/omnipay-docdata-payments 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
A PHP client for the Salesforce SOAP API
Payyo Gateway for the Omnipay payment processing library
A Yii2 component for working with TurboSMS.ua SOAP service
Zend Framework 1 Soap package
NuSOAP PHP library re-packaged for Packagist/Composer
统计信息
- 总下载量: 3.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-03