piyushgarg-dev / react-razorpay

Integrate Razorpay payments in your React App
https://www.npmjs.com/package/react-razorpay
20 stars 4 forks source link

Added `razorpay_subscription_id` on success handler args #7

Open kunalkeshan opened 10 months ago

kunalkeshan commented 10 months ago

Updated with reference to changes in

Success Handler for Authorisation Transaction

image

Added the field - razorpay_subscription_id as a return type for the same function args.

Optional Parameters Updated

As per the Razorpay documentation, some parameters are now optional based on the transaction type. The order_id and amount fields are not always required, depending on the specific transaction. This enhancement allows for more flexibility and customization when using the Razorpay API.

Reference: https://razorpay.com/docs/api/payments/subscriptions/#authentication-transaction

image

interface RazorpayOptions {
    ...
   key: string;
   amount?: string;
   currency?: string;
   name?: string;
   order_id?: string;
   ...
}

This update provides developers with more control and adaptability in their interactions with the Razorpay API.

Thanks! If any issue with this PR let me know if I've done anything wrong, happy to hear your thoughts on it.