PHPackages                             tbclla/laravel-revolut-merchant - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tbclla/laravel-revolut-merchant

ActiveLibrary[API Development](/categories/api)

tbclla/laravel-revolut-merchant
===============================

An unoffial Laravel wrapper for Revolut's Merchant API

v1.0(6y ago)4715MITPHP

Since Apr 14Pushed 6y ago2 watchersCompare

[ Source](https://github.com/tbclla/laravel-revolut-merchant)[ Packagist](https://packagist.org/packages/tbclla/laravel-revolut-merchant)[ RSS](/packages/tbclla-laravel-revolut-merchant/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/561b51d8f4f1b8b8ce8bbdcf0f2d7336e881af37a549dc4b34339c448f5ca0bb/68747470733a2f2f706f7365722e707567782e6f72672f7462636c6c612f6c61726176656c2d7265766f6c75742d6d65726368616e742f762f737461626c65)](https://packagist.org/packages/tbclla/laravel-revolut-merchant)[![License](https://camo.githubusercontent.com/1b1286c8293e946c3d1449534a9fc315195c43a9fc48e49a47a8740d48cf5644/68747470733a2f2f706f7365722e707567782e6f72672f7462636c6c612f6c61726176656c2d7265766f6c75742d6d65726368616e742f6c6963656e7365)](https://packagist.org/packages/tbclla/laravel-revolut-merchant)[![Build Status](https://camo.githubusercontent.com/9edbfdc9d83bceeadc0141eaf797315e9b48c925949c79f979dffb15f60c4ab5/68747470733a2f2f7472617669732d63692e636f6d2f7462636c6c612f6c61726176656c2d7265766f6c75742d6d65726368616e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/tbclla/laravel-revolut-merchant)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bcb53540f6c65376262405bf8e9112a3246ba1b0534a00bbac2f4de2bae8a338/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7462636c6c612f6c61726176656c2d7265766f6c75742d6d65726368616e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tbclla/laravel-revolut-merchant/?branch=master)

Laravel-Revolut (Merchant)
==========================

[](#laravel-revolut-merchant)

An unofficial Laravel wrapper for [Revolut's Merchant API](https://developer.revolut.com/docs/merchant-api).
A sister package for [Revolut's Open API for Business](https://developer.revolut.com/docs/business-api/#getting-started) can be found [here](https://github.com/tbclla/laravel-revolut-business).

Requirements
------------

[](#requirements)

- Laravel &gt;=5.8
- PHP &gt;=7.2

Getting Started
---------------

[](#getting-started)

Follow this guide on how to install the package, and read Revolut's [Merchant API documentation](https://developer.revolut.com/docs/merchant-api/#getting-started) to learn more about the functionalities offered by the API.

⚠️ **Please use a [sandbox account](https://sandbox-business.revolut.com/signup) when setting up this package, and only switch to your real-world account once you're happy that everything is working correclty.**

### Installing

[](#installing)

Pull the package in through Composer

```
composer require tbclla/laravel-revolut-merchant

```

#### Service Provider &amp; Facade

[](#service-provider--facade)

If you have disabled auto-discovery, add the service provider and facade to your `config/app.php`.

```
'providers' => [
    // ...
    tbclla\RevolutMerchant\Providers\RevolutMerchantServiceProvider::class,
],

'aliases' => [
    // ...
    'Merchant' => tbclla\RevolutMerchant\Facades\Merchant::class,
]
```

#### Publish the configuration (optional)

[](#publish-the-configuration-optional)

If you would like to publish this package's configuration to your own config directory, use the below artisan command.

```
php artisan vendor:publish --provider "tbclla\RevolutMerchant\Providers\RevolutMerchantServiceProvider"

```

#### Set environment variables

[](#set-environment-variables)

Add the following keys to your project's `.env` file, as all of the configuration values are read from there.
❗Complete the `REVOLUT_MERCHANT_API_KEY` with the API key from your merchant account.

```
REVOLUT_MERCHANT_SANDBOX=true
REVOLUT_MERCHANT_API_KEY=

```

That's it, you're all done.

How to use this package
-----------------------

[](#how-to-use-this-package)

To use the client, you can either instantiate a new `tbclla\RevolutMerchant\Client` which accepts your API key, and whether or not to run in sandbox mode:

```
use tbclla\RevolutMerchant\Client;

// sandbox
$merchant = new Client('your_api_key', true);
// production
$merchant = new Client('your_api_key');

$merchant->order()->get($orderId);
```

Or you can use the facade, which will inject your environment values.
For brevity, all of the examples in this documentation are using the facade.

```
use tbclla\RevolutMerchant\Facades\Merchant;

Merchant::order()->get($id);
```

### Orders

[](#orders)

Please refer to [Revolut's official documentation on orders](https://developer.revolut.com/docs/merchant-api/#backend-api-order-object) for additional information on how to use the orders endpoint.

#### Create an order

[](#create-an-order)

```
Merchant::order()->create([
    "amount" => 200,
    "capture_mode" => "MANUAL",
    "merchant_order_id" => "00122",
    "customer_email" => "sally.gibson@gmail.com",
    "description" => "description",
    "currency" => "GBP",
    "settlement_currency" => "USD",
    "merchant_customer_id" => "sally01"
]);
```

#### Retrieve an order

[](#retrieve-an-order)

```
$orderId = 'd41c46db-5f82-4dd7-8a22-a43ac517b6df';

Merchant::order()->get($orderId);
```

#### Capture an order

[](#capture-an-order)

```
Merchant::order()->capture($orderId);
```

#### Cancel an order

[](#cancel-an-order)

```
Merchant::order()->cancel($orderId);
```

#### Refund an order

[](#refund-an-order)

```
Merchant::order()->refund($orderId, [
    "amount" => 100,
    "currency" => "GBP",
    "merchant_order_id" => "00122",
    "description" => null
]);
```

### Web-Hooks

[](#web-hooks)

Read [Revolut's official documentation about web-hooks](https://developer.revolut.com/docs/merchant-api/#backend-api-webhooks) to learn more.

#### Create the web-hook

[](#create-the-web-hook)

```
Merchant::webhook()->create('https://myapp.com/webhook');
```

#### Revoke the web-hook

[](#revoke-the-web-hook)

```
Merchant::webhook()->revoke();
```

#### Retrieve web-hooks

[](#retrieve-web-hooks)

```
Merchant::webhook()->retrieve();
```

Revolut Checkout Widget API
---------------------------

[](#revolut-checkout-widget-api)

To use the checkout widget, you have to embed [a script from Revolut](https://developer.revolut.com/docs/merchant-api/#revolut-checkout-widget-api-embed-script) on any page that will use the checkout widget.

This package includes a `@revolutMerchantScript` blade directive which will embed this script for you and set the correct source depending on your configured environment.

```

    Checkout Page

    @revolutMerchantScript

    ...

```

Brief example
-------------

[](#brief-example)

Below is a quick and dirty example to illustrate how to create a new payment order, and subsequently display a payment pop-up.

For this example, the logged in user sends an AJAX request to a `/purchase` route, where a new payment order is created. The payment order's `public_id` is then returned and passed to `RevolutCheckout()`.

#### PHP

[](#php)

```
Route::post('/purchase', function() {
    // Get the logged in user
    $user = Auth::user();
    // Fetch the item being purchased
    $item = Item::find(request('item_id'));
    // Create a new payment order
    $paymentOrder = Merchant::order()->create([
        "currency" => "GBP",
        "description" => $item->name,
        "amount" => $item->price,
        "customer_email" => $user->email,
        "merchant_customer_id" => $user->id,
    ]);
    // return the payment order's 'public_id'
    return $paymentOrder['public_id'];
});
```

#### JavaScript

[](#javascript)

❗Don't forget that any page which intends to use `RevolutCheckout()` must include the [above mentioned checkout widget script](https://github.com/tbclla/laravel-revolut-merchant#revolut-checkout-widget-api) **before** calling `RevolutCheckout()`.

```
// the user triggers a request to the above route
axios.post('/purchase', {"item_id": 123456}).then((response) => {
    // get the 'public_id' from the response
    let publicId = response.data;
    // pass the 'public_id' to RevolutCheckout()
    RevolutCheckout(publicId).then(function(instance) {
        // Launch the pop-up
        instance.payWithPopup({
            onSuccess() { ... },
            onError(message) { ... }
        });
    });
});
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

2214d ago

Major Versions

v0.1 → v1.02020-04-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/78bdce2dd15c3f5801880b4649558b1be2953355ed74b5f92ee2d4af47f542a5?d=identicon)[tbclla](/maintainers/tbclla)

### Embed Badge

![Health badge](/badges/tbclla-laravel-revolut-merchant/health.svg)

```
[![Health](https://phpackages.com/badges/tbclla-laravel-revolut-merchant/health.svg)](https://phpackages.com/packages/tbclla-laravel-revolut-merchant)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
