我试图创建一个php页面来设置PayPal付款,但不知道如何去做。
我试图通过此教程了解基础知识: http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/CreatePaymentUsingPayPal.html
这是代码(我已经注释掉了不起作用的代码行):
我有以下问题。
1。)apicontext是另一个文件中的未定义变量,所以我看不出它是如何声明的。如果有办法解决这个问题而不调用这个很好的变量。
2。)重定向URL我必须注释掉,因为getBaseUrl()未定义(在另一个文件中)
2。)我收到以下错误 - 还有更多相同的行:
( ! ) Warning: error_log(../PayPal.log): failed to open stream: Permission denied in /teaching/courses/co639/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalLoggingManager.php on line 116
Call Stack
# Time Memory Function Location
1 0.0017 238856 {main}( ) ../purchase_create.php:0
2 0.0135 408648 PayPal\Api\Payment->create( ) ../purchase_create.php:62
3 0.0136 409784 PayPal\Common\PayPalResourceModel::executeCall( ) ../Payment.php:303
4 0.0140 427152 PayPal\Transport\PayPalRestCall->execute( ) ../PayPalResourceModel.php:103
5 0.0144 446320 PayPal\Handler\RestHandler->handle( ) ../PayPalRestCall.php:71
6 0.0150 477024 PayPal\Auth\OAuthTokenCredential->getAccessToken( ) ../RestHandler.php:80
7 0.0154 480408 PayPal\Auth\OAuthTokenCredential->updateAccessToken( ) ../OAuthTokenCredential.php:164
8 0.0154 480712 PayPal\Auth\OAuthTokenCredential->generateAccessToken( ) ../OAuthTokenCredential.php:212
9 0.0154 481328 PayPal\Auth\OAuthTokenCredential->getToken( ) ../OAuthTokenCredential.php:267
10 0.0157 493288 PayPal\Core\PayPalHttpConnection->execute( ) ../OAuthTokenCredential.php:243
11 0.0157 493520 PayPal\Core\PayPalLoggingManager->info( ) ../PayPalHttpConnection.php:82
12 0.0157 493968 PayPal\Core\PayPalLoggingManager->log( ) ../PayPalLoggingManager.php:148
13 0.0158 494512 error_log ( ) ../PayPalLoggingManager.php:116
( ! ) Warning: error_log(../PayPal.log): failed to open stream: Permission denied in /teaching/courses/co639/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalLoggingManager.php on line 116
Call Stack
# Time Memory Function Location
1 0.0017 238856 {main}( ) ../purchase_create.php:0
2 0.0135 408648 PayPal\Api\Payment->create( ) ../purchase_create.php:62
3 0.0136 409784 PayPal\Common\PayPalResourceModel::executeCall( ) ../Payment.php:303
4 0.0140 427152 PayPal\Transport\PayPalRestCall->execute( ) ../PayPalResourceModel.php:103
5 0.0144 446320 PayPal\Handler\RestHandler->handle( ) ../PayPalRestCall.php:71
6 0.0150 477024 PayPal\Auth\OAuthTokenCredential->getAccessToken( ) ../RestHandler.php:80
7 0.0154 480408 PayPal\Auth\OAuthTokenCredential->updateAccessToken( ) ../OAuthTokenCredential.php:164
8 0.0154 480712 PayPal\Auth\OAuthTokenCredential->generateAccessToken( ) ../OAuthTokenCredential.php:212
9 0.0154 481328 PayPal\Auth\OAuthTokenCredential->getToken( ) ../OAuthTokenCredential.php:267
10 0.0157 493288 PayPal\Core\PayPalHttpConnection->execute( ) ../OAuthTokenCredential.php:243
11 1.2623 502104 PayPal\Core\PayPalLoggingManager->info( ) ../PayPalHttpConnection.php:157
12 1.2623 502248 PayPal\Core\PayPalLoggingManager->log( ) ../PayPalLoggingManager.php:148
13 1.2623 502496 error_log ( )
努力让这个简单的例子为我工作任何帮助实现基础的工作都会很棒。
答案 0 :(得分:-1)
PayPal-PHP-SDK已创建wiki documentation,可帮助您设置计算机以使用PayPal SDK。
您可以按照说明在此处拨打第一个电话:https://github.com/paypal/PayPal-PHP-SDK/wiki/Making-First-Call
按照提供的所有步骤操作后,您应该能够轻松上手。如果有帮助,请告诉我。我们为您可能需要的所有有用信息设置了PayPal PHP SDK页面设置。