0

I am trying to implement Stripe on my web application and I am having a problem setting the API key

Here is my code:

<?php //composer autoloader require_once 'vendor/autoload.php';
 $stripe = [
    'publishable' =>'pk_test(public code))',
    'private' => 'sk_test(private code)' ]

   Stripe::setApiKey($stripe['private']);
     // \Stripe\Stripe::setApiKey($stripe['private']);
?>

I have tried both methods and none seems to work. I keep getting this error:

Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in C:\xampp\htdocs\stripe_test\app\init.php on line 12

Don't Panic
  • 41,125
  • 10
  • 61
  • 80
omoyolab
  • 1
  • 2

1 Answers1

0

you are missing a ;

$stripe = [
    'publishable' =>'pk_test(public code))',
    'private' => 'sk_test(private code)' ]; // added ; here
cmorrissey
  • 8,493
  • 2
  • 23
  • 27