suspendSubscription method

Future<void> suspendSubscription(
  1. String subscriptionId,
  2. Reason reason
)

Suspends the subscription.

Parameter subscriptionId: The ID of the subscription

Parameter reason: The reason for suspenson of the subscription.

Implementation

Future<void> suspendSubscription(String subscriptionId, Reason reason) async {
  var url = _payPalHttpClient
      .getUrl('/v1/billing/subscriptions/$subscriptionId/suspend');

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

  await _payPalHttpClient.post(url, body: body);
}