0

I Have integrated PayPal in my Project and used in Community which has been build as Managed Package. Now I trying to install this Managed Package in Another Org.

Installation was successfully done. I have enable Community and testing the PayPal integrations in installed ORG getting following error.

exceptionType: "System.UnexpectedException"
isUserDefinedException: false
message: "Script-thrown exception"

It's working in Developed ORG. I Enabled the Debug log no much information available in Log.

Can anyone help me how to troubleshoot this kind of issues.

Thanks

1
  • Unless you can provide a code example or detailed steps to reproduce this issue, there's not much the community can do to help you. Please edit your post to provide additional detail.
    – David Reed
    Jan 7, 2021 at 4:02

1 Answer 1

1

You'll need to add package namespace to the callout name.

In this case "Script-thrown exception" means non-existing named credentials is referenced in the callout. The callout worked in Development org because the org had the same namespace as the Named Credentials and the namespace was optional. It's not documented anywhere but it fixed the issue for me.

HttpRequest req = new HttpRequest();
req.setEndpoint('callout:<namespace>__<Named_Credentials_Name>/some-path');

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .