0
我试图让laravel 5.4上的paymentwall工作,但我无法设置它。与Laravel 5.4一起使用非laravel和composer包
我已将它直接添加到根文件夹folder structure感觉有文档说它需要添加到我正在构建的应用程序中。我也曾尝试设置我的根composer.json这样的:
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Paymentwall\\": "paymentwall-php-master/paymentwall-php-master/lib"
}
},
后dumpauto我叫itlike牛逼
namespace App\Http\Controllers;
使用Paymentwall;
使用Illuminate \ Http \ Request; 类CheckoutController扩展控制器 {
public static function checkout(){
return view('rent.checkout.checkout');
}
public function paymentDrive(request $request){
Paymentwall_Config::getInstance()->set(array(
'private_key' => 'xxxxxxxx'
));
echo print_r($_POST, true);
$cardInfo = array(
'email' =>'[email protected]',
'amount' => 10,
'currency' => 'USD',
'token' => $_POST['brick_token'],
'fingerprint' => $_POST['brick_fingerprint'],
'description' => 'Order #123'
);
$charge = new Paymentwall_Charge();
$charge->create($cardInfo);
$response = $charge->getPublicData();
if ($charge->isSuccessful()) {
if ($charge->isCaptured()) {
// deliver s product
} elseif ($charge->isUnderReview()) {
// decide on risk charge
}
} else {
$errors = json_decode($response, true);
}
echo $response;
}
}
但我仍然得到这个错误Class 'App\Http\Controllers\Paymentwall_Config' not found
我真的想了解如何做到这一点。 BTW这个API包使用不同的文件夹结构,这让我感到困惑。
这确实解决了付款问题,谢谢。但是我仍然对如何实现一个没有composer的软件包感到困惑。 –