Open dbartenstein opened 1 month ago
Possible fix: payment_method = PaymentMethod.attach(payment_method, stripe_customer, api_key=self.default_api_key) https://github.com/dj-stripe/dj-stripe/blob/dbe360255a2d8385bb1004fc162c95ad23eb2a8e/djstripe/models/core.py#L1164
Describe the bug As described here https://dj-stripe.dev/dj-stripe/2.7/api_keys/, we got rid of
STRIPE_LIVE_SECRET_KEY
andSTRIPE_TEST_SECRET_KEY
.However when calling Customer.add_payment_method, PaymentMethod.attach is called without explicit
api_key
param.Fallback is
djstripe_settings.STRIPE_SECRET_KEY
, which will be""
in our case: https://github.com/dj-stripe/dj-stripe/blob/dbe360255a2d8385bb1004fc162c95ad23eb2a8e/djstripe/models/payment_methods.py#L1168A clear and concise description of what the bug is.
To Reproduce
*** djstripe.exceptions.InvalidStripeAPIKey: Invalid API key: ''
Software versions