问题描述
我真的需要帮助,我尝试将Flutter集成到laravel 8中,通过composer使用PHP sdk它显示了这个错误
composer install flutterwavedev/flutterwave-v3
Invalid argument flutterwavedev/flutterwave-v3. Use "composer require flutterwavedev/flutterwave-v3"
instead to add packages to your composer.json.
$ composer require flutterwavedev/flutterwave-v3
Using version ^1.0 for flutterwavedev/flutterwave-v3
./composer.json has been updated
Running composer update flutterwavedev/flutterwave-v3
Loading composer repositories with package information
Updating dependencies
Your requirements Could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires flutterwavedev/flutterwave-v3 ^1.0 -> satisfiable by
flutterwavedev/flutterwave-v3[1.0.0].
(lock file version) by a partial update and that version does not match. Make sure you list it as an
argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades,downgrades and removals for packages
currently locked to specific versions.
Installation Failed,reverting ./composer.json and ./composer.lock to their original content.
{"status":"error","message":"没有找到此 ID 的交易","data":null}
看看我的文件 这是我单击按钮时的错误消息,请在此处输入代码按钮
我的表格
<form class="lg:mt-6 lg:w-84" action="{{route('checkout.store')}}" method="POST">
{{csrf_field()}}
<label for="name" class="block text-xs font-semibold text-gray-600 uppercase">Name</label>
<input id="firstname" value="{{auth()->user()->name}}"
type="text" name="name" placeholder="Full Name" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200 appearance-none focus:outline-none focus:bg-gray-300 focus:shadow-inner" />
<label for="Phone" class="block text-xs font-semibold text-gray-600 uppercase">Phone</label>
<input id="phone" type="text" name="name" placeholder="Full Name" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200 " />
<label for="email" class="block mt-2 text-xs font-semibold text-gray-600 uppercase">E-mail</label>
<input id="email" type="email" name="email" placeholder="john.doe@company.com" autocomplete="email" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200" value="{{auth()->user()->email}}" readonly/>
<label for="address" class="block mt-2 text-xs font-semibold text-gray-600 uppercase">Address</label>
<input type="text" name="name" placeholder="address" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200 " />
<label for="State" class="block mt-2 text-xs font-semibold text-gray-600 uppercase">State</label>
<input placeholder="State" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200" />
<label class="block mt-2 text-xs font-semibold text-gray-600 uppercase">City</label>
<input type="text" placeholder="City" class="block w-full p-3 mt-2 text-gray-700 bg-gray-200 " />
<button type="submit"Name="pay" class="w-full mt-6 font-medium text-blue-700 uppercase shadow-lg" >
Save and continue
</button>
</form>
我的控制器检查控制器
<?PHP
namespace App\Http\Controllers;
use App\Models\Category;
use Illuminate\Http\Request;
use Cart;
class CheckoutController extends Controller
{
/**
* display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories=Category::all();
return view('pages.checkout',[
'categories'=>$categories]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request= [
'tx_ref' =>time(),'amount' => Cart::total(),'currency'=>'NGN','redirect_url'=>route('thankyou'),'payments_options'=>'card','customer'=>[
'email'=> auth()->user()->email,'name'=> auth()->user()->name,],' customizations,'=>[
'title'=> "Remedy plus",'description'=> "Payment for items in cart",'logo' => asset('img/logo.png'),'Meta'=>[
'price'=> Cart::total(),'email'=> auth()->user()->email
],];
$curl = curl_init();
curl_setopt_array($curl,array(
CURLOPT_URL => "https://api.flutterwave.com/v3/transactions/123456/verify",CURLOPT_RETURNTRANSFER => true,CURLOPT_ENCODING => "",CURLOPT_MAXREDirs => 10,CURLOPT_TIMEOUT => 0,CURLOPT_FOLLOWLOCATION => true,CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,CURLOPT_CUSTomrEQUEST => "GET",CURLOPT_POSTFIELDS => json_encode($request),CURLOPT_HTTPHEADER => array(
"Content-Type: application/json","Authorization: Bearer FLWSECK_TEST-1090b4e5393b92f0887e4ff3b7978a94-X"
),));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
}
}