pimcore / payment-provider-datatrans
Pimcore支付提供商 - Datatrans
v1.0.4
2024-04-29 10:52 UTC
Requires
- pimcore/pimcore: ^10.0.0
Requires (Dev)
- phpstan/phpstan: ^1.9
README
官方Datatrans文档
安装
使用composer安装最新版本
composer require pimcore/payment-provider-datatrans
通过控制台或Pimcore后端扩展管理器启用扩展
php bin/console pimcore:bundle:enable PimcorePaymentProviderDatatransBundle php bin/console pimcore:bundle:install PimcorePaymentProviderDatatransBundle
配置
支付管理器负责实现不同的支付提供商,并将它们集成到框架中。
有关支付管理器的更多信息,请参阅支付管理器文档。
在pimcore_ecommerce_config.payment_manager
配置部分配置支付提供商
pimcore_ecommerce_config: payment_manager: providers: datatrans: # service ID of payment provider implementation provider_id: Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\Payment\Datatrans # active profile - you can define multiple profiles in the section below profile: sandbox # available profiles with options - options vary on the provider implementation as the profiles: sandbox: merchant_id: 1000011011 sign: 30916165706580013 use_digital_signature: false live: merchant_id: merchant_id_id sign: sign_id use_digital_signature: false mode: live
支付信息:订单支付部分“支付信息”存储客户每次支付尝试的信息。
在“PaymentInfo”字段集中添加额外字段,以便订单管理器在订单对象中存储信息:
可以进行一步授权和清算。默认行为是仅授权。要自动清算,将“reqtype”选项设置为“CAA”
<?php $url = 'http://'. $_SERVER["HTTP_HOST"] . "/en/checkout/payment-status?mode="; $config = [ // checkout config 'language' => $language , 'refno' => $paymentInformation->getInternalPaymentId() , 'useAlias' => true , 'reqtype' => 'CAA' // Authorisation and settlement // system , 'successUrl' => $url . 'success' , 'errorUrl' => $url . 'error' , 'cancelUrl' => $url . 'cancel' ];