react-paypal-js: [BUG]: Warnings related to intent=tokenize on createSubscription

Is there an existing issue for this?

  • I have searched the existing issues.

🐞 Describe the Bug

I’m switching over an app to use this library, and it’s quite nice and well-documented. Thanks for making this!

I’ve setup my code pretty much identical to what found in the Storybook here.

When I click the subscribe button, the popup window opens; however, there are two warnings in the console (see below).

The subscriptions are working in the sandbox.

I realize these are warnings; however, I’d like to know if I can safely ignore them, or make some changes to the implementation to address them.

😕 Current Behavior

When I click the subscribe button there are warnings in the browser console.

🤔 Expected Behavior

There should be no warnings.

🔬 Minimal Reproduction

1. Implement buttons as shown in the Storybook mentioned above.
2. Click subscribe button.
3. View warnings in console.

🌍 Environment

| Software         | Version(s) |
| ---------------- | ---------- |
| react-paypal-js  | 8.1.0      |
| Browser          | Chrome 114.0.5735.198 |
| Operating System | macOS Ventura |

Relevant log output

smart_button_validation_error_billing_without_purchase_intent_tokenize_not_passed
{
    "vault": true,
    "cartBillingType": "SUBSCRIPTIONS_V1",
    "timestamp": "1690454123853",
    "referer": "www.sandbox.paypal.com",
    "sdkCorrelationID": "xxx",
    "sessionID": "xxx",
    "clientID": "xxx,
    "env": "sandbox",
    "buttonSessionID": "xxx",
    "buttonCorrelationID": "xxx",
    "time": "1690454123853",
    "user_id": "xxx",
    "token": "xxx"
}
Expected intent=tokenize for a billing-without-purchase transaction

Code of Conduct

  • I agree to follow this project’s Code of Conduct

➕ Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 16 (1 by maintainers)

Most upvoted comments

The invalid warning message smart_button_validation_error_billing_without_purchase_intent_tokenize_not_passed has been fixed. We are working on the other issue RESOURCE_NOT_FOUND mentioned on this issue.

I’m also having the same problem, my front-end integration breaks the same way @GatoVuelta described, but the webhook arrives correctly after a few seconds on my back-end.

I’ve made a temporary workaround to avoid this problem, if I catch the error RESOURCE_NOT_FOUND I just show a loading state while I poll my backend waiting for the payment confirmation ¯_(ツ)_/¯

I’m getting this as well even, I’m not new but then this started to pop out, also seems to be the direct cause for the following errors that break my app completely:

smart_api_billagmt_subscriptions_get_contingency_error 
Object { timestamp: "1692414277583", referer: "www.sandbox.paypal.com", sdkCorrelationID: "f29334927a890", sessionID: "uid_b6e3970e67_mdm6mdm6ntg", clientID: "AT_JzFs8g...", env: "sandbox", buttonSessionID: "uid_f07437e2c9_mdm6mdm6ntg", buttonCorrelationID: "f368299bd965a", token: "0BL308..." }

Then

Uncaught Error: RESOURCE_NOT_FOUND
js:3:71880

at error https://www.paypal.com/sdk/js?client-id=AT_JzFs8gVW...&intent=subscription&vault=true:3
at  Wr https://www.paypal.com/sdk/js?client-id=AT_JzFs8gVW...&intent=subscription&vault=true:3
at [...]

I’m getting this as well even, I’m not new but then this started to pop out, also seems to be the direct cause for the following errors that break my app completely:

smart_api_billagmt_subscriptions_get_contingency_error 
Object { timestamp: "1692414277583", referer: "www.sandbox.paypal.com", sdkCorrelationID: "f29334927a890", sessionID: "uid_b6e3970e67_mdm6mdm6ntg", clientID: "AT_JzFs8g...", env: "sandbox", buttonSessionID: "uid_f07437e2c9_mdm6mdm6ntg", buttonCorrelationID: "f368299bd965a", token: "0BL308..." }

Then

Uncaught Error: RESOURCE_NOT_FOUND
js:3:71880

at error https://www.paypal.com/sdk/js?client-id=AT_JzFs8gVW...&intent=subscription&vault=true:3
at  Wr https://www.paypal.com/sdk/js?client-id=AT_JzFs8gVW...&intent=subscription&vault=true:3
at [...]

I’m having this issue too. Checkouts works but subscriptions doesn’t. The subscription is created and paid on paypal side but I never get any information back to my app.

I think it might be a breaking change on Paypal side because I didn’t have this problem in July but I had the same package version that I made my test today and it worked in July. Now I updated to the last one but no changes, still got the issue.