$agreement = Agreement::get($createdAgreement->getId(), $apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex);
exit(1);
}
ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement);
return $agreement;
Suspend an agreement
This sample code demonstrate how you can suspend a billing agreement, as documented here at: https://developer.paypal.com/webapps/developer/docs/api/#suspend-an-agreement API used: /v1/payments/billing-agreements//suspend