reviseSubscription method

Future<SubscriptionReviseResponse> reviseSubscription(
  1. String subscriptionId,
  2. SubscriptionReviseRequest request
)

Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the shipping_amount, shipping_address values for the subscription. This type of update requires the buyer's consent.

Parameter subscriptionId: The ID of the subscription

Parameter request: The subscription revise request

Implementation

Future<SubscriptionReviseResponse> reviseSubscription(
  String subscriptionId,
  SubscriptionReviseRequest request,
) async {
  var url = _payPalHttpClient
      .getUrl('/v1/billing/subscriptions/$subscriptionId/revise');

  var body = jsonEncode(request.toJson());

  var response = await _payPalHttpClient.post(url, body: body);

  return SubscriptionReviseResponse.fromJson(jsonDecode(response.body));
}