Hi, I am trying to implement a simple Stripe Checkout Button for a single charge with the help of @jordanmerrick SCK Plugin. When trying to make a test payment, I always get the warning: “You did not set a valid Publishable Key…” Of course I doublechecked my Test and Live keys but they seem to be right. So I’m wondering if there is an issue in how the keys are passed from the plugins config file (sck.config.php) to the sck.inc.php in the sck plugin folder. Is this configuration generally correct?
sck.config.php
c::set('stripe_test_mode', true);
c::set('sk_test_xxxxxxxxxxxxxxxxxxxx', 'sk_test');
c::set('pk_test_xxxxxxxxxxxxxxxxxxxx', 'pk_test');
c::set('sk_live_xxxxxxxxxxxxxxxxxxxx', 'sk_live');
c::set('pk_live_xxxxxxxxxxxxxxxxxxxx', 'pk_live');
sck.inc.php
<?php
require_once('stripe-php/init.php');
if (c::get('stripe_test_mode')) {
$pk = c::get('stripe_test_publishable_key');
$sk = c::get('stripe_test_secret_key');
} else {
$pk = c::get('stripe_live_publishable_key');
$sk = c::get('stripe_live_secret_key');
}
$stripe = array(
"publishable_key" => $pk,
"secret_key" => $sk
);
\Stripe\Stripe::setApiKey($stripe['secret_key']);
?>
I also tried to invert the option/value pairs in the config file and also to set the value in the sck.inc.php identical to the value in the config file (e.g. ‘stripe_test_publishable_key’ to ‘pk_test’) but it didn’t change anything. I also checked, if the sck.config.php is correctly included in the main config.php and it is…
Would be super helpful, if just somebody could confirm the above settings are correct?
Edit: I’m aware that the Plugin isn’t maintained anymore, but I thought it’s still a good starting point for the integration.