Cannot use settings.php to store API secret when using Stripe form element

Created on 21 September 2018, almost 6 years ago
Updated 19 December 2023, 6 months ago

In Stripe module settings form help:

Bear in mind that this configuration will be exported in plain text and likely kept under version control. We recommend providing these settings through your settings.php file, directly on the environment and safe from prying eyes.

However, if you try to set Stripe API keys in settings.php, you are unable to use the Stripe form element:

You must configure the on for the stripe elements to work.

This is because the current Stripe element implementation depends on stripe.settings configuration. If we want to be able to store stripe api keys in settings.php, the handle() and processStripe() functions should not get API keys from the module settings configuration.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States AdamBernstein

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Confirming that those config values (in #4) in combination with dummy values in /admin/config/stripe seem to work perfectly.

    Thanks, @vonFrakas.

  • πŸ‡ΊπŸ‡ΈUnited States solarDog

    #4 does not work for me using Stripe 2.0.0-beta2 and Drupal 10.1.6. It would be really helpful if the documentation explained how to properly add the settings to the settings.php file.

Production build 0.69.0 2024