JAVA SDK - cancel Agreement?

vished
Contributor
Contributor

Hi all,

 

How can I cancel an agreement?

I tried:

 

private void cancelAgreement(Agreement agreement, String accessToken) throws PayPalRESTException {
AgreementStateDescriptor agreementStateDescriptor = new AgreementStateDescriptor();
agreementStateDescriptor.setNote("Cancel the contract");
agreement.cancel(accessToken, agreementStateDescriptor);
}

 

But I got:

The method cancel(String, AgreementStateDescriptor) from the type Agreement is deprecated

 

Any ideas?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.