This seems to have come up on this forum several times before, but I haven’t seen a real solution. Hoping someone can help or someone from Adalo can speak to it…
I’ve got a subscription based app. Seeing as the current Stripe component in the Marketplace is apparently defunct, I’m using an external purchase link from Stripe to process the payments. I’m trying to use Zapier to update my Adalo database with the new subscription. However, it isn’t possible to update my User records with Zapier without it being able to read the Record ID to know which record to update. Hoping for a fix that will allow Zapier to automatically these IDs and update.
Until then, looking for a work around that will check if a user has a paid subscription to allow them to continue using the app. Tried making new records in an “Active Subscriptions” collection for each subscription through Zapier, but not sure how I can cross reference the email listed on the User record with the email on the Active Subscription record? This has me stumped and without a solution I’m just treading water with no revenue.
You can do this with a custom action and API. I do this to track subscriptions within the apps for admin reasons and for users to be able to cancel their subscriptions.
First, in your user database collection, add a text parameter and call it “Stripe Customer ID”.
On the screen where you send them to the external purchase, have an additional button on the screen that says something like “After you’ve completed your purchase, click this button”. Similar to this:
Place a button with 3 actions: 1. A custom action that retrieves the current customer ID from stripe (here’s the API for that). 2. An action to update the user’s new Stripe Customer ID parameter with the API call’s customer ID response. 3. A link to a modal screen with a success/error message. Like so:
I’m still a bit new to custom actions and APIs, is there a way to make sure the request to retrieve the ID pulls from the correct customer? It looks on like you have to list a specific ID in the base url.
I feel like I’m almost there… but when testing the call I can see the outputs come through, and am able to rename them:
However, when testing in the web app, the action doesn’t refresh the magic text and the user info isn’t updated with the retrieved Stripe ID. I’ve arranged the screen like you have shown, not sure if an issue with the buttons? I’ve tried a few times, I may be missing something.
I had it all set up as you described. However, I had a text box with a significant amount of text to provide instructions for the user which must have brought the whole page to a crawl and prevented the API call from running properly. I set up a collection to house that text and replaced the text box with a list, and it works like a dream.
You’re a champion for this, thank you! Hope this helps people in the future with this problem, this was hugely helpful.
Hey @Flawless I’ve followed your instructions for the custom action but had a small issue:
When someone doesn’t pay and just clicks on the “sync” account button they get automatic access to the app without having to pay and the custom action pulls the previous customer ID data in. Is there a way to fix this?