PHP code example of matthv / laravel-atos-sips-gateway

1. Go to this page and download the library: Download matthv/laravel-atos-sips-gateway 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/ */

    

matthv / laravel-atos-sips-gateway example snippets

 
return app()->make(AtosSipsAuthorization::class)
            ->setPaymentNumber('AABBAA'.rand(1000,9999))
            ->setAmount(1000)
            ->paymentView();

return app()->make(AtosSipsAuthorization::class)
            ->setPaymentNumber('AABBAA'.rand(1000,9999))
            ->setCustomParameters(
                [
                    'customerEmail' => '[email protected]',
                    'customerId' => 123,
                    'orderId' => 456,
                ]
            )
            ->setAmount(1000)
            ->paymentView();

$verify = app()->make(Verify::class);
// you can access all callback data using
$allParameters = $verify->getParameters();
// or specify a field using
$paymentNumber = $verify->getParameter('transactionReference');

try {
    $success = $verify->isSuccess();
    if ($success) {
        // handle successful payment
    } else {
        // handle error payment
    }
    echo "OK";
} catch (InvalidSignature $e) {
    Log::alert('Invalid payment signature detected');
}

php artisan vendor:publish --provider="Matthv\AtosSipsGateway\Providers\AtosSipsServiceProvider"