2017 © Pedro Peláez
 

library paypal-adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

image

ladela/paypal-adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  • Wednesday, October 30, 2013
  • by rodgermd
  • Repository
  • 0 Watchers
  • 4 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 78 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PayPal PHP Adaptive Payments SDK

Prerequisites

PayPal's PHP Adaptive Payments SDK requires, (*1)

  • PHP 5.2 and above with curl/openssl extensions enabled

Using the SDK

To use the SDK,, (*2)

  • Copy the config and lib folders into your project. Modify the config file to suit your needs.
  • Make sure that the lib folder in your project is available in PHP's include path
  • Include the services\AdaptivePayments\AdaptivePaymentsService.php file in your code.
  • Instantiate a service wrapper object
  • Instantiate a request object as per your project's needs. All the API request and response classes are available in services\AdaptivePayments\AdaptivePaymentsService.php
  • Invoke the appropriate method on the service object passing in the request object.

For example,, (*3)

``` php, (*4)

require_once('services/AdaptivePayments/AdaptivePaymentsService.php');

$payRequest = new PayRequest($requestEnvelope, $actionType, $cancelUrl, 
                              $currencyCode, $receiverList, $returnUrl);
// Add optional params
if($_POST["feesPayer"] != "") {
   $payRequest->feesPayer = $_POST["feesPayer"];
}
......

$service = new AdaptivePaymentsService();
$response = $service->Pay($payRequest); 
$ack = strtoupper($response->responseEnvelope->ack); 
if($ack == 'SUCCESS') {
    // Success
}

The SDK provides multiple ways to authenticate your API call. ``` php $service = new AdaptivePaymentsService(); // Use the default account (the first account) configured in sdk_config.ini $response = $service->Pay($payRequest); // Use a specific account configured in sdk_config.inig $response = $service->Pay($payRequest, 'jb-us-seller_api1.paypal.com'); // Pass in a dynamically created API credential object $cred = new PPCertificateCredential("username", "password", "path-to-pem-file"); $cred->setThirdPartyAuthorization(new PPTokenAuthorization("accessToken", "tokenSecret")); $response = $service->Pay($payRequest, $cred);

SDK Configuration

Replace the API credential in config/sdk_config.ini . You can use the configuration file to configure, (*5)

  • (Multiple) API account credentials.
  • Service endpoint and other HTTP connection parameters
  • Logging

Please refer to the sample config file provided with this bundle., (*6)

Using multiple SDKs together

*copy the contents in 'lib/service/' to one of the SDKs *add the service endpoint to 'config/sdk_config.ini', for the endpoints refer the list below, (*7)

Endpoint Configuration

*The list below specifies endpoints for different services, in SANDBOX and PRODUCTION, with their property keys and end-point as property values., (*8)

------------------------------SANDBOX------------------------------
* Merchant/Button Manager Service (3 Token)
service.EndPoint.PayPalAPI=https://api-3t.sandbox.paypal.com/2.0
service.EndPoint.PayPalAPIAA=https://api-3t.sandbox.paypal.com/2.0, (*9)

  • Merchant/Button Manager Service (Certificate)
    service.EndPoint.PayPalAPI=https://api.sandbox.paypal.com/2.0
    service.EndPoint.PayPalAPIAA=https://api.sandbox.paypal.com/2.0, (*10)

  • AdaptiveAccounts Platform Service
    service.EndPoint.AdaptiveAccounts=https://svcs.sandbox.paypal.com/, (*11)

  • AdaptivePayments Platform Service
    service.EndPoint.AdaptivePayments=https://svcs.sandbox.paypal.com/, (*12)

  • Invoice Platform Service
    service.EndPoint.Invoice=https://svcs.sandbox.paypal.com/, (*13)

  • Permissions Platform Service
    service.EndPoint.Permissions=https://svcs.sandbox.paypal.com/, (*14)

------------------------------PRODUCTION------------------------------
* Merchant/Button Manager Service (3 Token)
service.EndPoint.PayPalAPI=https://api-3t.paypal.com/2.0
service.EndPoint.PayPalAPIAA=https://api-3t.paypal.com/2.0, (*15)

  • Merchant/Button Manager Service (Certificate)
    service.EndPoint.PayPalAPI=https://api.paypal.com/2.0
    service.EndPoint.PayPalAPIAA=https://api.paypal.com/2.0, (*16)

  • AdaptiveAccounts Platform Service
    service.EndPoint.AdaptiveAccounts=https://svcs.paypal.com/, (*17)

  • AdaptivePayments Platform Service
    service.EndPoint.AdaptivePayments=https://svcs.paypal.com/, (*18)

  • Invoice Platform Service
    service.EndPoint.Invoice=https://svcs.paypal.com/, (*19)

  • Permissions Platform Service
    service.EndPoint.Permissions=https://svcs.paypal.com/, (*20)

For additional information please refer to https://www.x.com/developers/paypal/documentation-tools/api, (*21)

Instant Payment Notification (IPN)

refer to the IPN-README in 'samples/IPN' directory, (*22)

Getting help

If you need help using the SDK, a new feature that you need or have a issue to report, please visit, (*23)

https://www.x.com/developers/paypal/forums/adaptive-payments-api, (*24)

 OR

https://github.com/paypal/adaptivepayments-sdk-php/issues, (*25)

The Versions

30/10 2013

dev-master

9999999-dev https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

14/01 2013

dev-compatibility-changes

dev-compatibility-changes https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

14/01 2013

v0.4.3

0.4.3.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

14/01 2013

v0.4.2

0.4.2.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

12/01 2013

v0.4

0.4.0.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

12/01 2013

v0.4.1

0.4.1.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

10/01 2013

v0.3

0.3.0.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

10/01 2013

dev-composer-json

dev-composer-json https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments

10/01 2013

v0.1

0.1.0.0 https://github.com/paypal/adaptivepayments-sdk-php

Paypal PHP Adaptive Payments SDK

  Sources   Download

SDK Licence

The Requires

  • php >=5.2.0
  • ext-curl *
  • ext-json *

 

sdk paypal adaptive payments