PHPackages                             wonderfulpaymentsltd/one-api-sdk-php - 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. wonderfulpaymentsltd/one-api-sdk-php

ActiveLibrary

wonderfulpaymentsltd/one-api-sdk-php
====================================

Official PHP SDK for the Wonderful One API - Accept Open Banking payments, manage customers, orders, and more.

v1.0.0(1mo ago)00MITPHPPHP ^8.0

Since Jul 13Pushed 1mo agoCompare

[ Source](https://github.com/wonderfulpaymentsltd/one-api-sdk-php)[ Packagist](https://packagist.org/packages/wonderfulpaymentsltd/one-api-sdk-php)[ RSS](/packages/wonderfulpaymentsltd-one-api-sdk-php/feed)WikiDiscussions main Synced 1w ago

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

Wonderful One API - PHP SDK
===========================

[](#wonderful-one-api---php-sdk)

[![Latest Version](https://camo.githubusercontent.com/925a2602b93a333b224b299626caf6dcfe4471a8e2f057cdc61d722d404e0cc2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776f6e64657266756c7061796d656e74736c74642f6f6e652d6170692d73646b2d706870)](https://packagist.org/packages/wonderfulpaymentsltd/one-api-sdk-php)[![Total Downloads](https://camo.githubusercontent.com/ca230aff9ea9dc4ccaca0c241c333fa18411c5c8e9deb1a7b6d8ebfe67b9a6cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776f6e64657266756c7061796d656e74736c74642f6f6e652d6170692d73646b2d706870)](https://packagist.org/packages/wonderfulpaymentsltd/one-api-sdk-php)[![License](https://camo.githubusercontent.com/376fb23ba048856b0925ae385ad12f12099672a7791a7990a0102cfdb5c26e6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776f6e64657266756c7061796d656e74736c74642f6f6e652d6170692d73646b2d706870)](LICENSE)

Official PHP SDK for the [Wonderful One API](https://api.wonderful.one). Accept Open Banking payments, manage customers, orders, and generate reusable payment links — directly from your PHP or Laravel application.

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

[](#requirements)

- PHP 8.0 or higher
- [Guzzle](https://docs.guzzlephp.org) ^7.0 (installed automatically)
- A Wonderful One merchant account and [API token](https://dashboard.wonderful.one)

Installation
------------

[](#installation)

```
composer require wonderfulpaymentsltd/one-api-sdk-php
```

Configuration
-------------

[](#configuration)

### Standalone

[](#standalone)

```
use Wonderful\OneApi\OneApiClient;

$client = OneApiClient::make('your-api-key');
```

### Laravel

[](#laravel)

The Service Provider and Facade are registered automatically via [Package Discovery](https://laravel.com/docs/packages#package-discovery).

1. Add your API key to `.env`:

```
ONE_API_KEY=your-api-key

```

2. (Optional) Publish the config file:

```
php artisan vendor:publish --tag=one-api-config
```

3. Use the Facade:

```
use OneApi;

OneApi::customers()->list();
```

Or inject via constructor:

```
use Wonderful\OneApi\OneApiClient;

class PaymentController
{
    public function __construct(protected OneApiClient $oneApi) {}

    public function index()
    {
        return $this->oneApi->payments()->list();
    }
}
```

---

Usage
-----

[](#usage)

### Quick Pay

[](#quick-pay)

Create a customer, order, order line, and payment in a single request.

```
$payment = $client->quickPay()
    ->amount(1000)                           // £10.00 in GB pence
    ->reference('ORDER-1234')                // Shown on bank statement (max 18 chars, A-Z, 0-9, -)
    ->description('Website Order #1234')      // Order description
    ->customerEmail('john@example.com')       // Links order to customer
    ->redirectUrl('https://mysite.com/success')
    ->webhookUrl('https://mysite.com/webhooks')
    ->create();

echo $payment->pay_link; // Send customer to this URL to pay
```

Minimum required fields:

```
$payment = $client->quickPay()
    ->amount(500)
    ->reference('ORDER-1')
    ->redirectUrl('https://mysite.com/success')
    ->create();
```

Advanced options:

```
$payment = $client->quickPay()
    ->amount(1000)
    ->reference('ORDER-1234')
    ->bankId('natwest')                     // Pre-select the customer's bank
    ->skipConfirmation(true)                // Skip the confirmation page
    ->sendToTap('a1b2c3d4')                 // Send to a Tap device
    ->create();
```

### Reusable Payment Links (QR Codes)

[](#reusable-payment-links-qr-codes)

Create a fixed-amount payment link that can be reused (e.g., for donations, subscriptions, or physical QR codes).

```
$qrCode = $client->qrCodes()->create([
    'amount' => 2000,
    'label' => 'Donation - General Fund',
    'customer_data_collection' => 'email_only',
]);

echo $qrCode->pay_link;   // Payment URL
echo $qrCode->image_link;  // QR code image URL
```

Customer data collection levels: `none`, `email_only`, `contact_light`, `contact_full`, `billing`

List, find, update, and delete QR codes:

```
$qrCodes = $client->qrCodes()->list();
$qrCode  = $client->qrCodes()->find('0e261265');
$client->qrCodes()->update('0e261265', ['amount' => 3000, 'label' => 'Updated']);
$client->qrCodes()->delete('0e261265');
```

### Customers

[](#customers)

```
// Create
$customer = $client->customers()->create([
    'first_name' => 'John',
    'last_name' => 'Smith',
    'email' => 'john@example.com',
    'telephone' => '01234 567890',
    'marketing_consent' => true,
    'address' => '123 Some Street, London, SW1A 1AA',
]);

// Find
$customer = $client->customers()->find('1d368e62');

// Update (pass all fields - the API replaces the entire record)
$client->customers()->update('1d368e62', [
    'first_name' => 'Jonathan',
    'last_name' => 'Smith',
    'email' => 'jonathan@example.com',
    'telephone' => '01234 567890',
]);

// Delete (soft-delete)
$client->customers()->delete('1d368e62');

// List with filters
$list = $client->customers()->list([
    'search' => 'John',
    'sort' => 'last_name_asc',
    'start_date' => '2024-01-01',
    'end_date' => '2024-12-31',
    'per_page' => 50,
]);

foreach ($list->data as $customer) {
    echo $customer->full_name . ' - ' . $customer->email . "\n";
}
```

### Orders &amp; Refunds

[](#orders--refunds)

```
// List orders
$orders = $client->orders()->list([
    'payment_status' => 'paid',
    'sort' => 'created_desc',
    'per_page' => 25,
]);

// Find a specific order
$order = $client->orders()->find('ed6d3016');

// Access related data
echo $order->total_formatted;
echo $order->customer->email;
echo $order->payments[0]->pay_link;
echo $order->order_lines[0]->description;

// Create a refund (amount in GB pence)
$refund = $client->orders()->refund(
    id: 'ed6d3016',
    amount: 500,
    reference: 'REF-001',          // Optional, max 18 chars
    reason: 'Item returned, too big.' // Optional, internal note
);

echo "Refunded: {$refund->refund_amount_formatted} ({$refund->status})";
```

### Payments

[](#payments)

```
// List payments
$payments = $client->payments()->list([
    'sort' => 'created_desc',
    'per_page' => 10,
]);

// Find a specific payment
$payment = $client->payments()->find('e2611865');

// Stop a payment (before it's authorised at the bank)
$payment = $client->payments()->stop('e2611865');

// Delete a payment (only if status is 'created')
$client->payments()->delete('e2611865');
```

### Tap Devices

[](#tap-devices)

```
// List all tap devices
$devices = $client->tapDevices()->list();

// Filter by action type
$tapDevices = $client->tapDevices()->list(['tap_payments']);
$reusableLinkDevices = $client->tapDevices()->list(['reusable_payment']);
$merchantLinkDevices = $client->tapDevices()->list(['merchant_link']);
```

### Supported Banks

[](#supported-banks)

```
$banks = $client->banks()->list();

foreach ($banks->data as $bank) {
    echo "{$bank->bank_name} ({$bank->bank_id}) - {$bank->status}\n";
}
```

### Error Handling

[](#error-handling)

The SDK throws typed exceptions for common HTTP errors:

```
use Wonderful\OneApi\Exceptions\AuthenticationException;
use Wonderful\OneApi\Exceptions\ValidationException;
use Wonderful\OneApi\Exceptions\NotFoundException;
use Wonderful\OneApi\Exceptions\OneApiException;

try {
    $payment = $client->quickPay()
        ->amount(1000)
        ->reference('ORDER-1234')
        ->redirectUrl('https://mysite.com/success')
        ->create();
} catch (AuthenticationException $e) {
    // 401 - Invalid or missing API key
    echo $e->getMessage();
} catch (ValidationException $e) {
    // 422 - Validation failed (check invalid fields)
    print_r($e->getInvalidFields());
} catch (NotFoundException $e) {
    // 404 - Resource not found
} catch (OneApiException $e) {
    // Other API errors (4xx, 5xx)
    echo "{$e->getMessage()} (code: {$e->getCode()})";
}
```

---

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

MIT © Wonderful Payments Ltd

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53d37d562c1d349e8305425c065fdee0b0ea56a68854923a5e41a5845cd395a8?d=identicon)[wonderfulpaymentsltd](/maintainers/wonderfulpaymentsltd)

---

Top Contributors

[![johnblackmore](https://avatars.githubusercontent.com/u/4094712?v=4)](https://github.com/johnblackmore "johnblackmore (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wonderfulpaymentsltd-one-api-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/wonderfulpaymentsltd-one-api-sdk-php/health.svg)](https://phpackages.com/packages/wonderfulpaymentsltd-one-api-sdk-php)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.4k567.5M2.9k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.1k1.0M59](/packages/neuron-core-neuron-ai)[craftcms/cms

Craft CMS

3.6k3.7M3.5k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3751.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.3k42.4k21](/packages/tempest-framework)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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