Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Stripe not working after changing test api keys to live keys #337

Closed
AnonJervis opened this issue Dec 30, 2024 · 2 comments
Closed

🐛Stripe not working after changing test api keys to live keys #337

AnonJervis opened this issue Dec 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AnonJervis
Copy link

AnonJervis commented Dec 30, 2024

Note

Please stick to the template and provide as much detail as possible to help us diagnose and fix the issue.
Low effort bug reports will be closed.

Describe the bug
I was in stripe sandbox with connected account for testing. Once I was done, I turned off saas and changed APP_SAAS_MODE_ENABLED to false. I entered live STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY, AND STRIPE_WEBHOOK_SECRET in .env and relaunch the docker-compose. However, when I tried running payment, it gave me said error:

production.ERROR: Stripe payment intent creation failed: No such customer: 'cus_xxx' {"exception":"[object] (Stripe\\Exception\\InvalidRequestException(code: 0): No such customer: 'cus_xxx' at /app/backend/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php:38)

I am not sure if it's because during testing I have it running in saas mode but once finished I disabled it to go non-saas. I do not want to use connected account in stripe and I've checked my stripe APIs are correct.

On the stripe end, I checked the logs and it's showing error:

`{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such customer: 'cus_XXX'",
    "param": "id",
    "request_log_url": "https://dashboard.stripe.com/logs/req_XXX?t=123456789",
    "type": "invalid_request_error"
  }
}`

To Reproduce
Steps to reproduce the behavior:

  1. Turn on sandbox mode in Stripe
  2. grabbed its sk_test, pk_test, whsec_xxx keys
  3. input keys into .env
  4. APP_SAAS_MODE_ENABLED=true
  5. launch docker compose
  6. test payment, succeed
  7. docker compose down
  8. APP_SAAS_MODE_ENABLED=false
  9. input sk_live, pk_live, whsec_xxx keys from stripe live environment
  10. launch docker compose
  11. when test paying first live ticket, after clicking "continue to payment", Stripe webhook failed saying "There was an error communicating with the payment provider. Please try again later"
  12. docker logs stated: production.ERROR: Stripe payment intent creation failed: No such customer: 'cus_xxx' {"exception":"[object] (Stripe\\Exception\\InvalidRequestException(code: 0): No such customer: 'cus_xxx' at /app/backend/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php:38)
  13. stripe logs stated: { "error": { "code": "resource_missing", "doc_url": "https://stripe.com/docs/error-codes/resource-missing", "message": "No such customer: 'cus_XXX'", "param": "id", "request_log_url": "https://dashboard.stripe.com/logs/req_XXX?t=123456789", "type": "invalid_request_error" } }

Expected behavior
Continue payment will show stripe webhook payment page

Screenshots
image

Desktop (please complete the following information):

  • OS: POP!os
  • Browser Version 131.0.6778.204 (Official Build) (64-bit)

Hi.Events Version and platform
Docker All-in-one v0.8.0-beta.9

@AnonJervis AnonJervis added the bug Something isn't working label Dec 30, 2024
@daveearley
Copy link
Contributor

Hi @AnonJervis,

If you connected with Stripe Connect, the account in the DB may still gave Stripe account ID associated with it.

Can you please set the accounts.stripe_account_id value to NULL in your DB and see if that fixes the issue.

Thanks

@AnonJervis
Copy link
Author

Hi @daveearley,

I've tried but no lucky. Maybe there was something I missed as well because it was giving me the same error. I took down the container and rebuild DB from scratch and now can connect Stripe API properly.

Thank you again for the quick response and happy new year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants