activateSubscription method

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

Activates the subscription.

Parameter subscriptionId: The ID of the subscription

Parameter reason: The reason for activation of a subscription. Required to reactivate the subscription.

Implementation

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

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

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