Skip to main content

Overview

UniBee Payment supports iframe integration for seamless payment experiences. By setting PaymentUIMode to "embedded" in API requests, you can embed payment pages directly into your application using an iframe, eliminating the need for page redirects.

Architecture Overview

API Integration

Supported Endpoints

The following API endpoints support iframe integration:

Request Parameters

Add the PaymentUIMode parameter to your API requests:

Response Structure

When PaymentUIMode is set to "embedded", the API returns:
Key Fields:
  • link: The payment page URL to embed in iframe
  • paymentId: Unique payment identifier
  • invoiceId: Unique invoice identifier
  • action: Gateway-specific payment data

API Integration Flow

Frontend Integration

Frontend Integration Flow

1. Basic iframe Setup

2. React Integration Example

Message Communication Protocol

Message Flow Diagram

Message Format

The iframe sends messages to the parent window in the following format:

Message Types

Complete Integration Flow

Integration Steps Overview

1. Create Payment

2. Embed Payment Page

3. Listen for Messages

Security Considerations

1. Message Origin Verification

2. Message Content Validation

Best Practices

1. Responsive Design

2. Loading States

3. Timeout Handling

API Reference

PaymentUIMode Values

Required Headers