react-razorpay icon indicating copy to clipboard operation
react-razorpay copied to clipboard

Added `razorpay_subscription_id` on success handler args

Open kunalkeshan opened this issue 2 years ago • 0 comments

Updated with reference to changes in

  • Subscriptions API: https://razorpay.com/docs/payments/subscriptions/apis/
  • Authorisation transaction: https://razorpay.com/docs/api/payments/subscriptions/#authentication-transaction

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.

kunalkeshan avatar Oct 01 '23 12:10 kunalkeshan