Services Plugins FAQs

Stripe Marketplace - Create a card error

As of today, we noticed the error below being thrown by Bubble.

The error occurs when a user attempts to save a credit card to their Stripe account using the Stripe Marketplace - Create a card activity which is subsequently declined.

Error handling within the workflow leverages ThisStripeMarketplaceTokenCard's error to terminate the workflow as well as a standalone activity below.

Is this a new/known bug in the Express Marketplace API?

Hi @ben2,

Thanks for reaching out. Based on this error, perhaps you are trying to use a live credit card while the Keys are set up from Test mode in Stripe.

In order to solve this, please make sure you are using Test API Keys for version-test, and Live API Keys for version-live of your app. In live, you’ll be able to use real credit cards and this issue should not be reproducing anymore.

But if you are testing the app with your Test environment in Stripe, make sure to use valid testing cards. The easiest one is 4242 4242 4242 4242. Meaning, even if you are testing your deployed Bubble app but having the Test API Keys set up - no problem, but just use testing cards which are valid. :pray:

Best,
Alex

Hi @Alexander,

You are correct. The error was the result of intentionally using an invalid CC number in the test environment to validate error handling. We’ve used this test (entering an incorrect CC number) on other pages with similar but slightly different implementations well to validate error handling without seeing this error.

Is there another way to test errors related to incorrect CC data entry?

If not, then this seems to be a bug. The plugin should handle the 402 error as a StripeMarketplaceToken error “declined_card” which can be handled in a conditional or separate workflow.

Please advise.

Hi @ben2,

Thanks for catching up. Sorry but I’m a bit confused. What is exactly that you’re trying to accomplish with our plugin on this matter? Could you relate a bit so we can try to provide working solutions asap. :pray:

Best,
Alex

@alexandru

We’ve implemented the plugin for a standard purchasing workflow:

  1. A user clicks a “Pay” button and presented with a pop-up

  1. User enters payment information and clicks submit.

  2. Payment is processed. If the user opted to save the card as a default payment, a card is created and saved to their account.

  3. User is redirected to the next page.

Provided the CC information is entered correctly, everything works as planned. However, if the user enters an incorrect CC number, the application error is thrown by bubble.

We’ve introduced error handling to catch an incorrect expiration date and it works as planned

However, when we enter in an incorrect card number is entered (error = “card_declined”), the app throws the error.

We need the plugin to handle a “card_declined” error when using the activity “Create a Card” so that we can notify the user to re-enter the card info.

The related workflow follows below.

Attached are screen captures from the bubble console.

  • Stripe marketplace - Create a Card error - “card_declined”:

  • StripeMarketplace Token error (we have a separate workflow monitoring StripeMarketplace errors that doesn’t fire here as well).

  • A screenshot of the Token error handling:

Hi @ben2,

Thanks for details. This explains a lot. You see, when using the Stripe Marketplace Token Error event, the token is detecting errors only at the creation stage, which is why the handling works. Then, the next error is actually coming from the Create a card action (the token has already been created), which is why the event will not work, unfortunately.

Hope it helps.

Best,
Alex

@alexandru That is precisely the question - How do we handle a “card_declined” resulting from an incorrect credit card number when it comes from the Create a card action?

We can successfully handle an incorrect expiration date (see image in previous post), but an incorrect credit card number causes this error.

Hi @ben2,

As previously mentioned, this is impossible as the error comes from the action rather than event, unfortunately.

The successful handle of the expiration date error is resulted from token creation stage, which is why it handles it. As for card creation, it is not possible I’m afraid.

Best,
Alex

Thanks @alexandru

One last question, is there a recommended pattern or method that we should be using to validate a credit card number prior to creating a card? Should we execute the purchase first to catch errors prior to creating the card?

@alexandru

I’m struggling with this one. I am unable to find a way to handle an incorrectly entered credit card number using the “create a card” action.

I even visited your site to see if your demo could gracefully handle a user entering a card number incorrectly and your application threw the same error as the one in my app!

I would like to request an update to the “create a card” activity in order to handle incorrectly entered credit card numbers.

Hi @ben2,

Handling this error based on the Create a card action is not possible, as this is not an event.

You are right, the same error appears on our demo as well, in case of prompting wrong data. This is working as intended, based on Stripe’s API.

I can understand your request of handling the errors for a pleasant User Experience, we’ll consider your feedback for future improvements of our plugin, but cannot guarantee any estimates on this matter, unfortunately.

But you should be able to successfully handle the error at the token creation stage, just as you did before. :pray:

Thanks for understanding.

Best,
Alex

Thanks @alexandru. Understand the timeline regarding the request.

In the meantime, using the Stripe Marketplace Token Error isn’t catching an incorrectly entered CC number. How can we catch this error?

Hi @alexandru. Should not the plugin be handling the 402 response code more gracefully, regardless of what caused it?

Hi guys @john1, @ben2

Thanks for feedback. Let me provide more insights here to help.

The verification and response happens outside of the plugin. This is where webhooks come in place. Otherwise, it is not possible to handle, unfortunately.

And when you are using the card via plugin - it is throwing the error.

We can only recommend you contact the Stripe support to see about handling card verification. So you can explain what you are looking for to implement, as this is not plugin related. But perhaps you can use the plugin features in order accomplish what you prefer, but via the help of webhooks.

Hope it helps.

Best,
Alex

@alexandru

We’ll investigate the use of webhooks but it is this the recommended pattern for a seemingly common use case?

I only ask because it seems odd that error handling of CC number isn’t available for this event, but is available in the activity Platform charge a customer. Is there another activity with this capability that we could consider in re-sequencing the activities?

Curious to know how other customers of the plugin handle CC entry issues.

Thanks again!

Hi @ben2,

Yes, this is the common and a recommended implementation to consider on this matter.

This call has been developed this way, while others do not provide such feature, unfortunately. However, we’ll consider your inputs as a future reference for plugin improvement if feasible. :pray:

Best,
Alex

1 Like