PHP 自定义 Class、PayPal API、Mailgun API、Easypost API。他们可以一起工作吗

PHP Custom Class, PayPal API, Mailgun API, Easypost API. Can they work together

我有一个正在为客户构建的电子商务网站。该站点之前使用过程函数和 curl 调用 Paypal 时运行良好。我下载了 Mailgun 和 Easypost API 手册并手动安装。在路上,我想更新网站以利用 PDO 和 OOP。我在奠定基础方面做得很好。现在是时候开始调用各种 API's.I 使用 composer 和当前 运行 双自动加载器安装的所有东西了。作曲家自动加载,然后在其下方自定义自动加载以加载我的 类。现在,当我调用 PayPal API 时,出现以下错误:

Fatal error: Class 'Paypal\Rest\ApiContext' not found in /var/www/html/myla-dev/shoppingCartFinalize.php on line 18 

我认为发生的事情是我的自动加载器正在尝试加载它而不是作曲家的自动加载器。这是自动加载发生的地方:

init.php

require __DIR__.'/core/functions/general.php';
function autoLoader ($class) {
  if (file_exists(__DIR__.'/core/classes/'.$class.'.php')) {
    require __DIR__.'/core/classes/'.$class.'.php';
  }
}
spl_autoload_register('autoLoader');
require __DIR__.'/vendor/autoload.php';

此文件位于项目根目录中,然后在每个文件的顶部都需要。

文件结构

core
--classes
----Alert.php
----....
--functions
----general.php
vendor
--composer
--easypost
--guzzle
--mailgun
--symfony
--paypal
--autoload.php
index.php
init.php
...

composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/EasyPost/easypost-php"
    }
  ],
  "require": {
    "php": ">=5.3.0",
    "easypost/easypost-php": "dev-master",
    "ext-curl": "*",
    "ext-json": "*",
    "paypal/rest-api-sdk-php":"*",
    "mailgun/mailgun-php": "dev-master"
  }
}

感谢任何和所有帮助。如果您想编写代码,那很好,但这不是我要的。那是我的工作,但如果能帮助重新工作以使其发挥作用那就太棒了。

谢谢

最后只是一个简单的语法错误。在我转储和更新 composer 之后它仍然无法工作,所以我只是从安装 wiki 复制代码。它起作用了,所以我将他们的代码编写成我的代码,并且我在调用 wiki 时缺少反斜杠。谢谢你的协助。