Symfony\Component\Debug\Exception\FatalThrowableError
Class ‘PayPal\Rest\ApiContext’ not found
https://www.*******.org/pay/paypal/paypal/agiGbpePNm0essSx
Stack trace
Request
App
User
Context
Debug
Share
Expand vendor frames
44
app/Http/Controllers/Pay/PaypalPayController.php
App\Http\Controllers\Pay\PaypalPayController
:34
6 vendor frames…
37
app/Http/Middleware/PayGateWay.php
App\Http\Middleware\PayGateWay
:19
20 vendor frames…
16
app/Http/Middleware/DujiaoSystem.php
App\Http\Middleware\DujiaoSystem
:29
14 vendor frames…
1
public/index.php
:55
App\Http\Controllers\Pay\PaypalPayController::gateway
app/Http/Controllers/Pay/PaypalPayController.php:34
use PayPal\Api\Transaction;
use PayPal\Auth\OAuthTokenCredential;
use PayPal\Exception\PayPalConnectionException;
use PayPal\Rest\ApiContext;
class PaypalPayController extends PayController
{
const Currency = ‘USD’; //货币单位
public function gateway(string $payway, string $orderSN)
{
try {
// 加载网关
$this->loadGateWay($orderSN, $payway);
$paypal = new ApiContext(
new OAuthTokenCredential(
$this->payGateway->merchant_key,
$this->payGateway->merchant_pem
)
);
$paypal->setConfig([‘mode’ => ‘live’]);
$product = $this->order->title;
// 得到汇率
$price = Currency::convert()
->from(‘CNY’)
->to(‘USD’)
->amount($this->order->actual_price)
->get();
$shipping = 0;
$description = $this->order->title;
吉林省网友说:建议到独角TG群里问 可能有大佬会解答
广东省网友说:官网那个群进不去
吉林省网友说:PayPal商业版only,而且bug特别多
甘肃省网友说:https://t.me/dujiaoka