Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
paypal与laravel的订单总额_Laravel_Api_Paypal - Fatal编程技术网

paypal与laravel的订单总额

paypal与laravel的订单总额,laravel,api,paypal,Laravel,Api,Paypal,有人在使用srmklive的PayPal API进行laravel项目吗 我已经安装了它,我已经使它的工作,直到我得到以下错误。 我已经找了几个小时了,但找不到解决办法 这里有什么问题? 它一直在说:;订单总数无效 Array ( [TIMESTAMP] => 2018-06-27T08:06:32Z [CORRELATIONID] => c8e16efc9b6e4 [ACK] => Failure [VERSION] => 123 [BUILD] => 4748

有人在使用srmklive的PayPal API进行laravel项目吗

我已经安装了它,我已经使它的工作,直到我得到以下错误。 我已经找了几个小时了,但找不到解决办法

这里有什么问题? 它一直在说:;订单总数无效

Array ( [TIMESTAMP] => 2018-06-27T08:06:32Z [CORRELATIONID] => c8e16efc9b6e4 [ACK] => Failure [VERSION] => 123 [BUILD] => 47483429 [L_ERRORCODE0] => 10401 [L_ERRORCODE1] => 10426 [L_ERRORCODE2] => 10431 [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details. [L_SHORTMESSAGE1] => Transaction refused because of an invalid argument. See additional error messages for details. [L_SHORTMESSAGE2] => Transaction refused because of an invalid argument. See additional error messages for details. [L_LONGMESSAGE0] => Order total is invalid. [L_LONGMESSAGE1] => Item total is invalid. [L_LONGMESSAGE2] => Item amount is invalid. [L_SEVERITYCODE0] => Error [L_SEVERITYCODE1] => Error [L_SEVERITYCODE2] => Error [paypal_link] => )
我在文档中没有看到关于订单总数的任何信息? 还是我遗漏了什么

我现在使用的代码

`$provider = new ExpressCheckout;

        $data = [];
        $order_id = 1;

        $data['items'] = [
            [
                'name'  => 'Product 1',
                'price' => 9.99,
                'qty'   => 1,
            ],
        ];
        $data['return_url'] = url('/paypal/ec-checkout-success');

        $data['invoice_id'] = config('paypal.invoice_prefix').'_'.$order_id;
        $data['invoice_description'] = "Order #$order_id Invoice";
        $data['cancel_url'] = url('/');
        $total = 0;

        foreach ($data['items'] as $item) {
            $total += $item['price'] * $item['qty'];
        }

        $data['total'] = $total;

        //return print_r($data);

        $response = $provider->setExpressCheckout($data);

        //return dd($respons);

        // This will redirect user to PayPal
        return print_r($response); `

提前谢谢。

我找到了上述问题的解决方案。 不知怎的,贝宝不接受9.99美元 当我做一个像10美元这样的整数时,它就起作用了