Integrating Stripe Customer Portal

I want to tie my weweb site to stripe such that when a user makes a payment, a certain number of credits get added to the user profile. The credits are tracked in a column of the user_subscriptions table that ties to the users table with an id. I followed the stripe integration portion of the weweb docs, and am able to accept payment in stripe (at least test payments with the fake credit cards), but it does not explain how to tie that payment to a specific user in my users table.

This is outside the scope of the weweb docs, but I was also unable to find how stripe would then communicate with my xano database when payment is received to increase the number of credits for a given user.

The solution I see would be to somehow integrate the stripe customer portal that can be built in stripe with my weweb application, but can find now tutorials for how this might be done. Can someone explain how I would integrate the strip customer portal with my weweb app, or does anyone have another suggestion that may be easier?

Hi Matt, this is something you would do through your backend → Xano. You need to set up a webhook in Stripe that will fire when a payment is concluded. This webhook would include the customer identifier. On the Xano side, you will listen to this webhook and when it arrives, process it accordingly. Based on the customer identifier included in the webhook, you will know exactly whom to associate the payment with in your Xano database.

Typically, you would want to set up a webhook to fire upon a successful payment intent. You send the entire JSON to Xano and then inside Xano you parse the data you need and work with it accordingly.

1 Like

I set this up myself recently. If you need help let me know.

Slavo,

Thanks for the reply. This is definitely helpful. A couple of follow up questions.

As you can see in the provided image, the customer column in blank in the stripe portal for all test payments. Do I have some kind of configuration error in weweb that is preventing that column from filling with data, or is it normal for that column to be blank?

Even if it did have a value in there, there is currently no way to tie that customer id in stripe back to a specific user. I would expect that stripe would need a customer ID that I create in xano and is thus automatically able to make purchases in stripe when they create an account.
image

Is there a way to import the stripe customer portal to weweb so that the user can change their payment information and subscription plan without me having to build that functionality and tie it to stripe?

Dorian,

Any help would be greatly appreciated. Would you be able to hop on a 30 minute call to discuss the issue?

Short answer is yes. I’ll DM you and we can get on a call.