我的文件夹结构如
1)samples文件夹包含所有请求的文件
2)lib文件夹包含所有必需的类
当我运行特定文件RequestPermissionsReceipt.php
文件时,显示错误
致命错误:未找到类'PayPal \ Types \ Common \ RequestEnvelope' 第59行的samples / RequestPermissionsReceipt.php
但此类可在lib\PayPal\Types\Common
文件夹中找到。
我该怎么做才能删除此错误?我的RequestPermissionsReceipt
文件的代码是
use PayPal\Service\PermissionsService;
use PayPal\Types\Common\RequestEnvelope;
use PayPal\Types\Perm\RequestPermissionsRequest;
require_once('PPBootStrap.php');
$serverName = $_SERVER['SERVER_NAME'];
$serverPort = $_SERVER['SERVER_PORT'];
$url = dirname('http://'.$serverName.':'.$serverPort.$_SERVER['REQUEST_URI']);
$returnURL = $url."/GetAccessToken.php";
$cancelURL = $url. "/RequestPermissions.php";
$scope = array();
if(isset($_POST['chkScope'])) {
$i = 0;
foreach ($_POST['chkScope'] as $value) {
$scope[$i++] = $value;
}
}
$requestEnvelope = new RequestEnvelope("en_US");