cancelScheduledChanges method
Future<Response<RazorpaySubscription> >
cancelScheduledChanges({
- required String subscriptionId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpaySubscription> ?
Cancel Scheduled Changes
@param subscriptionId - The unique identifier of the Subscription.
Implementation
Future<Response<RazorpaySubscription>> cancelScheduledChanges({
required String subscriptionId,
void Function(RazorpayApiException?, Response<RazorpaySubscription>?)?
callback,
}) async {
if (subscriptionId.isEmpty) {
throw ArgumentError(MISSING_ID_ERROR);
}
final url = '$BASE_URL/$subscriptionId/cancel_scheduled_changes';
return api.post<RazorpaySubscription>(
// Assuming it returns the subscription object
{'url': url},
fromJsonFactory: RazorpaySubscription.fromJson,
callback: callback,
);
}