# PayPalPayment::purchaseUnits()

> Purchase units of a PayPal order

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

```php
PayPalPayment::purchaseUnits(Wagnerwagner\Merx\OrderPage $virtualOrderPage, string $currency): array
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$virtualOrderPage` | `Wagnerwagner\Merx\OrderPage` | `–` |
| `$currency` | `string` | `–` |

## Return type

`array`

List of PayPal’s purchase_unit_request

## Description

The `wagnerwagner.merx.paypal.purchaseUnits` option replaces Merx’ own
purchase unit. PayPal charges the sum of all purchase units, so an option
which returns a complete unit — `Cart::payPalPurchaseUnits()` does — would
otherwise have the payer approve the cart total twice.

## Parent class

`Wagnerwagner\Merx\PayPalPayment`
