Skip to content

Commit

Permalink
Merge pull request ProtonMail#2 from ProtonMail/composer-2-php74-1
Browse files Browse the repository at this point in the history
Fix composer 2 compatibility and update composer.json to publish fork
  • Loading branch information
BafS authored Nov 3, 2020
2 parents 1b34cd6 + 51cc27d commit cf047c8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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.*"
}
}
```
Expand All @@ -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);
Expand All @@ -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
}
```
Expand Down Expand Up @@ -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);
```

Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* Unit of meausre for billing cycle
*/
class BillingPeriodDetailsType_Update
class BillingPeriodDetailsTypeUpdate
extends PPXmlMessage
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ class UpdateRecurringPaymentsProfileRequestDetailsType
* Trial period of this schedule
* @access public
* @namespace ebl
* @var \PayPal\EBLBaseComponents\BillingPeriodDetailsType_Update
* @var \PayPal\EBLBaseComponents\BillingPeriodDetailsTypeUpdate
*/
public $TrialPeriod;

/**
*
* @access public
* @namespace ebl
* @var \PayPal\EBLBaseComponents\BillingPeriodDetailsType_Update
* @var \PayPal\EBLBaseComponents\BillingPeriodDetailsTypeUpdate
*/
public $PaymentPeriod;

Expand Down

0 comments on commit cf047c8

Please sign in to comment.