stripe-bundle icon indicating copy to clipboard operation
stripe-bundle copied to clipboard

fix for stripe_api_key for symfony 3.2

Open larkarvin opened this issue 8 years ago • 6 comments

larkarvin avatar May 15 '17 16:05 larkarvin

Hey @larkarvin, thanks for the PR!

Did you have any problem using Symfony 3.2 ? I am not sure I had any trouble with it actually, could you explain the problem in a few words?

flo-sch avatar May 17 '17 10:05 flo-sch

Hey after installation i have this error :

The service "flosch.stripe.client" has a dependency on a non-existent parameter "stripe_api_key". Did you mean this: "flosch_stripe.stripe_api_key"?

soufyaneM avatar Jun 29 '17 09:06 soufyaneM

Hey @soufyaneM, IMHO I think it relate to a customized parameter (from app/config/parameters.yml which I called stripe_api_key in the example, containing the actual api key of your Stripe platform account (either test or live secret key, depending of your environment)

Are you using such a parameter in your parameters.yml file?

flo-sch avatar Jun 29 '17 10:06 flo-sch

No i start with your bundle and i have this error ! You think i need to add this parameter ?

soufyaneM avatar Jun 29 '17 10:06 soufyaneM

In the example (README.md), I just added a shortcut yo use Symfony parameters.

If, in your /app/config/config.yml file, you include such lines :

# app/config/config.yml
flosch.stripe:
    stripe_api_key: "%stripe_api_key%"

Then you need to add the stripe_api_key parameter in your /app/config/parameters.yml file, such as (here, in test mode) :

# app/config/parameters.yml
parameters:
    # // ...
    stripe_api_key: "sk_test_XXXYYYZZZ"

NB : it is of course possible to include it directly in the config.yml file, if you want to share the key between different environments, even though I do not think this is what anybody wishes :

# app/config/config.yml
flosch.stripe:
    stripe_api_key: "sk_test_XXXYYYZZZ"

flo-sch avatar Jun 29 '17 10:06 flo-sch

It's ok thks you :+1:

soufyaneM avatar Jun 29 '17 10:06 soufyaneM