SDK адаптивных платежей PayPal — класс «PayPal \ Core \ PPBaseService» не найден

Я пытаюсь использовать PHP-версию PayPal Adaptive Payments SDK, и у меня возникают огромные трудности с ошибками include_paths и class-not-found.

Я использую:

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

SDK можно получить по адресу:

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

Мой корень документа, следовательно, известный как «$ IP», выглядит так:

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

SDK развертывается в корневом каталоге документа, т.е.

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

Мой include_path — это акт отчаяния, попытка включить каждый возможный путь к необходимым PHP-файлам. Новые строки добавлены для удобства чтения:

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
"

Я получаю ошибку:

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

Обратите внимание, что класс «PayPal \ Core \ PPBaseService» должен быть доступным через одну или обе из следующих записей include_path, перечисленных выше:

- 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;

Тем не менее, я получаю сообщение об отсутствии класса. Я видел эту проблему несколько раз в Интернете, но не было предложено никакого рабочего решения.

Класс, который не может найти «PayPal \ Core \ PPBaseService» (который является ActivePaymentsService.php), имеет несколько версий:

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

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

Я указываю 1-е в своем утверждении ‘require’, но на самом деле я не знаю, какой из них следует использовать. Я пробовал оба и получаю ту же ошибку.

Не найденный класс ‘PPBaseService находится в’ $ IP \ adaptivepayments-sdk-php \ vendor \ paypal \ sdk-core-php \ lib \ PayPal \ Core \ ‘и имеет указанное пространство имен:

namespace PayPal\Core;
.
.
class PPBaseService {


The class AdaptivePaymentsService also has a namespace specified:

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

Я ничего не знаю о пространствах имен PHP, их последствиях или требованиях. В частности, я не понимаю, относится ли / почему любое пространство имен к пути ‘$ IP / adaptivepayments-sdk-php / vendor / paypal / sdk-core-php / lib /’.

Более того, я не знаю, почему мой include_path не захватывает / не охватывает все классы в SDK!

Мой вызывающий класс:

$IP/skins/Vector/VectorTemplate.php

В начале этого файла я указываю:

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

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

Когда эти операторы выполняются, я получаю ошибку «Класс не найден».

Я полностью в тупике. Любая помощь приветствуется.

Спасибо,

Шон.


Для тех, кто не знаком с деревом адаптивных платежей SDK:

.:
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

0

Решение

Для Adaptive SDK вы должны убедиться, что вы также установили библиотеку Core: https://github.com/paypal/sdk-core-php

0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]