> For the complete documentation index, see [llms.txt](https://docs.rapidbott.com/help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rapidbott.com/help-center/platform/introduction/integrations/myfatoorah-payment-gateway-integration.md).

# MyFatoorah Payment Gateway Integration

### Overview

The MyFatoorah Payment Gateway integration allows you to collect secure online payments directly inside your Rapidbott chatbot.

This integration supports:

* Payment link generation
* Payment success trigger
* Payment failure trigger
* Dynamic order data passing
* Secure API-based verification

***

### Requirements

Before installing:

* Active MyFatoorah merchant account
* MyFatoorah API Key (Test or Live)

***

### Installation

1. Go to Rapidbott Mini App Store
2. Install **MyFatoorah PG**
3. Enter your MyFatoorah API Key
4. Select Test or Live mode
5. Save

***

### Configuration

Inside the app settings:

* Enter API Key
* Select Mode:
  * Test Mode (recommended first)
  * Live Mode (production)

{% hint style="warning" %}
Always test before switching to live mode.
{% endhint %}

***

### Using in Chatbot Flow

Add a Payment Node in your chatbot builder.

Provide:

* Amount
* Customer Name
* Customer Email
* Reference ID
* Description

You can pass dynamic variables like:

Amount → {{order\_amount}}\
Name → {{user\_name}}\
Email → {{user\_email}}\
Reference → {{order\_id}}

***

### Payment Flow Logic

Step 1: User confirms purchase\
Step 2: Chatbot generates MyFatoorah payment link\
Step 3: User completes payment\
Step 4: Integration verifies payment using MyFatoorah API\
Step 5: Chatbot triggers:

* Payment Success Flow\
  or
* Payment Failed Flow

***

### Payment Success Trigger

Triggered when:

* Payment status = Paid

You can use this to:

* Confirm order
* Send invoice
* Unlock service
* Assign agent
* Trigger backend automation

***

### Payment Failed Trigger

Triggered when:

* Payment status = Failed
* Payment expired
* Payment cancelled

You can use this to:

* Retry payment
* Notify user
* Offer alternative payment

***

### Security

* API Key stored securely
* Payment status verified before confirmation
* No manual status validation required

***

### Test Mode vs Live Mode

Test Mode:

* Safe environment
* No real charges

Live Mode:

* Real transactions
* Production environment
