# How To Collect Payment Via Razorpay ( INDIAN GATEWAY ) For WhatsApp Native Commerce ?

#### Razorpay Payment Integration

1. **Generate API Keys**: Navigate to the Razorpay Dashboard, navigate to Settings, then API Keys, and generate keys if you have not done so already.
2. **Create Authentication**: In your automation builder, add a new authentication using the Razorpay API keys.
3. **Calculate Order Total**: Multiply the order total by 100 to convert to the smallest currency unit (e.g., cents), saving this figure in a custom field.
4. **Create Payment Link**: Utilize the Razorpay app within your automations builder to create a payment link. Include the multiplied order amount, currency, a brief description, customer details (including email and phone number), and your webhook URL for capturing payment status.
5. **Webhook Setup**: Configure a webhook to listen for incoming data, capturing key information such as the order ID and the customer's phone number.
6. **Store and Send Payment Link**: Save the generated payment link in a custom field. Craft a message to send this link as a clickable button to your user.
7. **Payment Monitoring**: Implement a wait time to allow the user to complete the payment. Afterwards, use a router to verify if the payment was successful.
8. **Order Status Update**: If payment is successful, proceed to update the order status on your e-commerce platform and notify the customer with a confirmation message.
9. **Handle Payment Failure**: In cases where the payment fails within a specified timeframe (e.g., 5 minutes), incorporate a basic router to assess the payment status. Inform the user via a message that the payment attempt has been unsuccessful.
10. **Payment Retrial**: Offer an option for the user to retry payment. On selection, generate a new payment link and dispatch it to the user.
11. **Automation Activation**: Make sure to save your configurations and enable the automation workflow to apply the changes.

**Automation Workflow Tutorial**: This video guide demonstrates the procedure of integrating Razorpay payment links with WhatsApp for seamless payment updates and transactions.

{% embed url="<https://youtu.be/jHX3X8V4BsI>" %}


---

# 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://helpdocumentation.gitbook.io/user/ecommerce/how-to-collect-payment-via-razorpay-indian-gateway-for-whatsapp-native-commerce.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.
