Forum Documentation Showcase Pricing Learn more

Error on Live App

Hello

I am trying to test my App Live, so that I can do some testing on Stripe.

However when I try to move on from payment I get the attached error.
I created the customer as part of the flow on Live so not sure what is happening

Any clues on what is happening?

Its ok…I have worked out its a Stripe error not a Bubble.is error

Right, it’s very likely an issue with the keys you’re using, mixing live and test.

Ahh no…ok so not an error on Stripe

I am using payment workflow -> Collect Users CC Card information.
I thought that would charge the customer, but it doesn’t, that just wants to save the info that was input so it looks for a customer on Stripe…which I didn’t have…that was the error message.

BUT…I need to charge a customers debit card not just save the info…I cannot see how to do this?

Collect a user CC info means collects the card info, not charge it. See here https://bubble.io/reference#Actions.ChargeUser. What you need is ‘charge the current user’ i think.

Also, the error message you showed is coming from stripe, that means you’re using the live keys in test mode.

Yes the error message was from stripe telling me that the customer doesn’t exist in live but it can find it in test, but I am accessing Strip via Live…which is correct as I am testing my Live App.

Charge current user would charge the user that is logged in…I don’t want to do this.
My App allows different sellers to login in to their account and sell products to people at fairs etc, so the person being charged is not the seller but will be customers…does that make sense?

Just change the email to something else. Charge current user doesn’t require the user to be logged in. But you need an email to charge someone, it’s a requirement from stripe.

1 Like

Ahh ok…got that working :smile:

However its paying into the wrong Stripe account :frowning:

It needs to pay into the Stripe account that I get the ‘User’ to connect to…not the one I have to enter in the Plugins page.

Is there a way of setting the keys dynamically according to the user logged in?

Yes, kind of. You need to enable your sellers to register with their stripe account. Check this

and

This is really a stripe question, you should understand their documentation well

I have read the Stripe documentation and I have implemented the Connect feature.

So my ‘User’ Logins in…they are asked to Connect to their Stripe account via the workflow -> Register the User as a Seller…after they have Signed Up/Logged into Stripe, they are redirected too my StripeAccess Page which in my settings is API Tab I have set StripeAccess as my Login Page for OAuth Redirects.

Soooo… not sure what I am missing now

The documentation says that after I have done Register the user as seller there is one other thing that need to be done for Standalone connection

  1. Using the code parameter, you should make a POST request to our access_token_url endpoint
    curl https://connect.stripe.com/oauth/token
    -d client_secret=sk_test_xDROamzZwpe2kRQ3KSOSOzS4
    -d code=AUTHORIZATION_CODE
    -d grant_type=authorization_code

Stripe will return a response containing the authentication credentials for the user:

{
“token_type”: “bearer”,
“stripe_publishable_key”: PUBLISHABLE_KEY,
“scope”: “read_write”,
“livemode”: false,
“stripe_user_id”: USER_ID,
“refresh_token”: REFRESH_TOKEN,
“access_token”: ACCESS_TOKEN
}
You’re done! The user is now connected to your platform.

But I don’t think Bubble lets me do this??

Bubble handles that on your behalf. What you need to do is have your venders go through a ‘register as a seller action’, and then when you use a charge user action, you can pick ‘the payee is another user’, and pick which vendor should get the payment.

Me Again :smile:

So…have moved forward but still got an issue, it might be a page flow thing maybe!?

I am going to explain the App flow just so that there is no confusion and tell you the issue.

  1. ‘User’ Logins
  2. ‘User’ Registers as Seller with Stripe
  3. Stripe redirects to StripeAccess Page with is the OAuth redirect
  4. ‘User’ Clicks Continue and gets taken to the Apps Welcome Page
  5. ‘User’ Clicks ‘Add New Order’ and gets taken to New Order Page
  6. ‘User’ Selects a ‘Customer’ from dropdown (previously added onto their account)
  7. ‘User’ selects products the customer wants to order
  8. ‘User’ Clicks Submit and gets forwarded to the Order Summary Page
  9. ‘User’ Clicks Submit on Order Summary Page and the Stripe payment pops-up
  10. ‘User’ fills in the Customers card details and submits payment.
    At this point I get an error saying
    ‘Sorry, this seller cannot accept payments right now due to a temporary error. Please try again later’

The ‘User’ then gets an email from Bubble as below

Hello,
You are trying to sell something but are not registered as a seller through Stripe.
Please go to the link below to register.
Thank you for your selling with us!
The team

The link takes me to the same page as ‘Register user as Seller’ to connect to Stripe account…user did this already, so confused as to why it cannot make payment

It’s probably because the payee of the transaction is the wrong user. Try to use the debugger (see our email of yesterday) to confirm it’s the right user, the message you’re getting is pretty explicit.

Payee is correct, is the currently logged-in user…its also them that gets the email that mentioned in my previous post, it is the same email address that they did step ‘register user as a seller’ with

Then check the register as a seller workflow, because stripe is saying the user isn’t registered. Check with your stripe console to make sure the user is a seller. The issue here is a workflow issue, not a bubble feature one.

Yep does look like its a workflow issue…as I can’t see what Bubble does in the background its hard to figure out.

When the use Registers as a seller, once they connect their stripe account they are redirected back to my app…my app needs to hold on to the authentication credentials to use later on…does Bubble do this in the background?

I cannot debug the bubble payment popup for stripe so I cannot tell what is being sent to Stripe at the point of payment

Continuing the discussion from Error on Live App:

The URL that the email asks me use to ‘Register User as a Seller’ is
https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_6yu1icPsPCTyg6dxRSGfVjwH1Az80WlC&
scope=read_write&state=%7B%22nextURL%22%3A%22https%3A%2F%2Fbubble.is%2Fsite%2F4evertest%2Fversion-test%22%2C%22
user_id%22%3A%221441285454619x635236654896289200%22%2C%22appname%22%3A%224evertest%22%7D&
stripe_user%5Bemail%5D=vpatel%40znazzymedia.com&
stripe_user%5Burl%5D=https%3A%2F%2Fbubble.is%2Fsite%2F4evertest%2Fversion-test&stripe_user%5Bbusiness_name%5D=4evertest

The URL my app uses to do the same thing is
https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_6yu1icPsPCTyg6dxRSGfVjwH1Az80WlC&
scope=read_write&state=%7B%22nextURL%22%3A%22https%3A%2F%2Fbubble.is%2Fsite%2F4evertest%2Fversion-test
%2Fstripe_registration%3Fdebug_mode%3Dtrue%26resume%3D1442495825619x206%22%2C%22
user_id%22%3A%221441285454619x635236654896289200%22%2C%22appname%22%3A%224evertest%22%7D&
stripe_user%5Bemail%5D=vpatel%40znazzymedia.com&
stripe_user%5Burl%5D=https%3A%2F%2Fbubble.is%2Fsite%2F4evertest%2Fversion-test&stripe_user%5Bbusiness_name%5D=4evertest

Can’t see the issue here

Can you post a screenshot of your workflow that both register the user as a seller and charge the (other user). We have quite some apps that use these functions, so things work on the Bubble end.