From 6cd6fa4d3b607d4499bce2571c38232ccf559053 Mon Sep 17 00:00:00 2001 From: Christian Dangl Date: Thu, 12 Oct 2023 15:43:45 +0200 Subject: [PATCH] MOL-1255: move php vendor fix composer ambiguous class --- .php_cs.php | 32 +- composer.json | 23 +- composer.lock | 1135 +++++++++-------- makefile | 2 +- vendor_manual/makefile | 18 + .../mollie-api-php/.php-cs-fixer.dist.php | 37 + vendor_manual/mollie/mollie-api-php/LICENSE | 8 + vendor_manual/mollie/mollie-api-php/README.md | 231 ++++ .../mollie/mollie-api-php/composer.json | 84 ++ .../mollie-api-php/phpstan-baseline.neon | 5 + .../mollie/mollie-api-php/phpstan.neon | 17 + .../mollie/mollie-api-php/phpunit.xml | 15 + .../mollie/mollie-api-php/scoper.inc.php | 13 + .../src/CompatibilityChecker.php | 59 + .../src/Endpoints/BalanceEndpoint.php | 82 ++ .../src/Endpoints/BalanceReportEndpoint.php | 69 + .../Endpoints/BalanceTransactionEndpoint.php | 83 ++ .../src/Endpoints/ChargebackEndpoint.php | 50 + .../src/Endpoints/ClientEndpoint.php | 69 + .../src/Endpoints/ClientLinkEndpoint.php | 40 + .../Endpoints/CollectionEndpointAbstract.php | 48 + .../src/Endpoints/CustomerEndpoint.php | 121 ++ .../Endpoints/CustomerPaymentsEndpoint.php | 97 ++ .../src/Endpoints/EndpointAbstract.php | 210 +++ .../src/Endpoints/InvoiceEndpoint.php | 79 ++ .../src/Endpoints/MandateEndpoint.php | 149 +++ .../src/Endpoints/MethodEndpoint.php | 103 ++ .../src/Endpoints/OnboardingEndpoint.php | 89 ++ .../src/Endpoints/OrderEndpoint.php | 130 ++ .../src/Endpoints/OrderLineEndpoint.php | 139 ++ .../src/Endpoints/OrderPaymentEndpoint.php | 74 ++ .../src/Endpoints/OrderRefundEndpoint.php | 69 + .../src/Endpoints/OrganizationEndpoint.php | 64 + .../Endpoints/OrganizationPartnerEndpoint.php | 58 + .../src/Endpoints/PaymentCaptureEndpoint.php | 121 ++ .../Endpoints/PaymentChargebackEndpoint.php | 89 ++ .../src/Endpoints/PaymentEndpoint.php | 168 +++ .../src/Endpoints/PaymentLinkEndpoint.php | 87 ++ .../src/Endpoints/PaymentRefundEndpoint.php | 122 ++ .../src/Endpoints/PaymentRouteEndpoint.php | 70 + .../src/Endpoints/PermissionEndpoint.php | 65 + .../src/Endpoints/ProfileEndpoint.php | 143 +++ .../src/Endpoints/ProfileMethodEndpoint.php | 129 ++ .../src/Endpoints/RefundEndpoint.php | 50 + .../Endpoints/SettlementPaymentEndpoint.php | 45 + .../src/Endpoints/SettlementsEndpoint.php | 87 ++ .../src/Endpoints/ShipmentEndpoint.php | 161 +++ .../src/Endpoints/SubscriptionEndpoint.php | 212 +++ .../src/Endpoints/TerminalEndpoint.php | 72 ++ .../src/Endpoints/WalletEndpoint.php | 44 + .../src/Exceptions/ApiException.php | 244 ++++ .../CurlConnectTimeoutException.php | 7 + ...dapterDoesNotSupportDebuggingException.php | 7 + .../src/Exceptions/IncompatiblePlatform.php | 12 + .../UnrecognizedClientException.php | 7 + .../src/HttpAdapter/CurlMollieHttpAdapter.php | 239 ++++ .../Guzzle6And7MollieHttpAdapter.php | 198 +++ .../Guzzle6And7RetryMiddlewareFactory.php | 83 ++ .../MollieHttpAdapterInterface.php | 26 + .../HttpAdapter/MollieHttpAdapterPicker.php | 65 + .../MollieHttpAdapterPickerInterface.php | 13 + .../DefaultIdempotencyKeyGenerator.php | 47 + .../FakeIdempotencyKeyGenerator.php | 21 + .../IdempotencyKeyGeneratorContract.php | 7 + .../mollie-api-php/src/MollieApiClient.php | 739 +++++++++++ .../mollie-api-php/src/Resources/Balance.php | 114 ++ .../src/Resources/BalanceCollection.php | 22 + .../src/Resources/BalanceReport.php | 80 ++ .../src/Resources/BalanceTransaction.php | 83 ++ .../BalanceTransactionCollection.php | 24 + .../src/Resources/BaseCollection.php | 34 + .../src/Resources/BaseResource.php | 31 + .../mollie-api-php/src/Resources/Capture.php | 71 ++ .../src/Resources/CaptureCollection.php | 22 + .../src/Resources/Chargeback.php | 75 ++ .../src/Resources/ChargebackCollection.php | 22 + .../mollie-api-php/src/Resources/Client.php | 36 + .../src/Resources/ClientCollection.php | 22 + .../src/Resources/ClientLink.php | 49 + .../src/Resources/CurrentProfile.php | 34 + .../src/Resources/CursorCollection.php | 96 ++ .../mollie-api-php/src/Resources/Customer.php | 250 ++++ .../src/Resources/CustomerCollection.php | 22 + .../mollie-api-php/src/Resources/Invoice.php | 109 ++ .../src/Resources/InvoiceCollection.php | 22 + .../mollie-api-php/src/Resources/Issuer.php | 35 + .../src/Resources/IssuerCollection.php | 14 + .../mollie-api-php/src/Resources/Mandate.php | 112 ++ .../src/Resources/MandateCollection.php | 40 + .../mollie-api-php/src/Resources/Method.php | 100 ++ .../src/Resources/MethodCollection.php | 14 + .../src/Resources/MethodPrice.php | 28 + .../src/Resources/MethodPriceCollection.php | 14 + .../src/Resources/Onboarding.php | 65 + .../mollie-api-php/src/Resources/Order.php | 570 +++++++++ .../src/Resources/OrderCollection.php | 22 + .../src/Resources/OrderLine.php | 420 ++++++ .../src/Resources/OrderLineCollection.php | 32 + .../src/Resources/Organization.php | 70 + .../src/Resources/OrganizationCollection.php | 22 + .../mollie-api-php/src/Resources/Partner.php | 50 + .../mollie-api-php/src/Resources/Payment.php | 806 ++++++++++++ .../src/Resources/PaymentCollection.php | 22 + .../src/Resources/PaymentLink.php | 127 ++ .../src/Resources/PaymentLinkCollection.php | 22 + .../src/Resources/Permission.php | 27 + .../src/Resources/PermissionCollection.php | 14 + .../mollie-api-php/src/Resources/Profile.php | 239 ++++ .../src/Resources/ProfileCollection.php | 22 + .../mollie-api-php/src/Resources/Refund.php | 177 +++ .../src/Resources/RefundCollection.php | 22 + .../src/Resources/ResourceFactory.php | 79 ++ .../mollie-api-php/src/Resources/Route.php | 35 + .../src/Resources/RouteCollection.php | 22 + .../src/Resources/Settlement.php | 192 +++ .../src/Resources/SettlementCollection.php | 22 + .../mollie-api-php/src/Resources/Shipment.php | 124 ++ .../src/Resources/ShipmentCollection.php | 14 + .../src/Resources/Subscription.php | 236 ++++ .../src/Resources/SubscriptionCollection.php | 22 + .../mollie-api-php/src/Resources/Terminal.php | 157 +++ .../src/Resources/TerminalCollection.php | 22 + .../src/Types/ApprovalPrompt.php | 14 + .../src/Types/BalanceTransferFrequency.php | 18 + .../src/Types/InvoiceStatus.php | 21 + .../src/Types/MandateMethod.php | 30 + .../src/Types/MandateStatus.php | 10 + .../src/Types/OnboardingStatus.php | 21 + .../src/Types/OrderLineStatus.php | 42 + .../src/Types/OrderLineType.php | 14 + .../Types/OrderLineUpdateOperationType.php | 13 + .../mollie-api-php/src/Types/OrderStatus.php | 52 + .../src/Types/PaymentMethod.php | 137 ++ .../src/Types/PaymentMethodStatus.php | 51 + .../src/Types/PaymentStatus.php | 46 + .../src/Types/ProfileStatus.php | 21 + .../mollie-api-php/src/Types/RefundStatus.php | 36 + .../mollie-api-php/src/Types/SequenceType.php | 15 + .../src/Types/SettlementStatus.php | 26 + .../src/Types/SubscriptionStatus.php | 12 + .../src/Types/TerminalStatus.php | 21 + 141 files changed, 12168 insertions(+), 543 deletions(-) create mode 100644 vendor_manual/makefile create mode 100644 vendor_manual/mollie/mollie-api-php/.php-cs-fixer.dist.php create mode 100644 vendor_manual/mollie/mollie-api-php/LICENSE create mode 100644 vendor_manual/mollie/mollie-api-php/README.md create mode 100644 vendor_manual/mollie/mollie-api-php/composer.json create mode 100644 vendor_manual/mollie/mollie-api-php/phpstan-baseline.neon create mode 100644 vendor_manual/mollie/mollie-api-php/phpstan.neon create mode 100644 vendor_manual/mollie/mollie-api-php/phpunit.xml create mode 100644 vendor_manual/mollie/mollie-api-php/scoper.inc.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/CompatibilityChecker.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceReportEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceTransactionEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ChargebackEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientLinkEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/CollectionEndpointAbstract.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/EndpointAbstract.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/InvoiceEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/MandateEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/MethodEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OnboardingEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderLineEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderPaymentEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderRefundEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationPartnerEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentCaptureEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentChargebackEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentLinkEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRouteEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/PermissionEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileMethodEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/RefundEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementPaymentEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementsEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/ShipmentEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/TerminalEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Endpoints/WalletEndpoint.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Exceptions/ApiException.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Exceptions/CurlConnectTimeoutException.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Exceptions/HttpAdapterDoesNotSupportDebuggingException.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Exceptions/IncompatiblePlatform.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Exceptions/UnrecognizedClientException.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/CurlMollieHttpAdapter.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterInterface.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterPicker.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterPickerInterface.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Idempotency/DefaultIdempotencyKeyGenerator.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Idempotency/FakeIdempotencyKeyGenerator.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Idempotency/IdempotencyKeyGeneratorContract.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/MollieApiClient.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Balance.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BalanceCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BalanceReport.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BalanceTransaction.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BalanceTransactionCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BaseCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/BaseResource.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Capture.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/CaptureCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Chargeback.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ChargebackCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Client.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ClientCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ClientLink.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/CurrentProfile.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/CursorCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Customer.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/CustomerCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Invoice.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/InvoiceCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Issuer.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/IssuerCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Mandate.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/MandateCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Method.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/MethodCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/MethodPrice.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/MethodPriceCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Onboarding.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Order.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/OrderCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/OrderLine.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/OrderLineCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Organization.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/OrganizationCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Partner.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Payment.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/PaymentCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLink.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLinkCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Permission.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/PermissionCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Profile.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ProfileCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Refund.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/RefundCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ResourceFactory.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Route.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/RouteCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Settlement.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/SettlementCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Shipment.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/ShipmentCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Subscription.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/SubscriptionCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/Terminal.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Resources/TerminalCollection.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/ApprovalPrompt.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/BalanceTransferFrequency.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/InvoiceStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/MandateMethod.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/MandateStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/OnboardingStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/OrderLineStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/OrderLineType.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/OrderLineUpdateOperationType.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/OrderStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/PaymentMethod.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/PaymentMethodStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/PaymentStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/ProfileStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/RefundStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/SequenceType.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/SettlementStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/SubscriptionStatus.php create mode 100644 vendor_manual/mollie/mollie-api-php/src/Types/TerminalStatus.php diff --git a/.php_cs.php b/.php_cs.php index efab35fe2..7515892c9 100644 --- a/.php_cs.php +++ b/.php_cs.php @@ -1,8 +1,19 @@ setUsingCache(false) - ->setRules([ +$finder = \PhpCsFixer\Finder::create()->in([ + __DIR__ . '/src', +]); + +$finder->exclude( + [ + 'Resources' + ] +); + +$config = new \PhpCsFixer\Config(); + +$config->setRules( + [ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], 'ordered_imports' => true, @@ -14,9 +25,12 @@ 'phpdoc_order' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types_order' => true, - 'yoda_style' => null, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude(['Resources']) - ->in(__DIR__ . '/src')); + 'yoda_style' => false, + ] +); + +$config->setFinder($finder); + +$config->setUsingCache(false); + +return $config; diff --git a/composer.json b/composer.json index c0e8162ed..7ae7cfeca 100644 --- a/composer.json +++ b/composer.json @@ -34,16 +34,20 @@ } }, "config": { + "platform": { + "php": "8.0" + }, "optimize-autoloader": true, "allow-plugins": { "infection/extension-installer": true, - "php-http/discovery": true + "php-http/discovery": true, + "symfony/runtime": true } }, "autoload": { "psr-4": { "Kiener\\MolliePayments\\": "src/", - "Mollie\\Api\\": "vendor/mollie/mollie-api-php/src/", + "Mollie\\Api\\": "vendor_manual/mollie/mollie-api-php/src/", "Shopware\\Core\\": "polyfill/Shopware/Core/" } }, @@ -64,16 +68,15 @@ }, "require": { "php": ">=7.4", - "ext-curl": "*", - "mollie/mollie-api-php": "2.61.0" + "ext-curl": "*" }, "require-dev": { - "phpunit/phpunit": "^9.5", - "phpstan/phpstan": "1.8.2", - "friendsofphp/php-cs-fixer": "^2.18", - "phpcompatibility/php-compatibility": "^9.3", - "squizlabs/php_codesniffer": "^3.6", - "infection/infection": "^0.25.4", + "phpunit/phpunit": "*", + "phpstan/phpstan": "*", + "friendsofphp/php-cs-fixer": "*", + "phpcompatibility/php-compatibility": "*", + "squizlabs/php_codesniffer": "*", + "infection/infection": "*", "boxblinkracer/phpunuhi": "dev-main", "shopware/core": "*", "shopware/administration": "*", diff --git a/composer.lock b/composer.lock index af7690c9e..3ef2cf13f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,177 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "845e0f39f54ea899e3d4e1d9c7787702", - "packages": [ - { - "name": "composer/ca-bundle", - "version": "1.3.7", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.7" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-30T09:31:38+00:00" - }, - { - "name": "mollie/mollie-api-php", - "version": "v2.61.0", - "source": { - "type": "git", - "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d3ec7a191985aa57bec9b4425a665e95b4ba346a", - "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.2", - "ext-curl": "*", - "ext-json": "*", - "ext-openssl": "*", - "php": "^7.2|^8.0" - }, - "require-dev": { - "eloquent/liberator": "^2.0||^3.0", - "friendsofphp/php-cs-fixer": "^3.0", - "guzzlehttp/guzzle": "^6.3 || ^7.0", - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^8.5 || ^9.5" - }, - "suggest": { - "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information." - }, - "type": "library", - "autoload": { - "psr-4": { - "Mollie\\Api\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Mollie B.V.", - "email": "info@mollie.com" - } - ], - "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", - "homepage": "https://www.mollie.com/en/developers", - "keywords": [ - "Apple Pay", - "CBC", - "Przelewy24", - "api", - "bancontact", - "banktransfer", - "belfius", - "belfius direct net", - "charges", - "creditcard", - "direct debit", - "fashioncheque", - "gateway", - "gift cards", - "ideal", - "inghomepay", - "intersolve", - "kbc", - "klarna", - "mistercash", - "mollie", - "paylater", - "payment", - "payments", - "paypal", - "paysafecard", - "podiumcadeaukaart", - "recurring", - "refunds", - "sepa", - "service", - "sliceit", - "sofort", - "sofortbanking", - "subscriptions" - ], - "support": { - "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.61.0" - }, - "time": "2023-07-31T15:37:46+00:00" - } - ], + "content-hash": "00005170869a9f21f214b224bf3ffe28", + "packages": [], "packages-dev": [ { "name": "aws/aws-crt-php", @@ -232,16 +63,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.282.2", + "version": "3.283.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "b9b4013f68f1bd5f219f9784c1b2a47da02c1261" + "reference": "6616677d76e39af28138512740199d38a461859f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b9b4013f68f1bd5f219f9784c1b2a47da02c1261", - "reference": "b9b4013f68f1bd5f219f9784c1b2a47da02c1261", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6616677d76e39af28138512740199d38a461859f", + "reference": "6616677d76e39af28138512740199d38a461859f", "shasum": "" }, "require": { @@ -321,9 +152,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.282.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.283.2" }, - "time": "2023-10-03T18:07:23+00:00" + "time": "2023-10-06T18:09:54+00:00" }, { "name": "boxblinkracer/phpunuhi", @@ -395,26 +226,25 @@ }, { "name": "brick/math", - "version": "0.9.3", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", + "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.1 || ^8.0" + "php": "^8.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "vimeo/psalm": "4.9.2" + "phpunit/phpunit": "^9.0", + "vimeo/psalm": "5.0.0" }, "type": "library", "autoload": { @@ -439,19 +269,15 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.9.3" + "source": "https://github.com/brick/math/tree/0.11.0" }, "funding": [ { "url": "https://github.com/BenMorel", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/brick/math", - "type": "tidelift" } ], - "time": "2021-08-15T20:50:18+00:00" + "time": "2023-01-15T23:15:59+00:00" }, { "name": "cocur/slugify", @@ -527,6 +353,173 @@ }, "time": "2019-12-14T13:04:14+00:00" }, + { + "name": "colinodell/json5", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/colinodell/json5.git", + "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/colinodell/json5/zipball/15b063f8cb5e6deb15f0cd39123264ec0d19c710", + "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^7.1.3|^8.0" + }, + "conflict": { + "scrutinizer/ocular": "1.7.*" + }, + "require-dev": { + "mikehaertl/php-shellcommand": "^1.2.5", + "phpstan/phpstan": "^1.4", + "scrutinizer/ocular": "^1.6", + "squizlabs/php_codesniffer": "^2.3 || ^3.0", + "symfony/finder": "^4.4|^5.4|^6.0", + "symfony/phpunit-bridge": "^5.4|^6.0" + }, + "bin": [ + "bin/json5" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "files": [ + "src/global.php" + ], + "psr-4": { + "ColinODell\\Json5\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Developer" + } + ], + "description": "UTF-8 compatible JSON5 parser for PHP", + "homepage": "https://github.com/colinodell/json5", + "keywords": [ + "JSON5", + "json", + "json5_decode", + "json_decode" + ], + "support": { + "issues": "https://github.com/colinodell/json5/issues", + "source": "https://github.com/colinodell/json5/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://www.patreon.com/colinodell", + "type": "patreon" + } + ], + "time": "2022-12-27T16:44:40+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.3.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-30T09:31:38+00:00" + }, { "name": "composer/composer", "version": "2.2.22", @@ -929,27 +922,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -975,7 +968,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -991,7 +984,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T20:20:32+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "deeplcom/deepl-php", @@ -1282,11 +1275,81 @@ "type": "patreon" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/collections", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1.3 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "time": "2022-05-20T20:07:39+00:00" + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", + "keywords": [ + "array", + "collections", + "iterators", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/1.8.0" + }, + "time": "2022-09-01T20:12:10+00:00" }, { "name": "doctrine/dbal", @@ -2473,18 +2536,79 @@ }, "time": "2020-06-29T00:56:53+00:00" }, + { + "name": "fidry/cpu-core-counter", + "version": "0.4.1", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-16T22:01:02+00:00" + }, { "name": "firebase/php-jwt", - "version": "v6.8.1", + "version": "v6.9.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", "shasum": "" }, "require": { @@ -2532,91 +2656,71 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.1" + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" }, - "time": "2023-07-14T18:33:00+00:00" + "time": "2023-10-05T00:24:42+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" + "reference": "1975e4453eb2726d1f50da0ce7fa91295029a4fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1975e4453eb2726d1f50da0ce7fa91295029a4fa", + "reference": "1975e4453eb2726d1f50da0ce7fa91295029a4fa", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0", + "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", + "php": "^7.4 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.23", + "symfony/polyfill-php81": "^1.23", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" }, "suggest": { "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ "php-cs-fixer" ], "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2635,7 +2739,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.6.0" }, "funding": [ { @@ -2643,7 +2747,7 @@ "type": "github" } ], - "time": "2021-11-15T17:17:55+00:00" + "time": "2022-02-07T18:02:40+00:00" }, { "name": "friendsofphp/proxy-manager-lts", @@ -2787,16 +2891,16 @@ }, { "name": "google/cloud-core", - "version": "v1.52.5", + "version": "v1.52.6", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "28765cf75bd028ed063b0422b9c85bb9a54c41ca" + "reference": "71f092f4dab880515917da64423656ed3d6aefc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/28765cf75bd028ed063b0422b9c85bb9a54c41ca", - "reference": "28765cf75bd028ed063b0422b9c85bb9a54c41ca", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/71f092f4dab880515917da64423656ed3d6aefc2", + "reference": "71f092f4dab880515917da64423656ed3d6aefc2", "shasum": "" }, "require": { @@ -2846,9 +2950,9 @@ ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", "support": { - "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.5" + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.6" }, - "time": "2023-09-30T16:50:41+00:00" + "time": "2023-10-06T21:49:26+00:00" }, { "name": "google/cloud-storage", @@ -3204,16 +3308,16 @@ }, { "name": "google/protobuf", - "version": "v3.24.3", + "version": "v3.24.4", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "2fc191fc5e137829081b8700086ac6ed7003b925" + "reference": "672d69e25f71b9364fdf1810eb8a8573defdc404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/2fc191fc5e137829081b8700086ac6ed7003b925", - "reference": "2fc191fc5e137829081b8700086ac6ed7003b925", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/672d69e25f71b9364fdf1810eb8a8573defdc404", + "reference": "672d69e25f71b9364fdf1810eb8a8573defdc404", "shasum": "" }, "require": { @@ -3242,9 +3346,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.24.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.24.4" }, - "time": "2023-09-07T15:39:13+00:00" + "time": "2023-10-04T17:22:47+00:00" }, { "name": "grpc/grpc", @@ -3777,61 +3881,63 @@ }, { "name": "infection/infection", - "version": "0.25.6", + "version": "0.26.19", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "bded7581329766616bf35f1018326c9b3912df0b" + "reference": "bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/bded7581329766616bf35f1018326c9b3912df0b", - "reference": "bded7581329766616bf35f1018326c9b3912df0b", + "url": "https://api.github.com/repos/infection/infection/zipball/bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f", + "reference": "bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f", "shasum": "" }, "require": { + "colinodell/json5": "^2.2", "composer-runtime-api": "^2.0", - "composer/xdebug-handler": "^2.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", + "ext-mbstring": "*", + "fidry/cpu-core-counter": "^0.4.0", "infection/abstract-testframework-adapter": "^0.5.0", "infection/extension-installer": "^0.1.0", "infection/include-interceptor": "^0.2.5", "justinrainbow/json-schema": "^5.2.10", - "nikic/php-parser": "^4.13", - "ondram/ci-detector": "^3.3.0", - "php": "^7.4.7 || ^8.0", + "nikic/php-parser": "^4.15.1", + "ondram/ci-detector": "^4.1.0", + "php": "^8.0", "sanmai/later": "^0.1.1", "sanmai/pipeline": "^5.1 || ^6", - "sebastian/diff": "^3.0.2 || ^4.0", - "seld/jsonlint": "^1.7", - "symfony/console": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", - "symfony/filesystem": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", - "symfony/finder": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", - "symfony/process": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", - "thecodingmachine/safe": "^1.1.3", - "webmozart/assert": "^1.3", - "webmozart/path-util": "^2.3" + "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/process": "^5.4 || ^6.0", + "thecodingmachine/safe": "^2.1.2", + "webmozart/assert": "^1.11" }, "conflict": { - "dg/bypass-finals": "*", - "phpunit/php-code-coverage": ">9 <9.1.4" + "dg/bypass-finals": "<1.4.1", + "phpunit/php-code-coverage": ">9,<9.1.4 || >9.2.17,<9.2.21" }, "require-dev": { "brianium/paratest": "^6.3", "ext-simplexml": "*", + "fidry/makefile": "^0.2.0", "helmich/phpunit-json-assert": "^3.0", "phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan": "^1.3.0", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.1.0", "phpstan/phpstan-webmozart-assert": "^1.0.2", - "phpunit/phpunit": "^9.3.11", - "symfony/phpunit-bridge": "^4.4.18 || ^5.1.10", - "symfony/yaml": "^5.0", - "thecodingmachine/phpstan-safe-rule": "^1.1.0" + "phpunit/phpunit": "^9.5.5", + "symfony/phpunit-bridge": "^5.4 || ^6.0", + "symfony/yaml": "^5.4 || ^6.0", + "thecodingmachine/phpstan-safe-rule": "^1.2.0" }, "bin": [ "bin/infection" @@ -3887,7 +3993,7 @@ ], "support": { "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.25.6" + "source": "https://github.com/infection/infection/tree/0.26.19" }, "funding": [ { @@ -3899,7 +4005,7 @@ "type": "open_collective" } ], - "time": "2022-01-08T13:06:28+00:00" + "time": "2023-02-05T21:47:26+00:00" }, { "name": "jdorn/sql-formatter", @@ -4093,31 +4199,31 @@ }, { "name": "lcobucci/clock", - "version": "2.0.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3" + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/353d83fe2e6ae95745b16b3d911813df6a05bfb3", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/fb533e093fd61321bfcbac08b131ce805fe183d3", + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": "^8.0", + "stella-maris/clock": "^0.1.4" }, "require-dev": { - "infection/infection": "^0.17", - "lcobucci/coding-standard": "^6.0", - "phpstan/extension-installer": "^1.0", + "infection/infection": "^0.26", + "lcobucci/coding-standard": "^8.0", + "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^0.12", "phpstan/phpstan-deprecation-rules": "^0.12", "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-code-coverage": "9.1.4", - "phpunit/phpunit": "9.3.7" + "phpunit/phpunit": "^9.5" }, "type": "library", "autoload": { @@ -4138,7 +4244,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/2.0.x" + "source": "https://github.com/lcobucci/clock/tree/2.2.0" }, "funding": [ { @@ -4150,7 +4256,7 @@ "type": "patreon" } ], - "time": "2020-08-27T18:56:02+00:00" + "time": "2022-04-19T19:34:17+00:00" }, { "name": "lcobucci/jwt", @@ -5285,16 +5391,16 @@ }, { "name": "ondram/ci-detector", - "version": "3.5.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/OndraM/ci-detector.git", - "reference": "594e61252843b68998bddd48078c5058fe9028bd" + "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/594e61252843b68998bddd48078c5058fe9028bd", - "reference": "594e61252843b68998bddd48078c5058fe9028bd", + "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8a4b664e916df82ff26a44709942dfd593fa6f30", + "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30", "shasum": "" }, "require": { @@ -5302,11 +5408,11 @@ }, "require-dev": { "ergebnis/composer-normalize": "^2.2", - "lmc/coding-standard": "^1.3 || ^2.0", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpstan/extension-installer": "^1.0.3", - "phpstan/phpstan": "^0.12.0", - "phpstan/phpstan-phpunit": "^0.12.1", + "lmc/coding-standard": "^1.3 || ^2.1", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "^0.12.58", + "phpstan/phpstan-phpunit": "^0.12.16", "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" }, "type": "library", @@ -5334,6 +5440,9 @@ "appveyor", "aws", "aws codebuild", + "azure", + "azure devops", + "azure pipelines", "bamboo", "bitbucket", "buddy", @@ -5341,19 +5450,22 @@ "codebuild", "continuous integration", "continuousphp", + "devops", "drone", "github", "gitlab", "interface", "jenkins", + "pipelines", + "sourcehut", "teamcity", "travis" ], "support": { "issues": "https://github.com/OndraM/ci-detector/issues", - "source": "https://github.com/OndraM/ci-detector/tree/main" + "source": "https://github.com/OndraM/ci-detector/tree/4.1.0" }, - "time": "2020-09-04T11:21:14+00:00" + "time": "2021-04-14T09:16:52+00:00" }, { "name": "orhanerday/open-ai", @@ -5705,16 +5817,16 @@ }, { "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", "shasum": "" }, "require": { @@ -5742,22 +5854,19 @@ { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", + "description": "sebastian/diff v3 backport support for PHP 5.6+", "homepage": "https://github.com/PHP-CS-Fixer", "keywords": [ "diff" ], "support": { "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" }, "abandoned": true, - "time": "2020-10-14T08:39:05+00:00" + "time": "2020-10-14T08:32:19+00:00" }, { "name": "php-http/discovery", @@ -5957,16 +6066,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.8.2", + "version": "1.10.38", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c" + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c53312ecc575caf07b0e90dee43883fdf90ca67c", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5302bb402c57f00fb3c2c015bac86e0827e4b691", + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691", "shasum": "" }, "require": { @@ -5990,9 +6099,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.2" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -6003,16 +6119,12 @@ "url": "https://github.com/phpstan", "type": "github" }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, { "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", "type": "tidelift" } ], - "time": "2022-07-20T09:57:31+00:00" + "time": "2023-10-06T14:19:14+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6485,6 +6597,54 @@ }, "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "1.1.2", @@ -7023,25 +7183,23 @@ }, { "name": "ramsey/uuid", - "version": "4.2.3", + "version": "4.7.4", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + "reference": "60a4c63ab724854332900504274f6150ff26d286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286", + "reference": "60a4c63ab724854332900504274f6150ff26d286", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" }, "replace": { "rhumsaa/uuid": "self.version" @@ -7053,24 +7211,23 @@ "doctrine/annotations": "^1.8", "ergebnis/composer-normalize": "^2.15", "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", "paragonie/random-lib": "^2", "php-mock/php-mock": "^2.2", "php-mock/php-mock-mockery": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.1", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.9" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -7078,9 +7235,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, "captainhook": { "force-install": true } @@ -7105,7 +7259,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.4" }, "funding": [ { @@ -7117,7 +7271,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T23:10:38+00:00" + "time": "2023-04-15T23:01:58+00:00" }, { "name": "react/promise", @@ -7366,16 +7520,16 @@ }, { "name": "sanmai/pipeline", - "version": "v6.8.1", + "version": "v6.9", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "2e88e466dd49f20c10a15330b3953d4d49c326e3" + "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/2e88e466dd49f20c10a15330b3953d4d49c326e3", - "reference": "2e88e466dd49f20c10a15330b3953d4d49c326e3", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/c48f45c22c3ce4140d071f7658fb151df1cc08ea", + "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea", "shasum": "" }, "require": { @@ -7419,7 +7573,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.8.1" + "source": "https://github.com/sanmai/pipeline/tree/v6.9" }, "funding": [ { @@ -7427,7 +7581,7 @@ "type": "github" } ], - "time": "2023-06-15T09:14:47+00:00" + "time": "2023-10-08T11:56:54+00:00" }, { "name": "scssphp/scssphp", @@ -8786,18 +8940,22 @@ }, { "name": "shopware/conflicts", - "version": "0.0.2", + "version": "0.1.0", "source": { "type": "git", "url": "https://github.com/shopware/conflicts.git", - "reference": "b5414fb0e06ca91d32c896b21c55ad80e261477e" + "reference": "4118427f96c9cd622463119e43d461b816dac41f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shopware/conflicts/zipball/b5414fb0e06ca91d32c896b21c55ad80e261477e", - "reference": "b5414fb0e06ca91d32c896b21c55ad80e261477e", + "url": "https://api.github.com/repos/shopware/conflicts/zipball/4118427f96c9cd622463119e43d461b816dac41f", + "reference": "4118427f96c9cd622463119e43d461b816dac41f", "shasum": "" }, + "require": { + "doctrine/collections": "*", + "shopware/core": "<6.5.0.0" + }, "conflict": { "symfony/cache": "6.2.3 || 5.4.17", "symfony/notifier": "v5.3.8", @@ -8811,9 +8969,9 @@ "description": "Shopware 6 conflicting packages", "support": { "issues": "https://github.com/shopware/conflicts/issues", - "source": "https://github.com/shopware/conflicts/tree/0.0.2" + "source": "https://github.com/shopware/conflicts/tree/0.1.0" }, - "time": "2022-12-29T08:29:43+00:00" + "time": "2023-10-11T13:56:03+00:00" }, { "name": "shopware/core", @@ -9324,6 +9482,53 @@ }, "time": "2020-01-22T14:45:26+00:00" }, + { + "name": "stella-maris/clock", + "version": "0.1.7", + "source": { + "type": "git", + "url": "https://github.com/stella-maris-solutions/clock.git", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "psr/clock": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + }, + "time": "2022-11-25T16:15:06+00:00" + }, { "name": "superbalist/flysystem-google-storage", "version": "7.2.2", @@ -12167,74 +12372,6 @@ ], "time": "2023-07-28T09:04:16+00:00" }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, { "name": "symfony/polyfill-php72", "version": "v1.28.0", @@ -14473,39 +14610,46 @@ }, { "name": "thecodingmachine/safe", - "version": "v1.3.3", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/thecodingmachine/safe.git", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", "shasum": "" }, "require": { - "php": ">=7.2" + "php": "^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^0.12" + "thecodingmachine/phpstan-strict-rules": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.1-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { "files": [ "deprecated/apc.php", + "deprecated/array.php", + "deprecated/datetime.php", "deprecated/libevent.php", + "deprecated/misc.php", + "deprecated/password.php", "deprecated/mssql.php", "deprecated/stats.php", + "deprecated/strings.php", "lib/special_cases.php", + "deprecated/mysqli.php", "generated/apache.php", "generated/apcu.php", "generated/array.php", @@ -14526,6 +14670,7 @@ "generated/fpm.php", "generated/ftp.php", "generated/funchand.php", + "generated/gettext.php", "generated/gmp.php", "generated/gnupg.php", "generated/hash.php", @@ -14535,7 +14680,6 @@ "generated/image.php", "generated/imap.php", "generated/info.php", - "generated/ingres-ii.php", "generated/inotify.php", "generated/json.php", "generated/ldap.php", @@ -14544,20 +14688,14 @@ "generated/mailparse.php", "generated/mbstring.php", "generated/misc.php", - "generated/msql.php", "generated/mysql.php", - "generated/mysqli.php", - "generated/mysqlndMs.php", - "generated/mysqlndQc.php", "generated/network.php", "generated/oci8.php", "generated/opcache.php", "generated/openssl.php", "generated/outcontrol.php", - "generated/password.php", "generated/pcntl.php", "generated/pcre.php", - "generated/pdf.php", "generated/pgsql.php", "generated/posix.php", "generated/ps.php", @@ -14568,7 +14706,6 @@ "generated/sem.php", "generated/session.php", "generated/shmop.php", - "generated/simplexml.php", "generated/sockets.php", "generated/sodium.php", "generated/solr.php", @@ -14591,13 +14728,13 @@ "generated/zip.php", "generated/zlib.php" ], - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - } + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "deprecated/Exceptions/", + "generated/Exceptions/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -14606,9 +14743,9 @@ "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" + "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" }, - "time": "2020-10-28T17:51:34+00:00" + "time": "2023-04-05T11:54:14+00:00" }, { "name": "theseer/tokenizer", @@ -14986,57 +15123,6 @@ }, "time": "2022-06-03T18:03:27+00:00" }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" - }, { "name": "zircote/swagger-php", "version": "3.3.7", @@ -15123,5 +15209,8 @@ "ext-curl": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "platform-overrides": { + "php": "8.0" + }, + "plugin-api-version": "2.6.0" } diff --git a/makefile b/makefile index 900e016c9..e5d53fc5e 100644 --- a/makefile +++ b/makefile @@ -28,12 +28,12 @@ prod: ## Installs all production dependencies cd src/Resources/app/storefront && npm install --production dev: ## Installs all dev dependencies - curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' | sudo -E bash && sudo apt install shopware-cli php switch-composer.php dev @composer validate @composer install cd src/Resources/app/administration && npm install cd src/Resources/app/storefront && npm install + curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' | sudo -E bash && sudo apt install shopware-cli install: ## [deprecated] Installs all production dependencies. Please use "make prod" now. @make prod -B diff --git a/vendor_manual/makefile b/vendor_manual/makefile new file mode 100644 index 000000000..4e1d8209e --- /dev/null +++ b/vendor_manual/makefile @@ -0,0 +1,18 @@ + +MOLLIE_PHP_VERSION:=2.61.0 + + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +# ------------------------------------------------------------------------------------------------------------ + +install: ## Installs all production dependencies + rm -rf mollie + git clone -b v$(MOLLIE_PHP_VERSION) https://github.com/mollie/mollie-api-php.git mollie/mollie-api-php + rm -rf mollie/mollie-api-php/.git + rm -rf mollie/mollie-api-php/.github + rm -rf mollie/mollie-api-php/.gitattributes + rm -rf mollie/mollie-api-php/.gitignore + rm -rf mollie/mollie-api-php/examples + rm -rf mollie/mollie-api-php/tests diff --git a/vendor_manual/mollie/mollie-api-php/.php-cs-fixer.dist.php b/vendor_manual/mollie/mollie-api-php/.php-cs-fixer.dist.php new file mode 100644 index 000000000..f79cca01d --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/.php-cs-fixer.dist.php @@ -0,0 +1,37 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/examples', + __DIR__ . '/tests', + ]) + ->name('*.php') + ->notPath('bootstrap/*') + ->notPath('storage/*') + ->notPath('vendor') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline' => true, + 'phpdoc_scalar' => true, + 'unary_operator_spaces' => true, + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => [ + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], + ], + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_var_without_name' => true, + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ], + 'single_trait_insert_per_statement' => true, + ]) + ->setFinder($finder); diff --git a/vendor_manual/mollie/mollie-api-php/LICENSE b/vendor_manual/mollie/mollie-api-php/LICENSE new file mode 100644 index 000000000..12c9d8d14 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/LICENSE @@ -0,0 +1,8 @@ +Copyright (c) 2013-2016, Mollie B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor_manual/mollie/mollie-api-php/README.md b/vendor_manual/mollie/mollie-api-php/README.md new file mode 100644 index 000000000..c29135950 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/README.md @@ -0,0 +1,231 @@ +

