PHP code example of baptiste-dulac / systempay-bundle

1. Go to this page and download the library: Download baptiste-dulac/systempay-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/ */

    

baptiste-dulac / systempay-bundle example snippets



// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Tlconseil\SystempayBundle\TlconseilSystempayBundle(),
    );
}

    /**
     * @Route("/initiate-payment/id-{id}", name="pay_online")
     * @Template()
     */
    public function payOnlineAction($id)
    {
        // ...
        $systempay = $this->get('tlconseil.systempay')
            ->init()
            ->setOptionnalFields(array(
                'shop_url' => 'http://www.example.com'
            ))
        ;

        return array(
            'paymentUrl' => $systempay->getPaymentUrl(),
            'fields' => $systempay->getResponse(),
        );
    }

    /**
     * @Route("/payment/verification")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function paymentVerificationAction(Request $request)
    {
        // ...
        $this->get('tlconseil.systempay')
            ->responseHandler($request)
        ;

        return new Response();
    }