-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Unable to Dynamically Set Event Callbacks for Paddle Instance #27
Comments
Hi @FarhanAtAppyHigh , Thank you for raising a detailed report. This bug is very close to #20 and we are working on a strategic solution that will make it easy to use Paddle JS with SPA. I will let you know once we have a fix for this problem. |
Hi @FarhanAtAppyHigh, If you are using or if you are calling
Note: We have't updated our documentation with the new functions yet. It should be updated in a few days Thank you. |
Hello, Thank you. |
Hello @vijayasingam-paddle , I appreciate your efforts in addressing this issue promptly and providing the necessary fixes. I'm pleased to report that we have successfully integrated the retain flow. I conducted tests today, and everything appears to be functioning properly! Once again, thank you for your swift response and effective resolution. |
What happened?
Hi, We have encountered an issue with our web application's payment flows. We currently support two payment methods: subscription and pay-as-you-go. Previously, we initialized Paddle at runtime when the user clicked on either flow. This approach allowed us to optimize performance by loading/intialize Paddle dynamically only when necessary, thereby avoiding initial page load overhead.
However, a new requirement has emerged to add pwCustomer: object during Paddle initialization for Retain (ProfitWell Engagement) analytics purposes. To meet this requirement, we need to initialize Paddle in our NextJS layout so that it is declared on each page, as per the recommendation in your documentation. Unfortunately, this change has introduced a complication.
Since we now have only one Paddle instance declared, we are unable to set up different event callbacks based on the selected payment flow (such as redirections are different for both inline payment checkout). Initially, I attempted to dynamically add event callbacks based on the payment flow using:
handleSubs, handlePayAsYouGo are the functions they get called and I tried to change eventCallback for particular case before calling paddleInstance.checkout()
but encountered an issue: only the event callbacks initialized first are working properly. so how can i change these based on different inline checkout flows?
Also, for adding Retain (ProfitWell Engagement) support in our codebase, suggestions from Richard (from the Paddle team) were that further along in the user journey, when we have userEmail, we have to set pwCustomer with userEmail in our paddleInstance. I think this will also not work, as we are not able to dynamically set/change paddleInstance.
Steps to reproduce
...
What did you expect to happen?
How are you integrating?
The text was updated successfully, but these errors were encountered: