laravel-revolut-payments maintained by upscalewp
Laravel Revolut Payments
A Laravel SDK for the Revolut Merchant API: orders, checkout tokens, capture, cancel, refunds, payments, customers, and webhooks.
Install
composer require upscalewp/laravel-revolut-payments
Publish the config:
php artisan vendor:publish --tag=revolut-payments-config
Add environment variables:
REVOLUT_PAYMENTS_ENVIRONMENT=sandbox
REVOLUT_PAYMENTS_API_KEY=your_revolut_merchant_api_key
REVOLUT_PAYMENTS_API_VERSION=2026-04-20
REVOLUT_PAYMENTS_WEBHOOK_SECRET=your_webhook_secret
Create a checkout order
use upscalewp\RevolutPayments\Facades\RevolutPayments;
$order = RevolutPayments::orders()->create([
'amount' => 10000,
'currency' => 'RON',
'merchant_order_ext_ref' => 'ORDER-1001',
'description' => 'Order #1001',
'capture_mode' => 'automatic',
'success_url' => route('checkout.success'),
'failure_url' => route('checkout.failed'),
]);
$checkoutToken = $order['token'];
Use the returned token with Revolut Checkout on your frontend.
Orders
RevolutPayments::orders()->get($orderId);
RevolutPayments::orders()->list(['limit' => 20]);
RevolutPayments::orders()->update($orderId, ['description' => 'Updated description']);
RevolutPayments::orders()->capture($orderId);
RevolutPayments::orders()->cancel($orderId);
RevolutPayments::orders()->refund($orderId, ['amount' => 5000]);
Payments
RevolutPayments::payments()->payForOrder($orderId, [
'payment_method' => [
'id' => $savedPaymentMethodId,
],
]);
RevolutPayments::payments()->listForOrder($orderId);
RevolutPayments::payments()->get($paymentId);
Customers
$customer = RevolutPayments::customers()->create([
'email' => 'client@example.com',
'full_name' => 'Client Example',
]);
RevolutPayments::customers()->get($customer['id']);
RevolutPayments::customers()->update($customer['id'], ['email' => 'new@example.com']);
RevolutPayments::customers()->delete($customer['id']);
Webhooks
use Illuminate\Http\Request;
use upscalewp\RevolutPayments\WebhookVerifier;
Route::post('/webhooks/revolut', function (Request $request) {
WebhookVerifier::fromConfig()->verifyRequest($request);
$event = $request->json()->all();
// Handle ORDER_COMPLETED, ORDER_PAYMENT_AUTHENTICATED, ORDER_CANCELLED, etc.
return response()->json(['ok' => true]);
});
You can also manage webhook endpoints through the API:
RevolutPayments::webhooks()->create([
'url' => 'https://example.com/webhooks/revolut',
'events' => ['ORDER_COMPLETED'],
]);
RevolutPayments::webhooks()->list();
RevolutPayments::webhooks()->get($webhookId);
RevolutPayments::webhooks()->update($webhookId, ['events' => ['ORDER_COMPLETED', 'ORDER_CANCELLED']]);
RevolutPayments::webhooks()->delete($webhookId);
Testing
composer test
composer analyse
For application tests, you can bind the fake client:
use upscalewp\RevolutPayments\Contracts\ClientContract;
use upscalewp\RevolutPayments\Testing\FakeRevolutClient;
$fake = new FakeRevolutClient([
'post orders' => ['id' => 'ord_test', 'token' => 'token_test'],
]);
app()->instance(ClientContract::class, $fake);
Notes
This package targets Revolut Merchant API endpoints under /api/1.0. Pin REVOLUT_PAYMENTS_API_VERSION in production and upgrade it deliberately after checking Revolut's changelog.