PHP code example of talandis / laravel-banklinks

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

    

talandis / laravel-banklinks example snippets


$bank = new \Talandis\LaravelBanklinks\Lithuania\SEB();
$bank->setConfiguration( config('banklinks.lithuania-seb') );   // This line is optional. Same configuration is read automatically
$bank->setCallbackUrl( url( 'callback/seb' ) );
$bank->setCancelUrl( url('cancel/seb' ) );

$requestData = $bank->getPaymentRequest(1, 25, 'Beer + Movie');
$requestUrl = $bank->getRequestUrl();

$bank = new \Talandis\Banklinks\Lithuania\SEB();
$bank->setConfiguration( config('banklinks.lithuania-seb') );   // This line is optional. Same configuration is read automatically

if ( $bank->isCancelResponse( Input::all() ) ) {

}
bash
composer 

php artisan vendor:publish --provider="Talandis\LaravelBanklinks\LaravelBanklinksServiceProvider"
html
<form action="{{$requestUrl}}" method="post">
    @foreach ( $requestData as $fieldName => $value ):
      <input type="hidden" name="{{$fieldName}}" value="{{$value}}" />
    @endforeach
    <button type="submit">Make payment</button>
</form>