pimcore/payment-provider-ogone

Pimcore Payment Provider - OGOne

v1.0.4 2024-04-29 11:05 UTC

This package is auto-updated.

Last update: 2024-09-16 07:50:52 UTC


README

官方OGOne文档

安装

使用Composer安装最新版本

composer require pimcore/payment-provider-ogone

通过Pimcore后端控制台或扩展管理器启用捆绑包

php bin/console pimcore:bundle:enable PimcorePaymentProviderOGoneBundle
php bin/console pimcore:bundle:install PimcorePaymentProviderOGoneBundle

配置

支付管理器负责实现不同的支付提供者,以便将它们集成到框架中。

有关支付管理器的更多信息,请参阅支付管理器文档

pimcore_ecommerce_config.payment_manager 配置部分配置支付提供者

pimcore_ecommerce_config:
    payment_manager:
        # service ID of payment manager implementation - following value is default value an can be omitted
        payment_manager_id: Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\PaymentManager

        # configuration of payment providers, key is name of provider
        providers:
            ogone:
                provider_id: Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\Payment\OGone
                profile: sandbox
                profiles:
                    sandbox:
                        secretIn: D343DDFD3434
                        secretOut: E454EEGE4545
                        pspid: MyTestAccount
                        mode: sandbox                        
#                       encryptionType: SHA1 or SHA256 or SHA512 (optional)
                    live:
                        secretIn: D343DDFD3434
                        secretOut: E454EEGE4545
                        mode: live                        
#                       encryptionType: SHA1 or SHA256 or SHA512 (optional)

支付信息:订单支付部分“支付信息”存储客户每次支付尝试的信息。

在“PaymentInfo”字段集中添加额外字段,以便订单管理器将信息存储在订单对象中:PaymentInfo Additional Data

实现

在您的结账控制器中某个地方,您需要为提供者的 initPayment() 方法创建支付配置

<?php
    $url = 'https://'. $_SERVER["HTTP_HOST"] . "/en/checkout/confirm?state=";
    $paymentConfig = [                   
                    'language'            => "en",
                    'orderIdent'          => $paymentInfo->getInternalPaymentId(),                   
                    'customerStatement'   => $paymentMessage,
                    'successUrl'          => "https://my-server-name.com/shop/payment/confirm?provider=ogone&state=success",
                    'cancelUrl'           => "https://my-server-name.com/shop/payment/confirm?provider=ogone&state=cancel",
                    'errorUrl'            => "https://my-server-name.com/shop/payment/confirm?provider=ogone&state=error",
                    'paymentInfo'         => $order->getPaymentInfo()->getItems()[0]
                ];

您必须在OGOne后端配置回调URL,以便它们在服务器之间调用。

您可以根据OGOne文档在配置中传递额外的参数。例如,可以控制OGOne UI的颜色和外观,并传递额外的客户数据。