razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
107 stars 147 forks source link

Added `CheckoutOptions` class to make it easier #307

Closed HeySreelal closed 1 month ago

HeySreelal commented 1 year ago

⚠️ IMPORTANT: This is a breaking change!

What's the change?

  1. I've introduced the CheckoutOptions class according to the documentation specified here in the Flutter integration guide.
  2. Commented out the test case named throws error if key is not passed - cause this is now not possible with the CheckoutOptions. The key field is mandatory in the CheckoutOptions.
  3. Updated the pubspec.yaml file so that Dart SDK constraints are now >=2.17.0 <3.0.0
  4. Finally, the option Map can be simply obtained by CheckoutOptions.toJSON().

Why this change?

The CheckoutOptions is an essential part of the RazorPay flutter plugin as it provides a simplified and user-friendly way for users to create a checkout. Instead of passing a Map by themselves, users can simply create the CheckoutOptions object, which brings all the possible properties together in a well-described and helpful way.

This class helps to avoid confusion and makes it easier for users to understand and set the necessary fields required for the checkout process. Overall, the CheckoutOptions class enhances the user experience and improves the usability of the RazorPay flutter plugin.

Thank you :))