# Gateways::validatePayPalOrderAmount()

> Makes sure a PayPal order charges what the order costs

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

```php
Gateways::validatePayPalOrderAmount(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.amountMismatch |

## Description

The amount is fixed when the PayPal order is created. The default purchase
unit takes it from the cart, but `paypal.purchaseUnits` lets a shop build
its own — a mistake there would charge the wrong amount while the order is
still marked as paid.

## Parent class

`Wagnerwagner\Merx\Gateways`
