Razorpay Integration Guide
Razorpay is a leading payment gateway in India, providing a comprehensive suite of payment products. Fype integrates seamlessly with Razorpay to offer a unified checkout experience while leveraging Razorpay’s robust infrastructure.1. Obtain Razorpay API Credentials
To connect Razorpay to Fype, you need your API Key ID and Key Secret.- Log in to your Razorpay Dashboard.
- Navigate to Account & Settings > API Keys.
- Ensure you are in the correct environment (Test or Live) using the toggle at the top.
- Generate a new Key ID and Key Secret.
- Copy these credentials immediately, as the Secret will not be shown again.
2. Connect to Fype
- Log in to the Fype Dashboard.
- Navigate to Connections (or Providers).
- Click Connect Razorpay.
- Select the environment:
- Sandbox: Use this if you are using Razorpay Test Mode keys.
- Live: Use this for Razorpay Live Mode keys.
- Enter your
Key IDandKey Secret. - (Optional but Recommended) Enter a Webhook Secret. This should match the secret you set in the Razorpay Dashboard (see Step 3).
- Click Save Connection.
3. Configure Razorpay Webhooks
Fype relies on webhooks to receive real-time updates about your transactions.- In the Razorpay Dashboard, go to Account & Settings > Webhooks.
- Click + Add New Webhook.
- Webhook URL: Set this to
https://api.fype.dev/v1/webhooks/razorpay. - Secret: Enter a strong, unique string. This must match the Webhook Secret you provided in the Fype Dashboard.
- Active Events: Subscribe to the following events to ensure full synchronization:
payment.authorizedpayment.capturedpayment.failedrefund.processedrefund.failed
- Click Create Webhook.
4. Verification
- Test Transaction: Create a payment using your Fype Test API Key.
- Checkout: Follow the
checkout_urland complete the payment using Razorpay Test Instruments. - Status Sync: Verify in the Fype Dashboard that the payment status transitions to
succeeded. - Webhook Delivery: Confirm that your backend received the
payment.succeededevent from Fype.
Troubleshooting
Webhook Signature Mismatch
If Fype logs “Invalid signature” for Razorpay webhooks, double-check that the Webhook Secret in Razorpay matches exactly with the one stored in Fype’s Connection settings.Payments Stuck in “Processing”
Fype transitions a payment tosucceeded only after receiving a payment.captured event. If Razorpay is configured for Manual Capture, you must capture the payment in your Razorpay Dashboard or via API before Fype will mark it as successful.