PHP code example of wizcodepl / lunar-tpay

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

    

wizcodepl / lunar-tpay example snippets


'payments' => [
    'types' => [
        'tpay' => ['driver' => 'tpay'],
    ],
],

$result = Payments::driver('tpay')
    ->cart($cart)
    ->authorize();

if ($result->success) {
    return redirect()->away($result->message);  // tpay redirect URL
}

Payments::driver('tpay')
    ->cart($cart)
    ->withData(['pay' => ['groupId' => 150]])  // 150 = BLIK
    ->authorize();