PHP code example of snowcap / ogone-bundle

1. Go to this page and download the library: Download snowcap/ogone-bundle 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/ */

    

snowcap / ogone-bundle example snippets


// app/ApplicationKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Snowcap\OgoneBundle\SnowcapOgoneBundle(),
        // ...
    );
}

/** @var $ogone \Snowcap\OgoneBundle\Manager */
$ogone = $this->get('snowcap_ogone');

$ogoneForm = $ogone->getRequestForm($locale, $orderId, $customerName, $amount, $currency, array(
    'acceptUrl' => $this->generateUrl('your_success_page_route_name', array(), true),
    // and any other option your may want to pass to Ogone
));

return array(
    'ogone_form' => $ogoneForm,
);


namespace MyCompany\MyBundle\Ogone;
    
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

use Snowcap\OgoneBundle\Event\OgoneEvent;
use Snowcap\OgoneBundle\OgoneEvents;

class OgoneSubscriber implements EventSubscriberInterface
{
    /**
     * @param \Snowcap\OgoneBundle\Event\OgoneEvent $event
     */
    public function onOgoneSuccess(OgoneEvent $event)
    {
        
    }

    /**
     * @param \Snowcap\OgoneBundle\Event\OgoneEvent $event
     */
    public function onOgoneError(OgoneEvent $event)
    {
        
    }
    
    /**
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return array(
            OgoneEvents::SUCCESS => 'onOgoneSuccess',
            OgoneEvents::ERROR => 'onOgoneError'
        );
    }
}
bash
$ php composer.phar update snowcap/ogone-bundle