相关疑难解决方法(0)

致命错误:未在sdk Paypal中找到“ Paypal \ Api \ Payer”类

我用作曲家安装了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)

php paypal paypal-sandbox paypal-rest-sdk

3
推荐指数
1
解决办法
1892
查看次数

标签 统计

paypal ×1

paypal-rest-sdk ×1

paypal-sandbox ×1

php ×1