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

WP_STRIPE_KEY is undefined at plugin activation #25

Open
bdgeorge opened this issue Aug 18, 2014 · 2 comments
Open

WP_STRIPE_KEY is undefined at plugin activation #25

bdgeorge opened this issue Aug 18, 2014 · 2 comments
Labels

Comments

@bdgeorge
Copy link

It's only a warning until the API options are configured, but when first activated we get the following annoying notice message:

screen shot 2014-08-18 at 3 31 14 pm

This is because the constant is only defined after the api options have been set

if ( ! empty( $options['stripe_api_switch'] ) ) {

    if ( $options['stripe_api_switch'] === 'Yes') {
        Stripe::setApiKey( $options['stripe_test_api'] );
        define( 'WP_STRIPE_KEY', $options['stripe_test_api_publish'] );

    } else {
        Stripe::setApiKey( $options['stripe_prod_api'] );
        define( 'WP_STRIPE_KEY', $options['stripe_prod_api_publish'] );
    }
}
@willmot willmot self-assigned this Aug 18, 2014
@willmot willmot added the bug label Aug 18, 2014
@willmot
Copy link
Member

willmot commented Aug 18, 2014

Thanks for the bug report!

@tchalvak
Copy link

Yep, just got this on first install.

tchalvak added a commit to BitLucid/wp-stripe that referenced this issue Dec 21, 2015
by checking whether the constant is defined or else giving null.
Fixes humanmade#25.
@willmot willmot removed their assignment Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants