Stripe Cancelling Subscription

I have added the Stripe component for users to subscribe and I set an action for “when payment goes through”, it updates such user status. I see that the option to cancel will appear once they are subscribed. All that is good.

However, if they cancel their subscription, or if the payment doesn’t go through later in their subscription, I need an action to remove such logged in user status or change such status. How can you deal with this?

1 Like

There is probably a way to do this with custom actions but honestly the best way might be to go through Zapier for such a thing as they have a Stripe integration and you would be able to update a record with the Adalo integration too.

Great, I like Zapier very much, let me explore. Thanks!

I think this is a little more detail that might help:

2 Likes

Hey @ppvaldes did you get this figured out?

I’m working on a subscription app and having trouble figuring out the best flows.

Where is your cancel option? Will that be in your app or on stripe?

I have a free trial build into my app so I’m was limiting access once the free trial is over. To do this, I make the home screen only visible to people who’s subscription expiration is after the current date.

I need to figure out how to update the “subscription expiration” field using Zapier on successful payment but having trouble there.

So far not so many great options. So once the person suscribe in the Stripe component, instead of the credit card input, a message will appear saying “You are suscribed” with a Cancel button underneath. If they click on it, they indeed cancel. But that is about it.

A workaround I’m experimenting with is you creating a Canceling Form in Adalo, this creates an input in a “Cancelation Database” this may trigger a cancelation through Zapier, but still very tricky since you do not generate a customer ID necessarily.

1 Like

In the near future, I would like to post a little more detailed method.

3 Likes

It would be highly appreciated! :wink:

I still need to think about it more to get it worked out. I got some good ideas from @vancewong on my thread here. Maybe some of his tips will help you as well!

1 Like

I will write how to open Stripe’s customer portal.
Users will be able to:
・I want to end (cancel)
・I want to restart
・I want to check the payment history

You will need the following:
・Stripe’s “API Key”
・Zapier’s “Webhooks by Zapier” (Starter Plan or higher required)
・Google Spread Sheet
・Adalo ProPlan

Preparation 1
・Create a Google Spread Sheet
Prepare a table that can retrieve “id” of Users collection from email address.
ex)email,user_id

Preparation 2
・Create a Zap
Add a record ID to the Adalo Users collection when adding a user
Record ID is required when UpDate collection from Zapier,
Adalo does not tell you the record ID at this time, so you need to use Zapier.
With Zapier,
・Get “id” and “email address” with “New Record in Adalo”,
・Save the “id” and “email address” in Google Spread Sheet with “Create Spreadsheet Row in Google Sheets”.
-Save the value of “id” in the “id” property of the Users collection with “Update Record in Adalo”.
(1Zap)

Save Stripe’s “Customer ID” in Adalo’s Users collection at subscription start
With Zapier,
・Acquire Stripe’s “New Customer” event at “New Customer in Stripe”,
-Acquire the “id” of the Users collection from the email address in “Lookup Spreadsheet Row in Google Sheets”.
(By the way, how to update Date/Time property)
・ “Formatter by Zapier” “Date/Time”, get “end period” from Stripe’s “New Customer” event,
Changed format to “YYYY-MM-DDTHH:mm:ssZ”
Changed “+hhmm” at the end of “Formatter by Zapier” and “Text” to “.000Z”
Ex) “2020-07-21T18:46:06+0900” → “2020-07-21T18:46:06.000Z”
· Save the “StripeCustomerID” and “EndPeriod” of the Users collection with “Update Record in Adalo”
(2Zap)

When a subscriber presses the “Open Stripe Customer Portal” button on Adalo,
The following 1 to 3 should be executed.
Transit to the screen that lists “StripeSession URL collection”.

At Zapier,
・Create Webhook by Zapier “Catch Hook” and acquire “Webhook URL”
With Adalo,
・Create Custom Action “Stripe Session”
Type:Create
API Base URL: Zapier’s “Webhook URL”
・Method:POST
Inputs:Email(String), Stripe Customer ID(String)
Body{
“Email”:“Email”,
“Customer”:“Stripe Customer ID”
}
With Zapier,
・Call the Stripe API with Webhook by Zapier “POST”
URL: https://api.stripe.com/v1/billing_portal/sessions
・Payload Type:Form
・Data
Customer:“customer”(:“Stripe Customer ID”)
Return_url:"https://{your service’s URL} (Anything good)
· Headers
Authorization
Bearer
“Stripe’s API Key”
If the test is OK, you can get the URL.
· Save email address, customer ID and URL in StripeSessionURL collection with “Create Record in Adalo”
(3Zap)

With Adalo,
· “StripeSession URL Collection”
Filter: Login user’s email is the same as Name (= email address)
Sorting: Created Date-Newest to Oldest
Maximum number of items: 1
・Display CreateDate and Session URL in the list
・Click to jump to Session URL

Stripe’s customer portal opens in an external browser.

(I rely on Google Translate. I’m sorry if it’s hard to understand.)

9 Likes

Thank you so much, I will start playing with this tomorrow

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.