donkey111111 2015-10-20 21:52
浏览 113

PayPal自适应付款SDK - 未找到类'PayPal \ Core \ PPBaseService'

I'm trying to use the PHP edition of PayPal Adaptive Payments SDK, and having huge difficulties with include_paths and class-not-found errors.

I'm using:

- Windows7
- Bitnami MediaWiki stack, v1.25.1-0
- PHP v5.5.25
- Apache v2.4.12
- PayPal AdaptivePaymentSdk 3.6.106

The sdk can be obtained at:

- https://github.com/paypal/adaptivepayments-sdk-php/tree/namespace-php5.3

My document root, hence known as '$IP', is:

- 'C:/Bitnami/mediawiki-1.25.1-0/apps/mediawiki/htdocs/'

The SDK is deployed in the document root directory, i.e.

- $IP/adaptivepayments-sdk-php/...

My include_path is an act of desperation, an attempt to include every possible path to the required PHP files. Newlines added for readability:

include_path = ".;

C:\BitNami\mediawiki-1.25.1-0\php\PEAR;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Service;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Types\AP;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Types\Common;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Auth;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Auth\Oauth;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Auth\Openid;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Common;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Core;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Exception;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Formatter;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Handler;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\IPN;

C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Transport
"

I am getting the error:

Fatal error: Class 'PayPal\Core\PPBaseService' not found in C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Service\AdaptivePaymentsService.php on line 27

Please note that Class 'PayPal\Core\PPBaseService' should be reachable through one or both of the following include_path entries, listed above:

- C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib;

- C:\Bitnami\mediawiki-1.25.1-0\apps\mediawiki\htdocs\adaptivepayments-sdk-php\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Types\Common;

Yet I get the class-not-found error. I have seen this problem mentioned a few times online, but no working solution has been offered.

The class that cannot find 'PayPal\Core\PPBaseService' (which is ActivePaymentsService.php) has multiple versions:

- $IP/\vendor\paypal\adaptivepayments-sdk-php\lib\PayPal\Service\AdaptivePaymentsService.php

- $IP/adaptivepayments-sdk-php/lib/services/ActivePaymentsService.php

I am specifying the 1st in my 'require' statement, but I do not actually know which should be used. I've tried both and get the same error.

The not-found class 'PPBaseService resides in '$IP\adaptivepayments-sdk-php\vendor\paypal\sdk-core-php\lib\PayPal\Core\' and has a namespace specified:

