You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcardFieldsOptions : PayPalCardFieldsComponentOptions={// actions are in docs example but not within types// vvvvvv https://developer.paypal.com/sdk/js/reference/#link-requestcaptureorderfromserveronApprove: (data,actions)=>{}// onCancel is documented but not in types// vvvvvvv can't link to it, because links are broken (see screenshot 1)onCancel: ()=>{}}constfields=paypal.CardFields.(cardFieldsOptions)
// example from docs https://developer.paypal.com/sdk/js/reference/#link-requestcreateorderfromserverconstonApprove=(data,actions)=>{returnfetch('/api/paypal/order/capture',{method: 'POST',body: JSON.stringify({orderID: data.orderID})}).then(res=>{returnres.json();}).then(json=>{// Show a success page});};// this example does return a promise with data. type for onApprove is not a Promise, its just void
😕 Actual Behavior
see above
🤔 Expected Behavior
Not sure whats the right behavior, i guess types are right, and docs wrong?
🌍 Environment
Node.js/npm: 22 + pnpm latest
OS: ubuntu 24
Browser: chrome latest
➕ Additional Context
The sdk docs are a little broken. most links:
exists at least twice and always link to the first one.
The text was updated successfully, but these errors were encountered:
Library used
'@paypal/paypal-js'
(for types)script-tag
🐞 Describe the Bug
Docs and types are not in sync
🔬 Minimal Reproduction
😕 Actual Behavior
see above
🤔 Expected Behavior
Not sure whats the right behavior, i guess types are right, and docs wrong?
🌍 Environment
➕ Additional Context
The sdk docs are a little broken. most links:
exists at least twice and always link to the first one.
The text was updated successfully, but these errors were encountered: