PHP code example of sebastienheyd / laravel-systempay

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

    

sebastienheyd / laravel-systempay example snippets


return [
    'default' => [
        'site_id' => 'YOUR_SITE_ID',
        'key'     => env('SYSTEMPAY_SITE_KEY', 'YOUR_KEY'),
        'env'     => env('SYSTEMPAY_ENV', 'PRODUCTION'),
    ]
];

return [
    'default' => [
        // ...
        'algo'    => 'sha1'
    ]
];

return [
    'default' => [
        // ...
        'params'  => [
            'currency' => '826'
        ]
    ]
];

return [
    'default' => [
       // ...
    ],
    'store_uk' => [
        'site_id' => '123456',
        'key'     => env('SYSTEMPAY_UK_SITE_KEY', '12345678'),
        'env'     => env('SYSTEMPAY_UK_ENV', 'PRODUCTION'),
        'algo'    => 'sha256'        
    ]
];
 
$systemPay = Systempay::config('store_uk')->set([
    'amount' => 12.34,
    'trans_id' => 123456
]);

 namespace App\Http\Controllers;

use Systempay; // Facade

class PaymentController extends Controller
{
    public function payment()
    {
        $systemPay = Systempay::set([
            'amount' => 12.34,
            'trans_id' => 123456
        ]);
        
        return view('payment', compact('systemPay'));
    }
}

php artisan vendor:publish --provider="Sebastienheyd\Systempay\SystempayServiceProvider"