嘟嘟社区

[疑问] 独角数卡配置的paypal支付提示这个啥情况


SymfonyComponentDebugExceptionFatalThrowableError
Class ‘PayPalRestApiContext’ 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
AppHttpControllersPayPaypalPayController
:34

6 vendor frames…
37
app/Http/Middleware/PayGateWay.php
AppHttpMiddlewarePayGateWay
:19

20 vendor frames…
16
app/Http/Middleware/DujiaoSystem.php
AppHttpMiddlewareDujiaoSystem
:29

14 vendor frames…
1
public/index.php
:55
AppHttpControllersPayPaypalPayController::gateway
app/Http/Controllers/Pay/PaypalPayController.php:34

use PayPalApiTransaction;

use PayPalAuthOAuthTokenCredential;

use PayPalExceptionPayPalConnectionException;

use PayPalRestApiContext;

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群里问 可能有大佬会解答

SzeMeng76 发表于 2022-6-9 11:52
建议到独角TG群里问 可能有大佬会解答

官网那个群进不去  

PayPal商业版only,而且bug特别多

qiuqiu 发表于 2022-6-9 11:53
官网那个群进不去

https://t.me/dujiaoka