PHP code example of antqa / payum-perfectmoney

1. Go to this page and download the library: Download antqa/payum-perfectmoney library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

antqa / payum-perfectmoney example snippets




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',
]);