PHP code example of kna / payum-yandex-checkout

1. Go to this page and download the library: Download kna/payum-yandex-checkout 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/ */

    

kna / payum-yandex-checkout example snippets


use Payum\Core\GatewayFactoryInterface;
use Kna\Payum\YandexCheckout\YandexCheckoutGatewayFactory;

$payumBuilder->addGatewayFactory('yandex_checkout', function(array $config, GatewayFactoryInterface $gatewayFactory) {
    return new YandexCheckoutGatewayFactory($config, $gatewayFactory);
});

$payumBuilder->addGateway('yandex_checkout', [
    'factory' => 'yandex_checkout',
    'shop_id' => '<shop_id>', 
    'secret_key' => '<secret_key>',
    'payment_id_key' => 'payment_id', // optional
    'force_payment_id' => true // optional
]);

$gateway = $this->get('payum')->getGeteway('yandex_checkout');