使用PAYPAL创建付款时,我会收到以下异常:
PayPal\Exception\PayPalConnectionException
File:
/var/www/clients/client2/web93/web/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:178
Message:
Got Http response code 500 when accessing https://api.sandbox.paypal.com/v1/payments/payment.
Stack trace:
#0 /var/www/clients/client2/web93/web/vendor/paypal/rest-api-sdk-php/lib/PayPal/Transport/PayPalRestCall.php(74): PayPal\Core\PayPalHttpConnection->execute('{"intent":"sale...')
#1 /var/www/clients/client2/web93/web/vendor/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php(102): PayPal\Transport\PayPalRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL)
#2 /var/www/clients/client2/web93/web/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Payment.php(579): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL, Object(PayPal\Rest\ApiContext), NULL)
#3 /var/www/clients/client2/web93/web/module/Application/src/Application/Controller/CompanyController.php(399): PayPal\Api\Payment->create(Object(PayPal\Rest\ApiContext))
这是我发送给paypal sdk的请求:
object(PayPal\Api\Payment)#1045 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(4) {
["intent"]=>
string(4) "sale"
["payer"]=>
object(PayPal\Api\Payer)#1039 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(1) {
["payment_method"]=>
string(6) "payapl"
}
}
["redirect_urls"]=>
object(PayPal\Api\RedirectUrls)#1044 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(2) {
["return_url"]=>
string(17) "http://google.com"
["cancel_url"]=>
string(17) "http://google.com"
}
}
["transactions"]=>
array(1) {
[0]=>
object(PayPal\Api\Transaction)#1043 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(4) {
["amount"]=>
object(PayPal\Api\Amount)#1041 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(2) {
["currency"]=>
string(3) "USD"
["total"]=>
string(2) "95"
}
}
["item_list"]=>
object(PayPal\Api\ItemList)#1036 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(1) {
["items"]=>
array(1) {
[0]=>
object(PayPal\Api\Item)#1035 (1) {
["_propMap":"PayPal\Common\PayPalModel":private]=>
array(4) {
["name"]=>
string(9) "e-toolset"
["currency"]=>
string(3) "USD"
["quantity"]=>
int(1)
["price"]=>
string(2) "95"
}
}
}
}
}
["description"]=>
string(17) "E-Toolset package"
["invoice_number"]=>
string(13) "574fff863c2d0"
}
}
}
}
}
如果你在这里询问日志文件是我得到的错误日志: [Thu Jun 02 11:11:37.373825 2016] [:error] [pid 5053:tid 140435666220800] [client 91.218.196.212:49810] FastCGI:server“/ var / www / clients / client2 / web93 / cgi-bin / php5 -fcgi - * - 80-etoolset.dev.artio.pl“stderr:PHP消息:PHP警告:chdir():open_basedir限制生效。文件(/ var / www / clients / client2 / web93)不在允许的路径中:(/ var / www / clients / client2 / web93 / web:/ var / www / clients / client2 / web93 / tmp:在/ var中的/var/www/etoolset.dev.artio.pl/web:/srv/www/etoolset.dev.artio.pl/web:/usr/share/php5:/tmp:/usr/share/php)第3行的/www/clients/client2/web93/web/public/chat.php,引用者:http://etoolset.dev.artio.pl/edit/company/dotpay/63
答案 0 :(得分:3)
您的Payer
payment_method
拼写错误;你有payapl
。