# `PhoenixKitBilling.Providers.Razorpay`
[🔗](https://github.com/BeamLabEU/phoenix_kit_billing/blob/0.5.1/lib/phoenix_kit_billing/providers/razorpay.ex#L1)

Razorpay payment provider implementation.

Razorpay is a popular payment gateway in India. Uses their REST API for:
- Payment Links (hosted checkout)
- Orders API
- Customers and Tokens (saved payment methods)
- Refunds

## Configuration

Required settings in database:
- `billing_razorpay_enabled` - "true" to enable
- `billing_razorpay_key_id` - Razorpay Key ID
- `billing_razorpay_key_secret` - Razorpay Key Secret
- `billing_razorpay_webhook_secret` - Webhook secret for signature verification

## Razorpay Flow

1. Create Order with amount and currency
2. Create Payment Link or use Checkout.js
3. User completes payment on Razorpay
4. Razorpay sends webhook on payment success
5. Verify signature and process payment

## Webhook Events

- `payment.authorized` - Payment authorized (for 2-step payments)
- `payment.captured` - Payment captured successfully
- `payment.failed` - Payment failed
- `refund.created` - Refund initiated
- `refund.processed` - Refund completed

## Currency Support

Primary currency is INR. International payments supported with:
USD, EUR, GBP, SGD, AED, CAD, CNY, SEK, NZD, MXN, etc.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
