The Payum extension. It provides Perfect Money payment integration.
$ composer require antqa/payum-perfectmoney
<?php
use Payum\Core\PayumBuilder;
use Payum\Core\Payum;
$payum = (new PayumBuilder)
->addGatewayFactory('perfectmoney', function(array $config, GatewayFactoryInterface $coreGatewayFactory) {
return new \Antqa\Payum\Perfectmoney\PerfectMoneyGatewayFactory($config, $coreGatewayFactory)
})
->addGateway('perfectmoney', [
'factory' => 'perfectmoney',
'sandbox' => true,
'alternate_passphrase' => 'place here',
'payee_account' => 'place here',
'display_name' => 'place here',
])
->getPayum()
;
use Payum\Core\Model\PaymentInterface;
use Antqa\Payum\Perfectmoney\Api;
/** @var PaymentInterface $payment */
$payment->setDetails([
Api::FIELD_SUGGESTED_MEMO => sprintf('Payment - %s', $product),
Api::FIELD_PAYMENT_URL_METHOD = 'POST',
Api::FIELD_NOPAYMENT_URL_METHOD = 'POST',
]);
#services.yml
app.payum.perfectmoney.factory_builder:
class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
arguments:
- Antqa\Payum\Perfectmoney\PerfectMoneyGatewayFactory
tags:
- { name: payum.gateway_factory_builder, factory: perfectmoney }
#config.yml
payum:
gateways_v2:
perfectmoney:
factory: perfectmoney
payee_account: %perfectmoney_account%
alternate_passphrase: %perfectmoney_alternate_passphrase%
sandbox: %payment_sandbox%
display_name: place_here
Payum Perfect Money is released under the MIT License.