namespace PayPal\Core;
.
.
class PPBaseService {


The class AdaptivePaymentsService also has a namespace specified:

namespace PayPal\Service;
.
.
use PayPal\Core\PPBaseService;
.
.
class AdaptivePaymentsService extends PPBaseService {

I do not know anything about PHP namespaces or their implications or requirements. In particular, I do not understand if/why either namespace is relative to the path '$IP/adaptivepayments-sdk-php/vendor/paypal/sdk-core-php/lib/'.

More basically, I don't know why my include_path is not capturing/covering every class in the SDK!

My calling class is:

$IP/skins/Vector/VectorTemplate.php

At the beginning of that file I specify:

- require("vendor/autoload.php");

- require_once("adaptivepayments-sdk-php/vendor/paypal/adaptivepayments-sdk-php/lib/PayPal/Service/AdaptivePaymentsService.php");

When those statements are executed, I get the 'Class not found' error.

I am completely stumped. Any help would be much appreciated.

Thanks,

Sean.


For those not familiar with the adaptive payments SDK tree:

.:
CHANGELOG.md
LICENSE.txt
README.md
composer.json
composer.lock
lib/
list.txt
samples/
vendor/

./lib:
services/

./lib/services:
AdaptivePayments/

./lib/services/AdaptivePayments:
AdaptivePayments.php
AdaptivePaymentsService.php

./samples:
CancelPreapproval.php
CancelPreapprovalReceipt.php
Common/
Configuration.php
ConfirmPreapproval.php
ConfirmPreapprovalReceipt.php
ConvertCurrency.php
ConvertCurrencyReceipt.php
ExecutePayment.php
ExecutePaymentReceipt.php
GetAllowedFundingSources.php
GetAllowedFundingSourcesReceipt.php
GetAvailableShippingAddresses.php
GetAvailableShippingAddressesReceipt.php
GetFundingPlans.php
GetFundingPlansReceipt.php
GetPaymentOptions.php
GetPaymentOptionsReceipt.php
GetShippingAddresses.php
GetShippingAddressesReceipt.php
GetUserLimits.php
GetUserLimitsReceipt.php
IPN/
PPBootStrap.php
Pay.php
PayReceipt.php
PaymentDetails.php
PaymentDetailsReceipt.php
Preapproval.php
PreapprovalDetails.php
PreapprovalDetailsReceipt.php
PreapprovalReceipt.php
Refund.php
RefundReceipt.php
SetPaymentOptions.php
SetPaymentOptionsReceipt.php
ShowAllResponse.php
SimpleSamples/
WebflowReturnPage.php
cert_key.pem
composer.json
index.php
install.php

./samples/Common:
Calls.php
Constants.php
Error.php
Response.php
jquery-1.3.2.min.js
jquery.qtip-1.0.0-rc3.min.js
jquery.qtip-1.0.0-rc3.min.txt
menu.html
sdk.css
sdk_functions.js
style.css
tooltip.js

./samples/IPN:
IPN-README.md
IPNListener.php

./samples/SimpleSamples:
ChainedPay.html.php
ChainedPay.php
DelayedChainedPay.html.php
DelayedChainedPay.php
EmbeddedPay.html.php
EmbeddedPay.php
ParallelPay.html.php
ParallelPay.php
Preapproval.html.php
Preapproval.php
SimplePay.html.php
SimplePay.php

./vendor:
autoload.php
composer/
paypal/

./vendor/composer:
ClassLoader.php
LICENSE
autoload_classmap.php
autoload_namespaces.php
autoload_psr4.php
autoload_real.php
installed.json

./vendor/paypal:
adaptivepayments-sdk-php/
sdk-core-php/

./vendor/paypal/adaptivepayments-sdk-php:
CHANGELOG.md
LICENSE.txt
README.md
composer.json
lib/
samples/

./vendor/paypal/adaptivepayments-sdk-php/lib:
PayPal/

./vendor/paypal/adaptivepayments-sdk-php/lib/PayPal:
Service/
Types/

./vendor/paypal/adaptivepayments-sdk-php/lib/PayPal/Service:
AdaptivePaymentsService.php

./vendor/paypal/adaptivepayments-sdk-php/lib/PayPal/Types:
AP/
Common/

./vendor/paypal/adaptivepayments-sdk-php/lib/PayPal/Types/AP:
Address.php
AddressList.php
CancelPreapprovalRequest.php
CancelPreapprovalResponse.php
ConfirmPreapprovalRequest.php
ConfirmPreapprovalResponse.php
ConversionRate.php
ConvertCurrencyRequest.php
ConvertCurrencyResponse.php
CurrencyCodeList.php
CurrencyConversion.php
CurrencyConversionList.php
CurrencyConversionTable.php
CurrencyList.php
DisplayOptions.php
ErrorList.php
ExecutePaymentRequest.php
ExecutePaymentResponse.php
FeeDisclosure.php
FundingConstraint.php
FundingPlan.php
FundingPlanCharge.php
FundingSource.php
FundingTypeInfo.php
FundingTypeList.php
GetAllowedFundingSourcesRequest.php
GetAllowedFundingSourcesResponse.php
GetAvailableShippingAddressesRequest.php
GetAvailableShippingAddressesResponse.php
GetFundingPlansRequest.php
GetFundingPlansResponse.php
GetPaymentOptionsRequest.php
GetPaymentOptionsResponse.php
GetPrePaymentDisclosureRequest.php
GetPrePaymentDisclosureResponse.php
GetShippingAddressesRequest.php
GetShippingAddressesResponse.php
GetUserLimitsRequest.php
GetUserLimitsResponse.php
InitiatingEntity.php
InstitutionCustomer.php
InvoiceData.php
InvoiceItem.php
PayError.php
PayErrorList.php
PayRequest.php
PayResponse.php
PaymentDetailsRequest.php
PaymentDetailsResponse.php
PaymentInfo.php
PaymentInfoList.php
PhoneNumber.php
PostPaymentDisclosure.php
PostPaymentDisclosureList.php
PreapprovalDetailsRequest.php
PreapprovalDetailsResponse.php
PreapprovalRequest.php
PreapprovalResponse.php
Receiver.php
ReceiverDisclosure.php
ReceiverDisclosureList.php
ReceiverIdentifier.php
ReceiverInfo.php
ReceiverInfoList.php
ReceiverList.php
ReceiverOptions.php
RefundInfo.php
RefundInfoList.php
RefundRequest.php
RefundResponse.php
SenderDisclosure.php
SenderIdentifier.php
SenderOptions.php
SetPaymentOptionsRequest.php
SetPaymentOptionsResponse.php
ShippingAddressInfo.php
TaxIdDetails.php
UserLimit.php
WarningData.php
WarningDataList.php

./vendor/paypal/adaptivepayments-sdk-php/lib/PayPal/Types/Common:
AccountIdentifier.php
BaseAddress.php
ClientDetailsType.php
CurrencyType.php
ErrorData.php
ErrorParameter.php
FaultMessage.php
PhoneNumberType.php
RequestEnvelope.php
ResponseEnvelope.php

./vendor/paypal/adaptivepayments-sdk-php/samples:
CancelPreapproval.php
CancelPreapprovalReceipt.php
Common/
Configuration.php
ConfirmPreapproval.php
ConfirmPreapprovalReceipt.php
ConvertCurrency.php
ConvertCurrencyReceipt.php
ExecutePayment.php
ExecutePaymentReceipt.php
GetAllowedFundingSources.php
GetAllowedFundingSourcesReceipt.php
GetAvailableShippingAddresses.php
GetAvailableShippingAddressesReceipt.php
GetFundingPlans.php
GetFundingPlansReceipt.php
GetPaymentOptions.php
GetPaymentOptionsReceipt.php
GetShippingAddresses.php
GetShippingAddressesReceipt.php
GetUserLimits.php
GetUserLimitsReceipt.php
IPN/
PPBootStrap.php
Pay.php
PayReceipt.php
PaymentDetails.php
PaymentDetailsReceipt.php
Preapproval.php
PreapprovalDetails.php
PreapprovalDetailsReceipt.php
PreapprovalReceipt.php
Refund.php
RefundReceipt.php
SetPaymentOptions.php
SetPaymentOptionsReceipt.php
ShowAllResponse.php
WebflowReturnPage.php
cert_key.pem
composer.json
index.php

./vendor/paypal/adaptivepayments-sdk-php/samples/Common:
Calls.php
Constants.php
Error.php
Response.php
jquery-1.3.2.min.js
jquery.qtip-1.0.0-rc3.min.js
jquery.qtip-1.0.0-rc3.min.txt
menu.html
sdk.css
sdk_functions.js
style.css
tooltip.js

./vendor/paypal/adaptivepayments-sdk-php/samples/IPN:
IPN-README.md
IPNListener.php

./vendor/paypal/sdk-core-php:
CHANGELOG.md
LICENSE.txt
README.md
build.xml
composer.json
lib/
tests/

./vendor/paypal/sdk-core-php/lib:
PayPal/

./vendor/paypal/sdk-core-php/lib/PayPal:
Auth/
Common/
Core/
Exception/
Formatter/
Handler/
IPN/
Transport/

./vendor/paypal/sdk-core-php/lib/PayPal/Auth:
IPPCredential.php
IPPThirdPartyAuthorization.php
Oauth/
Openid/
PPCertificateCredential.php
PPSignatureCredential.php
PPSubjectAuthorization.php
PPTokenAuthorization.php

./vendor/paypal/sdk-core-php/lib/PayPal/Auth/Oauth:
AuthSignature.php
MockOAuthDataStore.php
OAuthConsumer.php
OAuthDataStore.php
OAuthRequest.php
OAuthServer.php
OAuthSignatureMethod.php
OAuthSignatureMethodHmacSha1.php
OAuthSignatureMethodPLAINTEXT.php
OAuthSignatureMethodRsaSha1.php
OAuthToken.php
OAuthUtil.php

./vendor/paypal/sdk-core-php/lib/PayPal/Auth/Openid:
PPOpenIdAddress.php
PPOpenIdError.php
PPOpenIdSession.php
PPOpenIdTokeninfo.php
PPOpenIdUserinfo.php

./vendor/paypal/sdk-core-php/lib/PayPal/Common:
PPApiContext.php
PPArrayUtil.php
PPModel.php
PPReflectionUtil.php
PPUserAgent.php

./vendor/paypal/sdk-core-php/lib/PayPal/Core:
PPAPIService.php
PPBaseService.php
PPConfigManager.php
PPConnectionManager.php
PPConstants.php
PPCredentialManager.php
PPHttpConfig.php
PPHttpConnection.php
PPLoggingManager.php
PPMessage.php
PPRequest.php
PPUtils.php
PPXmlMessage.php
cacert.pem

./vendor/paypal/sdk-core-php/lib/PayPal/Exception:
OAuthException.php
PPConfigurationException.php
PPConnectionException.php
PPInvalidCredentialException.php
PPMissingCredentialException.php
PPTransformerException.php

./vendor/paypal/sdk-core-php/lib/PayPal/Formatter:
FormatterFactory.php
IPPFormatter.php
PPNVPFormatter.php
PPSOAPFormatter.php

./vendor/paypal/sdk-core-php/lib/PayPal/Handler:
IPPHandler.php
PPAuthenticationHandler.php
PPCertificateAuthHandler.php
PPGenericServiceHandler.php
PPMerchantServiceHandler.php
PPOpenIdHandler.php
PPPlatformServiceHandler.php
PPSignatureAuthHandler.php

./vendor/paypal/sdk-core-php/lib/PayPal/IPN:
PPIPNMessage.php

./vendor/paypal/sdk-core-php/lib/PayPal/Transport:
PPRestCall.php

./vendor/paypal/sdk-core-php/tests:
Openid/
PPAPIServiceTest.php
PPBaseServiceTest.php
PPBootStrap.php
PPCertificateCredentialTest.php
PPConfigManagerTest.php
PPConfigurationExceptionTest.php
PPConnectionExceptionTest.php
PPConnectionManagerTest.php
PPCredentialManagerTest.php
PPIPNMessageTest.php
PPInvalidCredentialExceptionTest.php
PPLoggingManagerTest.php
PPMessageTest.php
PPMissingCredentialExceptionTest.php
PPSignatureCredentialTest.php
PPUtilsTest.php
sdk_config.ini

./vendor/paypal/sdk-core-php/tests/Openid:
PPOpenIdAddressTest.php
PPOpenIdSessionTest.php
PPOpenIdTokeninfoTest.php
PPOpenIdUserinfoTest.php
  • 写回答

1条回答 默认 最新

  • drl6054 2015-10-21 20:43
    关注

    For Adaptive SDKs, you'll want to make sure you've also installed the Core library as well: https://github.com/paypal/sdk-core-php

    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)