PHP code example of inkvizytor / laravel-przelewy24

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

    

inkvizytor / laravel-przelewy24 example snippets

   
   composer 

   Devpark\Transfers24\Providers\Transfers24ServiceProvider::class,
   

    php artisan vendor:publish --provider="Devpark\Transfers24\Providers\Transfers24ServiceProvider"
    
      
$payment = app()->make(\App\Payment::class);
$registration_request = app()->make(\Devpark\Transfers24\Requests\Transfers24::class);

$register_payment = $registration_request->setEmail('[email protected]')->setAmount(100)->setArticle('Article Name')->init();

if($register_payment->isSuccess())
{
    // save registration parameters in payment object
    
    return $registration_request->execute($register_payment->getToken(), true);
}

$payment_verify = app()->make(\Devpark\Transfers24\Requests\Transfers24::class);
$payment_response = $payment_verify->receive($request);

if ($payment_response->isSuccess()) {
    $payment = Payment::where('session_id',$payment_response->getSessionId())->firstOrFail();
   // process order here after making sure it was real payment
}
echo "OK";