# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rapidbott.com/help-center/platform/introduction/integrations/myfatoorah-payment-gateway-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
