> ## Documentation Index
> Fetch the complete documentation index at: https://developers.orchestrasolutions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PayPal

> Accept PayPal payments with redirect-based checkout.

<Info>
  This page is part of **Supported Payment Methods**. [View all payment methods →](/guides/library/supported-payment-methods)
</Info>

PayPal enables customers to pay using their PayPal account balance, linked bank accounts, or saved cards. The payment flow redirects customers to PayPal for authentication.

## Availability

PayPal is available on all browsers and devices.

| Platform         | Availability |
| ---------------- | ------------ |
| Desktop browsers | Yes          |
| Mobile browsers  | Yes          |
| iOS apps         | Yes          |
| Android apps     | Yes          |

```javascript theme={null}
const available = await engine.checkAvailability();
if (available.includes('PayPal')) {
  // Show PayPal button
}
```

## Requirements

PayPal requires:

* A PayPal Business account (see [PayPal Setup](/guides/library/paypal-setup)), configured as a PayPal eWallet account in [Orchestra Portal](https://portal.orchestrasolutions.com/#/resource/eWalletAccount)

```javascript theme={null}
// Server-side session creation
const session = {
  operation: 'CHARGE',
  paymentGatewayAccountId: 'yourPspAccount',
  allowedeWalletAccountIds: ['your-paypal-account'],
  amount: 25.00,
  currencyCode: 'USD',
  countryCode: 'US',
  mode: 'LIVE'
};
```

<Note>
  PayPal does not require a separate PSP account. Payments are processed directly through PayPal. However, `paymentGatewayAccountId` is still required in the session for other payment methods.
</Note>

## Button Setup

```html theme={null}
<div id="paypal-button"></div>
```

```javascript theme={null}
engine.payBy(
  [{ name: 'PayPal', domEntitySelector: '#paypal-button' }],
  handleResult,
  { color: 'Dark', text: 'Pay' }
);
```

## How It Works

1. Customer clicks the PayPal button
2. A popup window opens with PayPal login
3. Customer logs into their PayPal account
4. Customer reviews and confirms the payment
5. PayPal redirects back to the popup
6. On completion, the popup closes and results are returned to the client, ready to be sent to your server for validation

## Supported Operations

| Operation             | Supported | Description                 |
| --------------------- | --------- | --------------------------- |
| `CHARGE`              | Yes       | Process payment immediately |
| `TOKENIZE`            | No        | Not supported               |
| `CHARGE_AND_TOKENIZE` | No        | Not supported               |

<Warning>
  PayPal only supports immediate charges. Tokenization is not available for PayPal payments.
</Warning>

## Address Collection

PayPal can provide the customer's shipping address from their PayPal account:

```javascript theme={null}
const requiredAncillaryInfo = {
  shippingInfo: {
    phoneRequired: false,
    emailAddressRequired: true
  }
};

const engine = new eWallet.Engine(sessionToken, requiredAncillaryInfo);
```

## Related

<CardGroup cols={2}>
  <Card title="PayPal Setup" icon="paypal" href="/guides/library/paypal-setup">
    Configure PayPal credentials
  </Card>

  <Card title="Result Handling" icon="check" href="/guides/library/result-handling">
    Parse payment results
  </Card>
</CardGroup>
