#b0otable

1 messages · Page 1 of 1 (latest)

modest juniperBOT
hardy glacier
#

Hi there, what do you mean by two secret keys?

cobalt wagon
#

It first adds:
firestore-stripe-payments-STRIPE_API_KEY
(which I would expect)

but also adds
firestore-stripe-payments-STRIPE_API_KEY-XXXX

Where XXXX appears to be numbers/lowercase letters
I can't find reference to this, or why it is being used.

#

I would have expected it to only add:
firestore-stripe-payments-STRIPE_API_KEY
and
firestore-stripe-payments-STRIPE_WEBHOOK_SECRET

hardy glacier
#

Can you share with me the link of the plugin that you are using?

cobalt wagon
#

I think it may be causing problems because one is my live PROD key

#

the other is my DEV key

#

However, I had reconfigured the app to only use my DEV key

hardy glacier
#

Where do you see the firestore-stripe-payments-STRIPE_API_KEY-XXXX ?

cobalt wagon
#

So I have two environments:

On my PROD env
firestore-stripe-payments-STRIPE_API_KEY-XXXX is my prod key
firestore-stripe-payments-STRIPE_API_KEY is my dev/test key

My expectations: Extension was reconfigured via Firebase Stripe Extension GUI to use Prod Key

On my DEV env
firestore-stripe-payments-STRIPE_API_KEY-XXXX is my dev/test key
firestore-stripe-payments-STRIPE_API_KEY is my dev/test key

My expectations: Extension was configured to use dev/test key

#

I also don't understand why there even is a: firestore-stripe-payments-STRIPE_API_KEY-XXXX at all (vs without the -XXXX), however if I look at the Stripe generated .env file, it references the -XXXX key.

#
CREATE_CHECKOUT_SESSION_MIN_INSTANCES=0
CUSTOMERS_COLLECTION=customers
DELETE_STRIPE_CUSTOMERS=Do not delete
LOCATION=europe-central2
PRODUCTS_COLLECTION=products
STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY-m99z/versions/latest
STRIPE_CONFIG_COLLECTION=configuration
STRIPE_WEBHOOK_SECRET=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_WEBHOOK_SECRET/versions/latest
SYNC_USERS_ON_CREATE=Sync
#

The larger issue is that, I have not been able to get the Stripe extension to work with multiple environments. Debugging and working through the Firebase logs lead me down this path.

#

My theory was that the -XXXX added ended up preventing multiple environments working because each env has a different XXXX. (I was getting an error that the API KEY was not provided)

However, I was hesitant to start going to change the values in Google Secret Manager and the .env files, as that are supposed to be managed by the Official Stripe extension

hardy glacier
#

Hm, I don't see the STRIPE_API_KEY-XXXX in the .env file that you share earlier.

#

Anyway I don't think this plugin allow you to configure keys for both prod and test. You might want to create two firebase projects to target prod and test respectively.

cobalt wagon
#

@hardy glacier
STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY-m99z/versions/latest

#

That is the line that has the appended -XXXX to the key

#

the m99z

hardy glacier
#

But the key name is still STRIPE_API_KEY, whatever after = is the value to the key

cobalt wagon
#

Do you see that the STRIPE_API_KEY is referencing Google Secret Manager?

#

after the = sign

#

I do have separate Firebase projects based on previous limitations of the extension

#

Currently:
1 Project for PROD
1 Project for DEV

fair ether
#

👋 taking over for my colleague. Let me catch up.

cobalt wagon
#

However here are the issues I'm seeing:

  1. It has two values it is storing for EACH project for the STRIPE_API_KEY within Google Cloud Manager
    ---- Value 1: STRIPE_API_KEY-m99z
    ---- Value 2: STRIPE_API_KEY
    Expectations: It should only have one value for EACH project for the API KEY within Google Cloud Manager

  2. The .env file generated by the Stripe extension references the -XXXX API_KEY. This won't work for multiple Firebase projects as each project is getting a random XXXX. You would need to create additional .env files for each env or modify the base .env file to use the STRIPE_API_KEY so that it could be generalized across firebase projects

  3. The Stripe Extension / Firebase is not cleaning up API_KEYS properly within Google Cloud Manager. My Prod firebase project has one STRIPE_API_KEY still using a 'TEST' Key when it was changed to 'PRODUCTION'

  4. It would seem like to me that Stripe should generate an env file that references:

STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY/versions/latest

NOT this:

STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY-m99z/versions/latest
fair ether
#

unfortunately this is impossible to test right away, the best thing you can do is to file an issue on github

cobalt wagon
#

@fair ether If you look at that github there is next to no activity on the issues -- No comments / follow ups. It is very frustrating to keep seeing pushes from Stripe / Firebase team to utilize their official extensions and then build your infrastructure on it and then basically be told... ya sorry we don't actually support that product -- it just sounds nice for our YouTube videos and conferences.

fair ether
#

I hear your frustration, all I'm saying is that we (at this channel) don't offer support on all Stripe related questions, we can help to the extent of our knowledge on any non direct API integration questions

#

if you want you can head to https://support.stripe.com/?contact=true they might be able to help you with your issue if you don't want to push back on github.

cobalt wagon
fair ether
#

I'm terribly sorry to hear that, I wish I had the knowledge to help you out, you see it's also frustrating for us when we're unable to help our users, as developers ourselves we know what it's like to be in your shoes, but there's so much that one can do

cobalt wagon
#

Ok, well me manually hacking up the .env seems to be working... at least the Stripe Checkout page comes up now.

#

Here is a more standard problem now:
I have two currencies for a product AED / USD. The USD price is coming up correctly, my AED price is coming up in USD.

#

I verified the priceID for both

fair ether
#

in Checkout you mean?

cobalt wagon
#

Yes, the extension brings up a checkout page.
AED Price is bringing up -> $13.50 (incorrect)
USD Price is bringing up -> $14.50 (correct)

fair ether
#

would you mind sharing the checkout session ids?

cobalt wagon
#

one moment

#

0XyXCWkzKZCnc5WjZeDt

#

sessionId: cs_test_a10sfFDqhw80yx1BEGGIWJVRIrPq0PsUJo7UHV1kySZMtpz7L1QwUcu0gI

fair ether
#

taking a look

#

ok so this price price_1LluVCHT0acjdX625UvroVCI has 2 presentment currencies AED and USD, depending on your customer's default currency (if it was already set) or the locale it will choose which currency to present

cobalt wagon
#

Should different currencies be different prices or added currencies within a single price

#

I didn't realize I had (or it was possible) to have additional currencies under a single price.

It looks like I have
Produce Foo
Price 1: $14.50 USD
Price 2: AED 49 (additional currency $13.50 USD)

#

You're saying based on my locale, it pulled up the $13.50 under the Price 2

sacred stream
#

Hey! Taking over for my colleague. Let me catch up.

sacred stream
cobalt wagon
#

So having separate prices allows you to manually specify currency values whereas having additional currencies under a single price will automatically select based on user locale?

sacred stream
cobalt wagon
#

ok, will do.

#

@sacred stream I don't suppose you have any additional insight on the stripe extension issues at the top of this thread?

sacred stream
#

Nope, sorry!