# Gateways::validatePayPalOrderIsUnused()

> Makes sure a PayPal order has not been used for another order already

- Source: `src/Gateways.php#L270` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/Gateways.php#L270>

```php
Gateways::validatePayPalOrderIsUnused(array $paypalOrder, Wagnerwagner\Merx\OrderPage $virtualOrderPage): void
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$paypalOrder` | `array` | `–` |
| `$virtualOrderPage` | `Wagnerwagner\Merx\OrderPage` | `–` |

## Return type

`void`

## Exceptions

| Type | Description |
| --- | --- |
| `Exception` | merx.paypalError when the order was captured before or belongs to another order |

## Description

PayPal refuses a second capture itself, but relying on that leaves the
check with the provider and reports it as an unspecific API error. This
is the PayPal counterpart of the `order_uid` check in
`completeStripePayment()`.

## Parent class

`Wagnerwagner\Merx\Gateways`
