我用作曲家安装了PayPal SDK,但我的php文件CHECKOUT.php出现错误:
致命错误:在第23行的C:\ xampp \ htdocs \ pagos \ checkout.php中找不到类“ Paypal \ Api \ Payer”
checkout.php:
<?php
require ("start.php");
use Paypal\Api\Payer;
use Paypal\Api\Item;
$payer = new Payer();
$payer->setPaymentMethod("paypal");
$item = new Item();
$item->setName($descripcion)
->setCurrency('MXN')
->setQuantity(1)
->setPrice($precio);
$itemList = new ItemList();
$itemList->setItems([$item]);
Run Code Online (Sandbox Code Playgroud)
start.php
<?php
// 1. Autoload the SDK Package. This will include all the files and classes to your autoloader
// Used for composer based installation
require __DIR__ . '/vendor/autoload.php';
// Use below for direct download installation
// require __DIR__ …Run Code Online (Sandbox Code Playgroud)