novalnet / payum
Payum 扩展。快速扩展开发
Requires
- payum/core: ^1.5
Requires (Dev)
- payum/core: ^1.5
- php-http/guzzle6-adapter: ^1.0
This package is not auto-updated.
Last update: 2024-09-21 01:37:29 UTC
README
Payum 是最受欢迎的无bug解决方案之一,已被一百万用户下载。它与所有顶级 PHP 框架兼容,并由全球范围内的众多开发者使用。可以同时快速集成和部署 50 多种支付服务。
优势
- 所有支付方式的简单配置
- 一个平台,用于所有相关支付类型和相关服务
- 所有支付流程的完全自动化
- 集成超过 50 个欺诈预防模块,以实时预防风险
- 使用我们的支付模块时,无需 PCI DSS 认证
- 从结账到应收款的交易流实时监控
- 多级索赔管理,包括集成转交给催收和多种会计导出功能
- 有关支付状态报告的自动电子邮件通知功能
- 清晰的实时支付状态概述和监控
- 自动在 XML、SOAP、CSV、MT940 中生成会计报告
支持的支付方式
- 直接借记 SEPA
- 信用卡(3DSecure 和非 3DSecure)
- 发票
- 预付款
- Barzahlen
- 即时银行转账
- PayPal
- iDEAL
- eps
- giropay
- Przelewy24
- Postfinance
- Postfinance 卡
- Bancontact
- Multibanco
- Apple Pay
主要功能
- 安全的 SSL 编码网关
- 无缝快速集成支付模块
- 3D Secure 信用卡
- 在商店管理员面板中配置挂起交易
- 对于直接借记 SEPA、直接借记 SEPA 加支付保证、信用卡、发票、带支付保证的发票、预付款和 PayPal,提供简单的方式来确认和取消挂起交易(取消并抓取选项)。
- 对于信用卡、直接借记 SEPA、带支付保证的直接借记 SEPA、发票、带支付保证的发票、预付款、Barzahlen、即时银行转账、iDEAL、eps、giropay、PayPal 和 Przelewy24 提供退款选项。
- 响应式模板
安装
安装库的首选方法是使用composer。运行 composer 以将依赖项添加到 composer.json
composer require novalnet/payum php-http/guzzle6-adapter
配置
将以下代码添加到默认的 app/Providers/AppServiceProvider.php 注册方法中
... public function register() { $this->app->resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) { $payumBuilder ->addDefaultStorages() ->addGatewayFactory('novalnet', function(array $config, GatewayFactoryInterface $coreGatewayFactory) { return new \Payum\Novalnet\NovalnetGatewayFactory($config, $coreGatewayFactory); }) ->addGateway('novalnet', [ 'factory' => 'novalnet', 'payment_access_key' => '###YOUR_PAYMENT_ACCESS_KEY###', 'signature' => '###YOUR_API_SIGNATURE###', 'tariff' => '###YOUR_TARIFF_ID###' ]); }); $this->app->resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) { $payumBuilder ->addDefaultStorages() ->addGatewayFactory('novalnet_creditcard', function(array $config, GatewayFactoryInterface $coreGatewayFactory) { return new \Payum\Novalnet\NovalnetCreditCardGatewayFactory($config, $coreGatewayFactory); }) ->addGateway('novalnet_creditcard', [ 'factory' => 'novalnet_creditcard', 'payment_access_key' => '###YOUR_PAYMENT_ACCESS_KEY###', 'signature' => '###YOUR_API_SIGNATURE###', 'tariff' => '###YOUR_TARIFF_ID###' 'sandbox' => false, // (true/false) true = The payment will be processed in the test mode therefore amount for this transaction will not be charged, false = The payment will be processed in the live mode. 'callback_debug_mode' => false, // (true/false) Please disable this option before setting your shop to LIVE mode, to avoid unauthorized calls from external parties (excl. Novalnet). For LIVE, set the value as false. 'payment_data' => [ 'action' => 'capture', // (authorize/capture) Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order 'client_key' => '###YOUR_CLIENT_KEY###', // A public unique key needs linked to your account. It is needed to do the client-side authentication. You can find this credential by logging into your Novalnet Admin Portal 'enforce_3d' => false, // (true/false) By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA. 'inline' => true, // (true/false) true = Show Inline Credit card form form, false = Show Credit Card form in multi lines. 'container' => '', // Customize styles of the Credit Card iframe. 'input' => '', // Customize styles of the Credit Card iframe input element. 'label' => '', // Customize styles of the Credit Card iframe label element. ], ]); }); } ...
准备支付
让我们创建一个控制器,其中我们准备支付详情。
<?php namespace App\Http\Controllers; use Payum\LaravelPackage\Controller\PayumController; use Payum\Core\Model\ArrayObject; class NovalnetPaymentController extends PayumController { public function doPayment() { $gatewayName = 'novalnet_creditcard'; $storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject'); $details = $storage->create(); $data['customer'] = [ 'first_name' => 'novalnet', 'last_name' => 'tester', 'email' => 'test@novalnet.de', 'customer_no' => '147', 'billing' => [ 'street' => 'Feringastraße', 'house_no' => '4', 'city' => 'Unterföhring', 'zip' => '85774', 'country_code' => 'DE', ] ]; $data['transaction'] = [ 'amount' => '150', 'currency' => 'EUR', 'order_no' => '123456', ]; $data['custom'] = [ 'lang' => 'EN' ]; $details['nn_request'] = $data; $storage->update($details); $notifyToken = $this->getPayum()->getTokenFactory()->createNotifyToken($gatewayName, $details); $data['transaction']['hook_url'] = $notifyToken->getTargetUrl(); $details['nn_request'] = $data; $storage->update($details); $authorizeToken = $this->getPayum()->getTokenFactory()->createAuthorizeToken($gatewayName, $details, 'payment_done'); return \Redirect::to($authorizeToken->getTargetUrl()); } }
让我们创建一个控制器,其中我们准备支付退款。
<?php namespace App\Http\Controllers; use Payum\LaravelPackage\Controller\PayumController; use Payum\Core\Model\ArrayObject; class NovalnetRefundController extends PayumController { public function doRefund() { $gatewayName = 'novalnet'; $storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject'); $details = $storage->create(); $data = ['transaction' => [ 'tid' => '###NOVALNET_TID###', 'amount' => 'XXX' ] ]; $details['nn_request'] = $data; $storage->update($details); $refundToken = $this->getPayum()->getTokenFactory()->createRefundToken($gatewayName, $details, 'payment_done'); return \Redirect::to($refundToken->getTargetUrl()); } }
有关支付集成的更多信息,请参阅开发者门户。您可以在那里找到有关支付集成的相关文档。
您可能想要修改一个 payment_done
路由。一旦支付完成,无论支付状态如何,付款人将被重定向到控制器。请阅读关于支付完成控制器外观的专门章节。
文档和支持
有关 Novalnet Payum 支付集成更多信息,请联系我们: sales@novalnet.de 或 +49 89 9230683-20
Novalnet AG
支付机构(ZAG)
Gutenbergstraße 7
D-85748 Garching
德国
电子邮件:sales@novalnet.de
电话:+49 89 9230683-20
网站: www.novalnet.de
诺瓦奈特是谁?
诺瓦奈特是一家德国支付服务提供商,为全球在线商家和批发市场提供支付网关。我们的PCI DSS认证的SaaS引擎旨在通过单一集成自动化从结账到债务回收的整个支付过程。我们提供实时风险管理;通过保证金账户进行安全支付(本地+国际),集成应收账款管理,动态会员和订阅管理,以及适用于所有商店系统的其他定制化支付解决方案。