PayPal breaking change: 2.0.0
What changed
controller methods switched from positional parameters to a single options object
From the upstream announcement:
Automated commit message
Who is affected
Every controller method call must wrap its positional arguments into a single options object whose keys follow the documented parameter names in order (body first, then the paypal* header options, then requestOptions).
To find out whether your repo is hit — file and line number, no code leaving your machine:
npx mendapi scan --repo .
How to fix it
Migration path:
Every controller method call must wrap its positional arguments into a single options object whose keys follow the documented parameter names in order (body first, then the paypal* header options, then requestOptions). For the common single-argument case the rewrite is trivial ( fn(body) becomes fn({ body }) ) and safely regex-able; multi-argument calls need argument-position-to-key mapping, which is AST-codemod territory (b-track) but fully deterministic since the parameter order is documented per method. Confidence medium because the safe automated coverage is the dominant single-argument form.
Before:
await client.ordersController.createOrder(orderRequest, undefined, requestId);
After:
await client.ordersController.createOrder({ body: orderRequest, paypalRequestId: requestId });
With your own LLM key configured (BYO compute — mendapi never proxies your credentials), npx mendapi llmfix turns this guide into a reviewable draft patch for your repo.
Detected and tracked by mendapi — Dependabot for every API you depend on. Scans run locally; your code never leaves your machine.
Related
- All monitored providers — live change counts for paypal and 19 others.
- Migration pack catalog — every deterministic fix mendapi ships.
- Getting started — scan your repo in 30 seconds, no code leaves your machine.