我正在尝试添加条纹并将其附加到自定义表格中,但出现错误 找不到类别“条带\充电” 我想将其包括在WordPress自定义模板中 我的wordpress代码模板是
<?php
/**
* Template Name: process
*
*
*/
require_once("vendor/autoload.php");
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_atuNZAE7y8lqtOmNPuj0iW5O");
// Token is created using Checkout or Elements!
// Get the payment token ID submitted by the form:
$test=$_POST['amount'];
echo $test;
$token = $_POST['stripeToken'];
//echo $token;
try{
ini_set('display_errors',1);
error_reporting(E_ALL);
$charge = \Stripe\Charge::create([
'amount' => $test,
'currency' => 'usd',
'description' => 'Example charge',
'source' => $token,
]);
}
catch(\Stripe\Error\Card $e){
}
?>
我还试图要求(“ vendor / stripe / stripe-php / init”);
它给我500错误