> For the complete documentation index, see [llms.txt](https://docs.payr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payr.com/payment-interface/payr-sdk/features/alternative-payment-methods-apms.md).

# Alternative Payment Methods (APMs)

Alternative Payment Methods allow your users to pay with popular payment services beyond traditional cards, particularly useful for international students and users from Asia.

***

### SDK Implementation

#### Enable APMs in Your Integration

Add the `apms` feature flag when initializing the SDK:

```javascript
PAYR.init({
  apiBaseUrl: 'https://api.mypayr.co.uk',
  authToken: token,
  container: '#payr-payment-form',
  features: {
    apms: true  // Enable Alternative Payment Methods
  },
  onSuccess: (result) => {
    console.log('Payment successful:', result);
  },
  onError: (error) => {
    console.error('Payment failed:', error);
  }
});
```

#### What Happens When Enabled

When `apms: true` is set:

* Users see a **Payment Type Selector** with options:
  * Card (default)
  * Alipay (China/Hong Kong)
  * WeChat Pay
  * UnionPay
* Selecting an APM changes the payment flow to redirect or QR code
* The SDK handles all APM-specific logic automatically

#### Making a Payment with APMs

Users simply select their preferred payment method and click pay. The SDK handles the rest:

```javascript
await PAYR.pay({
  pure_amount: 850.00,
  currency: 'GBP',
  reference: 'rent-jan-2024'
});
```

No special code required, the SDK automatically uses the payment method the user selected.

***

### Supported Payment Methods

#### Alipay (China/Hong Kong)

* China & Hong Kong's leading digital wallet
* Supports cross-border payments

#### WeChat Pay

* China's most popular messaging and payment app
* QR code-based payment

#### UnionPay

* China's national card payment network
* Widely accepted internationally
* Alternative to Visa/Mastercard for Chinese users

***

### How APMs Work

#### Payment Flow

1. **User selects payment method** - Chooses from Alipay, WeChat Pay, or UnionPay
2. **Redirect or QR code** - User is redirected to the payment provider or shown a QR code
3. **Authentication** - User completes payment in their preferred app/browser
4. **Confirmation** - User returns to your platform after successful payment
5. **Webhook notification** - Your backend receives payment confirmation

#### For Alipay & UnionPay

* User is redirected to the payment provider's page
* Completes authentication in their browser or mobile app
* Automatically returned to your platform after completion

#### For WeChat Pay

* A QR code is displayed
* User scans with WeChat mobile app
* Payment confirmed within the app
* Status updates automatically on the payment page

***

### Support

Need help with APM integration? Contact **<support@mypayr.co.uk>**
