我正在嘗試使用Cartalyst,一個用於條帶付款的全面PHP庫。這裏是他們的文檔鏈接:https://cartalyst.com/manual/stripe/1.0。這裏是我試圖去工作代碼:自動加載PHP類時發生致命錯誤
$stripe = Stripe::make('your-stripe-api-key');
$customers = $stripe->customers()->all();
foreach ($customers['data'] as $customer) {
var_dump($customer['email']);
}
當我運行上面的代碼(在我真正的代碼,我有我的API插入),我收到以下錯誤:Fatal error: Class 'Stripe' not found in on line 247
。我已經檢查了一切,我知道要檢查,我似乎無法弄清楚問題所在。我已經「自動加載」Stripe Cartalyst庫和Stripe庫。
而且,這裏是產生自動加載的文件我作曲代碼:
{
"require": {
"cartalyst/stripe": "~1.0",
"stripe/stripe-php": "3.*"
}
}
任何幫助,不勝感激!如果您需要更多信息,請告訴我。
@PedroLobito我該如何解決這個問題?我無法重命名這些軟件包,也不能下載。感謝您的幫助。 – three3
@PedroLobito感謝您的鏈接和示例代碼。我已閱讀鏈接,但我也嘗試過您的示例代碼,但仍收到相同的錯誤消息:'Class'Stripe''not found in'。 – three3
重複的http://stackoverflow.com/questions/28921871/fatal-error-class-stripe-not-found-in-c-wamp-www –