Solution skill
Adyen getResultOfPaymentSession 500 errorCode 701: pass sessionResult URL-decoded
Complete solution
Shows how to fix adyen getResultOfPaymentSession 500 errorCode 701: pass sessionResult URL-decoded. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Pass the sessionResult URL-decoded to getResultOfPaymentSession. If you are calling this from Next.js middleware, also switch that middleware to the nodejs runtime: the edge runtime lacks a working URL constructor and the SDK throws url_1.URL is not a constructor before the request even goes out.
Steps
- Pass the sessionResult URL-decoded to getResultOfPaymentSession. The value in the browser address bar looks like Ab02b4c0%21BQABAg... and decodes to Ab02b4c0!BQABAg... (note the exclamation mark). Hand the SDK the decoded form; the encoded form is what triggers the 500 with errorCode 701. If you are calling this from Next.js middleware, also switch that middleware to the nodejs runtime: the edge runtime lacks a working URL constructor and the SDK throws url_1.URL is not a constructor before the request even goes out.
When to use
You are seeing this: The value in the browser address bar looks like Ab02b4c0%21BQABAg... and decodes to Ab02b4c0!BQABAg... (note the exclamation mark). Use this skill when you run into "Adyen getResultOfPaymentSession 500 errorCode 701: pass sessionResult URL-decoded".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Issue Adyen/adyen-node-api-library#1467 (closed, 6 comments): A Hosted Checkout integration calling getResultOfPaymentSession (GET /sessions/{id}?sessionResult=...) got HTTP 500 with errorCode 701. The reporter's flow worked through the Drop-in submit step and only the result-fetch call failed. An Adyen maintainer reproduced the 701 by passing a wrong sessionResult and then pinned the real cause: the sessionResult string as it appears in the browser URL is percent-encoded, and passing the encoded form to the SDK method breaks the lookup.
Verified resolution: Pass the sessionResult URL-decoded to getResultOfPaymentSession. The value in the browser address bar looks like Ab02b4c0%21BQABAg... and decodes to Ab02b4c0!BQABAg... (note the exclamation mark). Hand the SDK the decoded form; the encoded form is what triggers the 500 with errorCode 701. If you are calling this from Next.js middleware, also switch that middleware to the nodejs runtime: the edge runtime lacks a working URL constructor and the SDK throws url_1.URL is not a constructor before the request even goes out.
Source URL: https://github.com/Adyen/adyen-node-api-library/issues/1467
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_mQxB4qLQIVLF7e8r5EWIiw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Adyen getResultOfPaymentSession 500 errorCode 701: pass sessionResult URL-decoded <span>— Vectle</span></a>