Skip to content

Commit 5c740cf

Browse files
feat!: remove deprecated functionality and drop PHP unsupported version compatibility
BREAKING CHANGE: This PR has been automatically generated by fountain. Please review it and merge it if everything is fine. > [!CAUTION] > BREAKING CHANGE. > The SDK supports PHP version 8.0 and newer. Versions lower than 8.0 are not supported any longer! ## Address deprecated functionality warnings: <details><summary> ### 1. Set jsonSerialize() return type explicitly </summary> * Since [8.2](https://github.com/php/php-src/blob/PHP-8.1.0/ext/json/json.stub.php#L18) - `JsonSerializable` requires the implementations to explicitly return the returned type. ``` Deprecated: Return type of ProcessOut\Invoice::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice ``` </details> <details><summary> ### 2. Remove curl_close() invocations - it's being done automatically during GC now. </summary> * Since [8.0](https://php.watch/versions/8.0/resource-CurlHandle) - `curl_close()` has no effect and is deprecated since [8.5](https://php.watch/versions/8.5/curl_close-curl_share_close-deprecated). ``` Deprecated: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 ``` </details> <details><summary> ### 3. Add "?" explicit nullable type operator when applicable. </summary> * Since [8.0](https://php.watch/versions/8.0/null-safe-operator) - added support for "nullable" types - nullability should be explicitly expressed using the `?` operator. ``` Deprecated: ProcessOut\Exceptions\AuthenticationException::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead ``` </details> ## Remove non-existent endpoints and related resources * /activities * /coupons * /customers/:id/subscriptions * /plans * /subscriptions * /supervised-projects
2 parents 64ed19e + 2abd350 commit 5c740cf

86 files changed

Lines changed: 675 additions & 5201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This package provides bindings to the ProcessOut API.
99
Dependencies
1010
------------
1111

12-
* PHP 5.4 or above
12+
* PHP 8.0 or above
1313
* cURL PHP extension
1414

1515
Installation
@@ -20,7 +20,7 @@ The package's installation is done using composer. Simply add these lines to you
2020
```json
2121
{
2222
"require": {
23-
"processout/processout-php": "^7.4.0"
23+
"processout/processout-php": "^8.0.0"
2424
}
2525
}
2626
```
@@ -41,7 +41,7 @@ cloning the directory into your project
4141
git clone https://github.com/processout/processout-php
4242
```
4343

44-
or downloading the latest release at
44+
or downloading the latest release at
4545
[github.com/ProcessOut/processout-php/releases](https://github.com/ProcessOut/processout-php/releases)
4646
and including the ProcessOut init file
4747

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=5.4",
18+
"php": ">=8.0",
1919
"ext-curl": "*",
2020
"ext-mbstring": "*"
2121
},

init.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
include_once(dirname(__FILE__) . "/src/Networking/Request.php");
1313
include_once(dirname(__FILE__) . "/src/Networking/Response.php");
1414

15-
include_once(dirname(__FILE__) . "/src/Activity.php");
16-
include_once(dirname(__FILE__) . "/src/Addon.php");
1715
include_once(dirname(__FILE__) . "/src/APIVersion.php");
1816
include_once(dirname(__FILE__) . "/src/ApplePayAlternativeMerchantCertificates.php");
1917
include_once(dirname(__FILE__) . "/src/AlternativeMerchantCertificate.php");
@@ -23,11 +21,9 @@
2321
include_once(dirname(__FILE__) . "/src/Card.php");
2422
include_once(dirname(__FILE__) . "/src/CardInformation.php");
2523
include_once(dirname(__FILE__) . "/src/Phone.php");
26-
include_once(dirname(__FILE__) . "/src/Coupon.php");
2724
include_once(dirname(__FILE__) . "/src/Customer.php");
2825
include_once(dirname(__FILE__) . "/src/CustomerPhone.php");
2926
include_once(dirname(__FILE__) . "/src/Token.php");
30-
include_once(dirname(__FILE__) . "/src/Discount.php");
3127
include_once(dirname(__FILE__) . "/src/Event.php");
3228
include_once(dirname(__FILE__) . "/src/ExportLayout.php");
3329
include_once(dirname(__FILE__) . "/src/ExportLayoutConfiguration.php");
@@ -59,13 +55,11 @@
5955
include_once(dirname(__FILE__) . "/src/Payout.php");
6056
include_once(dirname(__FILE__) . "/src/PayoutItem.php");
6157
include_once(dirname(__FILE__) . "/src/PayoutItemAmountBreakdowns.php");
62-
include_once(dirname(__FILE__) . "/src/Plan.php");
6358
include_once(dirname(__FILE__) . "/src/Product.php");
6459
include_once(dirname(__FILE__) . "/src/Project.php");
6560
include_once(dirname(__FILE__) . "/src/ProjectSFTPSettings.php");
6661
include_once(dirname(__FILE__) . "/src/ProjectSFTPSettingsPublic.php");
6762
include_once(dirname(__FILE__) . "/src/Refund.php");
68-
include_once(dirname(__FILE__) . "/src/Subscription.php");
6963
include_once(dirname(__FILE__) . "/src/Transaction.php");
7064
include_once(dirname(__FILE__) . "/src/NativeAPMResponse.php");
7165
include_once(dirname(__FILE__) . "/src/NativeAPMParameterDefinition.php");
@@ -77,11 +71,11 @@
7771
include_once(dirname(__FILE__) . "/src/TransactionOperation.php");
7872
include_once(dirname(__FILE__) . "/src/Webhook.php");
7973
include_once(dirname(__FILE__) . "/src/WebhookEndpoint.php");
74+
include_once(dirname(__FILE__) . "/src/CardUpdateRequest.php");
75+
include_once(dirname(__FILE__) . "/src/CardCreateRequest.php");
8076
include_once(dirname(__FILE__) . "/src/Device.php");
8177
include_once(dirname(__FILE__) . "/src/CardContact.php");
8278
include_once(dirname(__FILE__) . "/src/CardShipping.php");
83-
include_once(dirname(__FILE__) . "/src/CardUpdateRequest.php");
84-
include_once(dirname(__FILE__) . "/src/CardCreateRequest.php");
8579
include_once(dirname(__FILE__) . "/src/ErrorCodes.php");
8680
include_once(dirname(__FILE__) . "/src/CategoryErrorCodes.php");
8781
include_once(dirname(__FILE__) . "/src/ExternalThreeDS.php");

src/APIVersion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ public function fillWithData($data)
135135

136136
/**
137137
* Implements the JsonSerializable interface
138-
* @return object
138+
* @return array
139139
*/
140-
public function jsonSerialize() {
140+
public function jsonSerialize(): array {
141141
return array(
142142
"name" => $this->getName(),
143143
"description" => $this->getDescription(),

0 commit comments

Comments
 (0)