justlease/payum-ems

Payum 的 EMS 支付网关

0.2.4 2023-04-20 13:44 UTC

This package is auto-updated.

Last update: 2024-09-20 16:50:47 UTC


README

本软件包为 Payum 提供了与 EMS Pay 的集成。

安装

$ composer require justlease/payum-ems

用法

如果您使用 Symfony,建议使用 justlease/payum-ems-bundle 来配置网关。

否则,请参阅下面的示例,了解如何添加网关。

<?php

use Payum\Core\GatewayFactoryInterface;
use Justlease\PayumEms\EmsOffsiteGatewayFactory;

/** @var \Payum\Core\PayumBuilder $payumBuilder */
$payumBuilder->addGatewayFactory('ems_offsite', function (array $config, GatewayFactoryInterface $gatewayFactory) {
    return new EmsOffsiteGatewayFactory($config, $gatewayFactory);
});

$payumBuilder->addGateway('ems_offsite', [
    'factory' => 'ems_offsite',
    'store_name' => '123456789',
    'shared_secret' => 'mysharedsecret',
    'sandbox' => true,
    'classic_mode' => \Justlease\PayumEms\Api::CLASSIC_MODE_PAYONLY,
    'payment_method' => \Justlease\PayumEms\Api::PAYMENT_METHOD_IDEAL,
]);