+ +

+

Mollie API client for PHP

+ + + +Accepting [iDEAL](https://www.mollie.com/payments/ideal/), [Apple Pay](https://www.mollie.com/payments/apple-pay), [Bancontact](https://www.mollie.com/payments/bancontact/), [SOFORT Banking](https://www.mollie.com/payments/sofort/), [Creditcard](https://www.mollie.com/payments/credit-card/), [SEPA Bank transfer](https://www.mollie.com/payments/bank-transfer/), [SEPA Direct debit](https://www.mollie.com/payments/direct-debit/), [PayPal](https://www.mollie.com/payments/paypal/), [Belfius Direct Net](https://www.mollie.com/payments/belfius/), [KBC/CBC](https://www.mollie.com/payments/kbc-cbc/), [paysafecard](https://www.mollie.com/payments/paysafecard/), [ING Home'Pay](https://www.mollie.com/payments/ing-homepay/), [Giropay](https://www.mollie.com/payments/giropay/), [EPS](https://www.mollie.com/payments/eps/), [Przelewy24](https://www.mollie.com/payments/przelewy24/), [Postepay](https://www.mollie.com/en/payments/postepay), [In3](https://www.mollie.com/payments/in3/), [Klarna](https://www.mollie.com/payments/klarna-pay-later/) ([Pay now](https://www.mollie.com/payments/klarna-pay-now/), [Pay later](https://www.mollie.com/payments/klarna-pay-later/), [Slice it](https://www.mollie.com/payments/klarna-slice-it/), [Pay in 3](https://www.mollie.com/payments/klarna-pay-in-3/)), [Giftcard](https://www.mollie.com/payments/gift-cards/) and [Voucher](https://www.mollie.com/en/payments/meal-eco-gift-vouchers) online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers. + +[![Build Status](https://github.com/mollie/mollie-api-php/workflows/tests/badge.svg)](https://github.com/mollie/mollie-api-php/actions) +[![Latest Stable Version](https://poser.pugx.org/mollie/mollie-api-php/v/stable)](https://packagist.org/packages/mollie/mollie-api-php) +[![Total Downloads](https://poser.pugx.org/mollie/mollie-api-php/downloads)](https://packagist.org/packages/mollie/mollie-api-php) + +## Requirements ## +To use the Mollie API client, the following things are required: + ++ Get yourself a free [Mollie account](https://www.mollie.com/signup). No sign up costs. ++ Now you're ready to use the Mollie API client in test mode. ++ Follow [a few steps](https://www.mollie.com/dashboard/?modal=onboarding) to enable payment methods in live mode, and let us handle the rest. ++ PHP >= 7.0 ++ Up-to-date OpenSSL (or other SSL/TLS toolkit) + +For leveraging [Mollie Connect](https://docs.mollie.com/oauth/overview) (advanced use cases only), we recommend also installing our [OAuth2 client](https://github.com/mollie/oauth2-mollie-php). + +## Composer Installation ## + +By far the easiest way to install the Mollie API client is to require it with [Composer](http://getcomposer.org/doc/00-intro.md). + + $ composer require mollie/mollie-api-php:^2.0 + + { + "require": { + "mollie/mollie-api-php": "^2.0" + } + } + +The version of the API client corresponds to the version of the API it implements. Check the [notes on migration](https://docs.mollie.com/migrating-v1-to-v2) to see what changes you need to make if you want to start using a newer API version. + + +## Manual Installation ## +If you're not familiar with using composer we've added a ZIP file to the releases containing the API client and all the packages normally installed by composer. +Download the ``mollie-api-php.zip`` from the [releases page](https://github.com/mollie/mollie-api-php/releases). + +Include the ``vendor/autoload.php`` as shown in [Initialize example](https://github.com/mollie/mollie-api-php/blob/master/examples/initialize.php). + +## How to receive payments ## + +To successfully receive a payment, these steps should be implemented: + +1. Use the Mollie API client to create a payment with the requested amount, currency, description and optionally, a payment method. It is important to specify a unique redirect URL where the customer is supposed to return to after the payment is completed. + +2. Immediately after the payment is completed, our platform will send an asynchronous request to the configured webhook to allow the payment details to be retrieved, so you know when exactly to start processing the customer's order. + +3. The customer returns, and should be satisfied to see that the order was paid and is now being processed. + +Find our full documentation online on [docs.mollie.com](https://docs.mollie.com). + +## Getting started ## + +Initializing the Mollie API client, and setting your API key. + +```php +$mollie = new \Mollie\Api\MollieApiClient(); +$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); +``` + +Creating a new payment. + +```php +$payment = $mollie->payments->create([ + "amount" => [ + "currency" => "EUR", + "value" => "10.00" + ], + "description" => "My first API payment", + "redirectUrl" => "https://webshop.example.org/order/12345/", + "webhookUrl" => "https://webshop.example.org/mollie-webhook/", +]); +``` +_After creation, the payment id is available in the `$payment->id` property. You should store this id with your order._ + +After storing the payment id you can send the customer to the checkout using the `$payment->getCheckoutUrl()`. + +```php +header("Location: " . $payment->getCheckoutUrl(), true, 303); +``` +_This header location should always be a GET, thus we enforce 303 http response code_ + +For a payment create example, see [Example - New Payment](https://github.com/mollie/mollie-api-php/blob/master/examples/payments/create-payment.php). + +## Retrieving payments ## +We can use the `$payment->id` to retrieve a payment and check if the payment `isPaid`. + +```php +$payment = $mollie->payments->get($payment->id); + +if ($payment->isPaid()) +{ + echo "Payment received."; +} +``` + +Or retrieve a collection of payments. + +```php +$payments = $mollie->payments->page(); +``` + +For an extensive example of listing payments with the details and status, see [Example - List Payments](https://github.com/mollie/mollie-api-php/blob/master/examples/payments/list-payments.php). + +## Payment webhook ## + +When the status of a payment changes the `webhookUrl` we specified in the creation of the payment will be called. +There we can use the `id` from our POST parameters to check te status and act upon that, see [Example - Webhook](https://github.com/mollie/mollie-api-php/blob/master/examples/payments/webhook.php). + + +## Multicurrency ## +Since 2.0 it is now possible to create non-EUR payments for your customers. +A full list of available currencies can be found [in our documentation](https://docs.mollie.com/guides/multicurrency). + +```php +$payment = $mollie->payments->create([ + "amount" => [ + "currency" => "USD", + "value" => "10.00" + ], + "description" => "Order #12345", + "redirectUrl" => "https://webshop.example.org/order/12345/", + "webhookUrl" => "https://webshop.example.org/mollie-webhook/", +]); +``` +_After creation, the `settlementAmount` will contain the EUR amount that will be settled on your account._ + + +### Fully integrated iDEAL payments ### + +If you want to fully integrate iDEAL payments in your web site, some additional steps are required. First, you need to +retrieve the list of issuers (banks) that support iDEAL and have your customer pick the issuer he/she wants to use for +the payment. + +Retrieve the iDEAL method and include the issuers + +```php +$method = $mollie->methods->get(\Mollie\Api\Types\PaymentMethod::IDEAL, ["include" => "issuers"]); +``` + +_`$method->issuers` will be a list of objects. Use the property `$id` of this object in the + API call, and the property `$name` for displaying the issuer to your customer. For a more in-depth example, see [Example - iDEAL payment](https://github.com/mollie/mollie-api-php/blob/master/examples/payments/create-ideal-payment.php)._ + +Create a payment with the selected issuer: + +```php +$payment = $mollie->payments->create([ + "amount" => [ + "currency" => "EUR", + "value" => "10.00" + ], + "description" => "My first API payment", + "redirectUrl" => "https://webshop.example.org/order/12345/", + "webhookUrl" => "https://webshop.example.org/mollie-webhook/", + "method" => \Mollie\Api\Types\PaymentMethod::IDEAL, + "issuer" => $selectedIssuerId, // e.g. "ideal_INGBNL2A" +]); +``` + +_The `_links` property of the `$payment` object will contain an object `checkout` with a `href` property, which is a URL that points directly to the online banking environment of the selected issuer. +A short way of retrieving this URL can be achieved by using the `$payment->getCheckoutUrl()`._ + +### Refunding payments ### + +The API also supports refunding payments. Note that there is no confirmation and that all refunds are immediate and +definitive. refunds are supported for all methods except for paysafecard and gift cards. + +```php +$payment = $mollie->payments->get($payment->id); + +// Refund € 2 of this payment +$refund = $payment->refund([ + "amount" => [ + "currency" => "EUR", + "value" => "2.00" + ] +]); +``` + +For a working example, see [Example - Refund payment](https://github.com/mollie/mollie-api-php/blob/master/examples/payments/refund-payment.php). + +## Enabling debug mode + +When debugging it can be convenient to have the submitted request available on the `ApiException`. + +In order to prevent leaking sensitive request data into your local application logs, debugging is disabled by default. + +To enable debugging and inspect the request: + +```php +/** @var $mollie \Mollie\Api\MollieApiClient */ +$mollie->enableDebugging(); + +try { + $mollie->payments->get('tr_12345678'); +} catch (\Mollie\Api\Exceptions\ApiException $exception) { + $request = $exception->getRequest(); +} +``` + +If you're logging the `ApiException`, the request will also be logged. Make sure to not retain any sensitive data in +these logs and clean up after debugging. + +To disable debugging again: + +```php +/** @var $mollie \Mollie\Api\MollieApiClient */ +$mollie->disableDebugging(); +``` + +Note that debugging is only available when using the default Guzzle http adapter (`Guzzle6And7MollieHttpAdapter`). + +## API documentation ## +If you wish to learn more about our API, please visit the [Mollie Developer Portal](https://www.mollie.com/developers). API Documentation is available in English. + +## Want to help us make our API client even better? ## + +Want to help us make our API client even better? We take [pull requests](https://github.com/mollie/mollie-api-php/pulls?utf8=%E2%9C%93&q=is%3Apr), sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. [Check out our vacancies](https://jobs.mollie.com/) or [get in touch](mailto:personeel@mollie.com). + +## License ## +[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php). +Copyright (c) 2013-2018, Mollie B.V. + +## Support ## +Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20 820 20 70 diff --git a/vendor_manual/mollie/mollie-api-php/composer.json b/vendor_manual/mollie/mollie-api-php/composer.json new file mode 100644 index 000000000..47040d24b --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/composer.json @@ -0,0 +1,84 @@ +{ + "name": "mollie/mollie-api-php", + "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", + "keywords": [ + "mollie", + "payment", + "service", + "ideal", + "creditcard", + "apple pay", + "mistercash", + "bancontact", + "sofort", + "sofortbanking", + "sepa", + "paypal", + "paysafecard", + "podiumcadeaukaart", + "przelewy24", + "banktransfer", + "direct debit", + "belfius", + "belfius direct net", + "refunds", + "api", + "payments", + "gateway", + "subscriptions", + "recurring", + "charges", + "kbc", + "cbc", + "gift cards", + "intersolve", + "fashioncheque", + "inghomepay", + "klarna", + "paylater", + "sliceit" + ], + "homepage": "https://www.mollie.com/en/developers", + "license": "BSD-2-Clause", + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-openssl": "*", + "composer/ca-bundle": "^1.2" + }, + "require-dev": { + "eloquent/liberator": "^2.0||^3.0", + "friendsofphp/php-cs-fixer": "^3.0", + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^8.5 || ^9.5" + }, + "suggest": { + "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information." + }, + "config": { + "sort-packages": true + }, + "autoload": { + "psr-4": { + "Mollie\\Api\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/", + "Tests\\Mollie\\Api\\": "tests/Mollie/API/" + } + }, + "scripts": { + "test": "./vendor/bin/phpunit tests", + "format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes" + } +} diff --git a/vendor_manual/mollie/mollie-api-php/phpstan-baseline.neon b/vendor_manual/mollie/mollie-api-php/phpstan-baseline.neon new file mode 100644 index 000000000..56cabd08a --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/phpstan-baseline.neon @@ -0,0 +1,5 @@ +parameters: + ignoreErrors: + - + message: "#^Variable \\$mollie might not be defined\\.$#" + path: examples/* diff --git a/vendor_manual/mollie/mollie-api-php/phpstan.neon b/vendor_manual/mollie/mollie-api-php/phpstan.neon new file mode 100644 index 000000000..ecd56da76 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/phpstan.neon @@ -0,0 +1,17 @@ +parameters: + level: 5 + paths: + - %currentWorkingDirectory%/src + - %currentWorkingDirectory%/tests + - %currentWorkingDirectory%/examples + excludePaths: + - %currentWorkingDirectory%/vendor + ignoreErrors: + - '#Access to an undefined property Eloquent\\Liberator\\LiberatorProxyInterface::\$request#' + - '#Access to protected property Mollie\\Api\\MollieApiClient::\$apiKey#' + - '#Access to protected property Mollie\\Api\\MollieApiClient::\$httpClient#' + - '#Call to an undefined method Mollie\\Api\\HttpAdapter\\MollieHttpAdapterInterface::enableDebugging\(\)#' + - '#Call to an undefined method Mollie\\Api\\HttpAdapter\\MollieHttpAdapterInterface::disableDebugging\(\)#' + treatPhpDocTypesAsCertain: false +includes: + - phpstan-baseline.neon diff --git a/vendor_manual/mollie/mollie-api-php/phpunit.xml b/vendor_manual/mollie/mollie-api-php/phpunit.xml new file mode 100644 index 000000000..eb7a8f95d --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/phpunit.xml @@ -0,0 +1,15 @@ + + + + + src/ + + + + + + + + tests/ + + diff --git a/vendor_manual/mollie/mollie-api-php/scoper.inc.php b/vendor_manual/mollie/mollie-api-php/scoper.inc.php new file mode 100644 index 000000000..88317a713 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/scoper.inc.php @@ -0,0 +1,13 @@ + [], // Finder[] + 'patchers' => [], // callable[] + 'whitelist' => [ + 'Mollie\\Api\\*', + ], +]; \ No newline at end of file diff --git a/vendor_manual/mollie/mollie-api-php/src/CompatibilityChecker.php b/vendor_manual/mollie/mollie-api-php/src/CompatibilityChecker.php new file mode 100644 index 000000000..b754b2116 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/CompatibilityChecker.php @@ -0,0 +1,59 @@ +satisfiesPhpVersion()) { + throw new IncompatiblePlatform( + "The client requires PHP version >= " . self::MIN_PHP_VERSION . ", you have " . PHP_VERSION . ".", + IncompatiblePlatform::INCOMPATIBLE_PHP_VERSION + ); + } + + if (! $this->satisfiesJsonExtension()) { + throw new IncompatiblePlatform( + "PHP extension json is not enabled. Please make sure to enable 'json' in your PHP configuration.", + IncompatiblePlatform::INCOMPATIBLE_JSON_EXTENSION + ); + } + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesPhpVersion() + { + return (bool)version_compare(PHP_VERSION, self::MIN_PHP_VERSION, ">="); + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesJsonExtension() + { + // Check by extension_loaded + if (function_exists('extension_loaded') && extension_loaded('json')) { + return true; + } elseif (function_exists('json_encode')) { + return true; + } + + return false; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceEndpoint.php new file mode 100644 index 000000000..b1a9d69aa --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceEndpoint.php @@ -0,0 +1,82 @@ +client, $count, $_links); + } + + /** + * @inheritDoc + */ + protected function getResourceObject() + { + return new Balance($this->client); + } + + /** + * Retrieve a single balance from Mollie. + * + * Will throw an ApiException if the balance id is invalid or the resource cannot be found. + * + * @param string $balanceId + * @param array $parameters + * @return \Mollie\Api\Resources\Balance|\Mollie\Api\Resources\BaseResource + * @throws ApiException + */ + public function get(string $balanceId, array $parameters = []) + { + if (empty($balanceId) || strpos($balanceId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid balance ID: '{$balanceId}'. A balance ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_read($balanceId, $parameters); + } + + /** + * Retrieve the primary balance from Mollie. + * + * Will throw an ApiException if the balance id is invalid or the resource cannot be found. + * + * @param array $parameters + * @return \Mollie\Api\Resources\Balance|\Mollie\Api\Resources\BaseResource + * @throws ApiException + */ + public function primary(array $parameters = []) + { + return parent::rest_read("primary", $parameters); + } + + /** + * Retrieves a collection of Balances from Mollie. + * + * @param string|null $from The first Balance ID you want to include in your list. + * @param int|null $limit + * @param array $parameters + * + * @return BaseCollection|BalanceCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function page(?string $from = null, ?int $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceReportEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceReportEndpoint.php new file mode 100644 index 000000000..86effa9cc --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceReportEndpoint.php @@ -0,0 +1,69 @@ +client); + } + + /** + * Retrieve a balance report for the provided balance id and parameters. + * + * @param string $balanceId + * @param array $parameters + * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId(string $balanceId, array $parameters = []) + { + $this->parentId = $balanceId; + + $result = $this->client->performHttpCall( + self::REST_READ, + $this->getResourcePath() . $this->buildQueryString($parameters) + ); + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + /** + * Retrieve the primary balance. + * This is the balance of your account’s primary currency, where all payments are settled to by default. + * + * @param array $parameters + * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForPrimary(array $parameters = []) + { + return $this->getForId("primary", $parameters); + } + + + /** + * Retrieve a balance report for the provided balance resource and parameters. + * + * @param \Mollie\Api\Resources\Balance $balance + * @param array $parameters + * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Balance $balance, array $parameters = []) + { + return $this->getForId($balance->id, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceTransactionEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceTransactionEndpoint.php new file mode 100644 index 000000000..ed0cbb098 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/BalanceTransactionEndpoint.php @@ -0,0 +1,83 @@ +client, $count, $_links); + } + + /** + * @inheritDoc + */ + protected function getResourceObject() + { + return new BalanceTransaction($this->client); + } + + /** + * List the transactions for a specific Balance. + * + * @param Balance $balance + * @param array $parameters + * @return BalanceTransactionCollection|\Mollie\Api\Resources\BaseCollection + * + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Balance $balance, array $parameters = []) + { + return $this->listForId($balance->id, $parameters); + } + + /** + * List the transactions for a specific Balance ID. + * + * @param string $balanceId + * @param array $parameters + * @return BalanceTransactionCollection|\Mollie\Api\Resources\BaseCollection + * + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId(string $balanceId, array $parameters = []) + { + $this->parentId = $balanceId; + + return parent::rest_list(null, null, $parameters); + } + + /** + * List the transactions for the primary Balance. + * + * @param array $parameters + * @return BalanceTransactionCollection|\Mollie\Api\Resources\BaseCollection + * + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForPrimary(array $parameters = []) + { + $this->parentId = "primary"; + + return parent::rest_list(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ChargebackEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ChargebackEndpoint.php new file mode 100644 index 000000000..dd5045ab5 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ChargebackEndpoint.php @@ -0,0 +1,50 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return ChargebackCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new ChargebackCollection($this->client, $count, $_links); + } + + /** + * Retrieves a collection of Chargebacks from Mollie. + * + * @param string $from The first chargeback ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return ChargebackCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientEndpoint.php new file mode 100644 index 000000000..86891785f --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientEndpoint.php @@ -0,0 +1,69 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return ClientCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new ClientCollection($this->client, $count, $_links); + } + + /** + * Retrieve a client from Mollie. + * + * Will throw an ApiException if the client id is invalid or the resource cannot be found. + * The client id corresponds to the organization id, for example "org_1337". + * + * @param string $clientId + * @param array $parameters + * + * @return Client + * @throws ApiException + */ + public function get($clientId, array $parameters = []) + { + if (empty($clientId)) { + throw new ApiException("Client ID is empty."); + } + + return parent::rest_read($clientId, $parameters); + } + + /** + * Retrieves a page of clients from Mollie. + * + * @param string $from The first client ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return ClientCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientLinkEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientLinkEndpoint.php new file mode 100644 index 000000000..5641cc0d7 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ClientLinkEndpoint.php @@ -0,0 +1,40 @@ +client); + } + + /** + * Creates a client link in Mollie. + * + * @param array $data An array containing details on the client link. + * + * @return ClientLink + * @throws ApiException + */ + public function create(array $data = []): ClientLink + { + return $this->rest_create($data, []); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/CollectionEndpointAbstract.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CollectionEndpointAbstract.php new file mode 100644 index 000000000..b11ee9853 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CollectionEndpointAbstract.php @@ -0,0 +1,48 @@ + $from, "limit" => $limit], $filters); + + $apiPath = $this->getResourcePath() . $this->buildQueryString($filters); + + $result = $this->client->performHttpCall(self::REST_LIST, $apiPath); + + /** @var BaseCollection $collection */ + $collection = $this->getResourceCollectionObject($result->count, $result->_links); + + foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) { + $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->getResourceObject()); + } + + return $collection; + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return BaseCollection + */ + abstract protected function getResourceCollectionObject($count, $_links); +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerEndpoint.php new file mode 100644 index 000000000..ae04d8f4b --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerEndpoint.php @@ -0,0 +1,121 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return CustomerCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new CustomerCollection($this->client, $count, $_links); + } + + /** + * Creates a customer in Mollie. + * + * @param array $data An array containing details on the customer. + * @param array $filters + * + * @return Customer + * @throws ApiException + */ + public function create(array $data = [], array $filters = []) + { + return $this->rest_create($data, $filters); + } + + /** + * Retrieve a single customer from Mollie. + * + * Will throw a ApiException if the customer id is invalid or the resource cannot be found. + * + * @param string $customerId + * @param array $parameters + * @return Customer + * @throws ApiException + */ + public function get($customerId, array $parameters = []) + { + return $this->rest_read($customerId, $parameters); + } + + /** + * Update a specific Customer resource. + * + * Will throw an ApiException if the customer id is invalid or the resource cannot be found. + * + * @param string $customerId + * + * @param array $data + * @return Customer + * @throws ApiException + */ + public function update($customerId, array $data = []) + { + if (empty($customerId) || strpos($customerId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid order ID: '{$customerId}'. An order ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_update($customerId, $data); + } + + /** + * Deletes the given Customer. + * + * Will throw a ApiException if the customer id is invalid or the resource cannot be found. + * Returns with HTTP status No Content (204) if successful. + * + * @param string $customerId + * + * @param array $data + * @return null + * @throws ApiException + */ + public function delete($customerId, array $data = []) + { + return $this->rest_delete($customerId, $data); + } + + /** + * Retrieves a collection of Customers from Mollie. + * + * @param string $from The first customer ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return CustomerCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php new file mode 100644 index 000000000..3961ea6f3 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php @@ -0,0 +1,97 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return PaymentCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PaymentCollection($this->client, $count, $_links); + } + + /** + * Create a subscription for a Customer + * + * @param Customer $customer + * @param array $options + * @param array $filters + * + * @return Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Customer $customer, array $options = [], array $filters = []) + { + return $this->createForId($customer->id, $options, $filters); + } + + /** + * Create a subscription for a Customer ID + * + * @param string $customerId + * @param array $options + * @param array $filters + * + * @return \Mollie\Api\Resources\Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($customerId, array $options = [], array $filters = []) + { + $this->parentId = $customerId; + + return parent::rest_create($options, $filters); + } + + /** + * @param Customer $customer + * @param string $from The first resource ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return PaymentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = []) + { + return $this->listForId($customer->id, $from, $limit, $parameters); + } + + /** + * @param string $customerId + * @param string $from The first resource ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return \Mollie\Api\Resources\PaymentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($customerId, $from = null, $limit = null, array $parameters = []) + { + $this->parentId = $customerId; + + return parent::rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/EndpointAbstract.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/EndpointAbstract.php new file mode 100644 index 000000000..fe87e9787 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/EndpointAbstract.php @@ -0,0 +1,210 @@ +client = $api; + } + + /** + * @param array $filters + * @return string + */ + protected function buildQueryString(array $filters) + { + if (empty($filters)) { + return ""; + } + + foreach ($filters as $key => $value) { + if ($value === true) { + $filters[$key] = "true"; + } + + if ($value === false) { + $filters[$key] = "false"; + } + } + + return "?" . http_build_query($filters, "", "&"); + } + + /** + * @param array $body + * @param array $filters + * @return mixed + * @throws ApiException + */ + protected function rest_create(array $body, array $filters) + { + $result = $this->client->performHttpCall( + self::REST_CREATE, + $this->getResourcePath() . $this->buildQueryString($filters), + $this->parseRequestBody($body) + ); + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + /** + * Sends a PATCH request to a single Mollie API object. + * + * @param string $id + * @param array $body + * + * @return mixed + * @throws ApiException + */ + protected function rest_update($id, array $body = []) + { + if (empty($id)) { + throw new ApiException("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->client->performHttpCall( + self::REST_UPDATE, + "{$this->getResourcePath()}/{$id}", + $this->parseRequestBody($body) + ); + + if ($result == null) { + return null; + } + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + /** + * Retrieves a single object from the REST API. + * + * @param string $id Id of the object to retrieve. + * @param array $filters + * @return mixed + * @throws ApiException + */ + protected function rest_read($id, array $filters) + { + if (empty($id)) { + throw new ApiException("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->client->performHttpCall( + self::REST_READ, + "{$this->getResourcePath()}/{$id}" . $this->buildQueryString($filters) + ); + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + /** + * Sends a DELETE request to a single Molle API object. + * + * @param string $id + * @param array $body + * + * @return mixed + * @throws ApiException + */ + protected function rest_delete($id, array $body = []) + { + if (empty($id)) { + throw new ApiException("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->client->performHttpCall( + self::REST_DELETE, + "{$this->getResourcePath()}/{$id}", + $this->parseRequestBody($body) + ); + + if ($result == null) { + return null; + } + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + + + /** + * Get the object that is used by this API endpoint. Every API endpoint uses one type of object. + * + * @return BaseResource + */ + abstract protected function getResourceObject(); + + /** + * @param string $resourcePath + */ + public function setResourcePath($resourcePath) + { + $this->resourcePath = strtolower($resourcePath); + } + + /** + * @return string + * @throws ApiException + */ + public function getResourcePath() + { + if (strpos($this->resourcePath, "_") !== false) { + [$parentResource, $childResource] = explode("_", $this->resourcePath, 2); + + if (empty($this->parentId)) { + throw new ApiException("Subresource '{$this->resourcePath}' used without parent '$parentResource' ID."); + } + + return "$parentResource/{$this->parentId}/$childResource"; + } + + return $this->resourcePath; + } + + /** + * @param array $body + * @return null|string + */ + protected function parseRequestBody(array $body) + { + if (empty($body)) { + return null; + } + + return @json_encode($body); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/InvoiceEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/InvoiceEndpoint.php new file mode 100644 index 000000000..a228fd283 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/InvoiceEndpoint.php @@ -0,0 +1,79 @@ +client); + } + + /** + * Get the collection object that is used by this API. Every API uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return \Mollie\Api\Resources\BaseCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new InvoiceCollection($this->client, $count, $_links); + } + + /** + * Retrieve an Invoice from Mollie. + * + * Will throw a ApiException if the invoice id is invalid or the resource cannot be found. + * + * @param string $invoiceId + * @param array $parameters + * + * @return Invoice + * @throws ApiException + */ + public function get($invoiceId, array $parameters = []) + { + return $this->rest_read($invoiceId, $parameters); + } + + /** + * Retrieves a collection of Invoices from Mollie. + * + * @param string $from The first invoice ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return InvoiceCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } + + /** + * This is a wrapper method for page + * + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection + * @throws ApiException + */ + public function all(array $parameters = []) + { + return $this->page(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/MandateEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/MandateEndpoint.php new file mode 100644 index 000000000..046eaf2e1 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/MandateEndpoint.php @@ -0,0 +1,149 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return MandateCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new MandateCollection($this->client, $count, $_links); + } + + /** + * @param Customer $customer + * @param array $options + * @param array $filters + * + * @return \Mollie\Api\Resources\Mandate + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Customer $customer, array $options = [], array $filters = []) + { + return $this->createForId($customer->id, $options, $filters); + } + + /** + * @param string $customerId + * @param array $options + * @param array $filters + * + * @return \Mollie\Api\Resources\Mandate + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($customerId, array $options = [], array $filters = []) + { + $this->parentId = $customerId; + + return parent::rest_create($options, $filters); + } + + /** + * @param Customer $customer + * @param string $mandateId + * @param array $parameters + * + * @return \Mollie\Api\Resources\Mandate + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Customer $customer, $mandateId, array $parameters = []) + { + return $this->getForId($customer->id, $mandateId, $parameters); + } + + /** + * @param string $customerId + * @param string $mandateId + * @param array $parameters + * + * @return \Mollie\Api\Resources\Mandate + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId($customerId, $mandateId, array $parameters = []) + { + $this->parentId = $customerId; + + return parent::rest_read($mandateId, $parameters); + } + + /** + * @param Customer $customer + * @param string $from The first resource ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return \Mollie\Api\Resources\MandateCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = []) + { + return $this->listForId($customer->id, $from, $limit, $parameters); + } + + /** + * @param string $customerId + * @param null $from + * @param null $limit + * @param array $parameters + * + * @return \Mollie\Api\Resources\MandateCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($customerId, $from = null, $limit = null, array $parameters = []) + { + $this->parentId = $customerId; + + return parent::rest_list($from, $limit, $parameters); + } + + /** + * @param Customer $customer + * @param string $mandateId + * @param array $data + * + * @return null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function revokeFor(Customer $customer, $mandateId, $data = []) + { + return $this->revokeForId($customer->id, $mandateId, $data); + } + + /** + * @param string $customerId + * @param string $mandateId + * @param array $data + * + * @return null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function revokeForId($customerId, $mandateId, $data = []) + { + $this->parentId = $customerId; + + return parent::rest_delete($mandateId, $data); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/MethodEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/MethodEndpoint.php new file mode 100644 index 000000000..934a27a84 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/MethodEndpoint.php @@ -0,0 +1,103 @@ +client); + } + + /** + * Retrieve all active methods. In test mode, this includes pending methods. The results are not paginated. + * + * @deprecated Use allActive() instead + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\MethodCollection + * @throws ApiException + */ + public function all(array $parameters = []) + { + return $this->allActive($parameters); + } + + /** + * Retrieve all active methods for the organization. In test mode, this includes pending methods. + * The results are not paginated. + * + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\MethodCollection + * @throws ApiException + */ + public function allActive(array $parameters = []) + { + return parent::rest_list(null, null, $parameters); + } + + /** + * Retrieve all available methods for the organization, including activated and not yet activated methods. The + * results are not paginated. Make sure to include the profileId parameter if using an OAuth Access Token. + * + * @param array $parameters Query string parameters. + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\MethodCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function allAvailable(array $parameters = []) + { + $url = 'methods/all' . $this->buildQueryString($parameters); + + $result = $this->client->performHttpCall('GET', $url); + + return ResourceFactory::createBaseResourceCollection( + $this->client, + Method::class, + $result->_embedded->methods, + $result->_links + ); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return MethodCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new MethodCollection($count, $_links); + } + + /** + * Retrieve a payment method from Mollie. + * + * Will throw a ApiException if the method id is invalid or the resource cannot be found. + * + * @param string $methodId + * @param array $parameters + * @return \Mollie\Api\Resources\Method + * @throws ApiException + */ + public function get($methodId, array $parameters = []) + { + if (empty($methodId)) { + throw new ApiException("Method ID is empty."); + } + + return parent::rest_read($methodId, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OnboardingEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OnboardingEndpoint.php new file mode 100644 index 000000000..52ba56958 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OnboardingEndpoint.php @@ -0,0 +1,89 @@ +client); + } + + /** + * Retrieve the organization's onboarding status from Mollie. + * + * Will throw a ApiException if the resource cannot be found. + * + * @return Onboarding + * @throws ApiException + */ + public function get() + { + return $this->rest_read('', []); + } + + /** + * Submit data that will be prefilled in the merchant’s onboarding. + * Please note that the data you submit will only be processed when the onboarding status is needs-data. + * + * Information that the merchant has entered in their dashboard will not be overwritten. + * + * Will throw a ApiException if the resource cannot be found. + * + * @throws ApiException + */ + public function submit(array $parameters = []) + { + return $this->rest_create($parameters, []); + } + + /** + * @param string $id + * @param array $filters + * + * @return mixed + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected function rest_read($id, array $filters) + { + $result = $this->client->performHttpCall( + self::REST_READ, + $this->getResourcePath() . $this->buildQueryString($filters) + ); + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } + + /** + * @param array $body + * @param array $filters + * + * @return mixed + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected function rest_create(array $body, array $filters) + { + $this->client->performHttpCall( + self::REST_CREATE, + $this->getResourcePath() . $this->buildQueryString($filters), + $this->parseRequestBody($body) + ); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderEndpoint.php new file mode 100644 index 000000000..605544a30 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderEndpoint.php @@ -0,0 +1,130 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API + * endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return OrderCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new OrderCollection($this->client, $count, $_links); + } + + /** + * Creates a order in Mollie. + * + * @param array $data An array containing details on the order. + * @param array $filters + * + * @return Order + * @throws ApiException + */ + public function create(array $data = [], array $filters = []) + { + return $this->rest_create($data, $filters); + } + + /** + * Update a specific Order resource + * + * Will throw a ApiException if the order id is invalid or the resource cannot be found. + * + * @param string $orderId + * + * @param array $data + * @return Order + * @throws ApiException + */ + public function update($orderId, array $data = []) + { + if (empty($orderId) || strpos($orderId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid order ID: '{$orderId}'. An order ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_update($orderId, $data); + } + + /** + * Retrieve a single order from Mollie. + * + * Will throw a ApiException if the order id is invalid or the resource cannot + * be found. + * + * @param array $parameters + * @return Order + * @throws ApiException + */ + public function get($orderId, array $parameters = []) + { + if (empty($orderId) || strpos($orderId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid order ID: '{$orderId}'. An order ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_read($orderId, $parameters); + } + + /** + * Cancel the given Order. + * + * If the order was partially shipped, the status will be "completed" instead of + * "canceled". + * Will throw a ApiException if the order id is invalid or the resource cannot + * be found. + * Returns the canceled order with HTTP status 200. + * + * @param string $orderId + * + * @param array $parameters + * @return Order + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancel($orderId, $parameters = []) + { + return $this->rest_delete($orderId, $parameters); + } + + /** + * Retrieves a collection of Orders from Mollie. + * + * @param string $from The first order ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return OrderCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderLineEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderLineEndpoint.php new file mode 100644 index 000000000..2f16f0dad --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderLineEndpoint.php @@ -0,0 +1,139 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API + * endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return OrderLineCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new OrderLineCollection($count, $_links); + } + + /** + * Update a specific OrderLine resource. + * + * Will throw an ApiException if the order line id is invalid or the resource cannot be found. + * + * @param string|null $orderId + * @param string $orderlineId + * + * @param array $data + * + * @return \Mollie\Api\Resources\BaseResource|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function update($orderId, $orderlineId, array $data = []) + { + $this->parentId = $orderId; + + if (empty($orderlineId) || strpos($orderlineId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid order line ID: '{$orderlineId}'. An order line ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_update($orderlineId, $data); + } + + /** + * @param string $orderId + * @param array $operations + * @param array $parameters + * @return Order|\Mollie\Api\Resources\BaseResource + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function updateMultiple(string $orderId, array $operations, array $parameters = []) + { + if (empty($orderId)) { + throw new ApiException("Invalid resource id."); + } + + $this->parentId = $orderId; + + $parameters['operations'] = $operations; + + $result = $this->client->performHttpCall( + self::REST_UPDATE, + "{$this->getResourcePath()}", + $this->parseRequestBody($parameters) + ); + + return ResourceFactory::createFromApiResult($result, new Order($this->client)); + } + + /** + * Cancel lines for the provided order. + * The data array must contain a lines array. + * You can pass an empty lines array if you want to cancel all eligible lines. + * Returns null if successful. + * + * @param Order $order + * @param array $data + * + * @return null + * @throws ApiException + */ + public function cancelFor(Order $order, array $data) + { + return $this->cancelForId($order->id, $data); + } + + /** + * Cancel lines for the provided order id. + * The data array must contain a lines array. + * You can pass an empty lines array if you want to cancel all eligible lines. + * Returns null if successful. + * + * @param string $orderId + * @param array $data + * + * @return null + * @throws ApiException + */ + public function cancelForId($orderId, array $data) + { + if (! isset($data['lines']) || ! is_array($data['lines'])) { + throw new ApiException("A lines array is required."); + } + $this->parentId = $orderId; + + $this->client->performHttpCall( + self::REST_DELETE, + "{$this->getResourcePath()}", + $this->parseRequestBody($data) + ); + + return null; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderPaymentEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderPaymentEndpoint.php new file mode 100644 index 000000000..6bedacf3e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderPaymentEndpoint.php @@ -0,0 +1,74 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API + * endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return \Mollie\Api\Resources\PaymentCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PaymentCollection($this->client, $count, $_links); + } + + /** + * Creates a payment in Mollie for a specific order. + * + * @param \Mollie\Api\Resources\Order $order + * @param array $data An array containing details on the order payment. + * @param array $filters + * + * @return \Mollie\Api\Resources\Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Order $order, array $data, array $filters = []) + { + return $this->createForId($order->id, $data, $filters); + } + + /** + * Creates a payment in Mollie for a specific order ID. + * + * @param string $orderId + * @param array $data An array containing details on the order payment. + * @param array $filters + * + * @return \Mollie\Api\Resources\Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($orderId, array $data, array $filters = []) + { + $this->parentId = $orderId; + + return $this->rest_create($data, $filters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderRefundEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderRefundEndpoint.php new file mode 100644 index 000000000..d50c9e3b4 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrderRefundEndpoint.php @@ -0,0 +1,69 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return RefundCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new RefundCollection($this->client, $count, $_links); + } + + /** + * Refund some order lines. You can provide an empty array for the + * "lines" data to refund all eligible lines for this order. + * + * @param Order $order + * @param array $data + * @param array $filters + * + * @return Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Order $order, array $data, array $filters = []) + { + return $this->createForId($order->id, $data, $filters); + } + + /** + * Refund some order lines. You can provide an empty array for the + * "lines" data to refund all eligible lines for this order. + * + * @param string $orderId + * @param array $data + * @param array $filters + * + * @return \Mollie\Api\Resources\Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($orderId, array $data, array $filters = []) + { + $this->parentId = $orderId; + + return parent::rest_create($data, $filters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationEndpoint.php new file mode 100644 index 000000000..10a7d7b95 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationEndpoint.php @@ -0,0 +1,64 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return OrganizationCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new OrganizationCollection($this->client, $count, $_links); + } + + /** + * Retrieve an organization from Mollie. + * + * Will throw a ApiException if the organization id is invalid or the resource cannot be found. + * + * @param string $organizationId + * @param array $parameters + * @return Organization + * @throws ApiException + */ + public function get($organizationId, array $parameters = []) + { + if (empty($organizationId)) { + throw new ApiException("Organization ID is empty."); + } + + return parent::rest_read($organizationId, $parameters); + } + + /** + * Retrieve the current organization from Mollie. + * + * @param array $parameters + * @return Organization + * @throws ApiException + */ + public function current(array $parameters = []) + { + return parent::rest_read('me', $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationPartnerEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationPartnerEndpoint.php new file mode 100644 index 000000000..06a677b04 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/OrganizationPartnerEndpoint.php @@ -0,0 +1,58 @@ +client); + } + + /** + * Retrieve details about the partner status of the currently authenticated organization. + * + * Will throw an ApiException if the resource cannot be found. + * + * @return Partner + * @throws ApiException + */ + public function get() + { + return $this->rest_read('', []); + } + + /** + * @param string $id + * @param array $filters + * + * @return mixed + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected function rest_read($id, array $filters) + { + $result = $this->client->performHttpCall( + self::REST_READ, + $this->getResourcePath() . $this->buildQueryString($filters) + ); + + return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentCaptureEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentCaptureEndpoint.php new file mode 100644 index 000000000..6766235ab --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentCaptureEndpoint.php @@ -0,0 +1,121 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return \Mollie\Api\Resources\CaptureCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new CaptureCollection($this->client, $count, $_links); + } + + /** + * Creates a payment capture in Mollie. + * + * @param Payment $payment. + * @param array $data An array containing details on the capture. + * @param array $filters + * + * @return Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Payment $payment, array $data = [], array $filters = []) + { + return $this->createForId($payment->id, $data, $filters); + } + + /** + * Creates a payment capture in Mollie. + * + * @param string $paymentId The payment's ID. + * @param array $data An array containing details on the capture. + * @param array $filters + * + * @return Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($paymentId, array $data = [], array $filters = []) + { + $this->parentId = $paymentId; + + return $this->rest_create($data, $filters); + } + + /** + * @param Payment $payment + * @param string $captureId + * @param array $parameters + * + * @return Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Payment $payment, $captureId, array $parameters = []) + { + return $this->getForId($payment->id, $captureId, $parameters); + } + + /** + * @param string $paymentId + * @param string $captureId + * @param array $parameters + * + * @return \Mollie\Api\Resources\Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId($paymentId, $captureId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_read($captureId, $parameters); + } + + /** + * @param Payment $payment + * @param array $parameters + * + * @return Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Payment $payment, array $parameters = []) + { + return $this->listForId($payment->id, $parameters); + } + + /** + * @param string $paymentId + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\Capture + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($paymentId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_list(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentChargebackEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentChargebackEndpoint.php new file mode 100644 index 000000000..e27ddeb5a --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentChargebackEndpoint.php @@ -0,0 +1,89 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return ChargebackCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new ChargebackCollection($this->client, $count, $_links); + } + + /** + * @param Payment $payment + * @param string $chargebackId + * @param array $parameters + * + * @return Chargeback + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Payment $payment, $chargebackId, array $parameters = []) + { + return $this->getForId($payment->id, $chargebackId, $parameters); + } + + /** + * @param string $paymentId + * @param string $chargebackId + * @param array $parameters + * + * @return Chargeback + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId($paymentId, $chargebackId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_read($chargebackId, $parameters); + } + + /** + * @param Payment $payment + * @param array $parameters + * + * @return Chargeback + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Payment $payment, array $parameters = []) + { + return $this->listForId($payment->id, $parameters); + } + + /** + * @param string $paymentId + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\Chargeback + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($paymentId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_list(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentEndpoint.php new file mode 100644 index 000000000..a840863e7 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentEndpoint.php @@ -0,0 +1,168 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return PaymentCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PaymentCollection($this->client, $count, $_links); + } + + /** + * Creates a payment in Mollie. + * + * @param array $data An array containing details on the payment. + * @param array $filters + * + * @return Payment + * @throws ApiException + */ + public function create(array $data = [], array $filters = []) + { + return $this->rest_create($data, $filters); + } + + /** + * Update the given Payment. + * + * Will throw a ApiException if the payment id is invalid or the resource cannot be found. + * + * @param string $paymentId + * + * @param array $data + * @return Payment + * @throws ApiException + */ + public function update($paymentId, array $data = []) + { + if (empty($paymentId) || strpos($paymentId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid payment ID: '{$paymentId}'. A payment ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_update($paymentId, $data); + } + + /** + * Retrieve a single payment from Mollie. + * + * Will throw a ApiException if the payment id is invalid or the resource cannot be found. + * + * @param string $paymentId + * @param array $parameters + * @return Payment + * @throws ApiException + */ + public function get($paymentId, array $parameters = []) + { + if (empty($paymentId) || strpos($paymentId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid payment ID: '{$paymentId}'. A payment ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_read($paymentId, $parameters); + } + + /** + * Deletes the given Payment. + * + * Will throw a ApiException if the payment id is invalid or the resource cannot be found. + * Returns with HTTP status No Content (204) if successful. + * + * @param string $paymentId + * + * @param array $data + * @return Payment + * @throws ApiException + */ + public function delete($paymentId, array $data = []) + { + return $this->rest_delete($paymentId, $data); + } + + /** + * Cancel the given Payment. This is just an alias of the 'delete' method. + * + * Will throw a ApiException if the payment id is invalid or the resource cannot be found. + * Returns with HTTP status No Content (204) if successful. + * + * @param string $paymentId + * + * @param array $data + * @return Payment + * @throws ApiException + */ + public function cancel($paymentId, array $data = []) + { + return $this->rest_delete($paymentId, $data); + } + + /** + * Retrieves a collection of Payments from Mollie. + * + * @param string $from The first payment ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return PaymentCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } + + /** + * Issue a refund for the given payment. + * + * The $data parameter may either be an array of endpoint parameters, a float value to + * initiate a partial refund, or empty to do a full refund. + * + * @param Payment $payment + * @param array|float|null $data + * + * @return Refund + * @throws ApiException + */ + public function refund(Payment $payment, $data = []) + { + $resource = "{$this->getResourcePath()}/" . urlencode($payment->id) . "/refunds"; + + $body = null; + if (($data === null ? 0 : count($data)) > 0) { + $body = json_encode($data); + } + + $result = $this->client->performHttpCall(self::REST_CREATE, $resource, $body); + + return ResourceFactory::createFromApiResult($result, new Refund($this->client)); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentLinkEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentLinkEndpoint.php new file mode 100644 index 000000000..8f3f3bef1 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentLinkEndpoint.php @@ -0,0 +1,87 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return PaymentLinkCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PaymentLinkCollection($this->client, $count, $_links); + } + + /** + * Creates a payment link in Mollie. + * + * @param array $data An array containing details on the payment link. + * @param array $filters + * + * @return PaymentLink + * @throws ApiException + */ + public function create(array $data = [], array $filters = []) + { + return $this->rest_create($data, $filters); + } + + /** + * Retrieve payment link from Mollie. + * + * Will throw a ApiException if the payment link id is invalid or the resource cannot be found. + * + * @param string $paymentLinkId + * @param array $parameters + * @return PaymentLink + * @throws ApiException + */ + public function get($paymentLinkId, array $parameters = []) + { + if (empty($paymentLinkId) || strpos($paymentLinkId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid payment link ID: '{$paymentLinkId}'. A payment link ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_read($paymentLinkId, $parameters); + } + + /** + * Retrieves a collection of Payment Links from Mollie. + * + * @param string $from The first payment link ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return PaymentLinkCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php new file mode 100644 index 000000000..3dfa24696 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php @@ -0,0 +1,122 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return RefundCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new RefundCollection($this->client, $count, $_links); + } + + /** + * @param Payment $payment + * @param string $refundId + * @param array $parameters + * + * @return Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Payment $payment, $refundId, array $parameters = []) + { + return $this->getForId($payment->id, $refundId, $parameters); + } + + /** + * @param string $paymentId + * @param string $refundId + * @param array $parameters + * + * @return \Mollie\Api\Resources\Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId($paymentId, $refundId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_read($refundId, $parameters); + } + + /** + * @param Payment $payment + * @param array $parameters + * + * @return Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Payment $payment, array $parameters = []) + { + return $this->listForId($payment->id, $parameters); + } + + /** + * @param string $paymentId + * @param array $parameters + * + * @return \Mollie\Api\Resources\BaseCollection|\Mollie\Api\Resources\Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($paymentId, array $parameters = []) + { + $this->parentId = $paymentId; + + return parent::rest_list(null, null, $parameters); + } + + + /** + * Creates a refund for a specific payment. + * + * @param Payment $payment + * @param array $data + * @param array $filters + * + * @return Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Payment $payment, array $data, array $filters = []) + { + return $this->createForId($payment->id, $data, $filters); + } + + /** + * Creates a refund for a specific payment. + * + * @param string $paymentId + * @param array $data + * @param array $filters + * + * @return \Mollie\Api\Resources\Refund + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId(string $paymentId, array $data, array $filters = []) + { + $this->parentId = $paymentId; + + return parent::rest_create($data, $filters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRouteEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRouteEndpoint.php new file mode 100644 index 000000000..fc5c654cb --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PaymentRouteEndpoint.php @@ -0,0 +1,70 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return \Mollie\Api\Resources\RouteCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new RouteCollection($this->client, $count, $_links); + } + + /** + * @param Payment $payment + * @param string $routeId + * @param string $releaseDate - UTC datetime in ISO-8601 format when the funds for the following payment will become available on + * the balance of the connected account + * + * @return Route + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function updateReleaseDateFor(Payment $payment, $routeId, $releaseDate) + { + return $this->updateReleaseDateForPaymentId($payment->id, $routeId, $releaseDate); + } + + /** + * @param string $paymentId + * @param string $routeId + * @param string $releaseDate - UTC datetime in ISO-8601 format when the funds for the following payment will become available on + * the balance of the connected account + * + * @return \Mollie\Api\Resources\Route + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function updateReleaseDateForPaymentId($paymentId, $routeId, $releaseDate, $testmode = false) + { + $this->parentId = $paymentId; + + $params = [ + 'releaseDate' => $releaseDate, + 'testmode' => $testmode, + ]; + + return parent::rest_update($routeId, $params); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/PermissionEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PermissionEndpoint.php new file mode 100644 index 000000000..fbe038204 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/PermissionEndpoint.php @@ -0,0 +1,65 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API + * endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return PermissionCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PermissionCollection($count, $_links); + } + + /** + * Retrieve a single Permission from Mollie. + * + * Will throw an ApiException if the permission id is invalid. + * + * @param string $permissionId + * @param array $parameters + * @return Permission + * @throws ApiException + */ + public function get($permissionId, array $parameters = []) + { + return $this->rest_read($permissionId, $parameters); + } + + /** + * Retrieve all permissions. + * + * @param array $parameters + * + * @return PermissionCollection + * @throws ApiException + */ + public function all(array $parameters = []) + { + return parent::rest_list(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileEndpoint.php new file mode 100644 index 000000000..498d442ad --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileEndpoint.php @@ -0,0 +1,143 @@ +resourceClass($this->client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return ProfileCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new ProfileCollection($this->client, $count, $_links); + } + + /** + * Creates a Profile in Mollie. + * + * @param array $data An array containing details on the profile. + * @param array $filters + * + * @return Profile + * @throws ApiException + */ + public function create(array $data = [], array $filters = []) + { + return $this->rest_create($data, $filters); + } + + /** + * Retrieve a Profile from Mollie. + * + * Will throw an ApiException if the profile id is invalid or the resource cannot be found. + * + * @param string $profileId + * @param array $parameters + * + * @return Profile + * @throws ApiException + */ + public function get($profileId, array $parameters = []) + { + if ($profileId === 'me') { + return $this->getCurrent($parameters); + } + + return $this->rest_read($profileId, $parameters); + } + + /** + * Update a specific Profile resource. + * + * Will throw an ApiException if the profile id is invalid or the resource cannot be found. + * + * @param string $profileId + * + * @param array $data + * @return Profile + * @throws ApiException + */ + public function update($profileId, array $data = []) + { + if (empty($profileId) || strpos($profileId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid profile id: '{$profileId}'. An profile id should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + return parent::rest_update($profileId, $data); + } + + /** + * Retrieve the current Profile from Mollie. + * + * @param array $parameters + * + * @return CurrentProfile + * @throws ApiException + */ + public function getCurrent(array $parameters = []) + { + $this->resourceClass = CurrentProfile::class; + + return $this->rest_read('me', $parameters); + } + + /** + * Delete a Profile from Mollie. + * + * Will throw a ApiException if the profile id is invalid or the resource cannot be found. + * Returns with HTTP status No Content (204) if successful. + * + * @param string $profileId + * + * @param array $data + * @return Profile + * @throws ApiException + */ + public function delete($profileId, array $data = []) + { + return $this->rest_delete($profileId, $data); + } + + /** + * Retrieves a collection of Profiles from Mollie. + * + * @param string $from The first profile ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return ProfileCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileMethodEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileMethodEndpoint.php new file mode 100644 index 000000000..606d6141c --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ProfileMethodEndpoint.php @@ -0,0 +1,129 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return MethodCollection() + */ + protected function getResourceCollectionObject($count, $_links) + { + return new MethodCollection($count, $_links); + } + + /** + * Enable a method for the provided Profile ID. + * + * @param string $profileId + * @param string $methodId + * @param array $data + * @return \Mollie\Api\Resources\Method + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($profileId, $methodId, array $data = []) + { + $this->parentId = $profileId; + $resource = $this->getResourcePath() . '/' . urlencode($methodId); + + $body = null; + if (count($data) > 0) { + $body = json_encode($data); + } + + $result = $this->client->performHttpCall(self::REST_CREATE, $resource, $body); + + return ResourceFactory::createFromApiResult($result, new Method($this->client)); + } + + /** + * Enable a method for the provided Profile object. + * + * @param Profile $profile + * @param string $methodId + * @param array $data + * @return Method + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor($profile, $methodId, array $data = []) + { + return $this->createForId($profile->id, $methodId, $data); + } + + /** + * Enable a method for the current profile. + * + * @param string $methodId + * @param array $data + * @return \Mollie\Api\Resources\Method + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForCurrentProfile($methodId, array $data = []) + { + return $this->createForId('me', $methodId, $data); + } + + /** + * Disable a method for the provided Profile ID. + * + * @param string $profileId + * @param string $methodId + * @param array $data + * @return mixed + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function deleteForId($profileId, $methodId, array $data = []) + { + $this->parentId = $profileId; + + return $this->rest_delete($methodId, $data); + } + + /** + * Disable a method for the provided Profile object. + * + * @param Profile $profile + * @param string $methodId + * @param array $data + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function deleteFor($profile, $methodId, array $data = []) + { + return $this->deleteForId($profile->id, $methodId, $data); + } + + /** + * Disable a method for the current profile. + * + * @param string $methodId + * @param array $data + * @return \Mollie\Api\Resources\Method + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function deleteForCurrentProfile($methodId, array $data) + { + return $this->deleteForId('me', $methodId, $data); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/RefundEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/RefundEndpoint.php new file mode 100644 index 000000000..385e21c0f --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/RefundEndpoint.php @@ -0,0 +1,50 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return RefundCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new RefundCollection($this->client, $count, $_links); + } + + /** + * Retrieves a collection of Refunds from Mollie. + * + * @param string $from The first refund ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return RefundCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementPaymentEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementPaymentEndpoint.php new file mode 100644 index 000000000..6ac8304e5 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementPaymentEndpoint.php @@ -0,0 +1,45 @@ +client); + } + + /** + * @inheritDoc + */ + protected function getResourceCollectionObject($count, $_links) + { + return new PaymentCollection($this->client, $count, $_links); + } + + /** + * Retrieves a collection of Payments from Mollie. + * + * @param string $settlementId + * @param string $from The first payment ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return mixed + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function pageForId($settlementId, $from = null, $limit = null, array $parameters = []) + { + $this->parentId = $settlementId; + + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementsEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementsEndpoint.php new file mode 100644 index 000000000..a4d49e85e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SettlementsEndpoint.php @@ -0,0 +1,87 @@ +client); + } + + /** + * Get the collection object that is used by this API. Every API uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return \Mollie\Api\Resources\BaseCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new SettlementCollection($this->client, $count, $_links); + } + + /** + * Retrieve a single settlement from Mollie. + * + * Will throw a ApiException if the settlement id is invalid or the resource cannot be found. + * + * @param string $settlementId + * @param array $parameters + * @return Settlement + * @throws ApiException + */ + public function get($settlementId, array $parameters = []) + { + return parent::rest_read($settlementId, $parameters); + } + + /** + * Retrieve the details of the current settlement that has not yet been paid out. + * + * @return Settlement + * @throws ApiException + */ + public function next() + { + return parent::rest_read("next", []); + } + + /** + * Retrieve the details of the open balance of the organization. + * + * @return Settlement + * @throws ApiException + */ + public function open() + { + return parent::rest_read("open", []); + } + + /** + * Retrieves a collection of Settlements from Mollie. + * + * @param string $from The first settlement ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return SettlementCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/ShipmentEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ShipmentEndpoint.php new file mode 100644 index 000000000..6456ab7ca --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/ShipmentEndpoint.php @@ -0,0 +1,161 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API + * endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return ShipmentCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new ShipmentCollection($count, $_links); + } + + /** + * Create a shipment for some order lines. You can provide an empty array for the + * "lines" option to include all unshipped lines for this order. + * + * @param Order $order + * @param array $options + * @param array $filters + * + * @return Shipment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createFor(Order $order, array $options = [], array $filters = []) + { + return $this->createForId($order->id, $options, $filters); + } + + /** + * Create a shipment for some order lines. You can provide an empty array for the + * "lines" option to include all unshipped lines for this order. + * + * @param string $orderId + * @param array $options + * @param array $filters + * + * @return Shipment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createForId($orderId, array $options = [], array $filters = []) + { + $this->parentId = $orderId; + + return parent::rest_create($options, $filters); + } + + /** + * Retrieve a single shipment and the order lines shipped by a shipment’s ID. + * + * @param Order $order + * @param string $shipmentId + * @param array $parameters + * + * @return Shipment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getFor(Order $order, $shipmentId, array $parameters = []) + { + return $this->getForId($order->id, $shipmentId, $parameters); + } + + /** + * Retrieve a single shipment and the order lines shipped by a shipment’s ID. + * + * @param string $orderId + * @param string $shipmentId + * @param array $parameters + * + * @return \Mollie\Api\Resources\Shipment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function getForId($orderId, $shipmentId, array $parameters = []) + { + $this->parentId = $orderId; + + return parent::rest_read($shipmentId, $parameters); + } + + /** + * Update a specific Order Shipment resource. + * + * Will throw an ApiException if the shipment id is invalid or the resource cannot be found. + * + * @param string $shipmentId + * @param string $orderId + * + * @param array $data + * @return Shipment + * @throws ApiException + */ + public function update($orderId, $shipmentId, array $data = []) + { + if (empty($shipmentId) || strpos($shipmentId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid subscription ID: '{$shipmentId}'. An subscription ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + $this->parentId = $orderId; + + return parent::rest_update($shipmentId, $data); + } + + /** + * Return all shipments for the Order provided. + * + * @param Order $order + * @param array $parameters + * + * @return ShipmentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listFor(Order $order, array $parameters = []) + { + return $this->listForId($order->id, $parameters); + } + + /** + * Return all shipments for the provided Order id. + * + * @param string $orderId + * @param array $parameters + * + * @return \Mollie\Api\Resources\ShipmentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function listForId($orderId, array $parameters = []) + { + $this->parentId = $orderId; + + return parent::rest_list(null, null, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php new file mode 100644 index 000000000..d9b919af3 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php @@ -0,0 +1,212 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return SubscriptionCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new SubscriptionCollection($this->client, $count, $_links); + } + + /** + * Create a subscription for a Customer + * + * @param Customer $customer + * @param array $options + * @param array $filters + * + * @return Subscription + * @throws ApiException + */ + public function createFor(Customer $customer, array $options = [], array $filters = []) + { + return $this->createForId($customer->id, $options, $filters); + } + + /** + * Create a subscription for a Customer + * + * @param string $customerId + * @param array $options + * @param array $filters + * + * @return Subscription + * @throws ApiException + */ + public function createForId($customerId, array $options = [], array $filters = []) + { + $this->parentId = $customerId; + + return parent::rest_create($options, $filters); + } + + /** + * Update a specific Subscription resource. + * + * Will throw an ApiException if the subscription id is invalid or the resource cannot be found. + * + * @param string $subscriptionId + * @param string $customerId + * + * @param array $data + * + * @return Subscription + * @throws ApiException + */ + public function update($customerId, $subscriptionId, array $data = []) + { + if (empty($subscriptionId) || strpos($subscriptionId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid subscription ID: '{$subscriptionId}'. An subscription ID should start with '".self::RESOURCE_ID_PREFIX."'."); + } + + $this->parentId = $customerId; + + return parent::rest_update($subscriptionId, $data); + } + + /** + * @param Customer $customer + * @param string $subscriptionId + * @param array $parameters + * + * @return Subscription + * @throws ApiException + */ + public function getFor(Customer $customer, $subscriptionId, array $parameters = []) + { + return $this->getForId($customer->id, $subscriptionId, $parameters); + } + + /** + * @param string $customerId + * @param string $subscriptionId + * @param array $parameters + * + * @return Subscription + * @throws ApiException + */ + public function getForId($customerId, $subscriptionId, array $parameters = []) + { + $this->parentId = $customerId; + + return parent::rest_read($subscriptionId, $parameters); + } + + /** + * @param Customer $customer + * @param string $from The first resource ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return SubscriptionCollection + * @throws ApiException + */ + public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = []) + { + return $this->listForId($customer->id, $from, $limit, $parameters); + } + + /** + * @param string $customerId + * @param string $from The first resource ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return SubscriptionCollection + * @throws ApiException + */ + public function listForId($customerId, $from = null, $limit = null, array $parameters = []) + { + $this->parentId = $customerId; + + return parent::rest_list($from, $limit, $parameters); + } + + /** + * @param Customer $customer + * @param string $subscriptionId + * @param array $data + * + * @return null + * @throws ApiException + */ + public function cancelFor(Customer $customer, $subscriptionId, array $data = []) + { + return $this->cancelForId($customer->id, $subscriptionId, $data); + } + + /** + * @param string $customerId + * @param string $subscriptionId + * @param array $data + * + * @return null + * @throws ApiException + */ + public function cancelForId($customerId, $subscriptionId, array $data = []) + { + $this->parentId = $customerId; + + return parent::rest_delete($subscriptionId, $data); + } + + /** + * Retrieves a collection of Subscriptions from Mollie. + * + * @param string $from The first payment ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return SubscriptionCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + $filters = array_merge(["from" => $from, "limit" => $limit], $parameters); + + $apiPath = 'subscriptions' . $this->buildQueryString($filters); + + $result = $this->client->performHttpCall(self::REST_LIST, $apiPath); + + /** @var SubscriptionCollection $collection */ + $collection = $this->getResourceCollectionObject($result->count, $result->_links); + + foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) { + $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->getResourceObject()); + } + + return $collection; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/TerminalEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/TerminalEndpoint.php new file mode 100644 index 000000000..4b100b566 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/TerminalEndpoint.php @@ -0,0 +1,72 @@ +client); + } + + /** + * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. + * + * @param int $count + * @param \stdClass $_links + * + * @return TerminalCollection + */ + protected function getResourceCollectionObject($count, $_links) + { + return new TerminalCollection($this->client, $count, $_links); + } + + /** + * Retrieve terminal from Mollie. + * + * Will throw a ApiException if the terminal id is invalid or the resource cannot be found. + * + * @param string $terminalId + * @param array $parameters + * @return Terminal + * @throws ApiException + */ + public function get($terminalId, array $parameters = []) + { + if (empty($terminalId) || strpos($terminalId, self::RESOURCE_ID_PREFIX) !== 0) { + throw new ApiException("Invalid terminal ID: '{$terminalId}'. A terminal ID should start with '" . self::RESOURCE_ID_PREFIX . "'."); + } + + return parent::rest_read($terminalId, $parameters); + } + + /** + * Retrieves a collection of Terminals from Mollie for the current organization / profile, ordered from newest to oldest. + * + * @param string $from The first terminal ID you want to include in your list. + * @param int $limit + * @param array $parameters + * + * @return TerminalCollection + * @throws ApiException + */ + public function page($from = null, $limit = null, array $parameters = []) + { + return $this->rest_list($from, $limit, $parameters); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Endpoints/WalletEndpoint.php b/vendor_manual/mollie/mollie-api-php/src/Endpoints/WalletEndpoint.php new file mode 100644 index 000000000..628aaebde --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Endpoints/WalletEndpoint.php @@ -0,0 +1,44 @@ +parseRequestBody(array_merge([ + 'domain' => $domain, + 'validationUrl' => $validationUrl, + ], $parameters)); + + $response = $this->client->performHttpCall( + self::REST_CREATE, + 'wallets/applepay/sessions', + $body + ); + + return json_encode($response); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Exceptions/ApiException.php b/vendor_manual/mollie/mollie-api-php/src/Exceptions/ApiException.php new file mode 100644 index 000000000..dc619db6e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Exceptions/ApiException.php @@ -0,0 +1,244 @@ +plainMessage = $message; + + $this->raisedAt = new \DateTimeImmutable(); + + $formattedRaisedAt = $this->raisedAt->format(DateTime::ISO8601); + $message = "[{$formattedRaisedAt}] " . $message; + + if (! empty($field)) { + $this->field = (string)$field; + $message .= ". Field: {$this->field}"; + } + + if (! empty($response)) { + $this->response = $response; + + $object = static::parseResponseBody($this->response); + + if (isset($object->_links)) { + foreach ($object->_links as $key => $value) { + $this->links[$key] = $value; + } + } + } + + if ($this->hasLink('documentation')) { + $message .= ". Documentation: {$this->getDocumentationUrl()}"; + } + + $this->request = $request; + if ($request) { + $requestBody = $request->getBody()->__toString(); + + if ($requestBody) { + $message .= ". Request body: {$requestBody}"; + } + } + + parent::__construct($message, $code, $previous); + } + + /** + * @param \Psr\Http\Message\ResponseInterface $response + * @param \Psr\Http\Message\RequestInterface $request + * @param \Throwable|null $previous + * @return \Mollie\Api\Exceptions\ApiException + * @throws \Mollie\Api\Exceptions\ApiException + */ + public static function createFromResponse($response, $request = null, $previous = null) + { + $object = static::parseResponseBody($response); + + $field = null; + if (! empty($object->field)) { + $field = $object->field; + } + + return new self( + "Error executing API call ({$object->status}: {$object->title}): {$object->detail}", + $response->getStatusCode(), + $field, + $request, + $response, + $previous + ); + } + + /** + * @return string|null + */ + public function getField() + { + return $this->field; + } + + /** + * @return string|null + */ + public function getDocumentationUrl() + { + return $this->getUrl('documentation'); + } + + /** + * @return string|null + */ + public function getDashboardUrl() + { + return $this->getUrl('dashboard'); + } + + /** + * @return \Psr\Http\Message\ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * @param string $key + * @return bool + */ + public function hasLink($key) + { + return array_key_exists($key, $this->links); + } + + /** + * @param string $key + * @return mixed|null + */ + public function getLink($key) + { + if ($this->hasLink($key)) { + return $this->links[$key]; + } + + return null; + } + + /** + * @param string $key + * @return null + */ + public function getUrl($key) + { + if ($this->hasLink($key)) { + return $this->getLink($key)->href; + } + + return null; + } + + /** + * @return \Psr\Http\Message\RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the ISO8601 representation of the moment this exception was thrown + * + * @return \DateTimeImmutable + */ + public function getRaisedAt() + { + return $this->raisedAt; + } + + /** + * @param \Psr\Http\Message\ResponseInterface $response + * @return \stdClass + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected static function parseResponseBody($response) + { + $body = (string) $response->getBody(); + + $object = @json_decode($body); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw new self("Unable to decode Mollie response: '{$body}'."); + } + + return $object; + } + + /** + * Retrieve the plain exception message. + * + * @return string + */ + public function getPlainMessage() + { + return $this->plainMessage; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Exceptions/CurlConnectTimeoutException.php b/vendor_manual/mollie/mollie-api-php/src/Exceptions/CurlConnectTimeoutException.php new file mode 100644 index 000000000..ab40ca1bc --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Exceptions/CurlConnectTimeoutException.php @@ -0,0 +1,7 @@ +attemptRequest($httpMethod, $url, $headers, $httpBody); + } catch (CurlConnectTimeoutException $e) { + // Nothing + } + } + + throw new CurlConnectTimeoutException( + "Unable to connect to Mollie. Maximum number of retries (". self::MAX_RETRIES .") reached." + ); + } + + /** + * @param string $httpMethod + * @param string $url + * @param array $headers + * @param string $httpBody + * @return \stdClass|void|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected function attemptRequest($httpMethod, $url, $headers, $httpBody) + { + $curl = curl_init($url); + $headers["Content-Type"] = "application/json"; + + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPHEADER, $this->parseHeaders($headers)); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, self::DEFAULT_CONNECT_TIMEOUT); + curl_setopt($curl, CURLOPT_TIMEOUT, self::DEFAULT_TIMEOUT); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($curl, CURLOPT_CAINFO, CaBundle::getBundledCaBundlePath()); + + switch ($httpMethod) { + case MollieApiClient::HTTP_POST: + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $httpBody); + + break; + case MollieApiClient::HTTP_GET: + break; + case MollieApiClient::HTTP_PATCH: + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); + curl_setopt($curl, CURLOPT_POSTFIELDS, $httpBody); + + break; + case MollieApiClient::HTTP_DELETE: + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); + curl_setopt($curl, CURLOPT_POSTFIELDS, $httpBody); + + break; + default: + throw new \InvalidArgumentException("Invalid http method: ". $httpMethod); + } + + $startTime = microtime(true); + $response = curl_exec($curl); + $endTime = microtime(true); + + if ($response === false) { + $executionTime = $endTime - $startTime; + $curlErrorNumber = curl_errno($curl); + $curlErrorMessage = "Curl error: " . curl_error($curl); + + if ($this->isConnectTimeoutError($curlErrorNumber, $executionTime)) { + throw new CurlConnectTimeoutException("Unable to connect to Mollie. " . $curlErrorMessage); + } + + throw new ApiException($curlErrorMessage); + } + + $statusCode = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); + curl_close($curl); + + return $this->parseResponseBody($response, $statusCode, $httpBody); + } + + /** + * The version number for the underlying http client, if available. + * @example Guzzle/6.3 + * + * @return string|null + */ + public function versionString() + { + return 'Curl/*'; + } + + /** + * Whether this http adapter provides a debugging mode. If debugging mode is enabled, the + * request will be included in the ApiException. + * + * @return false + */ + public function supportsDebugging() + { + return false; + } + + /** + * @param int $curlErrorNumber + * @param string|float $executionTime + * @return bool + */ + protected function isConnectTimeoutError($curlErrorNumber, $executionTime) + { + $connectErrors = [ + \CURLE_COULDNT_RESOLVE_HOST => true, + \CURLE_COULDNT_CONNECT => true, + \CURLE_SSL_CONNECT_ERROR => true, + \CURLE_GOT_NOTHING => true, + ]; + + if (isset($connectErrors[$curlErrorNumber])) { + return true; + }; + + if ($curlErrorNumber === \CURLE_OPERATION_TIMEOUTED) { + if ($executionTime > self::DEFAULT_TIMEOUT) { + return false; + } + + return true; + } + + return false; + } + + /** + * @param string $response + * @param int $statusCode + * @param string $httpBody + * @return \stdClass|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + protected function parseResponseBody($response, $statusCode, $httpBody) + { + if (empty($response)) { + if ($statusCode === self::HTTP_NO_CONTENT) { + return null; + } + + throw new ApiException("No response body found."); + } + + $body = @json_decode($response); + + // GUARDS + if (json_last_error() !== JSON_ERROR_NONE) { + throw new ApiException("Unable to decode Mollie response: '{$response}'."); + } + + if (isset($body->error)) { + throw new ApiException($body->error->message); + } + + if ($statusCode >= 400) { + $message = "Error executing API call ({$body->status}: {$body->title}): {$body->detail}"; + + $field = null; + + if (! empty($body->field)) { + $field = $body->field; + } + + if (isset($body->_links, $body->_links->documentation)) { + $message .= ". Documentation: {$body->_links->documentation->href}"; + } + + if ($httpBody) { + $message .= ". Request body: {$httpBody}"; + } + + throw new ApiException($message, $statusCode, $field); + } + + return $body; + } + + protected function parseHeaders($headers) + { + $result = []; + + foreach ($headers as $key => $value) { + $result[] = $key .': ' . $value; + } + + return $result; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php new file mode 100644 index 000000000..a9e27cdb3 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php @@ -0,0 +1,198 @@ +httpClient = $httpClient; + } + + /** + * Instantiate a default adapter with sane configuration for Guzzle 6 or 7. + * + * @return static + */ + public static function createDefault() + { + $retryMiddlewareFactory = new Guzzle6And7RetryMiddlewareFactory; + $handlerStack = HandlerStack::create(); + $handlerStack->push($retryMiddlewareFactory->retry()); + + $client = new Client([ + GuzzleRequestOptions::VERIFY => CaBundle::getBundledCaBundlePath(), + GuzzleRequestOptions::TIMEOUT => self::DEFAULT_TIMEOUT, + GuzzleRequestOptions::CONNECT_TIMEOUT => self::DEFAULT_CONNECT_TIMEOUT, + 'handler' => $handlerStack, + ]); + + return new Guzzle6And7MollieHttpAdapter($client); + } + + /** + * Send a request to the specified Mollie api url. + * + * @param string $httpMethod + * @param string $url + * @param array $headers + * @param string $httpBody + * @return \stdClass|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function send($httpMethod, $url, $headers, $httpBody) + { + $request = new Request($httpMethod, $url, $headers, $httpBody); + + try { + $response = $this->httpClient->send($request, ['http_errors' => false]); + } catch (GuzzleException $e) { + // Prevent sensitive request data from ending up in exception logs unintended + if (! $this->debugging) { + $request = null; + } + + // Not all Guzzle Exceptions implement hasResponse() / getResponse() + if (method_exists($e, 'hasResponse') && method_exists($e, 'getResponse')) { + if ($e->hasResponse()) { + throw ApiException::createFromResponse($e->getResponse(), $request); + } + } + + throw new ApiException($e->getMessage(), $e->getCode(), null, $request, null); + } + + return $this->parseResponseBody($response); + } + + /** + * Whether this http adapter provides a debugging mode. If debugging mode is enabled, the + * request will be included in the ApiException. + * + * @return true + */ + public function supportsDebugging() + { + return true; + } + + /** + * Whether debugging is enabled. If debugging mode is enabled, the request will + * be included in the ApiException. By default, debugging is disabled to prevent + * sensitive request data from leaking into exception logs. + * + * @return bool + */ + public function debugging() + { + return $this->debugging; + } + + /** + * Enable debugging. If debugging mode is enabled, the request will + * be included in the ApiException. By default, debugging is disabled to prevent + * sensitive request data from leaking into exception logs. + */ + public function enableDebugging() + { + $this->debugging = true; + } + + /** + * Disable debugging. If debugging mode is enabled, the request will + * be included in the ApiException. By default, debugging is disabled to prevent + * sensitive request data from leaking into exception logs. + */ + public function disableDebugging() + { + $this->debugging = false; + } + + /** + * Parse the PSR-7 Response body + * + * @param ResponseInterface $response + * @return \stdClass|null + * @throws ApiException + */ + private function parseResponseBody(ResponseInterface $response) + { + $body = (string) $response->getBody(); + if (empty($body)) { + if ($response->getStatusCode() === self::HTTP_NO_CONTENT) { + return null; + } + + throw new ApiException("No response body found."); + } + + $object = @json_decode($body); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw new ApiException("Unable to decode Mollie response: '{$body}'."); + } + + if ($response->getStatusCode() >= 400) { + throw ApiException::createFromResponse($response, null); + } + + return $object; + } + + /** + * The version number for the underlying http client, if available. This is used to report the UserAgent to Mollie, + * for convenient support. + * @example Guzzle/6.3 + * + * @return string|null + */ + public function versionString() + { + if (defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { // Guzzle 7 + return "Guzzle/" . ClientInterface::MAJOR_VERSION; + } elseif (defined('\GuzzleHttp\ClientInterface::VERSION')) { // Before Guzzle 7 + return "Guzzle/" . ClientInterface::VERSION; + } + + return null; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php new file mode 100644 index 000000000..b6d8cb73e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php @@ -0,0 +1,83 @@ +newRetryDecider(), + $delay ? $this->getRetryDelay() : $this->getZeroRetryDelay() + ); + } + + /** + * Returns a method that takes the number of retries and returns the number of milliseconds + * to wait + * + * @return callable + */ + private function getRetryDelay() + { + return function ($numberOfRetries) { + return static::DELAY_INCREASE_MS * $numberOfRetries; + }; + } + + /** + * Returns a method that returns zero milliseconds to wait + * + * @return callable + */ + private function getZeroRetryDelay() + { + return function ($numberOfRetries) { + return 0; + }; + } + + /** + * @return callable + */ + private function newRetryDecider() + { + return function ( + $retries, + Request $request, + Response $response = null, + TransferException $exception = null + ) { + if ($retries >= static::MAX_RETRIES) { + return false; + } + + if ($exception instanceof ConnectException) { + return true; + } + + return false; + }; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterInterface.php b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterInterface.php new file mode 100644 index 000000000..226bbef85 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterInterface.php @@ -0,0 +1,26 @@ +guzzleIsDetected()) { + $guzzleVersion = $this->guzzleMajorVersionNumber(); + + if ($guzzleVersion && in_array($guzzleVersion, [6, 7])) { + return Guzzle6And7MollieHttpAdapter::createDefault(); + } + } + + return new CurlMollieHttpAdapter; + } + + if ($httpClient instanceof MollieHttpAdapterInterface) { + return $httpClient; + } + + if ($httpClient instanceof \GuzzleHttp\ClientInterface) { + return new Guzzle6And7MollieHttpAdapter($httpClient); + } + + throw new UnrecognizedClientException('The provided http client or adapter was not recognized.'); + } + + /** + * @return bool + */ + private function guzzleIsDetected() + { + return interface_exists('\\' . \GuzzleHttp\ClientInterface::class); + } + + /** + * @return int|null + */ + private function guzzleMajorVersionNumber() + { + // Guzzle 7 + if (defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { + return (int) \GuzzleHttp\ClientInterface::MAJOR_VERSION; + } + + // Before Guzzle 7 + if (defined('\GuzzleHttp\ClientInterface::VERSION')) { + return (int) \GuzzleHttp\ClientInterface::VERSION[0]; + } + + return null; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterPickerInterface.php b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterPickerInterface.php new file mode 100644 index 000000000..b91542d61 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/HttpAdapter/MollieHttpAdapterPickerInterface.php @@ -0,0 +1,13 @@ +length = $length; + } + + /** + * @throws \Mollie\Api\Exceptions\IncompatiblePlatform + * @return string + */ + public function generate() + { + $length = $this->length; + + $string = ''; + + while (($len = strlen($string)) < $length) { + $size = $length - $len; + + try { + $bytes = random_bytes($size); + } catch (\Exception $e) { + throw new IncompatiblePlatform( + 'PHP function random_bytes missing. Consider overriding the DefaultIdempotencyKeyGenerator with your own.', + IncompatiblePlatform::INCOMPATIBLE_RANDOM_BYTES_FUNCTION + ); + } + + $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); + } + + return $string; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Idempotency/FakeIdempotencyKeyGenerator.php b/vendor_manual/mollie/mollie-api-php/src/Idempotency/FakeIdempotencyKeyGenerator.php new file mode 100644 index 000000000..95871939f --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Idempotency/FakeIdempotencyKeyGenerator.php @@ -0,0 +1,21 @@ +fakeKey = $fakeKey; + } + + public function generate() + { + return $this->fakeKey; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Idempotency/IdempotencyKeyGeneratorContract.php b/vendor_manual/mollie/mollie-api-php/src/Idempotency/IdempotencyKeyGeneratorContract.php new file mode 100644 index 000000000..6ffe80ca6 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Idempotency/IdempotencyKeyGeneratorContract.php @@ -0,0 +1,7 @@ +httpClient = $httpAdapterPicker->pickHttpAdapter($httpClient); + + $compatibilityChecker = new CompatibilityChecker; + $compatibilityChecker->checkCompatibility(); + + $this->initializeEndpoints(); + $this->initializeVersionStrings(); + $this->initializeIdempotencyKeyGenerator($idempotencyKeyGenerator); + } + + public function initializeEndpoints() + { + $this->payments = new PaymentEndpoint($this); + $this->methods = new MethodEndpoint($this); + $this->profileMethods = new ProfileMethodEndpoint($this); + $this->customers = new CustomerEndpoint($this); + $this->settlements = new SettlementsEndpoint($this); + $this->settlementPayments = new SettlementPaymentEndpoint($this); + $this->subscriptions = new SubscriptionEndpoint($this); + $this->customerPayments = new CustomerPaymentsEndpoint($this); + $this->mandates = new MandateEndpoint($this); + $this->balances = new BalanceEndpoint($this); + $this->balanceTransactions = new BalanceTransactionEndpoint($this); + $this->balanceReports = new BalanceReportEndpoint($this); + $this->invoices = new InvoiceEndpoint($this); + $this->permissions = new PermissionEndpoint($this); + $this->profiles = new ProfileEndpoint($this); + $this->onboarding = new OnboardingEndpoint($this); + $this->organizations = new OrganizationEndpoint($this); + $this->orders = new OrderEndpoint($this); + $this->orderLines = new OrderLineEndpoint($this); + $this->orderPayments = new OrderPaymentEndpoint($this); + $this->orderRefunds = new OrderRefundEndpoint($this); + $this->shipments = new ShipmentEndpoint($this); + $this->refunds = new RefundEndpoint($this); + $this->paymentRefunds = new PaymentRefundEndpoint($this); + $this->paymentCaptures = new PaymentCaptureEndpoint($this); + $this->paymentRoutes = new PaymentRouteEndpoint($this); + $this->chargebacks = new ChargebackEndpoint($this); + $this->paymentChargebacks = new PaymentChargebackEndpoint($this); + $this->wallets = new WalletEndpoint($this); + $this->paymentLinks = new PaymentLinkEndpoint($this); + $this->terminals = new TerminalEndpoint($this); + $this->organizationPartners = new OrganizationPartnerEndpoint($this); + $this->clients = new ClientEndpoint($this); + $this->clientLinks = new ClientLinkEndpoint($this); + } + + protected function initializeVersionStrings() + { + $this->addVersionString("Mollie/" . self::CLIENT_VERSION); + $this->addVersionString("PHP/" . phpversion()); + + $httpClientVersionString = $this->httpClient->versionString(); + if ($httpClientVersionString) { + $this->addVersionString($httpClientVersionString); + } + } + + /** + * @param \Mollie\Api\Idempotency\IdempotencyKeyGeneratorContract $generator + * @return void + */ + protected function initializeIdempotencyKeyGenerator($generator) + { + $this->idempotencyKeyGenerator = $generator ? $generator : new DefaultIdempotencyKeyGenerator; + } + + /** + * @param string $url + * + * @return MollieApiClient + */ + public function setApiEndpoint($url) + { + $this->apiEndpoint = rtrim(trim($url), '/'); + + return $this; + } + + /** + * @return string + */ + public function getApiEndpoint() + { + return $this->apiEndpoint; + } + + /** + * @return array + */ + public function getVersionStrings() + { + return $this->versionStrings; + } + + /** + * @param string $apiKey The Mollie API key, starting with 'test_' or 'live_' + * + * @return MollieApiClient + * @throws ApiException + */ + public function setApiKey($apiKey) + { + $apiKey = trim($apiKey); + + if (! preg_match('/^(live|test)_\w{30,}$/', $apiKey)) { + throw new ApiException("Invalid API key: '{$apiKey}'. An API key must start with 'test_' or 'live_' and must be at least 30 characters long."); + } + + $this->apiKey = $apiKey; + $this->oauthAccess = false; + + return $this; + } + + /** + * @param string $accessToken OAuth access token, starting with 'access_' + * + * @return MollieApiClient + * @throws ApiException + */ + public function setAccessToken($accessToken) + { + $accessToken = trim($accessToken); + + if (! preg_match('/^access_\w+$/', $accessToken)) { + throw new ApiException("Invalid OAuth access token: '{$accessToken}'. An access token must start with 'access_'."); + } + + $this->apiKey = $accessToken; + $this->oauthAccess = true; + + return $this; + } + + /** + * Returns null if no API key has been set yet. + * + * @return bool|null + */ + public function usesOAuth() + { + return $this->oauthAccess; + } + + /** + * @param string $versionString + * + * @return MollieApiClient + */ + public function addVersionString($versionString) + { + $this->versionStrings[] = str_replace([" ", "\t", "\n", "\r"], '-', $versionString); + + return $this; + } + + /** + * Enable debugging mode. If debugging mode is enabled, the attempted request will be included in the ApiException. + * By default, debugging is disabled to prevent leaking sensitive request data into exception logs. + * + * @throws \Mollie\Api\Exceptions\HttpAdapterDoesNotSupportDebuggingException + */ + public function enableDebugging() + { + if ( + ! method_exists($this->httpClient, 'supportsDebugging') + || ! $this->httpClient->supportsDebugging() + ) { + throw new HttpAdapterDoesNotSupportDebuggingException( + "Debugging is not supported by " . get_class($this->httpClient) . "." + ); + } + + $this->httpClient->enableDebugging(); + } + + /** + * Disable debugging mode. If debugging mode is enabled, the attempted request will be included in the ApiException. + * By default, debugging is disabled to prevent leaking sensitive request data into exception logs. + * + * @throws \Mollie\Api\Exceptions\HttpAdapterDoesNotSupportDebuggingException + */ + public function disableDebugging() + { + if ( + ! method_exists($this->httpClient, 'supportsDebugging') + || ! $this->httpClient->supportsDebugging() + ) { + throw new HttpAdapterDoesNotSupportDebuggingException( + "Debugging is not supported by " . get_class($this->httpClient) . "." + ); + } + + $this->httpClient->disableDebugging(); + } + + /** + * Set the idempotency key used on the next request. The idempotency key is a unique string ensuring a request to a + * mutating Mollie endpoint is processed only once. The idempotency key resets to null after each request. Using + * the setIdempotencyKey method supersedes the IdempotencyKeyGenerator. + * + * @param $key + * @return $this + */ + public function setIdempotencyKey($key) + { + $this->idempotencyKey = $key; + + return $this; + } + + /** + * Retrieve the idempotency key. The idempotency key is a unique string ensuring a request to a + * mutating Mollie endpoint is processed only once. Note that the idempotency key gets reset to null after each + * request. + * + * @return string|null + */ + public function getIdempotencyKey() + { + return $this->idempotencyKey; + } + + /** + * Reset the idempotency key. Note that the idempotency key automatically resets to null after each request. + * @return $this + */ + public function resetIdempotencyKey() + { + $this->idempotencyKey = null; + + return $this; + } + + /** + * @param \Mollie\Api\Idempotency\IdempotencyKeyGeneratorContract $generator + * @return \Mollie\Api\MollieApiClient + */ + public function setIdempotencyKeyGenerator($generator) + { + $this->idempotencyKeyGenerator = $generator; + + return $this; + } + + /** + * @return \Mollie\Api\MollieApiClient + */ + public function clearIdempotencyKeyGenerator() + { + $this->idempotencyKeyGenerator = null; + + return $this; + } + + /** + * Perform a http call. This method is used by the resource specific classes. Please use the $payments property to + * perform operations on payments. + * + * @param string $httpMethod + * @param string $apiMethod + * @param string|null $httpBody + * + * @return \stdClass + * @throws ApiException + * + * @codeCoverageIgnore + */ + public function performHttpCall($httpMethod, $apiMethod, $httpBody = null) + { + $url = $this->apiEndpoint . "/" . self::API_VERSION . "/" . $apiMethod; + + return $this->performHttpCallToFullUrl($httpMethod, $url, $httpBody); + } + + /** + * Perform a http call to a full url. This method is used by the resource specific classes. + * + * @see $payments + * @see $isuers + * + * @param string $httpMethod + * @param string $url + * @param string|null $httpBody + * + * @return \stdClass|null + * @throws ApiException + * + * @codeCoverageIgnore + */ + public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null) + { + if (empty($this->apiKey)) { + throw new ApiException("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key."); + } + + $userAgent = implode(' ', $this->versionStrings); + + if ($this->usesOAuth()) { + $userAgent .= " OAuth/2.0"; + } + + $headers = [ + 'Accept' => "application/json", + 'Authorization' => "Bearer {$this->apiKey}", + 'User-Agent' => $userAgent, + ]; + + if ($httpBody !== null) { + $headers['Content-Type'] = "application/json"; + } + + if (function_exists("php_uname")) { + $headers['X-Mollie-Client-Info'] = php_uname(); + } + + $headers = $this->applyIdempotencyKey($headers, $httpMethod); + + $response = $this->httpClient->send($httpMethod, $url, $headers, $httpBody); + + $this->resetIdempotencyKey(); + + return $response; + } + + /** + * Conditionally apply the idempotency key to the request headers + * + * @param array $headers + * @param string $httpMethod + * @return array + */ + private function applyIdempotencyKey(array $headers, string $httpMethod) + { + if (! in_array($httpMethod, [self::HTTP_POST, self::HTTP_PATCH, self::HTTP_DELETE])) { + unset($headers['Idempotency-Key']); + + return $headers; + } + + if ($this->idempotencyKey) { + $headers['Idempotency-Key'] = $this->idempotencyKey; + + return $headers; + } + + if ($this->idempotencyKeyGenerator) { + $headers['Idempotency-Key'] = $this->idempotencyKeyGenerator->generate(); + + return $headers; + } + + unset($headers['Idempotency-Key']); + + return $headers; + } + + /** + * Serialization can be used for caching. Of course doing so can be dangerous but some like to live dangerously. + * + * \serialize() should be called on the collections or object you want to cache. + * + * We don't need any property that can be set by the constructor, only properties that are set by setters. + * + * Note that the API key is not serialized, so you need to set the key again after unserializing if you want to do + * more API calls. + * + * @deprecated + * @return string[] + */ + public function __sleep() + { + return ["apiEndpoint"]; + } + + /** + * When unserializing a collection or a resource, this class should restore itself. + * + * Note that if you have set an HttpAdapter, this adapter is lost on wakeup and reset to the default one. + * + * @throws IncompatiblePlatform If suddenly unserialized on an incompatible platform. + */ + public function __wakeup() + { + $this->__construct(); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Balance.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Balance.php new file mode 100644 index 000000000..c84ad5678 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Balance.php @@ -0,0 +1,114 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/BalanceReport.php b/vendor_manual/mollie/mollie-api-php/src/Resources/BalanceReport.php new file mode 100644 index 000000000..96479f742 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/BalanceReport.php @@ -0,0 +1,80 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/BaseCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/BaseCollection.php new file mode 100644 index 000000000..fd43b87a6 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/BaseCollection.php @@ -0,0 +1,34 @@ +count = $count; + $this->_links = $_links; + parent::__construct(); + } + + /** + * @return string|null + */ + abstract public function getCollectionResourceName(); +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/BaseResource.php b/vendor_manual/mollie/mollie-api-php/src/Resources/BaseResource.php new file mode 100644 index 000000000..d5762ccfd --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/BaseResource.php @@ -0,0 +1,31 @@ +client = $client; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Capture.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Capture.php new file mode 100644 index 000000000..2fc7c4e5e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Capture.php @@ -0,0 +1,71 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Chargeback.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Chargeback.php new file mode 100644 index 000000000..d55b6da09 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Chargeback.php @@ -0,0 +1,75 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Client.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Client.php new file mode 100644 index 000000000..ed226421b --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Client.php @@ -0,0 +1,36 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/ClientLink.php b/vendor_manual/mollie/mollie-api-php/src/Resources/ClientLink.php new file mode 100644 index 000000000..36ac0b7a3 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/ClientLink.php @@ -0,0 +1,49 @@ + $client_id, + 'state' => $state, + 'approval_prompt' => $approval_prompt, + 'scope' => implode(' ', $scopes), + ], '', '&', PHP_QUERY_RFC3986); + + return "{$this->_links->clientLink->href}?{$query}"; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/CurrentProfile.php b/vendor_manual/mollie/mollie-api-php/src/Resources/CurrentProfile.php new file mode 100644 index 000000000..b351fa92e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/CurrentProfile.php @@ -0,0 +1,34 @@ +client->profileMethods->createForCurrentProfile($methodId, $data); + } + + /** + * Disable a payment method for this profile. + * + * @param string $methodId + * @param array $data + * @return Method + * @throws ApiException + */ + public function disableMethod($methodId, array $data = []) + { + return $this->client->profileMethods->deleteForCurrentProfile($methodId, $data); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/CursorCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/CursorCollection.php new file mode 100644 index 000000000..e32653351 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/CursorCollection.php @@ -0,0 +1,96 @@ +client = $client; + } + + /** + * @return BaseResource + */ + abstract protected function createResourceObject(); + + /** + * Return the next set of resources when available + * + * @return CursorCollection|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + final public function next() + { + if (! $this->hasNext()) { + return null; + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->next->href); + + $collection = new static($this->client, $result->count, $result->_links); + + foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) { + $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject()); + } + + return $collection; + } + + /** + * Return the previous set of resources when available + * + * @return CursorCollection|null + * @throws \Mollie\Api\Exceptions\ApiException + */ + final public function previous() + { + if (! $this->hasPrevious()) { + return null; + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->previous->href); + + $collection = new static($this->client, $result->count, $result->_links); + + foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) { + $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject()); + } + + return $collection; + } + + /** + * Determine whether the collection has a next page available. + * + * @return bool + */ + public function hasNext() + { + return isset($this->_links->next->href); + } + + /** + * Determine whether the collection has a previous page available. + * + * @return bool + */ + public function hasPrevious() + { + return isset($this->_links->previous->href); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Customer.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Customer.php new file mode 100644 index 000000000..98fc7443d --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Customer.php @@ -0,0 +1,250 @@ + $this->name, + "email" => $this->email, + "locale" => $this->locale, + "metadata" => $this->metadata, + ]; + + $result = $this->client->customers->update($this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Customer($this->client)); + } + + /** + * @param array $options + * @param array $filters + * + * @return Payment + * @throws ApiException + */ + public function createPayment(array $options = [], array $filters = []) + { + return $this->client->customerPayments->createFor($this, $this->withPresetOptions($options), $filters); + } + + /** + * Get all payments for this customer + * + * @return PaymentCollection + * @throws ApiException + */ + public function payments() + { + return $this->client->customerPayments->listFor($this, null, null, $this->getPresetOptions()); + } + + /** + * @param array $options + * @param array $filters + * + * @return Subscription + * @throws ApiException + */ + public function createSubscription(array $options = [], array $filters = []) + { + return $this->client->subscriptions->createFor($this, $this->withPresetOptions($options), $filters); + } + + /** + * @param string $subscriptionId + * @param array $parameters + * + * @return Subscription + * @throws ApiException + */ + public function getSubscription($subscriptionId, array $parameters = []) + { + return $this->client->subscriptions->getFor($this, $subscriptionId, $this->withPresetOptions($parameters)); + } + + /** + * @param string $subscriptionId + * + * @return null + * @throws ApiException + */ + public function cancelSubscription($subscriptionId) + { + return $this->client->subscriptions->cancelFor($this, $subscriptionId, $this->getPresetOptions()); + } + + /** + * Get all subscriptions for this customer + * + * @return SubscriptionCollection + * @throws ApiException + */ + public function subscriptions() + { + return $this->client->subscriptions->listFor($this, null, null, $this->getPresetOptions()); + } + + /** + * @param array $options + * @param array $filters + * + * @return Mandate + * @throws ApiException + */ + public function createMandate(array $options = [], array $filters = []) + { + return $this->client->mandates->createFor($this, $this->withPresetOptions($options), $filters); + } + + /** + * @param string $mandateId + * @param array $parameters + * + * @return Mandate + * @throws ApiException + */ + public function getMandate($mandateId, array $parameters = []) + { + return $this->client->mandates->getFor($this, $mandateId, $parameters); + } + + /** + * @param string $mandateId + * + * @return null + * @throws ApiException + */ + public function revokeMandate($mandateId) + { + return $this->client->mandates->revokeFor($this, $mandateId, $this->getPresetOptions()); + } + + /** + * Get all mandates for this customer + * + * @return MandateCollection + * @throws ApiException + */ + public function mandates() + { + return $this->client->mandates->listFor($this, null, null, $this->getPresetOptions()); + } + + /** + * Helper function to check for mandate with status valid + * + * @return bool + */ + public function hasValidMandate() + { + $mandates = $this->mandates(); + foreach ($mandates as $mandate) { + if ($mandate->isValid()) { + return true; + } + } + + return false; + } + + /** + * Helper function to check for specific payment method mandate with status valid + * + * @return bool + */ + public function hasValidMandateForMethod($method) + { + $mandates = $this->mandates(); + foreach ($mandates as $mandate) { + if ($mandate->method === $method && $mandate->isValid()) { + return true; + } + } + + return false; + } + + /** + * When accessed by oAuth we want to pass the testmode by default + * + * @return array + */ + private function getPresetOptions() + { + $options = []; + if ($this->client->usesOAuth()) { + $options["testmode"] = $this->mode === "test" ? true : false; + } + + return $options; + } + + /** + * Apply the preset options. + * + * @param array $options + * @return array + */ + private function withPresetOptions(array $options) + { + return array_merge($this->getPresetOptions(), $options); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/CustomerCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/CustomerCollection.php new file mode 100644 index 000000000..deece5770 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/CustomerCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Invoice.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Invoice.php new file mode 100644 index 000000000..70b86e775 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Invoice.php @@ -0,0 +1,109 @@ +status == InvoiceStatus::STATUS_PAID; + } + + /** + * @return bool + */ + public function isOpen() + { + return $this->status == InvoiceStatus::STATUS_OPEN; + } + + /** + * @return bool + */ + public function isOverdue() + { + return $this->status == InvoiceStatus::STATUS_OVERDUE; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/InvoiceCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/InvoiceCollection.php new file mode 100644 index 000000000..3278dd082 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/InvoiceCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Issuer.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Issuer.php new file mode 100644 index 000000000..357238c81 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Issuer.php @@ -0,0 +1,35 @@ +status === MandateStatus::STATUS_VALID; + } + + /** + * @return bool + */ + public function isPending() + { + return $this->status === MandateStatus::STATUS_PENDING; + } + + /** + * @return bool + */ + public function isInvalid() + { + return $this->status === MandateStatus::STATUS_INVALID; + } + + /** + * Revoke the mandate + * + * @return null|\stdClass|\Mollie\Api\Resources\Mandate + */ + public function revoke() + { + if (! isset($this->_links->self->href)) { + return $this; + } + + $body = null; + if ($this->client->usesOAuth()) { + $body = json_encode([ + "testmode" => $this->mode === "test" ? true : false, + ]); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_DELETE, + $this->_links->self->href, + $body + ); + + return $result; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/MandateCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/MandateCollection.php new file mode 100644 index 000000000..23d39d16c --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/MandateCollection.php @@ -0,0 +1,40 @@ +client); + } + + /** + * @param string $status + * @return array|\Mollie\Api\Resources\MandateCollection + */ + public function whereStatus($status) + { + $collection = new self($this->client, 0, $this->_links); + + foreach ($this as $item) { + if ($item->status === $status) { + $collection[] = $item; + $collection->count++; + } + } + + return $collection; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Method.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Method.php new file mode 100644 index 000000000..fac587437 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Method.php @@ -0,0 +1,100 @@ +size1x and $image->size2x to display the payment method logo. + * + * @var \stdClass + */ + public $image; + + /** + * The issuers available for this payment method. Only for the methods iDEAL, KBC/CBC and gift cards. + * Will only be filled when explicitly requested using the query string `include` parameter. + * + * @var array|object[] + */ + public $issuers; + + /** + * The pricing for this payment method. Will only be filled when explicitly requested using the query string + * `include` parameter. + * + * @var array|object[] + */ + public $pricing; + + /** + * The activation status the method is in. + * If the method has status "null", this value will be returned as a null value, not as a string. + * + * @var string | null + */ + public $status; + + /** + * @var \stdClass + */ + public $_links; + + /** + * Get the issuer value objects + * + * @return IssuerCollection + */ + public function issuers() + { + return ResourceFactory::createBaseResourceCollection( + $this->client, + Issuer::class, + $this->issuers + ); + } + + /** + * Get the method price value objects. + * + * @return MethodPriceCollection + */ + public function pricing() + { + return ResourceFactory::createBaseResourceCollection( + $this->client, + MethodPrice::class, + $this->pricing + ); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/MethodCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/MethodCollection.php new file mode 100644 index 000000000..a1f204109 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/MethodCollection.php @@ -0,0 +1,14 @@ +status === OnboardingStatus::NEEDS_DATA; + } + + /** + * @return bool + */ + public function isInReview() + { + return $this->status === OnboardingStatus::IN_REVIEW; + } + + /** + * @return bool + */ + public function isCompleted() + { + return $this->status === OnboardingStatus::COMPLETED; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Order.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Order.php new file mode 100644 index 000000000..349a2c3df --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Order.php @@ -0,0 +1,570 @@ +status === OrderStatus::STATUS_CREATED; + } + + /** + * Is this order paid for? + * + * @return bool + */ + public function isPaid() + { + return $this->status === OrderStatus::STATUS_PAID; + } + + /** + * Is this order authorized? + * + * @return bool + */ + public function isAuthorized() + { + return $this->status === OrderStatus::STATUS_AUTHORIZED; + } + + /** + * Is this order canceled? + * + * @return bool + */ + public function isCanceled() + { + return $this->status === OrderStatus::STATUS_CANCELED; + } + + /** + * (Deprecated) Is this order refunded? + * @deprecated 2018-11-27 + * + * @return bool + */ + public function isRefunded() + { + return $this->status === OrderStatus::STATUS_REFUNDED; + } + + /** + * Is this order shipping? + * + * @return bool + */ + public function isShipping() + { + return $this->status === OrderStatus::STATUS_SHIPPING; + } + + /** + * Is this order completed? + * + * @return bool + */ + public function isCompleted() + { + return $this->status === OrderStatus::STATUS_COMPLETED; + } + + /** + * Is this order expired? + * + * @return bool + */ + public function isExpired() + { + return $this->status === OrderStatus::STATUS_EXPIRED; + } + + /** + * Is this order completed? + * + * @return bool + */ + public function isPending() + { + return $this->status === OrderStatus::STATUS_PENDING; + } + + /** + * Cancels this order. + * If the order was partially shipped, the status will be "completed" instead of + * "canceled". + * Will throw a ApiException if the order id is invalid or the resource cannot + * be found. + * + * @return Order + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancel() + { + return $this->client->orders->cancel($this->id, $this->getPresetOptions()); + } + + /** + * Cancel a line for this order. + * The data array must contain a lines array. + * You can pass an empty lines array if you want to cancel all eligible lines. + * Returns null if successful. + * + * @param array $data + * @return null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancelLines(array $data) + { + return $this->client->orderLines->cancelFor($this, $data); + } + + /** + * Cancels all eligible lines for this order. + * Returns null if successful. + * + * @param array|null $data + * @return null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancelAllLines($data = []) + { + $data['lines'] = []; + + return $this->client->orderLines->cancelFor($this, $data); + } + + /** + * Get the line value objects + * + * @return OrderLineCollection + */ + public function lines() + { + return ResourceFactory::createBaseResourceCollection( + $this->client, + OrderLine::class, + $this->lines + ); + } + + /** + * Create a shipment for some order lines. You can provide an empty array for the + * "lines" option to include all unshipped lines for this order. + * + * @param array $options + * + * @return Shipment + * @throws ApiException + */ + public function createShipment(array $options = []) + { + return $this->client->shipments->createFor($this, $this->withPresetOptions($options)); + } + + /** + * Create a shipment for all unshipped order lines. + * + * @param array $options + * + * @return Shipment + */ + public function shipAll(array $options = []) + { + $options['lines'] = []; + + return $this->createShipment($options); + } + + /** + * Retrieve a specific shipment for this order. + * + * @param string $shipmentId + * @param array $parameters + * + * @return Shipment + * @throws ApiException + */ + public function getShipment($shipmentId, array $parameters = []) + { + return $this->client->shipments->getFor($this, $shipmentId, $this->withPresetOptions($parameters)); + } + + /** + * Get all shipments for this order. + * + * @param array $parameters + * + * @return ShipmentCollection + * @throws ApiException + */ + public function shipments(array $parameters = []) + { + return $this->client->shipments->listFor($this, $this->withPresetOptions($parameters)); + } + + /** + * Get the checkout URL where the customer can complete the payment. + * + * @return string|null + */ + public function getCheckoutUrl() + { + if (empty($this->_links->checkout)) { + return null; + } + + return $this->_links->checkout->href; + } + + /** + * Refund specific order lines. + * + * @param array $data + * @return Refund + * @throws ApiException + */ + public function refund(array $data) + { + return $this->client->orderRefunds->createFor($this, $this->withPresetOptions($data)); + } + + /** + * Refund all eligible order lines. + * + * @param array $data + * @return Refund + */ + public function refundAll(array $data = []) + { + $data['lines'] = []; + + return $this->refund($data); + } + + /** + * Retrieves all refunds associated with this order + * + * @return RefundCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function refunds() + { + if (! isset($this->_links->refunds->href)) { + return new RefundCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->refunds, + Refund::class, + $result->_links + ); + } + + /** + * Saves the order's updated billingAddress and/or shippingAddress. + * + * @return \Mollie\Api\Resources\Order + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function update() + { + $body = [ + "billingAddress" => $this->billingAddress, + "shippingAddress" => $this->shippingAddress, + "orderNumber" => $this->orderNumber, + "redirectUrl" => $this->redirectUrl, + "cancelUrl" => $this->cancelUrl, + "webhookUrl" => $this->webhookUrl, + ]; + + $result = $this->client->orders->update($this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Order($this->client)); + } + + /** + * Create a new payment for this Order. + * + * @param array $data + * @param array $filters + * @return \Mollie\Api\Resources\Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function createPayment($data, $filters = []) + { + return $this->client->orderPayments->createFor($this, $data, $filters); + } + + /** + * Retrieve the payments for this order. + * Requires the order to be retrieved using the embed payments parameter. + * + * @return null|\Mollie\Api\Resources\PaymentCollection + */ + public function payments() + { + if (! isset($this->_embedded, $this->_embedded->payments)) { + return null; + } + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $this->_embedded->payments, + Payment::class + ); + } + + /** + * When accessed by oAuth we want to pass the testmode by default + * + * @return array + */ + private function getPresetOptions() + { + $options = []; + if ($this->client->usesOAuth()) { + $options["testmode"] = $this->mode === "test" ? true : false; + } + + return $options; + } + + /** + * Apply the preset options. + * + * @param array $options + * @return array + */ + private function withPresetOptions(array $options) + { + return array_merge($this->getPresetOptions(), $options); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/OrderCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderCollection.php new file mode 100644 index 000000000..ff5fad80c --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLine.php b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLine.php new file mode 100644 index 000000000..aa700feb2 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLine.php @@ -0,0 +1,420 @@ +_links->productUrl)) { + return null; + } + + return $this->_links->productUrl; + } + + /** + * Get the image URL of the product sold. + * + * @return string|null + */ + public function getImageUrl() + { + if (empty($this->_links->imageUrl)) { + return null; + } + + return $this->_links->imageUrl; + } + + /** + * Is this order line created? + * + * @return bool + */ + public function isCreated() + { + return $this->status === OrderLineStatus::STATUS_CREATED; + } + + /** + * Is this order line paid for? + * + * @return bool + */ + public function isPaid() + { + return $this->status === OrderLineStatus::STATUS_PAID; + } + + /** + * Is this order line authorized? + * + * @return bool + */ + public function isAuthorized() + { + return $this->status === OrderLineStatus::STATUS_AUTHORIZED; + } + + /** + * Is this order line canceled? + * + * @return bool + */ + public function isCanceled() + { + return $this->status === OrderLineStatus::STATUS_CANCELED; + } + + /** + * (Deprecated) Is this order line refunded? + * @deprecated 2018-11-27 + * + * @return bool + */ + public function isRefunded() + { + return $this->status === OrderLineStatus::STATUS_REFUNDED; + } + + /** + * Is this order line shipping? + * + * @return bool + */ + public function isShipping() + { + return $this->status === OrderLineStatus::STATUS_SHIPPING; + } + + /** + * Is this order line completed? + * + * @return bool + */ + public function isCompleted() + { + return $this->status === OrderLineStatus::STATUS_COMPLETED; + } + + /** + * Is this order line for a physical product? + * + * @return bool + */ + public function isPhysical() + { + return $this->type === OrderLineType::TYPE_PHYSICAL; + } + + /** + * Is this order line for applying a discount? + * + * @return bool + */ + public function isDiscount() + { + return $this->type === OrderLineType::TYPE_DISCOUNT; + } + + /** + * Is this order line for a digital product? + * + * @return bool + */ + public function isDigital() + { + return $this->type === OrderLineType::TYPE_DIGITAL; + } + + /** + * Is this order line for applying a shipping fee? + * + * @return bool + */ + public function isShippingFee() + { + return $this->type === OrderLineType::TYPE_SHIPPING_FEE; + } + + /** + * Is this order line for store credit? + * + * @return bool + */ + public function isStoreCredit() + { + return $this->type === OrderLineType::TYPE_STORE_CREDIT; + } + + /** + * Is this order line for a gift card? + * + * @return bool + */ + public function isGiftCard() + { + return $this->type === OrderLineType::TYPE_GIFT_CARD; + } + + /** + * Is this order line for a surcharge? + * + * @return bool + */ + public function isSurcharge() + { + return $this->type === OrderLineType::TYPE_SURCHARGE; + } + + /** + * Update an orderline by supplying one or more parameters in the data array + * + * @return BaseResource + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function update() + { + $result = $this->client->orderLines->update($this->orderId, $this->id, $this->getUpdateData()); + + return ResourceFactory::createFromApiResult($result, new Order($this->client)); + } + + /** + * Get sanitized array of order line data + * + * @return array + */ + public function getUpdateData() + { + $data = [ + "name" => $this->name, + 'imageUrl' => $this->imageUrl, + 'productUrl' => $this->productUrl, + 'metadata' => $this->metadata, + 'sku' => $this->sku, + 'quantity' => $this->quantity, + 'unitPrice' => $this->unitPrice, + 'discountAmount' => $this->discountAmount, + 'totalAmount' => $this->totalAmount, + 'vatAmount' => $this->vatAmount, + 'vatRate' => $this->vatRate, + ]; + + // Explicitly filter only NULL values to keep "vatRate => 0" intact + return array_filter($data, function ($value) { + return $value !== null; + }); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLineCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLineCollection.php new file mode 100644 index 000000000..d2f8bc285 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/OrderLineCollection.php @@ -0,0 +1,32 @@ +id === $lineId) { + return $line; + } + } + + return null; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Organization.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Organization.php new file mode 100644 index 000000000..209f9e3af --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Organization.php @@ -0,0 +1,70 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Partner.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Partner.php new file mode 100644 index 000000000..2c00ac1f1 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Partner.php @@ -0,0 +1,50 @@ +consumerName and $details->consumerAccount. + * + * @var \stdClass|null + */ + public $details; + + /** + * Used to restrict the payment methods available to your customer to those from a single country. + * + * @var string|null; + */ + public $restrictPaymentMethodsToCountry; + + /** + * @var \stdClass + */ + public $_links; + + /** + * @var \stdClass[] + */ + public $_embedded; + + /** + * Whether or not this payment can be canceled. + * + * @var bool|null + */ + public $isCancelable; + + /** + * The total amount that is already captured for this payment. Only available + * when this payment supports captures. + * + * @var \stdClass|null + */ + public $amountCaptured; + + /** + * Indicates whether the capture will be scheduled automatically or not. Set + * to manual to capture the payment manually using the Create capture endpoint. + * + * Possible values: "automatic", "manual" + * + * @var string|null + */ + public $captureMode; + + /** + * Indicates the interval to wait before the payment is + * captured, for example `8 hours` or `2 days. The capture delay + * will be added to the date and time the payment became authorized. + * + * Possible values: ... hours ... days + * @example 8 hours + * @var string|null + */ + public $captureDelay; + + /** + * UTC datetime on which the merchant has to have captured the payment in + * ISO-8601 format. This parameter is omitted if the payment is not authorized (yet). + * + * @example "2013-12-25T10:30:54+00:00" + * @var string|null + */ + public $captureBefore; + + /** + * The application fee, if the payment was created with one. Contains amount + * (the value and currency) and description. + * + * @var \stdClass|null + */ + public $applicationFee; + + /** + * An optional routing configuration which enables you to route a successful payment, + * or part of the payment, to one or more connected accounts. Additionally, you can + * schedule (parts of) the payment to become available on the connected account on a + * future date. + * + * @var array|null + */ + public $routing; + + /** + * The date and time the payment became authorized, in ISO 8601 format. This + * parameter is omitted if the payment is not authorized (yet). + * + * @example "2013-12-25T10:30:54+00:00" + * @var string|null + */ + public $authorizedAt; + + /** + * The date and time the payment was expired, in ISO 8601 format. This + * parameter is omitted if the payment did not expire (yet). + * + * @example "2013-12-25T10:30:54+00:00" + * @var string|null + */ + public $expiredAt; + + /** + * If a customer was specified upon payment creation, the customer’s token will + * be available here as well. + * + * @example cst_XPn78q9CfT + * @var string|null + */ + public $customerId; + + /** + * This optional field contains your customer’s ISO 3166-1 alpha-2 country code, + * detected by us during checkout. For example: BE. This field is omitted if the + * country code was not detected. + * + * @var string|null + */ + public $countryCode; + + /** + * Is this payment canceled? + * + * @return bool + */ + public function isCanceled() + { + return $this->status === PaymentStatus::STATUS_CANCELED; + } + + /** + * Is this payment expired? + * + * @return bool + */ + public function isExpired() + { + return $this->status === PaymentStatus::STATUS_EXPIRED; + } + + /** + * Is this payment still open / ongoing? + * + * @return bool + */ + public function isOpen() + { + return $this->status === PaymentStatus::STATUS_OPEN; + } + + /** + * Is this payment pending? + * + * @return bool + */ + public function isPending() + { + return $this->status === PaymentStatus::STATUS_PENDING; + } + + /** + * Is this payment authorized? + * + * @return bool + */ + public function isAuthorized() + { + return $this->status === PaymentStatus::STATUS_AUTHORIZED; + } + + /** + * Is this payment paid for? + * + * @return bool + */ + public function isPaid() + { + return ! empty($this->paidAt); + } + + /** + * Does the payment have refunds + * + * @return bool + */ + public function hasRefunds() + { + return ! empty($this->_links->refunds); + } + + /** + * Does this payment has chargebacks + * + * @return bool + */ + public function hasChargebacks() + { + return ! empty($this->_links->chargebacks); + } + + /** + * Is this payment failing? + * + * @return bool + */ + public function isFailed() + { + return $this->status === PaymentStatus::STATUS_FAILED; + } + + /** + * Check whether 'sequenceType' is set to 'first'. If a 'first' payment has been + * completed successfully, the consumer's account may be charged automatically + * using recurring payments. + * + * @return bool + */ + public function hasSequenceTypeFirst() + { + return $this->sequenceType === SequenceType::SEQUENCETYPE_FIRST; + } + + /** + * Check whether 'sequenceType' is set to 'recurring'. This type of payment is + * processed without involving + * the consumer. + * + * @return bool + */ + public function hasSequenceTypeRecurring() + { + return $this->sequenceType === SequenceType::SEQUENCETYPE_RECURRING; + } + + /** + * Get the checkout URL where the customer can complete the payment. + * + * @return string|null + */ + public function getCheckoutUrl() + { + if (empty($this->_links->checkout)) { + return null; + } + + return $this->_links->checkout->href; + } + + /** + * Get the mobile checkout URL where the customer can complete the payment. + * + * @return string|null + */ + public function getMobileAppCheckoutUrl() + { + if (empty($this->_links->mobileAppCheckout)) { + return null; + } + + return $this->_links->mobileAppCheckout->href; + } + + /** + * @return bool + */ + public function canBeRefunded() + { + return $this->amountRemaining !== null; + } + + /** + * @return bool + */ + public function canBePartiallyRefunded() + { + return $this->canBeRefunded(); + } + + /** + * Get the amount that is already refunded + * + * @return float + */ + public function getAmountRefunded() + { + if ($this->amountRefunded) { + return (float)$this->amountRefunded->value; + } + + return 0.0; + } + + /** + * Get the remaining amount that can be refunded. For some payment methods this + * amount can be higher than the payment amount. This is possible to reimburse + * the costs for a return shipment to your customer for example. + * + * @return float + */ + public function getAmountRemaining() + { + if ($this->amountRemaining) { + return (float)$this->amountRemaining->value; + } + + return 0.0; + } + + /** + * Get the total amount that was charged back for this payment. Only available when the + * total charged back amount is not zero. + * + * @return float + */ + public function getAmountChargedBack() + { + if ($this->amountChargedBack) { + return (float)$this->amountChargedBack->value; + } + + return 0.0; + } + + /** + * Does the payment have split payments + * + * @return bool + */ + public function hasSplitPayments() + { + return ! empty($this->routing); + } + + /** + * Retrieves all refunds associated with this payment + * + * @return RefundCollection + * @throws ApiException + */ + public function refunds() + { + if (! isset($this->_links->refunds->href)) { + return new RefundCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_GET, + $this->_links->refunds->href + ); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->refunds, + Refund::class, + $result->_links + ); + } + + /** + * @param string $refundId + * @param array $parameters + * + * @return Refund + * @throws ApiException + */ + public function getRefund($refundId, array $parameters = []) + { + return $this->client->paymentRefunds->getFor($this, $refundId, $this->withPresetOptions($parameters)); + } + + /** + * @param array $parameters + * + * @return Refund + * @throws ApiException + */ + public function listRefunds(array $parameters = []) + { + return $this->client->paymentRefunds->listFor($this, $this->withPresetOptions($parameters)); + } + + /** + * Retrieves all captures associated with this payment + * + * @return CaptureCollection + * @throws ApiException + */ + public function captures() + { + if (! isset($this->_links->captures->href)) { + return new CaptureCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_GET, + $this->_links->captures->href + ); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->captures, + Capture::class, + $result->_links + ); + } + + /** + * @param string $captureId + * @param array $parameters + * + * @return Capture + * @throws ApiException + */ + public function getCapture($captureId, array $parameters = []) + { + return $this->client->paymentCaptures->getFor( + $this, + $captureId, + $this->withPresetOptions($parameters) + ); + } + + /** + * Retrieves all chargebacks associated with this payment + * + * @return ChargebackCollection + * @throws ApiException + */ + public function chargebacks() + { + if (! isset($this->_links->chargebacks->href)) { + return new ChargebackCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_GET, + $this->_links->chargebacks->href + ); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->chargebacks, + Chargeback::class, + $result->_links + ); + } + + /** + * Retrieves a specific chargeback for this payment. + * + * @param string $chargebackId + * @param array $parameters + * + * @return Chargeback + * @throws ApiException + */ + public function getChargeback($chargebackId, array $parameters = []) + { + return $this->client->paymentChargebacks->getFor( + $this, + $chargebackId, + $this->withPresetOptions($parameters) + ); + } + + /** + * Issue a refund for this payment. + * + * @param array $data + * + * @return \Mollie\Api\Resources\Refund + * @throws ApiException + */ + public function refund($data) + { + return $this->client->paymentRefunds->createFor($this, $data); + } + + /** + * @return \Mollie\Api\Resources\Payment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function update() + { + $body = [ + "description" => $this->description, + "cancelUrl" => $this->cancelUrl, + "redirectUrl" => $this->redirectUrl, + "webhookUrl" => $this->webhookUrl, + "metadata" => $this->metadata, + "restrictPaymentMethodsToCountry" => $this->restrictPaymentMethodsToCountry, + "locale" => $this->locale, + "dueDate" => $this->dueDate, + ]; + + $result = $this->client->payments->update($this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Payment($this->client)); + } + + /** + * When accessed by oAuth we want to pass the testmode by default + * + * @return array + */ + private function getPresetOptions() + { + $options = []; + if ($this->client->usesOAuth()) { + $options["testmode"] = $this->mode === "test" ? true : false; + } + + return $options; + } + + /** + * Apply the preset options. + * + * @param array $options + * @return array + */ + private function withPresetOptions(array $options) + { + return array_merge($this->getPresetOptions(), $options); + } + + /** + * The total amount that is already captured for this payment. Only available + * when this payment supports captures. + * + * @return float + */ + public function getAmountCaptured() + { + if ($this->amountCaptured) { + return (float)$this->amountCaptured->value; + } + + return 0.0; + } + + /** + * The amount that has been settled. + * + * @return float + */ + public function getSettlementAmount() + { + if ($this->settlementAmount) { + return (float)$this->settlementAmount->value; + } + + return 0.0; + } + + /** + * The total amount that is already captured for this payment. Only available + * when this payment supports captures. + * + * @return float + */ + public function getApplicationFeeAmount() + { + if ($this->applicationFee) { + return (float)$this->applicationFee->amount->value; + } + + return 0.0; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentCollection.php new file mode 100644 index 000000000..892deb1be --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLink.php b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLink.php new file mode 100644 index 000000000..cd64ed7d9 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLink.php @@ -0,0 +1,127 @@ +paidAt); + } + + /** + * Get the checkout URL where the customer can complete the payment. + * + * @return string|null + */ + public function getCheckoutUrl() + { + if (empty($this->_links->paymentLink)) { + return null; + } + + return $this->_links->paymentLink->href; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLinkCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLinkCollection.php new file mode 100644 index 000000000..061f1f665 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/PaymentLinkCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Permission.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Permission.php new file mode 100644 index 000000000..fe0761d0a --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Permission.php @@ -0,0 +1,27 @@ +status == ProfileStatus::STATUS_UNVERIFIED; + } + + /** + * @return bool + */ + public function isVerified() + { + return $this->status == ProfileStatus::STATUS_VERIFIED; + } + + /** + * @return bool + */ + public function isBlocked() + { + return $this->status == ProfileStatus::STATUS_BLOCKED; + } + + /** + * @return \Mollie\Api\Resources\Profile + * @throws ApiException + */ + public function update() + { + $body = [ + "name" => $this->name, + "website" => $this->website, + "email" => $this->email, + "phone" => $this->phone, + "businessCategory" => $this->businessCategory, + "mode" => $this->mode, + ]; + + $result = $this->client->profiles->update($this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Profile($this->client)); + } + + /** + * Retrieves all chargebacks associated with this profile + * + * @return ChargebackCollection + * @throws ApiException + */ + public function chargebacks() + { + if (! isset($this->_links->chargebacks->href)) { + return new ChargebackCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->chargebacks->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->chargebacks, + Chargeback::class, + $result->_links + ); + } + + /** + * Retrieves all methods activated on this profile + * + * @return MethodCollection + * @throws ApiException + */ + public function methods() + { + if (! isset($this->_links->methods->href)) { + return new MethodCollection(0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->methods->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->methods, + Method::class, + $result->_links + ); + } + + /** + * Enable a payment method for this profile. + * + * @param string $methodId + * @param array $data + * @return Method + * @throws ApiException + */ + public function enableMethod($methodId, array $data = []) + { + return $this->client->profileMethods->createFor($this, $methodId, $data); + } + + /** + * Disable a payment method for this profile. + * + * @param string $methodId + * @param array $data + * @return Method + * @throws ApiException + */ + public function disableMethod($methodId, array $data = []) + { + return $this->client->profileMethods->deleteFor($this, $methodId, $data); + } + + /** + * Retrieves all payments associated with this profile + * + * @return PaymentCollection + * @throws ApiException + */ + public function payments() + { + if (! isset($this->_links->payments->href)) { + return new PaymentCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->payments->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->methods, + Method::class, + $result->_links + ); + } + + /** + * Retrieves all refunds associated with this profile + * + * @return RefundCollection + * @throws ApiException + */ + public function refunds() + { + if (! isset($this->_links->refunds->href)) { + return new RefundCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->refunds, + Refund::class, + $result->_links + ); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/ProfileCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/ProfileCollection.php new file mode 100644 index 000000000..536926b37 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/ProfileCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Refund.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Refund.php new file mode 100644 index 000000000..651b13f13 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Refund.php @@ -0,0 +1,177 @@ +isQueued() || $this->isPending(); + } + + /** + * Is this refund queued? + * + * @return bool + */ + public function isQueued() + { + return $this->status === RefundStatus::STATUS_QUEUED; + } + + /** + * Is this refund pending? + * + * @return bool + */ + public function isPending() + { + return $this->status === RefundStatus::STATUS_PENDING; + } + + /** + * Is this refund processing? + * + * @return bool + */ + public function isProcessing() + { + return $this->status === RefundStatus::STATUS_PROCESSING; + } + + /** + * Is this refund transferred to consumer? + * + * @return bool + */ + public function isTransferred() + { + return $this->status === RefundStatus::STATUS_REFUNDED; + } + + /** + * Is this refund failed? + * + * @return bool + */ + public function isFailed() + { + return $this->status === RefundStatus::STATUS_FAILED; + } + + /** + * Is this refund canceled? + * + * @return bool + */ + public function isCanceled() + { + return $this->status === RefundStatus::STATUS_CANCELED; + } + + /** + * Cancel the refund. + * Returns null if successful. + * + * @return null + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancel() + { + $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_DELETE, + $this->_links->self->href + ); + + return null; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/RefundCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/RefundCollection.php new file mode 100644 index 000000000..01b55a3ce --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/RefundCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/ResourceFactory.php b/vendor_manual/mollie/mollie-api-php/src/Resources/ResourceFactory.php new file mode 100644 index 000000000..bd418e6c2 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/ResourceFactory.php @@ -0,0 +1,79 @@ + $value) { + $resource->{$property} = $value; + } + + return $resource; + } + + /** + * @param MollieApiClient $client + * @param string $resourceClass + * @param array $data + * @param null $_links + * @param string $resourceCollectionClass + * @return mixed + */ + public static function createBaseResourceCollection( + MollieApiClient $client, + $resourceClass, + $data, + $_links = null, + $resourceCollectionClass = null + ) { + $resourceCollectionClass = $resourceCollectionClass ?: $resourceClass . 'Collection'; + $data = $data ?: []; + + $result = new $resourceCollectionClass(count($data), $_links); + foreach ($data as $item) { + $result[] = static::createFromApiResult($item, new $resourceClass($client)); + } + + return $result; + } + + /** + * @param MollieApiClient $client + * @param array $input + * @param string $resourceClass + * @param null $_links + * @param null $resourceCollectionClass + * @return mixed + */ + public static function createCursorResourceCollection( + $client, + array $input, + $resourceClass, + $_links = null, + $resourceCollectionClass = null + ) { + if (null === $resourceCollectionClass) { + $resourceCollectionClass = $resourceClass.'Collection'; + } + + $data = new $resourceCollectionClass($client, count($input), $_links); + foreach ($input as $item) { + $data[] = static::createFromApiResult($item, new $resourceClass($client)); + } + + return $data; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Route.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Route.php new file mode 100644 index 000000000..20b119d34 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Route.php @@ -0,0 +1,35 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Settlement.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Settlement.php new file mode 100644 index 000000000..8bdef55ac --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Settlement.php @@ -0,0 +1,192 @@ +status === SettlementStatus::STATUS_OPEN; + } + + /** + * Is this settlement pending? + * + * @return bool + */ + public function isPending() + { + return $this->status === SettlementStatus::STATUS_PENDING; + } + + /** + * Is this settlement paidout? + * + * @return bool + */ + public function isPaidout() + { + return $this->status === SettlementStatus::STATUS_PAIDOUT; + } + + /** + * Is this settlement failed? + * + * @return bool + */ + public function isFailed() + { + return $this->status === SettlementStatus::STATUS_FAILED; + } + + /** + * Retrieves all payments associated with this settlement + * + * @param int|null $limit + * @param array $parameters + * @return PaymentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function payments(int $limit = null, array $parameters = []): PaymentCollection + { + return $this->client->settlementPayments->pageForId($this->id, null, $limit, $parameters); + } + + /** + * Retrieves all refunds associated with this settlement + * + * @return RefundCollection + * @throws ApiException + */ + public function refunds() + { + if (! isset($this->_links->refunds->href)) { + return new RefundCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->refunds, + Refund::class, + $result->_links + ); + } + + /** + * Retrieves all chargebacks associated with this settlement + * + * @return ChargebackCollection + * @throws ApiException + */ + public function chargebacks() + { + if (! isset($this->_links->chargebacks->href)) { + return new ChargebackCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->chargebacks->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->chargebacks, + Chargeback::class, + $result->_links + ); + } + + /** + * Retrieves all captures associated with this settlement + * + * @return CaptureCollection + * @throws ApiException + */ + public function captures() + { + if (! isset($this->_links->captures->href)) { + return new CaptureCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->captures->href); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->captures, + Capture::class, + $result->_links + ); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/SettlementCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/SettlementCollection.php new file mode 100644 index 000000000..f8910b6f6 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/SettlementCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Shipment.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Shipment.php new file mode 100644 index 000000000..01c1e9ae4 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Shipment.php @@ -0,0 +1,124 @@ +tracking !== null; + } + + /** + * Does this shipment offer a track and trace code? + * + * @return bool + */ + public function hasTrackingUrl() + { + return $this->hasTracking() && ! empty($this->tracking->url); + } + + /** + * Retrieve the track and trace url. Returns null if there is no url available. + * + * @return string|null + */ + public function getTrackingUrl() + { + if (! $this->hasTrackingUrl()) { + return null; + } + + return $this->tracking->url; + } + + /** + * Get the line value objects + * + * @return OrderLineCollection + */ + public function lines() + { + return ResourceFactory::createBaseResourceCollection( + $this->client, + OrderLine::class, + $this->lines + ); + } + + /** + * Get the Order object for this shipment + * + * @return Order + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function order() + { + return $this->client->orders->get($this->orderId); + } + + /** + * Save changes made to this shipment. + * + * @return BaseResource|Shipment + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function update() + { + $body = [ + "tracking" => $this->tracking, + ]; + + $result = $this->client->shipments->update($this->orderId, $this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Shipment($this->client)); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/ShipmentCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/ShipmentCollection.php new file mode 100644 index 000000000..b87f3453e --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/ShipmentCollection.php @@ -0,0 +1,14 @@ + $this->amount, + "times" => $this->times, + "startDate" => $this->startDate, + "webhookUrl" => $this->webhookUrl, + "description" => $this->description, + "mandateId" => $this->mandateId, + "metadata" => $this->metadata, + "interval" => $this->interval, + ]; + + $result = $this->client->subscriptions->update($this->customerId, $this->id, $body); + + return ResourceFactory::createFromApiResult($result, new Subscription($this->client)); + } + + /** + * Returns whether the Subscription is active or not. + * + * @return bool + */ + public function isActive() + { + return $this->status === SubscriptionStatus::STATUS_ACTIVE; + } + + /** + * Returns whether the Subscription is pending or not. + * + * @return bool + */ + public function isPending() + { + return $this->status === SubscriptionStatus::STATUS_PENDING; + } + + /** + * Returns whether the Subscription is canceled or not. + * + * @return bool + */ + public function isCanceled() + { + return $this->status === SubscriptionStatus::STATUS_CANCELED; + } + + /** + * Returns whether the Subscription is suspended or not. + * + * @return bool + */ + public function isSuspended() + { + return $this->status === SubscriptionStatus::STATUS_SUSPENDED; + } + + /** + * Returns whether the Subscription is completed or not. + * + * @return bool + */ + public function isCompleted() + { + return $this->status === SubscriptionStatus::STATUS_COMPLETED; + } + + /** + * Cancels this subscription + * + * @return Subscription + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function cancel() + { + if (! isset($this->_links->self->href)) { + return $this; + } + + $body = null; + if ($this->client->usesOAuth()) { + $body = json_encode([ + "testmode" => $this->mode === "test" ? true : false, + ]); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_DELETE, + $this->_links->self->href, + $body + ); + + return ResourceFactory::createFromApiResult($result, new Subscription($this->client)); + } + + /** + * Get subscription payments + * + * @return \Mollie\Api\Resources\PaymentCollection + * @throws \Mollie\Api\Exceptions\ApiException + */ + public function payments() + { + if (! isset($this->_links->payments->href)) { + return new PaymentCollection($this->client, 0, null); + } + + $result = $this->client->performHttpCallToFullUrl( + MollieApiClient::HTTP_GET, + $this->_links->payments->href + ); + + return ResourceFactory::createCursorResourceCollection( + $this->client, + $result->_embedded->payments, + Payment::class, + $result->_links + ); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/SubscriptionCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/SubscriptionCollection.php new file mode 100644 index 000000000..848130895 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/SubscriptionCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/Terminal.php b/vendor_manual/mollie/mollie-api-php/src/Resources/Terminal.php new file mode 100644 index 000000000..a2fd3b436 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/Terminal.php @@ -0,0 +1,157 @@ +status === TerminalStatus::STATUS_PENDING; + } + + /** + * @return bool + */ + public function isActive() + { + return $this->status === TerminalStatus::STATUS_ACTIVE; + } + + /** + * @return bool + */ + public function isInactive() + { + return $this->status === TerminalStatus::STATUS_INACTIVE; + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Resources/TerminalCollection.php b/vendor_manual/mollie/mollie-api-php/src/Resources/TerminalCollection.php new file mode 100644 index 000000000..af785a6e2 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Resources/TerminalCollection.php @@ -0,0 +1,22 @@ +client); + } +} diff --git a/vendor_manual/mollie/mollie-api-php/src/Types/ApprovalPrompt.php b/vendor_manual/mollie/mollie-api-php/src/Types/ApprovalPrompt.php new file mode 100644 index 000000000..3aff39844 --- /dev/null +++ b/vendor_manual/mollie/mollie-api-php/src/Types/ApprovalPrompt.php @@ -0,0 +1,14 @@ +