How can I show a list of connected credit cards a user has connected using stripe?

I have a repeating group setup and it keeps loading instead of showing the listed cards I need help setting this up.

What do you mean ‘it keeps loading instead of showing the listed cards’?

Are you saying it doesn’t load the data?

What is your datasource for the RG?

The data source for the RG is the following: current user’s Stripe Credit Cards current user’s Stripe Credit Cards

I have text elements to show the relevant information such as last 4 digits, Expiration date ect…

current user’s Stripe Credit Cards current user’s Stripe Credit Cards

I assume that’s a typo? (you don’t actually have it twice??)

And what happens?

My bad the following is the corrected: RepeatingGroup Stripe Credit Card’s List of Stripe Credit Cards.

The other one was wrong because I copied the expressions.

Anyway when I preview it just loads I have 2 test cards added on the stripe payment methods which I want to show in a list of connected cards

Again… I don’t know what you mean by “it just loads”?..

Does it load or doesn’t it?

In any case, your RG datasource doesn’t make any sense:

RepeatingGroup Stripe Credit Card’s List of Stripe Credit Cards.

Unless that is referring to the data from another RG? in which case, what is the datasource of that RG?

Okay so It doesn’t load but what I have right now is a data type called credit card with fields for:
Card Number
Card Type
Cardholder Name
Expiration Date
Last 4 Digits of Card Number
Security Code

I’m thinking my problem is that the relevant information (The above) are not storing the information from the Stripe database for a user in this case its in test mode and I’m using my user account with email address.

The text elements inside my RG I have got the expiration date and the last 4 digits so far just trying to setup them for now then when I figure out how to do that I can add card type cardholder name ect…

Right…

well, firstly, I definitely wouldn’t advise storing customer’s Card Details in a custom datatype in your Bubble app database, if that’s what you’re doing.

That’s what Stripe is for.

You could store the Payment method ID (or card ID) if you really need to. Or you can just access those things directly from the Stripe API (using the Customer ID)

So all you really need is the Customer ID. If you’re using the Bubble Stripe Plugin, that is stored automatically on the User datatype.

Although, If you’re using the Bubble Stripe plugin, you should be able to access a customer’s cards directly on the User datatype.

So your RG datasource just needs to be: Current User's Stripe Credit Cards (the built in system field, not some custom datatype you’ve added)

Okay thank you so much seems to be showing some digits now. So I don’t need the data type I’ve created called Credit Card. This all seems to be working good now. Am I right in thinking the data that is showing is coming straight from Stripe?

You definitely don’t need it… and you could very well open yourself up to all sorts of legal and data security issues if you keep it. So get rid of it.

Am I right in thinking the data that is showing is coming straight from Stripe?

Yep, it all comes direct from Stripe where it is stored securely.

Is there a way to show the Cardholder name too?

It doesn’t look like it (not with the Bubble Stripe Plugin).

But if you make your own API call instead you can show whatever data Stripe expose in the API (which includes the cardholder name)

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.