From 2128f9d1ea0b2ae5e8b7f5a4d264f1f55b7d02ab Mon Sep 17 00:00:00 2001 From: BafS Date: Mon, 26 Oct 2020 11:55:48 +0100 Subject: [PATCH 1/2] Make the project composer v2 compatible --- ...ailsType_Update.php => BillingPeriodDetailsTypeUpdate.php} | 2 +- .../UpdateRecurringPaymentsProfileRequestDetailsType.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename lib/PayPal/EBLBaseComponents/{BillingPeriodDetailsType_Update.php => BillingPeriodDetailsTypeUpdate.php} (96%) diff --git a/lib/PayPal/EBLBaseComponents/BillingPeriodDetailsType_Update.php b/lib/PayPal/EBLBaseComponents/BillingPeriodDetailsTypeUpdate.php similarity index 96% rename from lib/PayPal/EBLBaseComponents/BillingPeriodDetailsType_Update.php rename to lib/PayPal/EBLBaseComponents/BillingPeriodDetailsTypeUpdate.php index aafa3f89..3bf976ed 100644 --- a/lib/PayPal/EBLBaseComponents/BillingPeriodDetailsType_Update.php +++ b/lib/PayPal/EBLBaseComponents/BillingPeriodDetailsTypeUpdate.php @@ -6,7 +6,7 @@ /** * Unit of meausre for billing cycle */ -class BillingPeriodDetailsType_Update +class BillingPeriodDetailsTypeUpdate extends PPXmlMessage { diff --git a/lib/PayPal/EBLBaseComponents/UpdateRecurringPaymentsProfileRequestDetailsType.php b/lib/PayPal/EBLBaseComponents/UpdateRecurringPaymentsProfileRequestDetailsType.php index 77a13011..9db11901 100644 --- a/lib/PayPal/EBLBaseComponents/UpdateRecurringPaymentsProfileRequestDetailsType.php +++ b/lib/PayPal/EBLBaseComponents/UpdateRecurringPaymentsProfileRequestDetailsType.php @@ -135,7 +135,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType * Trial period of this schedule * @access public * @namespace ebl - * @var \PayPal\EBLBaseComponents\BillingPeriodDetailsType_Update + * @var \PayPal\EBLBaseComponents\BillingPeriodDetailsTypeUpdate */ public $TrialPeriod; @@ -143,7 +143,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType * * @access public * @namespace ebl - * @var \PayPal\EBLBaseComponents\BillingPeriodDetailsType_Update + * @var \PayPal\EBLBaseComponents\BillingPeriodDetailsTypeUpdate */ public $PaymentPeriod; From 51cc27d63024b797972ccd374898027cdd66b671 Mon Sep 17 00:00:00 2001 From: BafS Date: Tue, 3 Nov 2020 11:32:56 +0100 Subject: [PATCH 2/2] Update comoser.json to publish fork --- README.md | 24 ++++++++++++------------ composer.json | 9 ++++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index dcfb09d8..959d2e27 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ ## POODLE Update - Because of the Poodle vulnerability, PayPal has disabled SSLv3. - To enable TLS encryption, the changes were made to [PPHttpConfig.php](https://github.com/paypal/sdk-core-php/blob/master/lib/PayPal/Core/PPHttpConfig.php#L11) in [SDK Core](https://github.com/paypal/sdk-core-php/tree/master) to use a cipher list specific to TLS encryption. -``` php +```php /** * Some default options for curl * These are typically overridden by PPConnectionManager */ - public static $DEFAULT_CURL_OPTS = array( + public static $DEFAULT_CURL_OPTS = [ CURLOPT_SSLVERSION => 1, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => TRUE, @@ -25,7 +25,7 @@ CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_SSL_VERIFYPEER => 1, CURLOPT_SSL_CIPHER_LIST => 'TLSv1', - ); + ]; ``` - There are two primary changes done to curl options: - CURLOPT_SSLVERSION is set to 1 . See [here](http://curl.haxx.se/libcurl/c/CURLOPT_SSLVERSION.html) for more information @@ -58,7 +58,7 @@ To use the SDK, { "name": "me/shopping-cart-app", "require": { - "paypal/merchant-sdk-php":"3.8.*" + "protonlabs/paypal-merchant-sdk-php":"3.8.*" } } ``` @@ -77,12 +77,12 @@ For example, require("PPBootStrap.php"); // Array containing credentials and confiuration parameters. (not required if config file is used) - $config = array( + $config = [ 'mode' => 'sandbox', 'acct1.UserName' => 'jb-us-seller_api1.paypal.com', - 'acct1.Password' => 'WX4WTU3S8MY44S7F' + 'acct1.Password' => 'WX4WTU3S8MY44S7F', ..... - ); + ]; // Create request details $itemAmount = new BasicAmountType($currencyId, $amount); @@ -97,9 +97,9 @@ For example, // Perform request $paypalService = new PayPalAPIInterfaceServiceService($config); $setECResponse = $paypalService->SetExpressCheckout($setECReq); - + // Check results - if(strtoupper($setECResponse->Ack) == 'SUCCESS') { + if (strtoupper($setECResponse->Ack) == 'SUCCESS') { // Success } ``` @@ -136,12 +136,12 @@ The SDK allows you to configure the following parameters- Dynamic configuration values can be set by passing a map of credential and config values (if config map is passed the config file is ignored) ```php - $config = array( + $config = [ 'mode' => 'sandbox', 'acct1.UserName' => 'jb-us-seller_api1.paypal.com', - 'acct1.Password' => 'WX4WTU3S8MY44S7F' + 'acct1.Password' => 'WX4WTU3S8MY44S7F', ..... - ); + ]; $service = new PayPalAPIInterfaceServiceService($config); ``` diff --git a/composer.json b/composer.json index a1cc7f4e..6dcaf69a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "paypal/merchant-sdk-php", + "name": "protonlabs/paypal-merchant-sdk-php", "description": "PayPal Merchant SDK for PHP", "keywords": ["paypal", "php", "sdk"], "homepage": "https://developer.paypal.com", @@ -11,9 +11,12 @@ } ], "require": { - "php": ">=5.3.0", + "php": ">=5.4.0", "ext-curl": "*", - "paypal/sdk-core-php":"3.*" + "protonlabs/paypal-sdk-core-php": "3.*" + }, + "replace": { + "paypal/merchant-sdk-php":"3.*" }, "autoload": { "psr-0": {