1. Go to this page and download the library: Download quickpayge/laravel 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/ */
// app/Listeners/HandlePaymentPaid.php
use Quickpay\Laravel\Events\PaymentPaid;
class HandlePaymentPaid
{
public function handle(PaymentPaid $event): void
{
$payment = $event->payment; // \Quickpay\DTO\Payment
// Update your order, send confirmation email, etc.
}
}
use Quickpay\Exceptions\AuthException;
use Quickpay\Exceptions\ValidationException;
use Quickpay\Exceptions\RateLimitException;
use Quickpay\Exceptions\NotFoundException;
use Quickpay\Exceptions\QuickpayException;
try {
$payment = Quickpay::payments->get('some-uuid');
} catch (AuthException $e) {
// 401/403
} catch (ValidationException $e) {
// 422 — field errors in $e->errors
} catch (RateLimitException $e) {
// 429 — retry after $e->retryAfter() seconds
} catch (NotFoundException $e) {
// 404
} catch (QuickpayException $e) {
// catch-all
}