PHP code example of restoore / laravel-systempay

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

    

restoore / laravel-systempay example snippets


  'providers' => [
      ...
      Restoore\Systempay\SystempayServiceProvider::class,
  ]

  'providers' => [
      ...
      Restoore\Systempay\SystempayServiceProvider,
  ]

return [

    'YOUR_SITE_ID' => [
        'key' => 'YOUR_KEY',
        'env' => 'PRODUCTION',
        'params' => [
            //Put here your generals payment call parameters
            'vads_page_action' => 'PAYMENT',
            'vads_action_mode' => 'INTERACTIVE',
            'vads_payment_config' => 'SINGLE',
            'vads_page_action' => 'PAYMENT',
            'vads_version' => 'V2',
            'vads_currency' => '978'
        ]
    ],
    //Systempay's url
    'url' => 'https://paiement.systempay.fr/vads-payment/',

];

    //create a Systempay object class with your site id in parameter. Note that it will automatically get your configuration in config/systempay.php
   $systempay = App::make('systempay', ['site_id' => '11111']);
    //add some parameters
    $systempay->set_amount(1500)
        ->set_trans_id(1112441)
        ->set_order_info2('New customer !');
    //create the signature
    $systempay->set_signature();
    //create html systempay call form
    $payment_form = $systempay->get_form('<button class="btn btn-lg btn-primary btn-payment" type="submit">Valider et payer</button>');

    $systempay = App::make('systempay', ['site_id' => '11111']);
    $systempay->add_product(
        [
            'label' => 'Concert Coldplay 2016',
            'amount' => 235.00,
            'type' => 'ENTERTAINMENT',
            'ref' => 'COLD016',
            'qty' => 3
        ]
    );

   $systempay = App::make('systempay', ['site_id' => '11111']);
   $systempay->add_product(
       [
           'label' => 'Concert Coldplay 2016',
           'amount' => 235.00,
           'type' => 'ENTERTAINMENT',
           'ref' => 'COLD016',
           'qty' => 3
       ]
   );
   $systempay->set_amount();
   echo $systempay->get_amount(); //will display 705.00 (3*235.00)

  $systempay = App::make('systempay', ['site_id' => '11111']);
  $systempay->add_product(
      [
          'label' => 'Concert Coldplay 2016',
          'amount' => 235.00,
          'type' => 'ENTERTAINMENT',
          'ref' => 'COLD016',
          'qty' => 3
      ]
  );
  $systempay->set_amount();
  echo $systempay->get_amount(); //will display 705.00 (3*235.00)
  echo $systempay->get_amount(false); //will display 70500 (3*235.00)

   $systempay = App::make('systempay', ['site_id' => '11111']);
   $systempay->set_params(
       [
           'vads_page_action' => 'PAYMENT',
           'vads_action_mode' => 'INTERACTIVE',
           'vads_payment_config' => 'SINGLE',
           'vads_page_action' => 'PAYMENT',
           'vads_version' => 'V2',
           'vads_trans_date' => gmdate('YmdHis'),
           'vads_currency' => '978'
       ]
   );