Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

13
modules/ps_checkout/.env Normal file
View File

@@ -0,0 +1,13 @@
PAYPAL_CLIENT_ID_LIVE="AXjYFXWyb4xJCErTUDiFkzL0Ulnn-bMm4fal4G-1nQXQ1ZQxp06fOuE7naKUXGkq2TZpYSiI9xXbs4eo"
PAYPAL_CLIENT_ID_SANDBOX="AWZMaFOTMPjG2oXFw1GqSp1hlrlFUTupuNqX0A0NJA_df0rcGQbyD9VwNAudXiRcAbSaePPPJ4FvgTqi"
CHECKOUT_API_URL_LIVE=https://api-live.checkout.prestashop.com
CHECKOUT_API_URL_SANDBOX=https://api-sandbox.checkout.prestashop.com
PAYMENT_API_URL_LIVE="https://api-live-checkout.psessentials.net/"
PAYMENT_API_URL_SANDBOX="https://api-sandbox-checkout.psessentials.net/"
CHECKOUT_BO_SDK_URL=https://assets.prestashop3.com/ext/checkout-sdk/backoffice/
CHECKOUT_BO_SDK_VERSION="4.X.X"
CHECKOUT_FO_SDK_URL=https://assets.prestashop3.com/ext/checkout-sdk/frontoffice/
CHECKOUT_FO_SDK_VERSION="4.X.X"
PAYPAL_BN_CODE=PrestaShop_Cart_PSXO_PSDownload
TRACKING_API_URL_LIVE=https://api-live-v2.checkout.prestashop.com/tracking-api/v1/
TRACKING_API_URL_SANDBOX=https://api-sandbox-v2.checkout.prestashop.com/tracking-api/v1/

View File

@@ -0,0 +1,15 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
<Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico|webp|woff|woff2|ttf|eot|otf|css|js)$">
Allow from all
</Files>
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
<Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico|webp|woff|woff2|ttf|eot|otf|css|js)$">
Require all granted
</Files>
</IfModule>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

170
modules/ps_checkout/LICENSE Normal file
View File

@@ -0,0 +1,170 @@
Academic Free License (“AFL”) v. 3.0
This Academic Free License (the "License") applies to any original work of
authorship (the "Original Work") whose owner (the "Licensor") has placed the
following licensing notice adjacent to the copyright notice for the Original
Work:
Licensed under the Academic Free License version 3.0
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
non-exclusive, sublicensable license, for the duration of the copyright, to do
the following:
a) to reproduce the Original Work in copies, either alone or as part of a
collective work;
b) to translate, adapt, alter, transform, modify, or arrange the Original
Work, thereby creating derivative works ("Derivative Works") based upon
the Original Work;
c) to distribute or communicate copies of the Original Work and
Derivative Works to the public, under any license of your choice that
does not contradict the terms and conditions, including Licensors
reserved rights and remedies, in this Academic Free License;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
non-exclusive, sublicensable license, under patent claims owned or controlled
by the Licensor that are embodied in the Original Work as furnished by the
Licensor, for the duration of the patents, to make, use, sell, offer for sale,
have made, and import the Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the preferred
form of the Original Work for making modifications to it and all available
documentation describing how to modify the Original Work. Licensor agrees to
provide a machine-readable copy of the Source Code of the Original Work along
with each copy of the Original Work that Licensor distributes. Licensor
reserves the right to satisfy this obligation by placing a machine-readable
copy of the Source Code in an information repository reasonably calculated to
permit inexpensive and convenient access by You for as long as Licensor
continues to distribute the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
of any contributors to the Original Work, nor any of their trademarks or
service marks, may be used to endorse or promote products derived from this
Original Work without express prior permission of the Licensor. Except as
expressly stated herein, nothing in this License grants any license to
Licensors trademarks, copyrights, patents, trade secrets or any other
intellectual property. No patent license is granted to make, use, sell, offer
for sale, have made, or import embodiments of any patent claims other than the
licensed claims defined in Section 2. No license is granted to the trademarks
of Licensor even if such marks are included in the Original Work. Nothing in
this License shall be interpreted to prohibit Licensor from licensing under
terms different from this License any Original Work that Licensor otherwise
would have a right to license.
5) External Deployment. The term "External Deployment" means the use,
distribution, or communication of the Original Work or Derivative Works in any
way such that the Original Work or Derivative Works may be used by anyone
other than You, whether those works are distributed or communicated to those
persons or made available as an application intended for use over a network.
As an express condition for the grants of license hereunder, You must treat
any External Deployment by You of the Original Work or a Derivative Work as a
distribution under section 1(c).
6) Attribution Rights. You must retain, in the Source Code of any Derivative
Works that You create, all copyright, patent, or trademark notices from the
Source Code of the Original Work, as well as any notices of licensing and any
descriptive text identified therein as an "Attribution Notice." You must cause
the Source Code for any Derivative Works that You create to carry a prominent
Attribution Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
the copyright in and to the Original Work and the patent rights granted herein
by Licensor are owned by the Licensor or are sublicensed to You under the
terms of this License with the permission of the contributor(s) of those
copyrights and patent rights. Except as expressly stated in the immediately
preceding sentence, the Original Work is provided under this License on an "AS
IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
limitation, the warranties of non-infringement, merchantability or fitness for
a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
License. No license to the Original Work is granted by this License except
under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal theory,
whether in tort (including negligence), contract, or otherwise, shall the
Licensor be liable to anyone for any indirect, special, incidental, or
consequential damages of any character arising as a result of this License or
the use of the Original Work including, without limitation, damages for loss
of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses. This limitation of liability shall not
apply to the extent applicable law prohibits such limitation.
9) Acceptance and Termination. If, at any time, You expressly assented to this
License, that assent indicates your clear and irrevocable acceptance of this
License and all of its terms and conditions. If You distribute or communicate
copies of the Original Work or a Derivative Work, You must make a reasonable
effort under the circumstances to obtain the express assent of recipients to
the terms of this License. This License conditions your rights to undertake
the activities listed in Section 1, including your right to create Derivative
Works based upon the Original Work, and doing so without honoring these terms
and conditions is prohibited by copyright law and international treaty.
Nothing in this License is intended to affect copyright exceptions and
limitations (including “fair use” or “fair dealing”). This License shall
terminate immediately and You may no longer exercise any of the rights granted
to You by this License upon your failure to honor the conditions in Section
1(c).
10) Termination for Patent Action. This License shall terminate automatically
and You may no longer exercise any of the rights granted to You by this
License as of the date You commence an action, including a cross-claim or
counterclaim, against Licensor or any licensee alleging that the Original Work
infringes a patent. This termination provision shall not apply for an action
alleging patent infringement by combinations of the Original Work with other
software or hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides or in which Licensor conducts its primary business, and under
the laws of that jurisdiction excluding its conflict-of-law provisions. The
application of the United Nations Convention on Contracts for the
International Sale of Goods is expressly excluded. Any use of the Original
Work outside the scope of this License or after its termination shall be
subject to the requirements and penalties of copyright or patent law in the
appropriate jurisdiction. This section shall survive the termination of this
License.
12) Attorneys Fees. In any action to enforce the terms of this License or
seeking damages relating thereto, the prevailing party shall be entitled to
recover its costs and expenses, including, without limitation, reasonable
attorneys' fees and costs incurred in connection with such action, including
any appeal of such action. This section shall survive the termination of this
License.
13) Miscellaneous. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent necessary
to make it enforceable.
14) Definition of "You" in This License. "You" throughout this License,
whether in upper or lower case, means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this License.
For legal entities, "You" includes any entity that controls, is controlled by,
or is under common control with you. For purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (ii) ownership
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
15) Right to Use. You may use the Original Work in all ways not otherwise
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
16) Modification of This License. This License is Copyright © 2005 Lawrence
Rosen. Permission is granted to copy, distribute, or communicate this License
without modification. Nothing in this License permits You to modify this
License as applied to the Original Work or to Derivative Works. However, You
may modify the text of this License and copy, distribute or communicate your
modified version (the "Modified License") and apply it to other original works
of authorship subject to the following conditions: (i) You may not indicate in
any way that your Modified License is the "Academic Free License" or "AFL" and
you may not use those names in the name of your Modified License; (ii) You
must replace the notice specified in the first paragraph above with the notice
"Licensed under <insert your license name here>" or with a notice of your own
that is not confusingly similar to the notice in this License; and (iii) You
may not claim that your original works are open source software unless your
Modified License has been approved by Open Source Initiative (OSI) and You
comply with its license review and certification process.

5113
modules/ps_checkout/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_checkout</name>
<displayName><![CDATA[PrestaShop Checkout]]></displayName>
<version><![CDATA[9.5.1.1]]></version>
<description><![CDATA[Provide the most commonly used payment methods to your customers in this all-in-one module, and manage all your sales in a centralized interface.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall this module?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,49 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Bootstrap\Install\Installer:
class: PsCheckout\Infrastructure\Bootstrap\Install\Installer
arguments:
- '@PsCheckout\Infrastructure\Bootstrap\Install\ConfigurationInstaller'
- '@PsCheckout\Infrastructure\Bootstrap\Install\DatabaseTableInstaller'
- '@PsCheckout\Infrastructure\Bootstrap\Install\FundingSourceInstaller'
- '@PsCheckout\Infrastructure\Bootstrap\Install\OrderStateInstaller'
- '@PsCheckout\Infrastructure\Bootstrap\Install\CompatibilityRulesInstaller'
PsCheckout\Infrastructure\Bootstrap\Install\ConfigurationInstaller:
class: PsCheckout\Infrastructure\Bootstrap\Install\ConfigurationInstaller
arguments:
- '@PsCheckout\Infrastructure\Repository\ShopRepository'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Infrastructure\Bootstrap\Install\DatabaseTableInstaller:
class: PsCheckout\Infrastructure\Bootstrap\Install\DatabaseTableInstaller
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Bootstrap\Install\FundingSourceInstaller:
class: PsCheckout\Infrastructure\Bootstrap\Install\FundingSourceInstaller
arguments:
- '@PsCheckout\Infrastructure\Repository\ShopRepository'
- '@PsCheckout\Infrastructure\Repository\FundingSourceRepository'
PsCheckout\Infrastructure\Bootstrap\Install\OrderStateInstaller:
class: PsCheckout\Infrastructure\Bootstrap\Install\OrderStateInstaller
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Language'
- '@=service("ps_checkout.module").name'
PsCheckout\Infrastructure\Bootstrap\Install\CompatibilityRulesInstaller:
class: PsCheckout\Infrastructure\Bootstrap\Install\CompatibilityRulesInstaller
arguments:
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\CurrencyRepository'
PsCheckout\Infrastructure\Bootstrap\Install\ApplePayInstaller:
class: 'PsCheckout\Infrastructure\Bootstrap\Install\ApplePayInstaller'
public: true
arguments:
- '@PsCheckout\Infrastructure\Adapter\SystemConfiguration'
- '@PsCheckout\Infrastructure\Adapter\Configuration'

View File

@@ -0,0 +1,60 @@
services:
_defaults:
public: true
PsCheckout\Presentation\Presenter\Settings\Admin\AdminSettingsPresenter:
class: PsCheckout\Presentation\Presenter\Settings\Admin\AdminSettingsPresenter
arguments:
- [
'@PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ContextModule',
'@PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ConfigurationModule',
'@PsCheckout\Presentation\Presenter\Settings\Admin\Modules\PaypalModule',
]
PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ContextModule:
class: PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ContextModule
arguments:
- '@=service("ps_checkout.module").name'
- '@=service("ps_checkout.module").version'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Environment\Env'
PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ConfigurationModule:
class: PsCheckout\Presentation\Presenter\Settings\Admin\Modules\ConfigurationModule
arguments:
- '@=service("ps_checkout.module").id'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter'
- '@=service("PsCheckout\\Infrastructure\\Adapter\\Context").getShop().id'
PsCheckout\Presentation\Presenter\Settings\Admin\Modules\PaypalModule:
class: PsCheckout\Presentation\Presenter\Settings\Admin\Modules\PaypalModule
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTransactionPresenter:
class: PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTransactionPresenter
arguments:
- '@PsCheckout\Presentation\Presenter\Date\DatePresenter'
- '@PsCheckout\Module\Presentation\Translator'
PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTotalsPresenter:
class: PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTotalsPresenter
PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderPresenter:
class: PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderPresenter
arguments:
- '@PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTransactionPresenter'
- '@PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderTotalsPresenter'
- '@PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator'
- '@PsCheckout\Presentation\Presenter\FundingSource\LogoPresenter'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
- '@PsCheckout\Module\Presentation\Translator'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
PsCheckout\Presentation\Presenter\Date\DatePresenter:
class: PsCheckout\Presentation\Presenter\Date\DatePresenter
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'

View File

@@ -0,0 +1,8 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Action\SaveBatchConfigurationActionInterface:
class: PsCheckout\Infrastructure\Action\SaveBatchConfigurationAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'

View File

@@ -0,0 +1,11 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Repository\ShopRepository:
class: PsCheckout\Infrastructure\Repository\ShopRepository
PsCheckout\Infrastructure\Repository\PaymentTokenRepository:
class: PsCheckout\Infrastructure\Repository\PaymentTokenRepository
arguments:
- '@ps_checkout.db'

View File

@@ -0,0 +1,10 @@
imports:
- { resource: ../common.yml }
- { resource: install.yml }
- { resource: presenter.yml }
- { resource: repository.yml }
- { resource: process.yml }
services:
_defaults:
public: true

View File

@@ -0,0 +1,51 @@
imports:
- { resource: shared/api.yml }
- { resource: shared/account.yml }
- { resource: shared/factory.yml }
- { resource: shared/adapter.yml }
- { resource: shared/repository.yml }
- { resource: shared/presenter.yml }
- { resource: shared/provider.yml }
- { resource: shared/logger.yml }
- { resource: shared/configuration.yml }
- { resource: shared/builder.yml }
- { resource: shared/validator.yml }
- { resource: shared/process.yml }
- { resource: shared/cache.yml }
services:
_defaults:
public: true
ps_checkout.module:
class: 'ps_checkout'
factory: [ 'Module', 'getInstanceByName' ]
arguments:
- 'ps_checkout'
ps_checkout.db:
class: Db
factory: [ 'Db', 'getInstance' ]
# Env loader
PsCheckout\Infrastructure\Environment\EnvLoader:
class: PsCheckout\Infrastructure\Environment\EnvLoader
PsCheckout\Infrastructure\Environment\Env:
class: PsCheckout\Infrastructure\Environment\Env
arguments:
- '@=service("ps_checkout.module").name'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\Webhook\Service\WebhookSecretToken:
class: PsCheckout\Core\Webhook\Service\WebhookSecretToken
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\OrderState\Service\OrderStateMapper:
class: PsCheckout\Core\OrderState\Service\OrderStateMapper
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Utility\Common\InputStreamUtility:
class: PsCheckout\Utility\Common\InputStreamUtility

View File

@@ -0,0 +1,17 @@
services:
_defaults:
public: true
PsCheckout\Core\PayPal\GooglePay\Builder\GooglePayPaymentRequestDataBuilder:
class: 'PsCheckout\Core\PayPal\GooglePay\Builder\GooglePayPaymentRequestDataBuilder'
arguments:
- '@PsCheckout\Core\Order\Builder\OrderPayloadBuilder'
- '@PsCheckout\Presentation\Presenter\Cart\CartPresenter'
- '@PsCheckout\Module\Presentation\Translator'
PsCheckout\Core\PayPal\ApplePay\Builder\ApplePayPaymentRequestDataBuilder:
class: 'PsCheckout\Core\PayPal\ApplePay\Builder\ApplePayPaymentRequestDataBuilder'
arguments:
- '@PsCheckout\Core\Order\Builder\OrderPayloadBuilder'
- '@PsCheckout\Presentation\Presenter\Cart\CartPresenter'
- '@PsCheckout\Module\Presentation\Translator'

View File

@@ -0,0 +1,17 @@
services:
_defaults:
public: true
PsCheckout\Core\Settings\Configuration\PayPalSdkConfiguration:
class: PsCheckout\Core\Settings\Configuration\PayPalSdkConfiguration
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\Settings\Configuration\PayPalConfiguration'
- '@PsCheckout\Infrastructure\Environment\Env'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter'
- '@PsCheckout\Infrastructure\Repository\PayPalCustomerRepository'
- '@PsCheckout\Core\PayPal\OAuth\OAuthService'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration'

View File

@@ -0,0 +1,22 @@
services:
_defaults:
public: true
PsCheckout\Core\Webhook\Handler\WebhookEventConfigurationUpdatedHandler:
class: PsCheckout\Core\Webhook\Handler\WebhookEventConfigurationUpdatedHandler
public: true
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\Webhook\Handler\WebhookHandler:
class: PsCheckout\Core\Webhook\Handler\WebhookHandler
arguments:
- '@PsCheckout\Core\Webhook\Service\WebhookSecretToken'
- [ '@PsCheckout\Core\Webhook\Handler\WebhookEventConfigurationUpdatedHandler' ]
PsCheckout\Core\Order\Exception\Handler\OrderCreationExceptionHandler:
class: PsCheckout\Core\Order\Exception\Handler\OrderCreationExceptionHandler
arguments:
- '@PsCheckout\Module\Presentation\Translator'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Infrastructure\Action\CustomerNotifyAction'

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,83 @@
services:
_defaults:
public: true
PsCheckout\Presentation\Presenter\Settings\Front\FrontSettingsPresenter:
class: PsCheckout\Presentation\Presenter\Settings\Front\FrontSettingsPresenter
arguments:
- [
'@PsCheckout\Presentation\Presenter\Settings\Front\Modules\PayPalModule',
'@PsCheckout\Presentation\Presenter\Settings\Front\Modules\ConfigurationModule',
'@PsCheckout\Presentation\Presenter\Settings\Front\Modules\MediaModule',
'@PsCheckout\Presentation\Presenter\Settings\Front\Modules\LinkModule',
'@PsCheckout\Presentation\Presenter\Settings\Front\Modules\TranslationModule',
]
PsCheckout\Presentation\Presenter\Settings\Front\SupportedCardBrandsPresenter:
class: PsCheckout\Presentation\Presenter\Settings\Front\SupportedCardBrandsPresenter
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
PsCheckout\Presentation\Presenter\Settings\Front\Modules\PayPalModule:
class: PsCheckout\Presentation\Presenter\Settings\Front\Modules\PayPalModule
arguments:
- '@=service("ps_checkout.module").name'
- '@=service("ps_checkout.module").version'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Environment\Env'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTokenPresenter'
- '@PsCheckout\Presentation\Presenter\Settings\Front\SupportedCardBrandsPresenter'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
PsCheckout\Presentation\Presenter\Settings\Front\Modules\ConfigurationModule:
class: PsCheckout\Presentation\Presenter\Settings\Front\Modules\ConfigurationModule
arguments:
- '@=service("ps_checkout.module").name'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\Settings\Configuration\PayPalConfiguration'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter'
- '@PsCheckout\Core\Settings\Configuration\PayPalSdkConfiguration'
- '@PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration'
- '@PsCheckout\Infrastructure\Validator\PayLaterValidator'
PsCheckout\Presentation\Presenter\Settings\Front\Modules\MediaModule:
class: PsCheckout\Presentation\Presenter\Settings\Front\Modules\MediaModule
arguments:
- '@=service("ps_checkout.module").name'
- '@=service("ps_checkout.module").getPathUri()'
PsCheckout\Presentation\Presenter\Settings\Front\Modules\LinkModule:
class: PsCheckout\Presentation\Presenter\Settings\Front\Modules\LinkModule
arguments:
- '@=service("ps_checkout.module").name'
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@PsCheckout\Infrastructure\Adapter\Tools'
PsCheckout\Presentation\Presenter\Settings\Front\Modules\TranslationModule:
class: PsCheckout\Presentation\Presenter\Settings\Front\Modules\TranslationModule
arguments:
- '@=service("ps_checkout.module").name'
- '@PsCheckout\Module\Presentation\Translator'
PsCheckout\Presentation\Presenter\Cart\CartPresenter:
class: PsCheckout\Presentation\Presenter\Cart\CartPresenter
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Address'
- '@PsCheckout\Infrastructure\Adapter\Currency'
- '@PsCheckout\Infrastructure\Repository\LanguageRepository'
- '@PsCheckout\Infrastructure\Repository\CustomerRepository'
PsCheckout\Presentation\Presenter\OrderSummary\OrderSummaryPresenter:
class: PsCheckout\Presentation\Presenter\OrderSummary\OrderSummaryPresenter
arguments:
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@PsCheckout\Module\Presentation\Translator'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderTranslationProvider'

View File

@@ -0,0 +1,262 @@
services:
_defaults:
public: true
PsCheckout\Core\PayPal\Order\Processor\CreatePayPalOrderProcessor:
class: PsCheckout\Core\PayPal\Order\Processor\CreatePayPalOrderProcessor
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Repository\PayPalCustomerRepository'
- '@PsCheckout\Infrastructure\Repository\PaymentTokenRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderPurchaseUnitRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderCaptureRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderAuthorizationRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRefundRepository'
PsCheckout\Core\PayPal\Order\Action\CreatePayPalOrderAction:
class: PsCheckout\Core\PayPal\Order\Action\CreatePayPalOrderAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Repository\PayPalCustomerRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Api\Http\OrderHttpClient'
- '@PsCheckout\Core\Order\Builder\OrderPayloadBuilder'
- '@PsCheckout\Presentation\Presenter\Cart\CartPresenter'
- '@PsCheckout\Core\PayPal\Order\Processor\CreatePayPalOrderProcessor'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
- '@PsCheckout\Core\PaymentToken\Action\DeletePaymentTokenAction'
PsCheckout\Infrastructure\Action\AddProductToCartAction:
class: PsCheckout\Infrastructure\Action\AddProductToCartAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
PsCheckout\Core\Order\Action\CreateValidateOrderDataAction:
class: PsCheckout\Core\Order\Action\CreateValidateOrderDataAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Infrastructure\Repository\CurrencyRepository'
- '@PsCheckout\Core\Order\Validator\OrderAmountValidator'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
PsCheckout\Core\Order\Action\ValidateOrderAction:
class: PsCheckout\Core\Order\Action\ValidateOrderAction
arguments:
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
- '@ps_checkout.module'
PsCheckout\Core\Order\Action\CreateOrderAction:
class: PsCheckout\Core\Order\Action\CreateOrderAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Core\Order\Action\CreateValidateOrderDataAction'
- '@PsCheckout\Core\Order\Action\ValidateOrderAction'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderMatrixRepository'
PsCheckout\Core\PayPal\Order\Action\CapturePayPalOrderAction:
class: PsCheckout\Core\PayPal\Order\Action\CapturePayPalOrderAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Api\Http\OrderHttpClient'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
- '@PsCheckout\Core\PayPal\Order\Handler\OrderCompletedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentPendingEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentCompletedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentDeniedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
PsCheckout\Core\PaymentToken\Action\SavePaymentTokenAction:
class: PsCheckout\Core\PaymentToken\Action\SavePaymentTokenAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalCustomerRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\PaymentTokenRepository'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@Psr\Log\LoggerInterface'
PsCheckout\Core\Order\Action\CreateOrderPaymentAction:
class: PsCheckout\Core\Order\Action\CreateOrderPaymentAction
arguments:
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Currency'
PsCheckout\Core\Order\Processor\CreateOrderProcessor:
class: PsCheckout\Core\Order\Processor\CreateOrderProcessor
arguments:
- '@PsCheckout\Core\Order\Validator\OrderAuthorizationValidator'
- '@PsCheckout\Core\Order\Action\CreateOrderAction'
- '@PsCheckout\Infrastructure\Repository\CartRepository'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Core\Order\Validator\CheckoutValidator'
- '@PsCheckout\Core\PayPal\Order\Action\CapturePayPalOrderAction'
- '@PsCheckout\Core\PaymentToken\Action\SavePaymentTokenAction'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PaymentToken\Action\DeletePaymentTokenAction'
PsCheckout\Infrastructure\Action\CustomerNotifyAction:
class: PsCheckout\Infrastructure\Action\CustomerNotifyAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Module\Presentation\Translator'
- '@ps_checkout.db'
PsCheckout\Core\PayPal\Order\Action\CancelPayPalOrderAction:
class: PsCheckout\Core\PayPal\Order\Action\CancelPayPalOrderAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
PsCheckout\Infrastructure\Action\CustomerAuthenticationAction:
class: PsCheckout\Infrastructure\Action\CustomerAuthenticationAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Customer'
- '@PsCheckout\Infrastructure\Adapter\Context'
PsCheckout\Infrastructure\Action\CreateOrUpdateAddressAction:
class: PsCheckout\Infrastructure\Action\CreateOrUpdateAddressAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Country'
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\AddressRepository'
PsCheckout\Core\Customer\Action\ExpressCheckoutAction:
class: PsCheckout\Core\Customer\Action\ExpressCheckoutAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Action\CustomerAuthenticationAction'
- '@PsCheckout\Infrastructure\Action\CreateOrUpdateAddressAction'
PsCheckout\Core\PayPal\Order\Processor\UpdateExternalPayPalOrderProcessor:
class: PsCheckout\Core\PayPal\Order\Processor\UpdateExternalPayPalOrderProcessor
arguments:
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Presentation\Presenter\Cart\CartPresenter'
- '@PsCheckout\Core\Order\Builder\OrderPayloadBuilder'
- '@PsCheckout\Api\Http\OrderHttpClient'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
- '@PsCheckout\Core\PayPal\Order\Action\UpdatePayPalOrderPurchaseUnitAction'
PsCheckout\Core\PayPal\Order\Handler\PaymentCompletedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\PaymentCompletedEventHandler
arguments:
- '@PsCheckout\Core\Order\Action\CreateOrderAction'
- '@PsCheckout\Core\Order\Action\CreateOrderPaymentAction'
- '@PsCheckout\Core\OrderState\Action\SetCompletedOrderStateAction'
- '@PsCheckout\Infrastructure\Adapter\Context'
PsCheckout\Core\PayPal\Order\Handler\PaymentPendingEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\PaymentPendingEventHandler
arguments:
- '@PsCheckout\Core\Order\Action\CreateOrderAction'
- '@PsCheckout\Core\OrderState\Action\SetPendingOrderStateAction'
PsCheckout\Core\PayPal\Order\Handler\PaymentDeniedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\PaymentDeniedEventHandler
arguments:
- '@PsCheckout\Core\OrderState\Action\SetDeclinedOrderStateAction'
PsCheckout\Core\PayPal\Order\Handler\PaymentRefundedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\PaymentRefundedEventHandler
arguments:
- '@PsCheckout\Core\OrderState\Action\SetRefundedOrderStateAction'
PsCheckout\Core\PayPal\Order\Handler\PaymentReversedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\PaymentReversedEventHandler
arguments:
- '@PsCheckout\Core\OrderState\Action\SetReversedOrderStateAction'
PsCheckout\Core\PayPal\Order\Handler\OrderApprovedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\OrderApprovedEventHandler
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction'
- '@PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator'
- '@PsCheckout\Core\PayPal\Order\Action\CapturePayPalOrderAction'
- '@PsCheckout\Core\PayPal\Order\Action\UpdatePayPalOrderPurchaseUnitAction'
PsCheckout\Core\PayPal\Order\Handler\OrderCompletedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\OrderCompletedEventHandler
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction'
- '@PsCheckout\Core\PayPal\Order\Action\UpdatePayPalOrderPurchaseUnitAction'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator'
PsCheckout\Core\PayPal\Order\Handler\OrderApprovalReversedEventHandler:
class: PsCheckout\Core\PayPal\Order\Handler\OrderApprovalReversedEventHandler
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction'
PsCheckout\Core\OrderState\Action\SetCompletedOrderStateAction:
class: PsCheckout\Core\OrderState\Action\SetCompletedOrderStateAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Core\Order\Validator\OrderAmountValidator'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Core\OrderState\Action\ChangeOrderStateAction'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
PsCheckout\Core\OrderState\Action\SetPendingOrderStateAction:
class: PsCheckout\Core\OrderState\Action\SetPendingOrderStateAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Core\OrderState\Action\ChangeOrderStateAction'
PsCheckout\Core\OrderState\Action\SetDeclinedOrderStateAction:
class: PsCheckout\Core\OrderState\Action\SetDeclinedOrderStateAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Core\OrderState\Action\ChangeOrderStateAction'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\OrderState\Action\SetReversedOrderStateAction:
class: PsCheckout\Core\OrderState\Action\SetReversedOrderStateAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Core\OrderState\Action\ChangeOrderStateAction'
PsCheckout\Core\PayPal\Order\Handler\PayPalEventDispatcher:
class: PsCheckout\Core\PayPal\Order\Handler\PayPalEventDispatcher
arguments:
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentCompletedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentPendingEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentDeniedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentRefundedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\PaymentReversedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\OrderApprovedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\OrderCompletedEventHandler'
- '@PsCheckout\Core\PayPal\Order\Handler\OrderApprovalReversedEventHandler'
PsCheckout\Core\WebhookDispatcher\Processor\DispatchWebhookProcessor:
class: PsCheckout\Core\WebhookDispatcher\Processor\DispatchWebhookProcessor
arguments:
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Core\PayPal\Order\Handler\PayPalEventDispatcher'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
- '@PsCheckout\Core\PaymentToken\Action\SavePaymentTokenAction'
- '@PsCheckout\Infrastructure\Repository\PaymentTokenRepository'

View File

@@ -0,0 +1,16 @@
services:
_defaults:
public: true
PsCheckout\Core\PayPal\Order\Provider\PayPalOrderTranslationProvider:
class: PsCheckout\Core\PayPal\Order\Provider\PayPalOrderTranslationProvider
arguments:
- '@PsCheckout\Module\Presentation\Translator'
PsCheckout\Core\WebhookDispatcher\Provider\WebhookHeaderProvider:
class: PsCheckout\Core\WebhookDispatcher\Provider\WebhookHeaderProvider
PsCheckout\Core\WebhookDispatcher\Provider\WebhookBodyProvider:
class: PsCheckout\Core\WebhookDispatcher\Provider\WebhookBodyProvider
arguments:
- '@PsCheckout\Utility\Common\InputStreamUtility'

View File

@@ -0,0 +1,18 @@
imports:
- { resource: ../common.yml }
- { resource: handler.yml }
- { resource: validator.yml }
- { resource: presenter.yml }
- { resource: configuration.yml }
- { resource: process.yml }
- { resource: provider.yml }
- { resource: builder.yml }
services:
_defaults:
public: true
PsCheckout\Core\PayPal\OAuth\OAuthService:
class: PsCheckout\Core\PayPal\OAuth\OAuthService
arguments:
- '@PsCheckout\Api\Http\CheckoutHttpClient'

View File

@@ -0,0 +1,64 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Validator\FrontControllerValidator:
class: PsCheckout\Infrastructure\Validator\FrontControllerValidator
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration'
PsCheckout\Core\Order\Validator\OrderAuthorizationValidator:
class: PsCheckout\Core\Order\Validator\OrderAuthorizationValidator
arguments:
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Infrastructure\Adapter\Customer'
- '@PsCheckout\Infrastructure\Adapter\Cart'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator'
PsCheckout\Core\Order\Validator\CheckoutValidator:
class: PsCheckout\Core\Order\Validator\CheckoutValidator
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Repository\CartRepository'
PsCheckout\Core\Order\Validator\OrderAmountValidator:
class: PsCheckout\Core\Order\Validator\OrderAmountValidator
PsCheckout\Core\WebhookDispatcher\Validator\HeaderValuesValidator:
class: PsCheckout\Core\WebhookDispatcher\Validator\HeaderValuesValidator
arguments:
- '@PsCheckout\Core\WebhookDispatcher\Provider\WebhookHeaderProvider'
PsCheckout\Core\WebhookDispatcher\Validator\BodyValuesValidator:
class: PsCheckout\Core\WebhookDispatcher\Validator\BodyValuesValidator
arguments:
- '@PsCheckout\Core\WebhookDispatcher\Provider\WebhookBodyProvider'
PsCheckout\Core\WebhookDispatcher\Action\CheckPSLSignatureAction:
class: PsCheckout\Core\WebhookDispatcher\Action\CheckPSLSignatureAction
arguments:
- '@PsCheckout\Api\Http\OrderHttpClient'
PsCheckout\Core\WebhookDispatcher\Validator\WebhookShopIdValidator:
class: PsCheckout\Core\WebhookDispatcher\Validator\WebhookShopIdValidator
arguments:
- '@PsCheckout\Infrastructure\Repository\PsAccountRepository'
PsCheckout\Core\PayPal\Order\Validator\CreatedPayPalOrderValidator:
class: PsCheckout\Core\PayPal\Order\Validator\CreatedPayPalOrderValidator
arguments:
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Adapter\Cart'
- '@=service("ps_checkout.module").id'
PsCheckout\Core\PayPal\Order\Validator\CreatedPayUponInvoiceOrderValidator:
class: PsCheckout\Core\PayPal\Order\Validator\CreatedPayUponInvoiceOrderValidator
arguments:
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Adapter\Cart'
- '@=service("ps_checkout.module").id'

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,13 @@
services:
_defaults:
public: true
PrestaShop\PsAccountsInstaller\Installer\Installer:
class: PrestaShop\PsAccountsInstaller\Installer\Installer
arguments:
- '4.0.0'
PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts:
class: PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts
arguments:
- '@PrestaShop\PsAccountsInstaller\Installer\Installer'

View File

@@ -0,0 +1,47 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Adapter\Context:
class: PsCheckout\Infrastructure\Adapter\Context
PsCheckout\Infrastructure\Adapter\Language:
class: PsCheckout\Infrastructure\Adapter\Language
PsCheckout\Infrastructure\Adapter\ShopContext:
class: PsCheckout\Infrastructure\Adapter\ShopContext
PsCheckout\Infrastructure\Adapter\Configuration:
class: PsCheckout\Infrastructure\Adapter\Configuration
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
PsCheckout\Infrastructure\Adapter\Link:
class: PsCheckout\Infrastructure\Adapter\Link
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@=service("ps_checkout.module").name'
PsCheckout\Infrastructure\Adapter\Address:
class: PsCheckout\Infrastructure\Adapter\Address
PsCheckout\Infrastructure\Adapter\Currency:
class: PsCheckout\Infrastructure\Adapter\Currency
PsCheckout\Infrastructure\Adapter\Validate:
class: PsCheckout\Infrastructure\Adapter\Validate
PsCheckout\Infrastructure\Adapter\Tools:
class: PsCheckout\Infrastructure\Adapter\Tools
PsCheckout\Infrastructure\Adapter\Customer:
class: PsCheckout\Infrastructure\Adapter\Customer
PsCheckout\Infrastructure\Adapter\Cart:
class: PsCheckout\Infrastructure\Adapter\Cart
PsCheckout\Infrastructure\Adapter\Country:
class: PsCheckout\Infrastructure\Adapter\Country
PsCheckout\Infrastructure\Adapter\SystemConfiguration:
class: PsCheckout\Infrastructure\Adapter\SystemConfiguration

View File

@@ -0,0 +1,18 @@
services:
_defaults:
public: true
PsCheckout\Api\Http\CheckoutHttpClient:
class: PsCheckout\Api\Http\CheckoutHttpClient
arguments:
- '@PsCheckout\Api\Http\Configuration\CheckoutClientConfigurationBuilder'
PsCheckout\Api\Http\OrderHttpClient:
class: PsCheckout\Api\Http\OrderHttpClient
arguments:
- '@PsCheckout\Api\Http\Configuration\OrderHttpClientConfigurationBuilder'
PsCheckout\Api\Http\OrderShipmentTrackingHttpClient:
class: PsCheckout\Api\Http\OrderShipmentTrackingHttpClient
arguments:
- '@PsCheckout\Api\Http\Configuration\OrderShipmentTrackingConfigurationBuilder'

View File

@@ -0,0 +1,107 @@
services:
_defaults:
public: true
PsCheckout\Core\Order\Builder\Node\BaseNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\BaseNodeBuilder
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\Order\Builder\Node\AmountBreakdownNode:
class: PsCheckout\Core\Order\Builder\Node\AmountBreakdownNode
PsCheckout\Core\Order\Builder\Node\ShippingNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\ShippingNodeBuilder
arguments:
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\StateRepository'
PsCheckout\Core\Order\Builder\Node\PayerNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\PayerNodeBuilder
arguments:
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Infrastructure\Adapter\Validate'
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\StateRepository'
PsCheckout\Core\Order\Builder\Node\ApplicationContextNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\ApplicationContextNodeBuilder
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Link'
PsCheckout\Core\Order\Builder\Node\CardPaymentSourceNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\CardPaymentSourceNodeBuilder
arguments:
- '@PsCheckout\Core\Settings\Configuration\PayPalConfiguration'
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\StateRepository'
PsCheckout\Core\Order\Builder\Node\SupplementaryDataNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\SupplementaryDataNodeBuilder
arguments:
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
- '@PsCheckout\Infrastructure\Repository\StateRepository'
PsCheckout\Core\Order\Builder\Node\PayPalPaymentSourceNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\PayPalPaymentSourceNodeBuilder
PsCheckout\Core\Order\Builder\Node\PaymentSource\VenmoPaymentSourceNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\PaymentSource\VenmoPaymentSourceNodeBuilder
PsCheckout\Core\Order\Builder\Node\GooglePayPaymentSourceNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\GooglePayPaymentSourceNodeBuilder
arguments:
- '@PsCheckout\Core\Settings\Configuration\PayPalConfiguration'
PsCheckout\Core\Order\Builder\Node\PuiPaymentSourceNodeBuilder:
class: PsCheckout\Core\Order\Builder\Node\PuiPaymentSourceNodeBuilder
arguments:
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Infrastructure\Adapter\Validate'
- '@PsCheckout\Infrastructure\Repository\CountryRepository'
PsCheckout\Core\Order\Builder\OrderPayloadBuilder:
class: PsCheckout\Core\Order\Builder\OrderPayloadBuilder
arguments:
- '@PsCheckout\Core\Order\Builder\Node\BaseNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\AmountBreakdownNode'
- '@PsCheckout\Core\Order\Builder\Node\ShippingNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\PayerNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\CardPaymentSourceNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\SupplementaryDataNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\ApplicationContextNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\PayPalPaymentSourceNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\GooglePayPaymentSourceNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\PaymentSource\VenmoPaymentSourceNodeBuilder'
- '@PsCheckout\Core\Order\Builder\Node\PuiPaymentSourceNodeBuilder'
PsCheckout\Api\Http\Configuration\CheckoutClientConfigurationBuilder:
class: PsCheckout\Api\Http\Configuration\CheckoutClientConfigurationBuilder
arguments:
- '@=service("ps_checkout.module").version'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@PsCheckout\Infrastructure\Environment\Env'
- '@PsCheckout\Infrastructure\Repository\PsAccountRepository'
- '@Psr\Log\LoggerInterface'
PsCheckout\Api\Http\Configuration\OrderHttpClientConfigurationBuilder:
class: 'PsCheckout\Api\Http\Configuration\OrderHttpClientConfigurationBuilder'
arguments:
- '@PsCheckout\Infrastructure\Environment\Env'
- '@PsCheckout\Infrastructure\Repository\PsAccountRepository'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@=service("ps_checkout.module").version'
PsCheckout\Api\Http\Configuration\OrderShipmentTrackingConfigurationBuilder:
class: PsCheckout\Api\Http\Configuration\OrderShipmentTrackingConfigurationBuilder
arguments:
- '@=service("ps_checkout.module").version'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Link'
- '@PsCheckout\Infrastructure\Environment\Env'
- '@PsCheckout\Infrastructure\Repository\PsAccountRepository'
- '@Psr\Log\LoggerInterface'

View File

@@ -0,0 +1,47 @@
services:
_defaults:
public: true
PrestaShop\ModuleLibCacheDirectoryProvider\Cache\CacheDirectoryProvider:
class: 'PrestaShop\ModuleLibCacheDirectoryProvider\Cache\CacheDirectoryProvider'
public: true
arguments:
- !php/const _PS_VERSION_
- !php/const _PS_ROOT_DIR_
- !php/const _PS_MODE_DEV_
PsCheckout\Cache\Array\PayPalOrder:
class: Symfony\Component\Cache\Adapter\ArrayAdapter
PsCheckout\Cache\FileSystem\PayPalOrder:
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
arguments:
- "paypal-orders"
- 3600
- '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()'
PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache:
class: PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache
public: true
arguments:
- '@PsCheckout\Cache\Array\PayPalOrder'
- '@PsCheckout\Cache\FileSystem\PayPalOrder'
- '@PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction'
# Shipping Tracking Cache Services
PsCheckout\Cache\Array\ShippingTracking:
class: Symfony\Component\Cache\Adapter\ArrayAdapter
PsCheckout\Cache\FileSystem\ShippingTracking:
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
arguments:
- "shipping-tracking"
- 3600
- '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()'
PsCheckout\Core\PayPal\ShippingTracking\Cache\ShippingTrackingCache:
class: PsCheckout\Core\PayPal\ShippingTracking\Cache\ShippingTrackingCache
public: true
arguments:
- '@PsCheckout\Cache\Array\ShippingTracking'
- '@PsCheckout\Cache\FileSystem\ShippingTracking'

View File

@@ -0,0 +1,13 @@
services:
_defaults:
public: true
PsCheckout\Core\Settings\Configuration\PayPalConfiguration:
class: PsCheckout\Core\Settings\Configuration\PayPalConfiguration
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration:
class: PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'

View File

@@ -0,0 +1,9 @@
services:
_defaults:
public: true
PsCheckout\Core\FundingSource\Factory\FundingSourceTokenFactory:
class: PsCheckout\Core\FundingSource\Factory\FundingSourceTokenFactory
arguments:
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
- '@PsCheckout\Presentation\Presenter\FundingSource\LogoPresenter'

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,37 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Logger\LoggerFileReader:
class: PsCheckout\Infrastructure\Logger\LoggerFileReader
arguments:
- '@PsCheckout\Infrastructure\Adapter\Validate'
- '@PsCheckout\Infrastructure\Logger\LoggerFileFinder'
PsCheckout\Infrastructure\Logger\LoggerFileFinder:
class: PsCheckout\Infrastructure\Logger\LoggerFileFinder
arguments:
- '@=service("ps_checkout.module").name'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Infrastructure\Logger\LoggerHandlerFactory:
class: 'PsCheckout\Infrastructure\Logger\LoggerHandlerFactory'
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@=service("ps_checkout.module").name'
Monolog\Handler\HandlerInterface:
class: 'Monolog\Handler\HandlerInterface'
factory: ['@PsCheckout\Infrastructure\Logger\LoggerHandlerFactory', "build"]
PsCheckout\Infrastructure\Logger\LoggerFactory:
class: 'PsCheckout\Infrastructure\Logger\LoggerFactory'
arguments:
- '@=service("ps_checkout.module").name'
- '@Monolog\Handler\HandlerInterface'
Psr\Log\LoggerInterface:
class: 'Psr\Log\LoggerInterface'
factory: ['@PsCheckout\Infrastructure\Logger\LoggerFactory', "build"]

View File

@@ -0,0 +1,22 @@
services:
_defaults:
public: true
PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter:
class: PsCheckout\Presentation\Presenter\FundingSource\FundingSourcePresenter
arguments:
- '@=service("ps_checkout.module").getPathUri()'
- '@PsCheckout\Infrastructure\Repository\FundingSourceRepository'
- '@PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider'
PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTokenPresenter:
class: PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTokenPresenter
arguments:
- '@PsCheckout\Infrastructure\Repository\PaymentTokenRepository'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\FundingSource\Factory\FundingSourceTokenFactory'
PsCheckout\Presentation\Presenter\FundingSource\LogoPresenter:
class: PsCheckout\Presentation\Presenter\FundingSource\LogoPresenter
arguments:
- '@=service("ps_checkout.module").getPathUri()'

View File

@@ -0,0 +1,137 @@
services:
_defaults:
public: true
PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction:
class: PsCheckout\Core\PayPal\OrderStatus\Action\PayPalCheckOrderStatusAction
PsCheckout\Core\PaymentToken\Action\DeletePaymentTokenAction:
class: PsCheckout\Core\PaymentToken\Action\DeletePaymentTokenAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PaymentTokenRepository'
- '@PsCheckout\Api\Http\CheckoutHttpClient'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Core\OrderState\Action\ChangeOrderStateAction:
class: PsCheckout\Core\OrderState\Action\ChangeOrderStateAction
arguments:
- '@PsCheckout\Infrastructure\Repository\OrderRepository'
- '@PsCheckout\Infrastructure\Repository\OrderStateRepository'
- '@PsCheckout\Infrastructure\Repository\OrderHistoryRepository'
PsCheckout\Core\OrderState\Action\SetRefundedOrderStateAction:
class: PsCheckout\Core\OrderState\Action\SetRefundedOrderStateAction
arguments:
- '@PsCheckout\Core\PayPal\Refund\Provider\PayPalRefundOrderProvider'
- '@PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider'
- '@PsCheckout\Core\OrderState\Service\OrderStateMapper'
- '@PsCheckout\Core\OrderState\Action\ChangeOrderStateAction'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
PsCheckout\Core\PayPal\Order\Action\RefundPayPalOrderAction:
class: PsCheckout\Core\PayPal\Order\Action\RefundPayPalOrderAction
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Api\Http\OrderHttpClient'
- '@PsCheckout\Core\OrderState\Action\SetRefundedOrderStateAction'
PsCheckout\Core\PayPal\Order\Action\UpdatePayPalOrderPurchaseUnitAction:
class: PsCheckout\Core\PayPal\Order\Action\UpdatePayPalOrderPurchaseUnitAction
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderPurchaseUnitRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderCaptureRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderAuthorizationRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRefundRepository'
PsCheckout\Core\PayPal\ShippingTracking\Validator\OrderTrackerValidator:
class: PsCheckout\Core\PayPal\ShippingTracking\Validator\OrderTrackerValidator
arguments:
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderCaptureRepository'
PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingBaseNodeBuilder:
class: PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingBaseNodeBuilder
PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingItemsNodeBuilder:
class: PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingItemsNodeBuilder
arguments:
- '@Psr\Log\LoggerInterface'
PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingCarrierModuleNodeBuilder:
class: PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingCarrierModuleNodeBuilder
PsCheckout\Core\PayPal\ShippingTracking\Builder\TrackingPayloadBuilder:
class: PsCheckout\Core\PayPal\ShippingTracking\Builder\TrackingPayloadBuilder
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingBaseNodeBuilder'
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingItemsNodeBuilder'
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\Node\TrackingCarrierModuleNodeBuilder'
PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingApiService:
class: PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingApiService
arguments:
- '@PsCheckout\Api\Http\OrderShipmentTrackingHttpClient'
- '@Psr\Log\LoggerInterface'
PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingDatabaseHandler:
class: PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingDatabaseHandler
arguments:
- '@PsCheckout\Infrastructure\Repository\ShippingTrackingRepository'
- '@Psr\Log\LoggerInterface'
PsCheckout\Core\PayPal\ShippingTracking\Action\AddTrackingAction:
class: PsCheckout\Core\PayPal\ShippingTracking\Action\AddTrackingAction
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessor'
- '@Psr\Log\LoggerInterface'
PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessor:
class: PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessor
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Validator\OrderTrackerValidator'
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\TrackingPayloadBuilder'
- '@PsCheckout\Infrastructure\Repository\ShippingTrackingRepository'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Core\PayPal\ShippingTracking\Cache\ShippingTrackingCache'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingApiService'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingDatabaseHandler'
# Shipping Tracking Processor
PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessorInterface:
class: PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessor
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Validator\OrderTrackerValidator'
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\TrackingPayloadBuilder'
- '@PsCheckout\Infrastructure\Repository\ShippingTrackingRepository'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Core\PayPal\ShippingTracking\Cache\ShippingTrackingCache'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingApiService'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingDatabaseHandler'
# External Shipping Tracking Processor
PsCheckout\Core\PayPal\ShippingTracking\Processor\ExternalShipmentProcessor:
class: PsCheckout\Core\PayPal\ShippingTracking\Processor\ExternalShipmentProcessor
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Validator\OrderTrackerValidator'
- '@PsCheckout\Core\PayPal\ShippingTracking\Builder\TrackingPayloadBuilder'
- '@PsCheckout\Infrastructure\Repository\ShippingTrackingRepository'
- '@Psr\Log\LoggerInterface'
- '@PsCheckout\Core\PayPal\ShippingTracking\Cache\ShippingTrackingCache'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingApiService'
- '@PsCheckout\Core\PayPal\ShippingTracking\Service\TrackingDatabaseHandler'
- '@PsCheckout\Core\PayPal\ShippingTracking\Action\AddTrackingActionInterface'
# Shipping Tracking Action
PsCheckout\Core\PayPal\ShippingTracking\Action\AddTrackingActionInterface:
class: PsCheckout\Core\PayPal\ShippingTracking\Action\AddTrackingAction
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Processor\ShipmentProcessorInterface'
- '@Psr\Log\LoggerInterface'
# External Shipping Tracking Action
PsCheckout\Core\PayPal\ShippingTracking\Action\ProcessExternalShipmentAction:
class: PsCheckout\Core\PayPal\ShippingTracking\Action\ProcessExternalShipmentAction
arguments:
- '@PsCheckout\Core\PayPal\ShippingTracking\Processor\ExternalShipmentProcessor'
- '@Psr\Log\LoggerInterface'

View File

@@ -0,0 +1,27 @@
services:
_defaults:
public: true
PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider:
class: PsCheckout\Presentation\Presenter\FundingSource\FundingSourceTranslationProvider
arguments:
- '@PsCheckout\Module\Presentation\Translator'
PsCheckout\Module\Presentation\Translator:
class: PsCheckout\Module\Presentation\Translator
arguments:
- '@=service("ps_checkout.module").getTranslator()'
PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider:
class: PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Core\PayPal\Order\Cache\PayPalOrderCache'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'
- '@PsCheckout\Api\Http\OrderHttpClient'
PsCheckout\Core\PayPal\Refund\Provider\PayPalRefundOrderProvider:
class: PsCheckout\Core\PayPal\Refund\Provider\PayPalRefundOrderProvider
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Repository\PayPalOrderRepository'

View File

@@ -0,0 +1,103 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Repository\CountryRepository:
class: PsCheckout\Infrastructure\Repository\CountryRepository
arguments:
- '@=service("ps_checkout.module").name'
PsCheckout\Infrastructure\Repository\CurrencyRepository:
class: PsCheckout\Infrastructure\Repository\CurrencyRepository
arguments:
- '@=service("ps_checkout.module").name'
PsCheckout\Infrastructure\Repository\PsAccountRepository:
class: PsCheckout\Infrastructure\Repository\PsAccountRepository
arguments:
- '@PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts'
PsCheckout\Infrastructure\Repository\FundingSourceRepository:
class: PsCheckout\Infrastructure\Repository\FundingSourceRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PaymentTokenRepository:
class: PsCheckout\Infrastructure\Repository\PaymentTokenRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PayPalOrderRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\LanguageRepository:
class: PsCheckout\Infrastructure\Repository\LanguageRepository
PsCheckout\Infrastructure\Repository\CustomerRepository:
class: PsCheckout\Infrastructure\Repository\CustomerRepository
PsCheckout\Infrastructure\Repository\GenderRepository:
class: PsCheckout\Infrastructure\Repository\GenderRepository
PsCheckout\Infrastructure\Repository\StateRepository:
class: PsCheckout\Infrastructure\Repository\StateRepository
PsCheckout\Infrastructure\Repository\PayPalCustomerRepository:
class: PsCheckout\Infrastructure\Repository\PayPalCustomerRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PayPalOrderPurchaseUnitRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderPurchaseUnitRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PayPalOrderCaptureRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderCaptureRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PayPalOrderAuthorizationRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderAuthorizationRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\PayPalOrderRefundRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderRefundRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\ConfigurationRepository:
class: PsCheckout\Infrastructure\Repository\ConfigurationRepository
arguments:
- '@ps_checkout.db'
- '@PsCheckout\Infrastructure\Adapter\Configuration'
PsCheckout\Infrastructure\Repository\CartRepository:
class: PsCheckout\Infrastructure\Repository\CartRepository
PsCheckout\Infrastructure\Repository\PayPalOrderMatrixRepository:
class: PsCheckout\Infrastructure\Repository\PayPalOrderMatrixRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\OrderRepository:
class: PsCheckout\Infrastructure\Repository\OrderRepository
PsCheckout\Infrastructure\Repository\AddressRepository:
class: PsCheckout\Infrastructure\Repository\AddressRepository
arguments:
- '@ps_checkout.db'
PsCheckout\Infrastructure\Repository\OrderStateRepository:
class: PsCheckout\Infrastructure\Repository\OrderStateRepository
PsCheckout\Infrastructure\Repository\OrderHistoryRepository:
class: PsCheckout\Infrastructure\Repository\OrderHistoryRepository
PsCheckout\Infrastructure\Repository\ShippingTrackingRepository:
class: PsCheckout\Infrastructure\Repository\ShippingTrackingRepository
arguments:
- '@ps_checkout.db'

View File

@@ -0,0 +1,18 @@
services:
_defaults:
public: true
PsCheckout\Infrastructure\Validator\MerchantValidator:
class: PsCheckout\Infrastructure\Validator\MerchantValidator
arguments:
- '@PsCheckout\Infrastructure\Adapter\Configuration'
- '@PsCheckout\Infrastructure\Repository\PsAccountRepository'
PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator:
class: PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator
PsCheckout\Infrastructure\Validator\PayLaterValidator:
class: PsCheckout\Infrastructure\Validator\PayLaterValidator
arguments:
- '@PsCheckout\Infrastructure\Adapter\Context'
- '@PsCheckout\Core\Settings\Configuration\PayPalConfiguration'

View File

@@ -0,0 +1,936 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use Monolog\Logger;
use PsCheckout\Core\Order\Exception\OrderException;
use PsCheckout\Core\OrderState\OrderStateException;
use PsCheckout\Core\OrderState\Service\OrderStateMapper;
use PsCheckout\Core\PayPal\Order\Action\RefundPayPalOrderAction;
use PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider;
use PsCheckout\Core\PayPal\Refund\Exception\PayPalRefundException;
use PsCheckout\Core\PayPal\Refund\ValueObject\PayPalRefund;
use PsCheckout\Core\Settings\Configuration\LoggerConfiguration;
use PsCheckout\Core\Settings\Configuration\PayPalConfiguration;
use PsCheckout\Core\Settings\Configuration\PayPalExpressCheckoutConfiguration;
use PsCheckout\Core\Settings\Configuration\PayPalPayLaterConfiguration;
use PsCheckout\Core\Webhook\Service\WebhookSecretToken;
use PsCheckout\Infrastructure\Action\SaveBatchConfigurationActionInterface;
use PsCheckout\Infrastructure\Adapter\Configuration;
use PsCheckout\Infrastructure\Bootstrap\Install\ApplePayInstaller;
use PsCheckout\Infrastructure\Bootstrap\Install\ApplePayInstallerException;
use PsCheckout\Infrastructure\Bootstrap\Install\OrderStateInstaller;
use PsCheckout\Infrastructure\Controller\AbstractAdminController;
use PsCheckout\Infrastructure\Logger\LoggerFileFinder;
use PsCheckout\Infrastructure\Logger\LoggerFileReader;
use PsCheckout\Infrastructure\Repository\FundingSourceRepository;
use PsCheckout\Infrastructure\Repository\PaymentTokenRepository;
use PsCheckout\Infrastructure\Repository\PayPalOrderRepository;
use PsCheckout\Infrastructure\Repository\PsAccountRepository;
use PsCheckout\Module\Presentation\Translator;
use PsCheckout\Presentation\Presenter\PayPalOrder\PayPalOrderPresenter;
use Psr\Log\LoggerInterface;
class AdminAjaxPrestashopCheckoutController extends AbstractAdminController
{
/**
* @var Ps_Checkout
*/
public $module;
/**
* @var bool
*/
public $ajax = true;
/**
* @var bool
*/
protected $json = true;
/**
* {@inheritDoc}
*/
public function postProcess()
{
$shopIdRequested = (int) Tools::getValue('id_shop');
$currentShopId = (int) Shop::getContextShopID();
if ($shopIdRequested && $shopIdRequested !== $currentShopId) {
$shopRequested = new Shop($shopIdRequested);
if (Validate::isLoadedObject($shopRequested)) {
Shop::setContext(Shop::CONTEXT_SHOP, $shopIdRequested);
$this->context->shop = $shopRequested;
}
}
return parent::postProcess();
}
/**
* {@inheritdoc}
*/
public function init()
{
if (!isset($this->context->employee) || !$this->context->employee->isLoggedBack()) {
// Avoid redirection to Login page because Ajax doesn't support it
$this->initCursedPage();
}
parent::init();
}
/**
* {@inheritdoc}
*/
public function display()
{
if ($this->errors) {
http_response_code(400);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => $this->errors,
]));
}
parent::display();
}
/**
* {@inheritdoc}
*/
public function initCursedPage()
{
http_response_code(401);
exit;
}
/**
* AJAX: Toggle payment option hosted fields availability
*/
public function ajaxProcessTogglePaymentOptionAvailability()
{
$paymentOption = json_decode(Tools::getValue('paymentOption'), true);
/** @var FundingSourceRepository $fundingSourceConfigurationRepository */
$fundingSourceConfigurationRepository = $this->module->getService(FundingSourceRepository::class);
$fundingSourceConfigurationRepository->upsert($paymentOption, $this->context->shop->id);
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Update payment method order
*/
public function ajaxProcessUpdatePaymentMethodsOrder()
{
$paymentOptions = json_decode(Tools::getValue('paymentMethods'), true);
/** @var FundingSourceRepository $fundingSourceConfigurationRepository */
$fundingSourceConfigurationRepository = $this->module->getService(FundingSourceRepository::class);
foreach ($paymentOptions as $key => $paymentOption) {
$paymentOption['position'] = $key + 1;
$fundingSourceConfigurationRepository->upsert($paymentOption, $this->context->shop->id);
}
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Update payment mode (LIVE or SANDBOX)
*/
public function ajaxProcessUpdatePaymentMode()
{
$paymentMode = Tools::getValue('paymentMode');
if (!in_array($paymentMode, [PayPalConfiguration::MODE_LIVE, PayPalConfiguration::MODE_SANDBOX])) {
throw new \UnexpectedValueException(sprintf('The value should be a Mode constant, %s value sent', $paymentMode));
}
$this->setConfiguration(PayPalConfiguration::PS_CHECKOUT_PAYMENT_MODE, $paymentMode);
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Change prestashop rounding settings
*
* PS_ROUND_TYPE need to be set to 1 (Round on each item)
* PS_PRICE_ROUND_MODE need to be set to 2 (Round up away from zero, when it is half way there)
*/
public function ajaxProcessEditRoundingSettings()
{
$this->setConfiguration(PayPalConfiguration::PS_ROUND_TYPE, PayPalConfiguration::ROUND_ON_EACH_ITEM);
$this->setConfiguration(PayPalConfiguration::PS_PRICE_ROUND_MODE, PayPalConfiguration::ROUND_UP_AWAY_FROM_ZERO);
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Update credit card fields (Hosted fields / Smartbutton)
*/
public function ajaxProcessUpdateCreditCardFields()
{
$this->setConfiguration(PayPalConfiguration::PS_CHECKOUT_CARD_PAYMENT_ENABLED, (bool) Tools::getValue('hostedFieldsEnabled'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Save PayPal button configuration
*/
public function ajaxProcessSavePaypalButtonConfiguration()
{
$this->setConfiguration(PayPalConfiguration::PS_CHECKOUT_PAYPAL_BUTTON, Tools::getValue('configuration'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Get or refresh token for CDN application
*/
public function ajaxProcessGetOrRefreshToken()
{
/** @var PsAccountRepository $psAccountRepository */
$psAccountRepository = $this->module->getService(PsAccountRepository::class);
try {
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'token' => $psAccountRepository->getIdToken(),
'shopId' => $psAccountRepository->getShopUuid(),
'isAccountLinked' => $psAccountRepository->isAccountLinked(),
]);
} catch (Exception $exception) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'error' => sprintf(
'%s %d : %s',
get_class($exception),
$exception->getCode(),
$exception->getMessage()
),
]);
}
}
public function ajaxProcessUpsertSecretToken()
{
/** @var WebhookSecretToken $webhookSecretTokenService */
$webhookSecretTokenService = $this->module->getService(WebhookSecretToken::class);
$token = (string) Tools::getValue('body');
$response = [];
try {
$status = $webhookSecretTokenService->upsertToken($token);
} catch (Exception $exception) {
$status = false;
$response['errors'] = $exception->getMessage();
}
http_response_code($status ? 204 : 500);
$response['status'] = $status;
$this->ajaxRender(json_encode($response));
}
public function ajaxProcessCheckConfiguration()
{
$response = [];
$query = new DbQuery();
$query->select('name, value, date_add, date_upd');
$query->from('configuration');
$query->where('name LIKE "PS_CHECKOUT_%"');
/** @var int|null $shopId When multishop is disabled, it returns null, so we don't have to restrict results by shop */
$shopId = Shop::getContextShopID(true);
// When ShopId is not NULL, we have to retrieve global values with id_shop = NULL and shop values with id_shop = ShopId
if ($shopId) {
$query->where('id_shop IS NULL OR id_shop = ' . (int) $shopId);
}
$configurations = Db::getInstance()->executeS($query);
$response['status'] = !empty($configurations);
foreach ($configurations as $configuration) {
$response['configuration'][] = [
'name' => $configuration['name'],
'value' => !empty($configuration['value']),
];
}
$this->exitWithResponse($response);
}
public function ajaxProcessFetchConfiguration()
{
$query = new DbQuery();
$query->select('name, value, date_add, date_upd');
$query->from('configuration');
$query->where('name LIKE "PS_CHECKOUT_%"');
/** @var int|null $shopId When multishop is disabled, it returns null, so we don't have to restrict results by shop */
$shopId = Shop::getContextShopID(true);
// When ShopId is not NULL, we have to retrieve global values with id_shop = NULL and shop values with id_shop = ShopId
if ($shopId) {
$query->where('id_shop IS NULL OR id_shop = ' . (int) $shopId);
}
$configurations = Db::getInstance()->executeS($query);
$response = [
'httpCode' => 200,
'status' => !empty($configurations),
'configuration' => array_map(function ($configuration) {
return [
'name' => $configuration['name'],
'value' => $configuration['value'],
];
}, $configurations),
];
$this->exitWithResponse($response);
}
public function ajaxProcessGetMappedOrderStates()
{
/** @var OrderStateMapper $orderStateMapper */
$orderStateMapper = $this->module->getService(OrderStateMapper::class);
$mappedOrderStates = [];
try {
$mappedOrderStates = $orderStateMapper->getMappedOrderStates();
} catch (OrderStateException $exception) {
if ($exception->getCode() === OrderStateException::INVALID_MAPPING) {
/** @var OrderStateInstaller $orderStateInstaller */
$orderStateInstaller = $this->module->getService(OrderStateInstaller::class);
$orderStateInstaller->init();
}
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'error' => $exception->getMessage(),
]);
}
$this->exitWithResponse([
'status' => true,
'mappedOrderStates' => $mappedOrderStates,
]);
}
public function ajaxProcessBatchSaveConfiguration()
{
/** @var SaveBatchConfigurationActionInterface $saveBatchConfigurationAction */
$saveBatchConfigurationAction = $this->module->getService(SaveBatchConfigurationActionInterface::class);
$configuration = json_decode(Tools::getValue('configuration'), true);
try {
$saveBatchConfigurationAction->execute($configuration);
$this->exitWithResponse([
'status' => true,
]);
} catch (Exception $exception) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'error' => $exception->getMessage(),
]);
}
}
public function ajaxProcessGetOrderStates()
{
$orderStates = OrderState::getOrderStates($this->context->language->id);
$this->exitWithResponse([
'status' => true,
'orderStates' => $orderStates,
]);
}
public function ajaxProcessGetPaymentTokenCount()
{
/** @var Configuration $configuration */
$configuration = $this->module->getService(Configuration::class);
/** @var PaymentTokenRepository $paymentTokenRepository */
$paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class);
$this->exitWithResponse([
'status' => true,
'count' => $paymentTokenRepository->getCount(
null,
$configuration->get(PayPalConfiguration::PS_CHECKOUT_PAYPAL_ID_MERCHANT)
),
]);
}
/**
* AJAX: Update logger level
*/
public function ajaxProcessUpdateLoggerLevel()
{
$levels = [
Logger::DEBUG,
Logger::INFO,
Logger::NOTICE,
Logger::WARNING,
Logger::ERROR,
Logger::CRITICAL,
Logger::ALERT,
Logger::EMERGENCY,
];
$level = (int) Tools::getValue('level');
if (false === in_array($level, $levels, true)) {
http_response_code(400);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
'Logger level is invalid',
],
]));
}
$this->setConfiguration(LoggerConfiguration::PS_CHECKOUT_LOGGER_LEVEL, $level);
$this->ajaxRender(json_encode([
'status' => true,
'content' => [
'level' => $level,
],
]));
}
/**
* AJAX: Update logger max files
*/
public function ajaxProcessUpdateLoggerMaxFiles()
{
$maxFiles = (int) Tools::getValue('maxFiles');
if ($maxFiles < 0 || $maxFiles > 30) {
http_response_code(400);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
'Logger max files is invalid',
],
]));
}
$this->setConfiguration(LoggerConfiguration::PS_CHECKOUT_LOGGER_MAX_FILES, $maxFiles);
$this->ajaxRender(json_encode([
'status' => true,
'content' => [
'maxFiles' => $maxFiles,
],
]));
}
/**
* AJAX: Update logger http
*/
public function ajaxProcessUpdateLoggerHttp()
{
$isEnabled = (int) Tools::getValue('isEnabled');
$this->setConfiguration(LoggerConfiguration::PS_CHECKOUT_LOGGER_HTTP, $isEnabled);
$this->ajaxRender(json_encode([
'status' => true,
'content' => [
'isEnabled' => $isEnabled,
],
]));
}
/**
* AJAX: Update logger http format
*/
public function ajaxProcessUpdateLoggerHttpFormat()
{
$formats = [
'CLF',
'DEBUG',
'SHORT',
];
$format = Tools::getValue('httpFormat');
if (false === in_array($format, $formats, true)) {
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
'Logger http format is invalid',
],
]));
}
$this->setConfiguration(LoggerConfiguration::PS_CHECKOUT_LOGGER_HTTP_FORMAT, $format);
$this->ajaxRender(json_encode([
'status' => true,
'content' => [
'httpFormat' => $format,
],
]));
}
/**
* AJAX: Get logs files
*/
public function ajaxProcessGetLogFiles()
{
/** @var LoggerFileFinder $loggerFileFinder */
$loggerFileFinder = $this->module->getService(LoggerFileFinder::class);
header('Content-type: application/json');
$this->ajaxRender(json_encode($loggerFileFinder->getFiles()));
}
/**
* AJAX: Read a log file
*/
public function ajaxProcessGetLogs()
{
$filename = Tools::getValue('file');
$offset = (int) Tools::getValue('offset');
$limit = (int) Tools::getValue('limit');
/** @var LoggerFileReader $loggerFileReader */
$loggerFileReader = $this->module->getService(LoggerFileReader::class);
$fileData = [];
try {
$fileData = $loggerFileReader->read(
$filename,
$offset,
$limit
);
} catch (InvalidArgumentException $exception) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
'errors' => [
$exception->getMessage(),
],
]);
} catch (Exception $exception) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 500,
'errors' => [
$exception->getMessage(),
],
]);
}
$this->exitWithResponse([
'status' => true,
'file' => $fileData['filename'],
'offset' => $fileData['offset'],
'limit' => $fileData['limit'],
'currentOffset' => $fileData['currentOffset'],
'eof' => (int) $fileData['eof'],
'lines' => $fileData['lines'],
]);
}
/**
* AJAX: Toggle express checkout on order page
*/
public function ajaxProcessToggleECOrderPage()
{
$this->setConfiguration(PayPalExpressCheckoutConfiguration::PS_CHECKOUT_EC_ORDER_PAGE, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Toggle express checkout on checkout page
*/
public function ajaxProcessToggleECCheckoutPage()
{
$this->setConfiguration(PayPalExpressCheckoutConfiguration::PS_CHECKOUT_EC_CHECKOUT_PAGE, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Toggle express checkout on product page
*/
public function ajaxProcessToggleECProductPage()
{
$this->setConfiguration(PayPalExpressCheckoutConfiguration::PS_CHECKOUT_EC_PRODUCT_PAGE, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Toggle pay later button on cart page
*/
public function ajaxProcessTogglePayLaterCartPageButton()
{
$this->setConfiguration(PayPalPayLaterConfiguration::PS_CHECKOUT_PAY_LATER_CART_PAGE_BUTTON, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Toggle pay later button on order page
*/
public function ajaxProcessTogglePayLaterOrderPageButton()
{
$this->setConfiguration(PayPalPayLaterConfiguration::PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BUTTON, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
/**
* AJAX: Toggle pay later button on product page
*/
public function ajaxProcessTogglePayLaterProductPageButton()
{
$this->setConfiguration(PayPalPayLaterConfiguration::PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE_BUTTON, (bool) Tools::getValue('status'));
$this->ajaxRender(json_encode(true));
}
public function ajaxProcessFetchOrder()
{
/** @var Translator $translator **/
$translator = $this->module->getService(Translator::class);
$id_order = (int) Tools::getValue('id_order');
if (empty($id_order)) {
http_response_code(400);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
$translator->trans('No PrestaShop Order identifier received'),
],
]));
}
$order = new Order($id_order);
/** @var PayPalOrderRepository $payPalOrderRepository */
$payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class);
$payPalOrder = $payPalOrderRepository->getOneByCartId($order->id_cart);
if (!$payPalOrder) {
try {
$migrationSuccessful = $payPalOrderRepository->attemptToMigratePsCheckoutCart($order->id_cart);
if ($migrationSuccessful) {
$payPalOrder = $payPalOrderRepository->getOneByCartId($order->id_cart);
}
} catch (\Exception $e) {
$logger = $this->module->getService(LoggerInterface::class);
$logger->error(
'Attempted to migrate order to V5 database structure. Encoutered error: ' . $e->getMessage(),
[
'exception' => $e,
'cart_id' => $order->id_cart,
]
);
}
}
if (!$payPalOrder) {
http_response_code(500);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
$translator->trans('Unable to find PayPal Order associated to this PrestaShop Order %s', [$order->id]),
],
]));
}
/** @var Configuration $configuration */
$configuration = $this->module->getService(Configuration::class);
if ($configuration->get(PayPalConfiguration::PS_CHECKOUT_PAYMENT_MODE) !== $payPalOrder->getEnvironment()) {
http_response_code(422);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [
$translator->trans('PayPal Order %s is not in the same environment as PrestaShop Checkout', [$payPalOrder->getId()]),
],
]));
}
/** @var PayPalOrderProvider $paypalOrderProvider */
$paypalOrderProvider = $this->module->getService(PayPalOrderProvider::class);
try {
$paypalOrderResponse = $paypalOrderProvider->getById($payPalOrder->getId());
} catch (Exception $exception) {
http_response_code(500);
$this->ajaxRender(json_encode([
'status' => false,
'errors' => [$exception->getMessage()],
]));
}
/** @var PayPalOrderPresenter $payPalOrderPresenter */
$payPalOrderPresenter = $this->module->getService(PayPalOrderPresenter::class);
$this->context->smarty->assign([
'orderPayPal' => $payPalOrderPresenter->present($paypalOrderResponse),
'psPayPalOrder' => $payPalOrder,
'isProductionEnv' => $payPalOrder->getEnvironment() === PayPalConfiguration::MODE_LIVE,
'moduleLogoUri' => $this->module->getPathUri() . 'logo.png',
'moduleUrl' => $this->context->link->getAdminLink('AdminModules', true, [], ['configure' => $this->module->name]),
'orderPayPalBaseUrl' => $this->context->link->getAdminLink('AdminAjaxPrestashopCheckout'),
]);
$this->ajaxRender(json_encode([
'status' => true,
'content' => $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/ajaxPayPalOrder.tpl'),
]));
}
public function ajaxProcessRefundOrder()
{
/** @var Translator $translator **/
$translator = $this->module->getService(Translator::class);
$payPalOrderId = Tools::getValue('orderPayPalRefundOrder');
$captureId = Tools::getValue('orderPayPalRefundTransaction');
$amount = Tools::getValue('orderPayPalRefundAmount');
$currency = Tools::getValue('orderPayPalRefundCurrency');
/** @var RefundPayPalOrderAction $refundPayPalOrderAction */
$refundPayPalOrderAction = $this->module->getService(RefundPayPalOrderAction::class);
try {
$payPalRefund = new PayPalRefund($payPalOrderId, $captureId, $currency, $amount);
$refundPayPalOrderAction->execute($payPalRefund);
} catch (PayPalRefundException $exception) {
switch ($exception->getCode()) {
case PayPalRefundException::INVALID_ORDER_ID:
$error = $translator->trans('PayPal Order is invalid.');
break;
case PayPalRefundException::INVALID_TRANSACTION_ID:
$error = $translator->trans('PayPal Transaction is invalid.');
break;
case PayPalRefundException::INVALID_CURRENCY:
$error = $translator->trans('PayPal refund currency is invalid.');
break;
case PayPalRefundException::INVALID_AMOUNT:
$error = $translator->trans('PayPal refund amount is invalid.');
break;
case PayPalRefundException::REFUND_FAILED:
$error = $translator->trans('PayPal refund failed.');
break;
default:
$error = '';
break;
}
$this->exitWithResponse([
'httpCode' => 400,
'status' => false,
'errors' => [$error],
]);
} catch (OrderException $exception) {
if ($exception->getCode() === OrderException::FAILED_UPDATE_ORDER_STATUS) {
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'content' => $translator->trans('Refund has been processed by PayPal, but order status change or email sending failed.'),
]);
} elseif ($exception->getCode() !== OrderException::ORDER_HAS_ALREADY_THIS_STATUS) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'errors' => [
$exception->getMessage(),
],
'error' => $exception->getMessage(),
]);
}
} catch (Exception $exception) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'errors' => [
$translator->trans('Refund cannot be processed by PayPal.'),
],
'error' => $exception->getMessage(),
]);
}
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'content' => $translator->trans('Refund has been processed by PayPal.'),
]);
}
/**
* {@inheritdoc}
*/
public function isAnonymousAllowed(): bool
{
return false;
}
/**
* @param string|null $value
* @param string|null $controller
* @param string|null $method
*
* @throws PrestaShopException
*/
protected function ajaxRender($value = null, $controller = null, $method = null)
{
parent::ajaxRender($value, $controller, $method);
exit;
}
/**
* @param string $key
* @param mixed $value
* @return void
*/
private function setConfiguration(string $key, $value)
{
/** @var Configuration $configuration */
$configuration = $this->module->getService(Configuration::class);
$configuration->set($key, $value);
}
/**
* @param array $response
*
* @return void
*/
private function exitWithResponse(array $response)
{
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Content-Type: application/json;charset=utf-8');
header('X-Robots-Tag: noindex, nofollow');
if (isset($response['httpCode'])) {
http_response_code($response['httpCode']);
unset($response['httpCode']);
}
if (!empty($response)) {
echo json_encode($response);
}
exit;
}
/**
* @return void
*/
public function ajaxProcessDownloadLogs()
{
$filename = Tools::getValue('file');
try {
/** @var LoggerFileReader $loggerFileReader */
$loggerFileReader = $this->module->getService(LoggerFileReader::class);
$loggerFileReader->validateFilename($filename);
} catch (InvalidArgumentException $exception) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
'errors' => [
$exception->getMessage(),
],
]);
}
$file = new SplFileObject(LoggerFileFinder::LOGGER_DIRECTORY_PATH . $filename);
if (false === $file->isReadable()) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 500,
'errors' => [
'File is not readable.',
],
]);
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $filename . '.log"');
header('Content-Length: ' . $file->getSize());
readfile($file->getRealPath());
exit;
}
/**
* @return void
*/
public function ajaxProcessSetupApplePay()
{
/** @var ApplePayInstaller $applePayInstaller */
$applePayInstaller = $this->module->getService(ApplePayInstaller::class);
try {
$applePayInstaller->setup();
} catch (ApplePayInstallerException $e) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'error' => [
'message' => $e->getMessage(),
'code' => $e->getCode(),
],
]);
}
$this->exitWithResponse([
'status' => true,
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,167 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Webhook\WebhookException;
use PsCheckout\Core\WebhookDispatcher\Action\CheckPSLSignatureAction;
use PsCheckout\Core\WebhookDispatcher\Processor\DispatchWebhookProcessor;
use PsCheckout\Core\WebhookDispatcher\Validator\BodyValuesValidator;
use PsCheckout\Core\WebhookDispatcher\Validator\HeaderValuesValidator;
use PsCheckout\Core\WebhookDispatcher\Validator\WebhookShopIdValidator;
use PsCheckout\Core\WebhookDispatcher\ValueObject\DispatchWebhookRequest;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use Psr\Log\LoggerInterface;
class ps_checkoutDispatchWebHookModuleFrontController extends AbstractFrontController
{
const PS_CHECKOUT_PAYPAL_ID_LABEL = 'PS_CHECKOUT_PAYPAL_ID_MERCHANT';
/**
* @var bool If set to true, will be redirected to authentication page
*/
public $auth = false;
/**
* @return bool
*/
public function display(): bool
{
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
$logger->info('Webhook dispatch initiated');
try {
/** @var HeaderValuesValidator $headerValuesValidator */
$headerValuesValidator = $this->module->getService(HeaderValuesValidator::class);
$headerValues = $headerValuesValidator->validate();
$logger->info('Headers validated', $headerValues);
/** @var BodyValuesValidator $bodyValuesValidator */
$bodyValuesValidator = $this->module->getService(BodyValuesValidator::class);
$bodyValues = $bodyValuesValidator->validate();
$logger->info('Body validated', $bodyValues);
$dispatchWebhookRequest = DispatchWebhookRequest::createFromRequest($bodyValues, $headerValues);
/** @var CheckPSLSignatureAction $checkPSLSignatureAction */
$checkPSLSignatureAction = $this->module->getService(CheckPSLSignatureAction::class);
$checkPSLSignatureAction->execute($bodyValues);
$logger->info('PSL Signature validated', $bodyValues);
/** @var WebhookShopIdValidator $webhookShopIdValidator */
$webhookShopIdValidator = $this->module->getService(WebhookShopIdValidator::class);
$webhookShopIdValidator->validate($dispatchWebhookRequest->getShopId());
$logger->info('Webhook dispatch started');
/** @var DispatchWebhookProcessor $dispatchWebHookProcessor */
$dispatchWebHookProcessor = $this->module->getService(DispatchWebhookProcessor::class);
$processed = $dispatchWebHookProcessor->process($dispatchWebhookRequest);
if ($processed) {
$logger->info('Webhook dispatch completed successfully');
} else {
$logger->warning('Webhook dispatch completed with no processing');
}
return $processed;
} catch (WebhookException $e) {
// Handle the exception
$logger->error('Webhook Dispatcher error: ' . $e->getMessage());
http_response_code($e->getCode());
echo json_encode(['error' => $e->getMessage()]);
} catch (Throwable $e) {
$logger->error(
sprintf(
'DispatchWebHookController - Exception %s : %s',
$e->getCode(),
$e->getMessage()
),
['exception' => $e]
);
http_response_code(500);
echo json_encode(['error' => 'An unexpected error occurred.']);
}
return false;
}
/**
* Override displayMaintenancePage to prevent the maintenance page to be displayed
*
* @see FrontController::displayMaintenancePage()
*/
protected function displayMaintenancePage()
{
return;
}
/**
* Override displayRestrictedCountryPage to prevent page country is not allowed
*
* @see FrontController::displayRestrictedCountryPage()
*/
protected function displayRestrictedCountryPage()
{
return;
}
/**
* Override geolocationManagement to prevent country GEOIP blocking
*
* @see FrontController::geolocationManagement()
*
* @param Country $defaultCountry
*
* @return false
*/
protected function geolocationManagement($defaultCountry)
{
return false;
}
/**
* Override sslRedirection to prevent redirection
*
* @see FrontController::sslRedirection()
*/
protected function sslRedirection()
{
return;
}
/**
* Override canonicalRedirection to prevent redirection
*
* @see FrontController::canonicalRedirection()
*
* @param string $canonical_url
*/
protected function canonicalRedirection($canonical_url = '')
{
return;
}
}

View File

@@ -0,0 +1,128 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Customer\Action\ExpressCheckoutAction;
use PsCheckout\Core\Customer\Request\ValueObject\ExpressCheckoutRequest;
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\Order\Entity\PayPalOrder;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Infrastructure\Repository\PayPalOrderRepository;
use PsCheckout\Infrastructure\Validator\FrontControllerValidator;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receive ajax call when customer click on an express checkout button
* We retrieve data from PayPal in payload and save it in PrestaShop to prefill order page
* Then customer must be redirected to order page to choose shipping method
*/
class ps_checkoutExpressCheckoutModuleFrontController extends AbstractFrontController
{
/**
* {@inheritdoc}
*/
public function postProcess()
{
/** @var FrontControllerValidator $frontControllerValidator */
$frontControllerValidator = $this->module->getService(FrontControllerValidator::class);
if (!$frontControllerValidator->isExpressCheckoutEnabled()) {
$this->exitWithResponse([
'httpCode' => 403,
'body' => 'Forbidden',
]);
}
// We receive data in a payload not in GET/POST
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (empty($bodyContent)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$requestData = json_decode($bodyContent, true);
if (empty($requestData)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$expressCheckoutRequest = new ExpressCheckoutRequest($requestData);
if (!$expressCheckoutRequest->getOrderId()) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
try {
/** @var PayPalOrderRepository $payPalOrderReposistory */
$payPalOrderReposistory = $this->module->getService(PayPalOrderRepository::class);
/** @var PayPalOrder|null $psCheckoutCart */
$payPalOrder = $payPalOrderReposistory->getOneBy(['id' => $expressCheckoutRequest->getOrderId()]);
if (!$payPalOrder || $payPalOrder->getIdCart() !== $this->context->cart->id) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
if ($payPalOrder) {
$payPalOrder->setFundingSource($expressCheckoutRequest->getFundingSource())
->setIsExpressCheckout(true)
->setIsCardFields(false);
$payPalOrderReposistory->save($payPalOrder);
}
/** @var ExpressCheckoutAction $expressCheckoutAction */
$expressCheckoutAction = $this->module->getService(ExpressCheckoutAction::class);
$expressCheckoutAction->execute($expressCheckoutRequest);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while processing the express checkout.',
PsCheckoutException::UNKNOWN,
$exception
));
}
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => $expressCheckoutRequest->getPayload(),
'exceptionCode' => null,
'exceptionMessage' => null,
]);
}
}

View File

@@ -0,0 +1,150 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\ApplePay\Builder\ApplePayPaymentRequestDataBuilder;
use PsCheckout\Core\Settings\Configuration\PayPalConfiguration;
use PsCheckout\Infrastructure\Adapter\Configuration;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receives AJAX calls when a customer clicks on a payment button.
*/
class Ps_CheckoutApplepayModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
try {
$action = $this->getActionFromRequest();
if (!$action) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Invalid request',
]);
}
switch ($action) {
case 'getPaymentRequest':
$this->getPaymentRequest();
break;
case 'getDomainAssociation':
$this->handleDomainAssociation();
break;
default:
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Invalid request',
]);
}
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while processing the Apple Pay request.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
/**
* Extracts action from the request body or GET parameters.
*
* @return string|null
*/
private function getActionFromRequest()
{
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (!empty($bodyContent)) {
$bodyValues = json_decode($bodyContent, true);
if (!empty($bodyValues['action'])) {
return $bodyValues['action'];
}
}
$action = Tools::getValue('action');
return $action === 'getDomainAssociation' ? $action : null;
}
/**
* Handles the domain association file retrieval for Apple Pay validation.
*
* @return void
*/
private function handleDomainAssociation()
{
/** @var Configuration $configuration */
$configuration = $this->module->getService(Configuration::class);
$environment = $configuration->get(PayPalConfiguration::PS_CHECKOUT_PAYMENT_MODE);
$associationFile = _PS_MODULE_DIR_ . $this->module->name . "/.well-known/apple-$environment-merchantid-domain-association";
if (!file_exists($associationFile)) {
$this->exitWithResponse([
'httpCode' => 404,
'body' => 'File not found',
]);
}
if (!headers_sent()) {
ob_end_clean();
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('X-Robots-Tag: noindex, nofollow');
header_remove('Last-Modified');
header('Content-Type: text/plain', true, 200);
}
echo file_get_contents($associationFile);
exit;
}
/**
* Handles the payment request for Apple Pay.
*
* @return void
*/
private function getPaymentRequest()
{
/** @var ApplePayPaymentRequestDataBuilder $applePayPaymentRequestDataBuilder */
$applePayPaymentRequestDataBuilder = $this->module->getService(ApplePayPaymentRequestDataBuilder::class);
$paymentRequest = $applePayPaymentRequestDataBuilder->build();
$this->exitWithResponse([
'httpCode' => 200,
'body' => $paymentRequest->toArray(),
]);
}
}

View File

@@ -0,0 +1,110 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\Order\Action\CancelPayPalOrderAction;
use PsCheckout\Core\PayPal\Order\Request\ValueObject\CancelPayPalOrderRequest;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Utility\Common\InputStreamUtility;
use Psr\Log\LoggerInterface;
/**
* This controller receive ajax call on customer canceled payment
*/
class Ps_CheckoutCancelModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
try {
if (!Validate::isLoadedObject($this->context->cart)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'No cart found.',
]);
}
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (empty($bodyContent)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$bodyValues = json_decode($bodyContent, true);
if (empty($bodyValues)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$orderCancelRequest = new CancelPayPalOrderRequest($bodyValues, $this->context->cart->id);
if ($orderCancelRequest->getOrderId()) {
/** @var CancelPayPalOrderAction $cancelPayPalOrderAction */
$cancelPayPalOrderAction = $this->module->getService(CancelPayPalOrderAction::class);
$cancelPayPalOrderAction->execute($orderCancelRequest);
}
$logger->log(
$orderCancelRequest->getError() ? 400 : 200,
'Customer canceled payment',
[
'PayPalOrderId' => $orderCancelRequest->getOrderId(),
'FundingSource' => $orderCancelRequest->getFundingSource(),
'id_cart' => $this->context->cart->id,
'isExpressCheckout' => $orderCancelRequest->isExpressCheckout(),
'isHostedFields' => $orderCancelRequest->isHostedFields(),
'reason' => $orderCancelRequest->getReason(),
'error' => $orderCancelRequest->getError(),
]
);
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => $bodyValues,
'exceptionCode' => null,
'exceptionMessage' => null,
]);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while canceling the PayPal order.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
}

View File

@@ -0,0 +1,115 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\Order\Action\CancelPayPalOrderAction;
use PsCheckout\Core\PayPal\Order\Processor\UpdateExternalPayPalOrderProcessor;
use PsCheckout\Core\PayPal\Order\Request\ValueObject\CancelPayPalOrderRequest;
use PsCheckout\Core\PayPal\Order\Request\ValueObject\CheckPayPalOrderRequest;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Utility\Common\InputStreamUtility;
use Psr\Log\LoggerInterface;
/**
* This controller receive ajax call on customer click on a payment button
*/
class Ps_CheckoutCheckModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
try {
if (!Validate::isLoadedObject($this->context->cart)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'No cart found.',
]);
}
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
$bodyValues = json_decode($bodyContent, true);
if (empty($bodyContent) || empty($bodyValues)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$checkOrderRequest = new CheckPayPalOrderRequest($this->context->cart->id, $bodyValues);
if (!$checkOrderRequest->getOrderId()) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Missing PayPal Order Id',
]);
}
try {
/** @var UpdateExternalPayPalOrderProcessor $updateExternalPayPalOrderProcessor */
$updateExternalPayPalOrderProcessor = $this->module->getService(UpdateExternalPayPalOrderProcessor::class);
$updateExternalPayPalOrderProcessor->execute($checkOrderRequest);
} catch (Exception $exception) {
$logger->error(
'Failed to patch PayPal Order',
[
'PayPalOrderId' => $checkOrderRequest->getOrderId(),
'FundingSource' => $checkOrderRequest->getFundingSource(),
'isExpressCheckout' => $checkOrderRequest->isExpressCheckout(),
'isHostedFields' => $checkOrderRequest->isHostedFields(),
'id_cart' => (int) $this->context->cart->id,
]
);
/** @var CancelPayPalOrderAction $cancelPayPalOrderAction */
$cancelPayPalOrderAction = $this->module->getService(CancelPayPalOrderAction::class);
$cancelPayPalOrderAction->execute(new CancelPayPalOrderRequest($bodyValues, $this->context->cart->id));
}
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => $bodyValues,
'exceptionCode' => null,
'exceptionMessage' => null,
]);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while checking the PayPal order.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
}

View File

@@ -0,0 +1,181 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\Order\Action\CreatePayPalOrderAction;
use PsCheckout\Core\PayPal\Order\Configuration\PayPalOrderStatus;
use PsCheckout\Core\PayPal\Order\Request\ValueObject\CreatePayPalOrderRequest;
use PsCheckout\Infrastructure\Action\AddProductToCartAction;
use PsCheckout\Infrastructure\Adapter\Context;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Infrastructure\Repository\PayPalOrderRepository;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receives ajax call to create a PayPal Order
*/
class Ps_CheckoutCreateModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
try {
/** @var Context $context */
$context = $this->module->getService(Context::class);
// BEGIN Express Checkout
$requestData = [];
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (!empty($bodyContent)) {
$requestData = json_decode($bodyContent, true);
}
$requestData['isExpressCheckout'] = (isset($requestData['isExpressCheckout']) && $requestData['isExpressCheckout']) || empty($this->context->cart->id_address_delivery);
$createPayPalOrderRequest = new CreatePayPalOrderRequest($requestData);
if ($this->shouldCreateCart($createPayPalOrderRequest)) {
try {
/** @var AddProductToCartAction $addProductToCartAction */
$addProductToCartAction = $this->module->getService(AddProductToCartAction::class);
$addProductToCartAction->execute($createPayPalOrderRequest);
} catch (PsCheckoutException $exception) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
'body' => [
'error' => [
'message' => 'Failed to update cart quantity.',
],
],
]);
}
}
// END Express Checkout
if (!isset($context->getCart()->id)) {
$this->exitWithResponse([
'httpCode' => 404,
'body' => 'Cart not found',
]);
}
// Validate PUI amount limits (5 EUR < amount < 2500 EUR)
if ($createPayPalOrderRequest->getFundingSource() === 'pay_upon_invoice') {
$cart = $context->getCart();
$cartTotal = (float) $cart->getOrderTotal(true, \Cart::BOTH);
if ($cartTotal <= 5.00 || $cartTotal >= 2500.00) {
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
'body' => [
'error' => [
'message' => $this->module->l('The payment is not valid: the amount is not eligible.', 'create'),
],
],
]);
}
}
if ($createPayPalOrderRequest->isExpressCheckout() || empty($context->getCart()->id_address_delivery)) {
/** @var PayPalOrderRepository $payPalOrderRepository */
$payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class);
$payPalOrder = $payPalOrderRepository->getOneByCartId((int) $context->getCart()->id);
if ($payPalOrder && $payPalOrder->isExpressCheckout() && in_array(
$payPalOrder->getStatus(),
[
PayPalOrderStatus::CREATED,
PayPalOrderStatus::APPROVED,
PayPalOrderStatus::PAYER_ACTION_REQUIRED,
],
true
)) {
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => [
'orderID' => $payPalOrder->getId(),
],
'exceptionCode' => null,
'exceptionMessage' => null,
]);
}
}
/** @var CreatePayPalOrderAction $createPayPalOrderAction */
$createPayPalOrderAction = $this->module->getService(CreatePayPalOrderAction::class);
$createPayPalOrderAction->execute((int) $context->getCart()->id, $createPayPalOrderRequest);
/** @var PayPalOrderRepository $payPalOrderRepository */
$payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class);
$payPalOrder = $payPalOrderRepository->getOneByCartId((int) $context->getCart()->id);
if (!$payPalOrder) {
$this->exitWithResponse([
'httpCode' => 404,
'body' => 'PayPal order not found',
]);
}
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => [
'orderID' => $payPalOrder->getId(),
],
'exceptionCode' => null,
'exceptionMessage' => null,
]);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while creating the PayPal order.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
/**
* @param CreatePayPalOrderRequest $checkoutRequest
*
* @return bool
*/
private function shouldCreateCart(CreatePayPalOrderRequest $checkoutRequest): bool
{
return $checkoutRequest->getQuantityWanted() !== null
|| $checkoutRequest->getIdProduct() !== null
|| $checkoutRequest->getIdProductAttribute() !== null
|| $checkoutRequest->getIdCustomization() !== null;
}
}

View File

@@ -0,0 +1,82 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PayPal\GooglePay\Builder\GooglePayPaymentRequestDataBuilder;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receive ajax call on customer click on a payment button
*/
class Ps_CheckoutGooglepayModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
try {
$bodyValues = [];
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (!empty($bodyContent)) {
$bodyValues = json_decode($bodyContent, true);
}
$action = $bodyValues['action'] ?? null;
if ($action === 'getTransactionInfo') {
$this->getTransactionInfo();
} else {
$this->exitWithExceptionMessage(new Exception('Invalid request', 400));
}
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while processing the Google Pay request.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
/**
* @return void
*/
private function getTransactionInfo()
{
/** @var GooglePayPaymentRequestDataBuilder $googlePayPaymentRequestDataBuilder */
$googlePayPaymentRequestDataBuilder = $this->module->getService(GooglePayPaymentRequestDataBuilder::class);
$transactionInfo = $googlePayPaymentRequestDataBuilder->build($this->context->cart->id);
$this->exitWithResponse([
'httpCode' => 200,
'body' => $transactionInfo->toArray(),
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,369 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Api\ValueObject\PayPalOrderResponse;
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\Order\Action\CreateOrderAction;
use PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureConfiguration;
use PsCheckout\Core\PayPal\Card3DSecure\Card3DSecureValidator;
use PsCheckout\Core\PayPal\Order\Action\CapturePayPalOrderAction;
use PsCheckout\Core\PayPal\Order\Configuration\PayPalOrderStatus;
use PsCheckout\Core\PayPal\Order\Entity\PayPalOrder;
use PsCheckout\Core\PayPal\Order\Exception\PayPalOrderException;
use PsCheckout\Core\PayPal\Order\Provider\PayPalOrderProvider;
use PsCheckout\Core\Settings\Configuration\PayPalConfiguration;
use PsCheckout\Infrastructure\Adapter\Tools;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Infrastructure\Repository\OrderRepository;
use PsCheckout\Infrastructure\Repository\PaymentTokenRepository;
use PsCheckout\Infrastructure\Repository\PayPalOrderRepository;
use PsCheckout\Module\Presentation\Translator;
use Psr\Log\LoggerInterface;
class Ps_CheckoutPaymentModuleFrontController extends AbstractFrontController
{
public $ssl = true;
public $controller_type = 'front';
public $display_footer = false;
public $display_header = true;
private $orderPageUrl;
private $paypalOrderId;
/**
* @return bool
*/
public function checkAccess(): bool
{
return $this->context->customer && $this->context->cart;
}
/**
* @return void
*
* @throws PrestaShopException
*/
public function initContent()
{
parent::initContent();
$this->setTemplate('module:' . $this->module->name . '/views/templates/front/payment.tpl');
$this->context->smarty->assign([
'css_url' => $this->module->getPathUri() . 'views/css/payment.css',
'order_url' => $this->orderPageUrl,
]);
}
/**
* @return bool|void
*/
public function setMedia()
{
$this->registerStylesheet('ps_checkout_payment', '/modules/' . $this->module->name . '/views/css/payment.css');
parent::setMedia();
}
/**
* @return void
*/
public function postProcess()
{
$this->orderPageUrl = $this->context->link->getPageLink('order');
/** @var Tools $tools */
$tools = $this->module->getService(Tools::class);
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
$orderId = $tools->getValue('orderID');
if (!$orderId) {
$logger->error('No PayPal Order ID found.');
$tools->redirect($this->orderPageUrl);
}
$this->paypalOrderId = $orderId;
$logger->info('Processing PayPal Order ID: ' . $this->paypalOrderId);
try {
/** @var PayPalOrderRepository $payPalOrderRepository */
$payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class);
/** @var PayPalOrderProvider $payPalOrderProvider */
$payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class);
/** @var OrderRepository $orderRepository */
$orderRepository = $this->module->getService(OrderRepository::class);
$payPalOrder = $payPalOrderRepository->getOneBy(['id' => $this->paypalOrderId]);
if (!$payPalOrder) {
$logger->error('PayPal Order not found: ' . $this->paypalOrderId);
$tools->redirect($this->orderPageUrl);
}
$orders = $orderRepository->getAllBy(['id_cart' => $payPalOrder->getIdCart()]);
if (!empty($orders)) {
$this->handleExistingOrder($payPalOrder->getIdCart());
}
if ($payPalOrder->getIdCart() !== $this->context->cart->id) {
$logger->error('Cart Id mismatch for PayPal Order: ' . $this->paypalOrderId);
$tools->redirect($this->orderPageUrl);
}
$payPalOrderResponse = $payPalOrderProvider->getById($this->paypalOrderId);
$this->handleOrderStatus($payPalOrderResponse, $payPalOrder);
} catch (Throwable $exception) {
$logger->error(
sprintf(
'PaymentController - Exception %s : %s',
$exception->getCode(),
$exception->getMessage()
),
['exception' => $exception]
);
/** @var Translator $translator **/
$translator = $this->module->getService(Translator::class);
$this->context->smarty->assign('error', $translator->trans('There was an error during the payment. Please try again or contact the support.'));
}
}
/**
* @param int $cartId
*
* @return void
*/
private function handleExistingOrder(int $cartId)
{
/** @var Tools $tools */
$tools = $this->module->getService(Tools::class);
/** @var PayPalOrderProvider $payPalOrderProvider */
$payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class);
if ($this->context->customer->isLogged()) {
$tools->redirect($this->context->link->getPageLink('history'));
} else {
$payPalOrderResponse = $payPalOrderProvider->getById($this->paypalOrderId);
$this->redirectToOrderConfirmationPage(
$cartId,
$payPalOrderResponse->getCapture()['id'] ?? null,
$payPalOrderResponse->getStatus()
);
}
}
/**
* @param PayPalOrderResponse $payPalOrderResponse
* @param PayPalOrder $payPalOrder
*
* @return void
*
* @throws PayPalOrderException
* @throws PsCheckoutException
*/
private function handleOrderStatus(
PayPalOrderResponse $payPalOrderResponse,
PayPalOrder $payPalOrder
) {
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
/** @var CapturePayPalOrderAction $capturePayPalOrderAction */
$capturePayPalOrderAction = $this->module->getService(CapturePayPalOrderAction::class);
/** @var PayPalOrderProvider $payPalOrderProvider */
$payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class);
switch ($payPalOrderResponse->getStatus()) {
case PayPalOrderStatus::COMPLETED:
$logger->info('PayPal Order Completed: ' . $this->paypalOrderId);
$this->createOrder($payPalOrderResponse, $payPalOrder);
break;
case PayPalOrderStatus::PAYER_ACTION_REQUIRED:
$logger->info('3DS Verification Required for PayPal Order: ' . $this->paypalOrderId);
$this->redirectTo3DSVerification($payPalOrderResponse);
break;
case PayPalOrderStatus::CREATED:
$this->handle3DSecureDecision($payPalOrderResponse, $payPalOrder);
break;
case PayPalOrderStatus::APPROVED:
$logger->info('Capturing PayPal Order: ' . $this->paypalOrderId);
$capturePayPalOrderAction->execute($payPalOrderResponse);
$this->createOrder($payPalOrderProvider->getById($this->paypalOrderId), $payPalOrder);
break;
}
}
/**
* @param PayPalOrderResponse $payPalOrderResponse
* @param PayPalOrder $payPalOrder
*
* @return void
*
* @throws PsCheckoutException
* @throws PayPalOrderException
*/
private function handle3DSecureDecision(
PayPalOrderResponse $payPalOrderResponse,
PayPalOrder $payPalOrder
) {
/** @var Card3DSecureValidator $card3DSecure */
$card3DSecure = $this->module->getService(Card3DSecureValidator::class);
/** @var CapturePayPalOrderAction $capturePayPalOrderAction */
$capturePayPalOrderAction = $this->module->getService(CapturePayPalOrderAction::class);
/** @var PayPalOrderProvider $payPalOrderProvider */
$payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class);
/** @var PayPalConfiguration $payPalConfiguration */
$payPalConfiguration = $this->module->getService(PayPalConfiguration::class);
switch ($card3DSecure->getAuthorizationDecision($payPalOrderResponse)) {
case Card3DSecureConfiguration::DECISION_RETRY:
$this->redirectTo3DSVerification($payPalOrderResponse);
break;
case Card3DSecureConfiguration::DECISION_PROCEED:
$capturePayPalOrderAction->execute($payPalOrderResponse);
$this->createOrder($payPalOrderProvider->getById($this->paypalOrderId), $payPalOrder);
break;
case Card3DSecureConfiguration::DECISION_NO_DECISION:
if ($payPalConfiguration->getCardFieldsContingencies() !== 'SCA_ALWAYS') {
$capturePayPalOrderAction->execute($payPalOrderResponse);
$this->createOrder($payPalOrderProvider->getById($this->paypalOrderId), $payPalOrder);
}
break;
}
}
/**
* @param PayPalOrderResponse $payPalOrderResponse
* @param PayPalOrder $payPalOrder
*
* @return void
*
* @throws PsCheckoutException
*/
private function createOrder(PayPalOrderResponse $payPalOrderResponse, PayPalOrder $payPalOrder)
{
/** @var CreateOrderAction $createOrderAction */
$createOrderAction = $this->module->getService(CreateOrderAction::class);
$createOrderAction->execute($payPalOrderResponse);
if ($payPalOrder->getPaymentTokenId() && $payPalOrder->checkCustomerIntent(PayPalConfiguration::PS_CHECKOUT_CUSTOMER_INTENT_FAVORITE)) {
/** @var PaymentTokenRepository $paymentTokenRepository */
$paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class);
$paymentTokenRepository->setTokenFavorite($payPalOrder->getPaymentTokenId(), $payPalOrderResponse->getCustomerId());
}
$this->redirectToOrderConfirmationPage(
$payPalOrder->getIdCart(),
$payPalOrderResponse->getCapture()['id'] ?? null,
$payPalOrderResponse->getStatus()
);
}
/**
* @param PayPalOrderResponse $paypalOrder
*
* @return void
*/
private function redirectTo3DSVerification(PayPalOrderResponse $payPalOrderResponse)
{
/** @var Tools $tools */
$tools = $this->module->getService(Tools::class);
$payerActionLinks = array_filter($payPalOrderResponse->getLinks(), function ($link) {
return $link['rel'] === 'payer-action';
});
if (!empty($payerActionLinks)) {
$redirectUrl = reset($payerActionLinks)['href'] . '&redirect_uri=' . urlencode(
$this->context->link->getModuleLink($this->module->name, 'payment', ['orderID' => $payPalOrderResponse->getId()])
);
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
$logger->info('Redirecting to 3DS verification: ' . $redirectUrl);
$tools->redirect($redirectUrl);
}
}
/**
* @param int $cartId
* @param string|null $captureId
* @param string $payPalOrderStatus
*
* @return void
*/
private function redirectToOrderConfirmationPage(int $cartId, $captureId, string $payPalOrderStatus)
{
/** @var Tools $tools */
$tools = $this->module->getService(Tools::class);
/** @var OrderRepository $orderRepository */
$orderRepository = $this->module->getService(OrderRepository::class);
$orders = $orderRepository->getAllBy(['id_cart' => $cartId]);
if (empty($orders)) {
return;
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$orderConfirmationUrl = $this->context->link->getPageLink(
'order-confirmation',
true,
$orders[0]->id_lang ?? null,
[
'paypal_status' => $payPalOrderStatus,
'paypal_order' => $this->paypalOrderId,
'paypal_transaction' => $captureId,
'id_cart' => $cartId,
'id_module' => (int) $this->module->id,
'id_order' => $orders[0]->id ?? null,
'key' => (new Cart($cartId))->secure_key,
]
);
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
$logger->info('Redirecting to order confirmation: ' . $orderConfirmationUrl);
$tools->redirect($orderConfirmationUrl);
}
}
}

View File

@@ -0,0 +1,202 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\Order\Exception\Handler\OrderCreationExceptionHandler;
use PsCheckout\Core\Order\Processor\CreateOrderProcessor;
use PsCheckout\Core\Order\Request\ValueObject\ValidateOrderRequest;
use PsCheckout\Core\PayPal\Order\Entity\PayPalOrder;
use PsCheckout\Core\PayPal\Order\Validator\CreatedPayPalOrderValidator;
use PsCheckout\Core\PayPal\Order\Validator\CreatedPayPalOrderValidatorInterface;
use PsCheckout\Core\PayPal\Order\Validator\CreatedPayUponInvoiceOrderValidator;
use PsCheckout\Core\PayPal\Order\ValueObject\PayPalOrderCompletionData;
use PsCheckout\Infrastructure\Adapter\Tools;
use PsCheckout\Infrastructure\Adapter\Validate;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Infrastructure\Repository\PayPalOrderRepository;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receive ajax call to capture/authorize payment and create a PrestaShop Order
*/
class Ps_CheckoutValidateModuleFrontController extends AbstractFrontController
{
/**
* @var Ps_checkout
*/
public $module;
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
/** @var Tools $tools */
$tools = $this->module->getService(Tools::class);
/** @var Validate $validate */
$validate = $this->module->getService(Validate::class);
$checkoutRequest = null;
try {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (empty($bodyContent)) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
$bodyValues = json_decode($bodyContent, true);
} else {
$bodyValues = [
'orderID' => $tools->getValue('token'),
'payerID' => $tools->getValue('token')('PayerID'),
];
}
/** @var PayPalOrderRepository $payPalOrderRepository */
$payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class);
/** @var PayPalOrder $payPalOrder */
$payPalOrder = $payPalOrderRepository->getOneBy(['id' => $bodyValues['orderID']]);
if (!$payPalOrder) {
throw new PsCheckoutException('PayPal Order not found', PsCheckoutException::PAYPAL_ORDER_NOT_FOUND);
}
$checkoutRequest = new ValidateOrderRequest($bodyValues, $payPalOrder->getIdCart());
if (empty($checkoutRequest->getOrderId()) || !$validate->isGenericName($checkoutRequest->getOrderId())) {
$this->exitWithResponse([
'httpCode' => 400,
'body' => 'Payload invalid',
]);
}
/** @var CreateOrderProcessor $createOrderProcessor */
$createOrderProcessor = $this->module->getService(CreateOrderProcessor::class);
$createOrderProcessor->run($checkoutRequest);
/** @var CreatedPayPalOrderValidatorInterface $createdOrderValidator */
$createdOrderValidator = $this->getCreatedOrderValidator($checkoutRequest);
$completedPayPalOrderData = $createdOrderValidator->validate($checkoutRequest->getOrderId(), $checkoutRequest->getCartId());
if (empty($completedPayPalOrderData)) {
throw new PsCheckoutException('PayPal Order not found', PsCheckoutException::PAYPAL_ORDER_NOT_FOUND);
}
$this->sendOkResponse($completedPayPalOrderData);
} catch (Exception $exception) {
if (!$checkoutRequest) {
$this->handleOrderCreationException($exception, 'unknown');
}
// NOTE: Retry to get the PayPal Order after the order creation
/** @var CreatedPayPalOrderValidatorInterface $createdOrderValidator */
$createdOrderValidator = $this->getCreatedOrderValidator($checkoutRequest);
$completedPayPalOrderData = $createdOrderValidator->validate($checkoutRequest->getOrderId(), $checkoutRequest->getCartId());
if (!empty($completedPayPalOrderData)) {
$this->sendOkResponse($completedPayPalOrderData);
}
$this->handleOrderCreationException($exception, $checkoutRequest->getOrderId());
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while validating the PayPal order.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
/**
* @param PayPalOrderCompletionData $orderCompletionData
*
* @return void
*/
private function sendOkResponse(PayPalOrderCompletionData $orderCompletionData)
{
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => $orderCompletionData->toArray(),
'exceptionCode' => null,
'exceptionMessage' => null,
]);
}
/**
* @param Exception $exception
* @param string $paypalOrderId
*
* @return void
*/
public function handleOrderCreationException(Exception $exception, string $paypalOrderId)
{
/** @var OrderCreationExceptionHandler $orderCreationExceptionHandler */
$orderCreationExceptionHandler = $this->module->getService(OrderCreationExceptionHandler::class);
$responseData = $orderCreationExceptionHandler->handle($exception, $paypalOrderId);
if ($responseData['httpCode'] === 500) {
$this->exitWithResponse($responseData);
} else {
$this->sendBadRequestError($responseData['body']['error']['message'], $exception);
}
}
/**
* @param string $exceptionMessageForCustomer
* @param Exception $exception
*
* @return void
*/
private function sendBadRequestError(string $exceptionMessageForCustomer, Exception $exception)
{
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
'body' => [
'error' => [
'code' => $exception->getCode(),
'message' => $exceptionMessageForCustomer,
],
],
]);
}
private function getCreatedOrderValidator(ValidateOrderRequest $checkoutRequest)
{
if ($checkoutRequest->getFundingSource() === 'pay_upon_invoice') {
return $this->module->getService(CreatedPayUponInvoiceOrderValidator::class);
}
return $this->module->getService(CreatedPayPalOrderValidator::class);
}
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\PaymentToken\Action\DeletePaymentTokenAction;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Infrastructure\Repository\PaymentTokenRepository;
use PsCheckout\Utility\Common\InputStreamUtility;
/**
* This controller receive ajax call to manage the Customer PayPal Payment Method tokens
*/
class Ps_CheckoutVaultModuleFrontController extends AbstractFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
try {
$bodyValues = [];
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$bodyContent = $inputStreamUtility->getBodyContent();
if (!empty($bodyContent)) {
$bodyValues = json_decode($bodyContent, true);
}
$customerId = $this->context->customer->isLogged() ? $this->context->customer->id : null;
if (isset($bodyValues['action'])) {
$action = $bodyValues['action'];
switch ($action) {
case 'deleteToken':
$vaultId = $bodyValues['vaultId'];
/** @var DeletePaymentTokenAction $deletePaymentTokenAction */
$deletePaymentTokenAction = $this->module->getService(DeletePaymentTokenAction::class);
$deletePaymentTokenAction->execute($vaultId, $customerId);
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
]);
break;
default:
$this->exitWithResponse([
'status' => false,
'httpCode' => 400,
]);
}
}
/** @var PaymentTokenRepository $paymentTokenRepository */
$paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class);
$tokens = $paymentTokenRepository->getAllByCustomerId($customerId);
$this->exitWithResponse([
'status' => true,
'httpCode' => 200,
'body' => [
'customerId' => $customerId,
'paymentTokens' => $tokens,
'totalItems' => null,
'totalPages' => null,
],
]);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while processing the vault request.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
}

View File

@@ -0,0 +1,213 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PsCheckout\Core\Exception\PsCheckoutException;
use PsCheckout\Core\Webhook\Handler\WebhookHandler;
use PsCheckout\Core\Webhook\Handler\WebhookHandlerInterface;
use PsCheckout\Core\Webhook\WebhookException;
use PsCheckout\Infrastructure\Controller\AbstractFrontController;
use PsCheckout\Utility\Common\InputStreamUtility;
use Psr\Log\LoggerInterface;
/**
* This controller receive webhook from API to performs asynchronous changes
*/
class Ps_CheckoutWebhookModuleFrontController extends AbstractFrontController
{
/**
* @var bool If set to true, will be redirected to authentication page
*/
public $auth = false;
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
/** @var LoggerInterface $logger */
$logger = $this->module->getService(LoggerInterface::class);
try {
/** @var WebhookHandlerInterface $webhookHandler */
$webhookHandler = $this->module->getService(WebhookHandler::class);
if (empty($_SERVER['HTTP_WEBHOOK_SECRET']) || !$webhookHandler->authenticate($_SERVER['HTTP_WEBHOOK_SECRET'])) {
throw new WebhookException('Webhook secret mismatch', WebhookException::WEBHOOK_SECRET_MISMATCH);
}
$payload = $this->getPayload();
$webhookHandler->handle($payload);
$logger->debug(
'Webhook handled successfully',
[
'id' => $payload['id'],
'createTime' => $payload['createTime'],
'eventType' => $payload['eventType'],
'eventVersion' => $payload['eventVersion'],
'summary' => $payload['summary'],
'resourceType' => $payload['resourceType'],
'resource' => $payload['resource'],
]
);
$this->exitWithResponse([
'httpCode' => 200,
]);
exit;
} catch (WebhookException $exception) {
switch ($exception->getCode()) {
case WebhookException::WEBHOOK_SECRET_MISMATCH:
$this->exitWithResponse([
'httpCode' => 401,
'error' => $exception->getMessage(),
]);
break;
default:
$this->exitWithResponse([
'httpCode' => 400,
'error' => $exception->getMessage(),
]);
}
exit;
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Throwable $exception) {
$this->exitWithExceptionMessage(new PsCheckoutException(
'An error occurred while processing the webhook.',
PsCheckoutException::UNKNOWN,
$exception
));
}
}
/**
* @return array{id: string, createTime: string, eventType: string, eventVersion: string, summary: string, resourceType: string, resource: array}
*
* @throws PsCheckoutException
*/
private function getPayload(): array
{
/** @var InputStreamUtility $inputStreamUtility */
$inputStreamUtility = $this->module->getService(InputStreamUtility::class);
$content = $inputStreamUtility->getBodyContent();
if (empty($content)) {
throw new WebhookException('Webhook payload is missing.', WebhookException::WEBHOOK_PAYLOAD_INVALID);
}
$payload = json_decode($content, true);
if (null === $payload && JSON_ERROR_NONE !== json_last_error()) {
throw new PsCheckoutException('Webhook payload cannot be decoded: ' . json_last_error_msg(), WebhookException::WEBHOOK_PAYLOAD_INVALID);
}
if (empty($payload['id'])) {
throw new WebhookException('Webhook id is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['createTime'])) {
throw new WebhookException('Webhook createTime is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['eventType'])) {
throw new WebhookException('Webhook eventType is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['eventVersion'])) {
throw new WebhookException('Webhook eventVersion is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['summary'])) {
throw new WebhookException('Webhook summary is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['resourceType'])) {
throw new WebhookException('Webhook resourceType is missing', WebhookException::WEBHOOK_PAYLOAD_EVENT_TYPE_MISSING);
}
if (empty($payload['resource'])) {
throw new WebhookException('Webhook resource is missing', WebhookException::WEBHOOK_PAYLOAD_RESOURCE_MISSING);
}
return $payload;
}
/**
* Override displayMaintenancePage to prevent the maintenance page to be displayed
*
* @see FrontController::displayMaintenancePage()
*/
protected function displayMaintenancePage()
{
return;
}
/**
* Override displayRestrictedCountryPage to prevent page country is not allowed
*
* @see FrontController::displayRestrictedCountryPage()
*/
protected function displayRestrictedCountryPage()
{
return;
}
/**
* Override geolocationManagement to prevent country GEOIP blocking
*
* @see FrontController::geolocationManagement()
*
* @param Country $defaultCountry
*
* @return false
*/
protected function geolocationManagement($defaultCountry): bool
{
return false;
}
/**
* Override sslRedirection to prevent redirection
*
* @see FrontController::sslRedirection()
*/
protected function sslRedirection()
{
return;
}
/**
* Override canonicalRedirection to prevent redirection
*
* @see FrontController::canonicalRedirection()
*
* @param string $canonical_url
*/
protected function canonicalRedirection($canonical_url = '')
{
return;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,8 @@
{
"dependencies": [
{
"name" : "ps_accounts",
"id": "49648"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,200 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
namespace PsCheckout\Module\Presentation;
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaShopBundle\Translation\TranslatorInterface as PrestaShopTranslator;
use PsCheckout\Presentation\TranslatorInterface;
class Translator implements TranslatorInterface
{
/**
* @var PrestaShopTranslator
*/
private $translator;
public function __construct(PrestaShopTranslator $translator)
{
$this->translator = $translator;
}
/**
* {@inheritdoc}
*/
public function trans(string $key, array $parameters = []): string
{
$map = [
'Checkout' => $this->translator->trans('Checkout', $parameters, 'Modules.Checkout.Pscheckout'),
'Go back to the Checkout' => $this->translator->trans('Go back to the Checkout', $parameters, 'Modules.Checkout.Pscheckout'),
'Card payment' => $this->translator->trans('Card payment', $parameters, 'Modules.Checkout.Pscheckout'),
'Order summary' => $this->translator->trans('Order summary', $parameters, 'Modules.Checkout.Pscheckout'),
'Your shopping cart is empty.' => $this->translator->trans('Your shopping cart is empty.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal' => $this->translator->trans('PayPal', $parameters, 'Modules.Checkout.Pscheckout'),
'You have chosen to pay by Card.' => $this->translator->trans('You have chosen to pay by Card.', $parameters, 'Modules.Checkout.Pscheckout'),
'You have chosen to pay by PayPal.' => $this->translator->trans('You have chosen to pay by PayPal.', $parameters, 'Modules.Checkout.Pscheckout'),
'Here is a short summary of your order:' => $this->translator->trans('Here is a short summary of your order:', $parameters, 'Modules.Checkout.Pscheckout'),
'The total amount of your order comes to' => $this->translator->trans('The total amount of your order comes to', $parameters, 'Modules.Checkout.Pscheckout'),
'(tax incl.)' => $this->translator->trans('(tax incl.)', $parameters, 'Modules.Checkout.Pscheckout'),
'Please confirm your order by clicking "I confirm my order".' => $this->translator->trans('Please confirm your order by clicking "I confirm my order".', $parameters, 'Modules.Checkout.Pscheckout'),
'Delete this payment method?' => $this->translator->trans('Delete this payment method?', $parameters, 'Modules.Checkout.Pscheckout'),
'The following payment method will be deleted from your account:' => $this->translator->trans('The following payment method will be deleted from your account:', $parameters, 'Modules.Checkout.Pscheckout'),
'Delete payment method' => $this->translator->trans('Delete payment method', $parameters, 'Modules.Checkout.Pscheckout'),
'Please wait, we are processing your request' => $this->translator->trans('Please wait, we are processing your request', $parameters, 'Modules.Checkout.Pscheckout'),
'Other payment methods' => $this->translator->trans('Other payment methods', $parameters, 'Modules.Checkout.Pscheckout'),
'I confirm my order' => $this->translator->trans('I confirm my order', $parameters, 'Modules.Checkout.Pscheckout'),
'Thanks for your purchase!' => $this->translator->trans('Thanks for your purchase!', $parameters, 'Modules.Checkout.Pscheckout'),
'Please wait, we are processing your payment' => $this->translator->trans('Please wait, we are processing your payment', $parameters, 'Modules.Checkout.Pscheckout'),
'This is taking longer than expected. Please wait...' => $this->translator->trans('This is taking longer than expected. Please wait...', $parameters, 'Modules.Checkout.Pscheckout'),
'Ok' => $this->translator->trans('Ok', $parameters, 'Modules.Checkout.Pscheckout'),
'Cancel' => $this->translator->trans('Cancel', $parameters, 'Modules.Checkout.Pscheckout'),
'100% secure payments' => $this->translator->trans('100% secure payments', $parameters, 'Modules.Checkout.Pscheckout'),
'or' => $this->translator->trans('or', $parameters, 'Modules.Checkout.Pscheckout'),
'Express Checkout' => $this->translator->trans('Express Checkout', $parameters, 'Modules.Checkout.Pscheckout'),
'Card' => $this->translator->trans('Card', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay by Card - 100% secure payments' => $this->translator->trans('Pay by Card - 100% secure payments', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay with a PayPal account' => $this->translator->trans('Pay with a PayPal account', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay in installments with PayPal Pay Later' => $this->translator->trans('Pay in installments with PayPal Pay Later', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay by %s' => $this->translator->trans('Pay by %s', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay with %s' => $this->translator->trans('Pay with %s', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay later with invoice' => $this->translator->trans('Pay later with invoice', $parameters, 'Modules.Checkout.Pscheckout'),
'Pay upon Invoice' => $this->translator->trans('Pay upon Invoice', $parameters, 'Modules.Checkout.Pscheckout'),
'Card holder name' => $this->translator->trans('Card holder name', $parameters, 'Modules.Checkout.Pscheckout'),
'Card number' => $this->translator->trans('Card number', $parameters, 'Modules.Checkout.Pscheckout'),
'Expiry date' => $this->translator->trans('Expiry date', $parameters, 'Modules.Checkout.Pscheckout'),
'MM/YY' => $this->translator->trans('MM/YY', $parameters, 'Modules.Checkout.Pscheckout'),
'CVC' => $this->translator->trans('CVC', $parameters, 'Modules.Checkout.Pscheckout'),
'XXX' => $this->translator->trans('XXX', $parameters, 'Modules.Checkout.Pscheckout'),
'Created' => $this->translator->trans('Created', $parameters, 'Modules.Checkout.Pscheckout'),
'Saved' => $this->translator->trans('Saved', $parameters, 'Modules.Checkout.Pscheckout'),
'Approved' => $this->translator->trans('Approved', $parameters, 'Modules.Checkout.Pscheckout'),
'Voided' => $this->translator->trans('Voided', $parameters, 'Modules.Checkout.Pscheckout'),
'Completed' => $this->translator->trans('Completed', $parameters, 'Modules.Checkout.Pscheckout'),
'Declined' => $this->translator->trans('Declined', $parameters, 'Modules.Checkout.Pscheckout'),
'Pending' => $this->translator->trans('Pending', $parameters, 'Modules.Checkout.Pscheckout'),
'Partially refunded' => $this->translator->trans('Partially refunded', $parameters, 'Modules.Checkout.Pscheckout'),
'Refunded' => $this->translator->trans('Refunded', $parameters, 'Modules.Checkout.Pscheckout'),
'Failed' => $this->translator->trans('Failed', $parameters, 'Modules.Checkout.Pscheckout'),
'There was an error during the payment. Please try again or contact the support.' => $this->translator->trans('There was an error during the payment. Please try again or contact the support.', $parameters, 'Modules.Checkout.Pscheckout'),
'No PayPal Javascript SDK Instance' => $this->translator->trans('No PayPal Javascript SDK Instance', $parameters, 'Modules.Checkout.Pscheckout'),
'No Google Pay Javascript SDK Instance' => $this->translator->trans('No Google Pay Javascript SDK Instance', $parameters, 'Modules.Checkout.Pscheckout'),
'No Apple Pay Javascript SDK Instance' => $this->translator->trans('No Apple Pay Javascript SDK Instance', $parameters, 'Modules.Checkout.Pscheckout'),
'An error occurred fetching Google Pay transaction info' => $this->translator->trans('An error occurred fetching Google Pay transaction info', $parameters, 'Modules.Checkout.Pscheckout'),
'An error occurred fetching Apple Pay payment request' => $this->translator->trans('An error occurred fetching Apple Pay payment request', $parameters, 'Modules.Checkout.Pscheckout'),
'Card holder authentication canceled, please choose another payment method or try again.' => $this->translator->trans('Card holder authentication canceled, please choose another payment method or try again.', $parameters, 'Modules.Checkout.Pscheckout'),
'An error occurred on card holder authentication, please choose another payment method or try again.' => $this->translator->trans('An error occurred on card holder authentication, please choose another payment method or try again.', $parameters, 'Modules.Checkout.Pscheckout'),
'Card holder authentication failed, please choose another payment method or try again.' => $this->translator->trans('Card holder authentication failed, please choose another payment method or try again.', $parameters, 'Modules.Checkout.Pscheckout'),
'Card holder authentication cannot be checked, please choose another payment method or try again.' => $this->translator->trans('Card holder authentication cannot be checked, please choose another payment method or try again.', $parameters, 'Modules.Checkout.Pscheckout'),
'Were unable to process your Apple Pay payment at the moment. This could be due to an issue verifying the payment setup for this website. Please try again later or choose a different payment method.' => $this->translator->trans('Were unable to process your Apple Pay payment at the moment. This could be due to an issue verifying the payment setup for this website. Please try again later or choose a different payment method.', $parameters, 'Modules.Checkout.Pscheckout'),
'We encountered an issue while processing your Apple Pay payment. Please verify your order details and try again, or use a different payment method.' => $this->translator->trans('We encountered an issue while processing your Apple Pay payment. Please verify your order details and try again, or use a different payment method.', $parameters, 'Modules.Checkout.Pscheckout'),
// Exception messages
'Error processing payment, you could have been charged. Please check your order history in your account to check the status of the order or please contact our customer service to know more.' => $this->translator->trans('Error processing payment, you could have been charged. Please check your order history in your account to check the status of the order or please contact our customer service to know more.', $parameters, 'Modules.Checkout.Pscheckout'),
'The transaction failed. Please try a different card.' => $this->translator->trans('The transaction failed. Please try a different card.', $parameters, 'Modules.Checkout.Pscheckout'),
'The transaction was refused.' => $this->translator->trans('The transaction was refused.', $parameters, 'Modules.Checkout.Pscheckout'),
'This payment method is unavailable' => $this->translator->trans('This payment method is unavailable', $parameters, 'Modules.Checkout.Pscheckout'),
'Unable to call API' => $this->translator->trans('Unable to call API', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal order identifier is missing' => $this->translator->trans('PayPal order identifier is missing', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal payment method is missing' => $this->translator->trans('PayPal payment method is missing', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart is invalid' => $this->translator->trans('Cart is invalid', $parameters, 'Modules.Checkout.Pscheckout'),
'Order cannot be saved' => $this->translator->trans('Order cannot be saved', $parameters, 'Modules.Checkout.Pscheckout'),
'OrderState cannot be saved' => $this->translator->trans('OrderState cannot be saved', $parameters, 'Modules.Checkout.Pscheckout'),
'OrderPayment cannot be saved' => $this->translator->trans('OrderPayment cannot be saved', $parameters, 'Modules.Checkout.Pscheckout'),
'The transaction amount doesn\'t match with the cart amount.' => $this->translator->trans('The transaction amount doesn\'t match with the cart amount.', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart doesn\'t contains product.' => $this->translator->trans('Cart doesn\'t contains product.', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart contains product unavailable.' => $this->translator->trans('Cart contains product unavailable.', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart invoice address is invalid.' => $this->translator->trans('Cart invoice address is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart delivery address is invalid.' => $this->translator->trans('Cart delivery address is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart delivery option is unavailable.' => $this->translator->trans('Cart delivery option is unavailable.', $parameters, 'Modules.Checkout.Pscheckout'),
'Processing of this card type is not supported. Use another card type.' => $this->translator->trans('Processing of this card type is not supported. Use another card type.', $parameters, 'Modules.Checkout.Pscheckout'),
'The CVC code length is invalid for the specified card type.' => $this->translator->trans('The CVC code length is invalid for the specified card type.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your card cannot be used to pay in this currency, please try another payment method.' => $this->translator->trans('Your card cannot be used to pay in this currency, please try another payment method.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your country is not supported by this payment method, please try to select another.' => $this->translator->trans('Your country is not supported by this payment method, please try to select another.', $parameters, 'Modules.Checkout.Pscheckout'),
'The transaction failed. Please try a different payment method.' => $this->translator->trans('The transaction failed. Please try a different payment method.', $parameters, 'Modules.Checkout.Pscheckout'),
'Transaction expired, please try again.' => $this->translator->trans('Transaction expired, please try again.', $parameters, 'Modules.Checkout.Pscheckout'),
'Order is already captured.' => $this->translator->trans('Order is already captured.', $parameters, 'Modules.Checkout.Pscheckout'),
'This payment method has been refused by the payment platform, please use another payment method.' => $this->translator->trans('This payment method has been refused by the payment platform, please use another payment method.', $parameters, 'Modules.Checkout.Pscheckout'),
// Notify customer error message
'This message is sent automatically by module PrestaShop Checkout' => $this->translator->trans('This message is sent automatically by module PrestaShop Checkout', $parameters, 'Modules.Checkout.Pscheckout'),
'A customer encountered a processing payment error :' => $this->translator->trans('A customer encountered a processing payment error :', $parameters, 'Modules.Checkout.Pscheckout'),
'Customer identifier:' => $this->translator->trans('Customer identifier:', $parameters, 'Modules.Checkout.Pscheckout'),
'Cart identifier:' => $this->translator->trans('Cart identifier:', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal order identifier:' => $this->translator->trans('PayPal order identifier:', $parameters, 'Modules.Checkout.Pscheckout'),
'Exception identifier:' => $this->translator->trans('Exception identifier:', $parameters, 'Modules.Checkout.Pscheckout'),
'Exception detail:' => $this->translator->trans('Exception detail:', $parameters, 'Modules.Checkout.Pscheckout'),
'If you need assistance, please contact our Support Team on PrestaShop Checkout configuration page on Help subtab.' => $this->translator->trans('If you need assistance, please contact our Support Team on PrestaShop Checkout configuration page on Help subtab.', $parameters, 'Modules.Checkout.Pscheckout.support'),
'Payment gateway information' => $this->translator->trans('Payment gateway information', $parameters, 'Modules.Checkout.Pscheckout'),
'Order identifier' => $this->translator->trans('Order identifier', $parameters, 'Modules.Checkout.Pscheckout'),
'Order status' => $this->translator->trans('Order status', $parameters, 'Modules.Checkout.Pscheckout'),
'Transaction identifier' => $this->translator->trans('Transaction identifier', $parameters, 'Modules.Checkout.Pscheckout'),
'Transaction status' => $this->translator->trans('Transaction status', $parameters, 'Modules.Checkout.Pscheckout'),
'Funding source' => $this->translator->trans('Funding source', $parameters, 'Modules.Checkout.Pscheckout'),
'Amount paid' => $this->translator->trans('Amount paid', $parameters, 'Modules.Checkout.Pscheckout'),
'Approve payment' => $this->translator->trans('Approve payment', $parameters, 'Modules.Checkout.Pscheckout'),
'Authenticate payment' => $this->translator->trans('Authenticate payment', $parameters, 'Modules.Checkout.Pscheckout'),
'Your payment has been declined by our payment gateway, please contact us via the link below.' => $this->translator->trans('Your payment has been declined by our payment gateway, please contact us via the link below.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your payment needs to be approved, please click the button below.' => $this->translator->trans('Your payment needs to be approved, please click the button below.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your payment needs to be authenticated, please click the button below.' => $this->translator->trans('Your payment needs to be authenticated, please click the button below.', $parameters, 'Modules.Checkout.Pscheckout'),
'You will be redirected to an external secured page of our payment gateway.' => $this->translator->trans('You will be redirected to an external secured page of our payment gateway.', $parameters, 'Modules.Checkout.Pscheckout'),
'If you have any question, please contact us.' => $this->translator->trans('If you have any question, please contact us.', $parameters, 'Modules.Checkout.Pscheckout'),
'Payment method status' => $this->translator->trans('Payment method status', $parameters, 'Modules.Checkout.Pscheckout'),
'was saved for future purchases' => $this->translator->trans('was saved for future purchases', $parameters, 'Modules.Checkout.Pscheckout'),
'was not saved for future purchases' => $this->translator->trans('was not saved for future purchases', $parameters, 'Modules.Checkout.Pscheckout'),
'Total ApplePay' => $this->translator->trans('Total', $parameters, 'Modules.Checkout.Pscheckout'),
'Total GooglePay' => $this->translator->trans('Total', $parameters, 'Modules.Checkout.Pscheckout'),
'Payment' => $this->translator->trans('Payment', $parameters, 'Modules.Checkout.Pscheckout'),
'Refund' => $this->translator->trans('Refund', $parameters, 'Modules.Checkout.Pscheckout'),
'You are not authorized to refund this order.' => $this->translator->trans('You are not authorized to refund this order.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal Order is invalid.' => $this->translator->trans('PayPal Order is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal Transaction is invalid.' => $this->translator->trans('PayPal Transaction is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal refund currency is invalid.' => $this->translator->trans('PayPal refund currency is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal refund amount is invalid.' => $this->translator->trans('PayPal refund amount is invalid.', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal refund failed.' => $this->translator->trans('PayPal refund failed.', $parameters, 'Modules.Checkout.Pscheckout'),
'Refund has been processed by PayPal, but order status change or email sending failed.' => $this->translator->trans('Refund has been processed by PayPal, but order status change or email sending failed.', $parameters, 'Modules.Checkout.Pscheckout'),
'Refund cannot be processed by PayPal.' => $this->translator->trans('Refund cannot be processed by PayPal.', $parameters, 'Modules.Checkout.Pscheckout'),
'Refund has been processed by PayPal.' => $this->translator->trans('Refund has been processed by PayPal.', $parameters, 'Modules.Checkout.Pscheckout'),
'No PrestaShop Order identifier received' => $this->translator->trans('No PrestaShop Order identifier received', $parameters, 'Modules.Checkout.Pscheckout'),
'Unable to find PayPal Order associated to this PrestaShop Order %s' => $this->translator->trans('Unable to find PayPal Order associated to this PrestaShop Order %s', $parameters, 'Modules.Checkout.Pscheckout'),
'PayPal Order %s is not in the same environment as PrestaShop Checkout' => $this->translator->trans('PayPal Order %s is not in the same environment as PrestaShop Checkout', $parameters, 'Modules.Checkout.Pscheckout'),
'Eligible' => $this->translator->trans('Eligible', $parameters, 'Modules.Checkout.Pscheckout'),
'Partially eligible' => $this->translator->trans('Partially eligible', $parameters, 'Modules.Checkout.Pscheckout'),
'Not eligible' => $this->translator->trans('Not eligible', $parameters, 'Modules.Checkout.Pscheckout'),
'Your PayPal balance remains intact if the customer claims that they did not receive an item or the account holder claims that they did not authorize the payment.' => $this->translator->trans('Your PayPal balance remains intact if the customer claims that they did not receive an item or the account holder claims that they did not authorize the payment.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your PayPal balance remains intact if the customer claims that they did not receive an item.' => $this->translator->trans('Your PayPal balance remains intact if the customer claims that they did not receive an item.', $parameters, 'Modules.Checkout.Pscheckout'),
'Your PayPal balance is not protected, the transaction is not eligible to the seller protection program.' => $this->translator->trans('Your PayPal balance is not protected, the transaction is not eligible to the seller protection program.', $parameters, 'Modules.Checkout.Pscheckout'),
'Dispute categories covered:' => $this->translator->trans('Dispute categories covered:', $parameters, 'Modules.Checkout.Pscheckout'),
'For more information, please go to the official PayPal website.' => $this->translator->trans('For more information, please go to the official PayPal website.', $parameters, 'Modules.Checkout.Pscheckout'),
'The payer paid for an item that they did not receive.' => $this->translator->trans('The payer paid for an item that they did not receive.', $parameters, 'Modules.Checkout.Pscheckout'),
'The payer did not authorize the payment.' => $this->translator->trans('The payer did not authorize the payment.', $parameters, 'Modules.Checkout.Pscheckout'),
];
return isset($map[$key]) && $map[$key] ? $map[$key] : $key;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,52 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 3.0.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_3_0_0(Ps_checkout $module)
{
// Force PrestaShop to upgrade for all shop to avoid issues
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
$shopsList = \Shop::getShops(false, null, true);
$module->registerHook('actionObjectShopDeleteAfter', $shopsList);
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
return true;
}

View File

@@ -0,0 +1,54 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 3.1.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_3_1_0($module)
{
// Force PrestaShop to upgrade for all shop to avoid issues
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
$shopsList = \Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
Configuration::updateValue('PS_CHECKOUT_LIABILITY_SHIFT_REQ', '1', false, null, (int) $shopId);
}
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
return true;
}

View File

@@ -0,0 +1,74 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.3.3.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_3_3_0(Ps_checkout $module)
{
// Force PrestaShop to upgrade for all shop to avoid issues
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
$module->registerHook('displayPaymentReturn');
$module->registerHook('displayOrderDetail');
try {
$db = Db::getInstance();
$db->delete(
'pscheckout_cart',
'paypal_order IS NULL'
);
$db->update(
'pscheckout_cart',
[
'paypal_token' => null,
'paypal_token_expire' => null,
],
'paypal_token IS NOT NULL',
0,
true
);
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 3, $exception->getCode(), 'Module', $module->id);
return false;
}
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
return true;
}

View File

@@ -0,0 +1,273 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.3.4.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_3_4_0(Ps_checkout $module)
{
// Force PrestaShop to upgrade for all shop to avoid issues
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
try {
$shopsList = Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
Configuration::updateValue('PS_CHECKOUT_LIABILITY_SHIFT_REQ', '0', false, null, (int) $shopId);
}
Configuration::updateGlobalValue('PS_CHECKOUT_LIABILITY_SHIFT_REQ', '0');
$db = Db::getInstance();
// Check module OrderState
$moduleOrderStates = [
'PS_CHECKOUT_STATE_PENDING' => (int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_PENDING'),
'PS_CHECKOUT_STATE_COMPLETED' => (int) Configuration::getGlobalValue('PS_OS_PAYMENT'),
'PS_CHECKOUT_STATE_CANCELED' => (int) Configuration::getGlobalValue('PS_OS_CANCELED'),
'PS_CHECKOUT_STATE_ERROR' => (int) Configuration::getGlobalValue('PS_OS_ERROR'),
'PS_CHECKOUT_STATE_REFUNDED' => (int) Configuration::getGlobalValue('PS_OS_REFUND'),
'PS_CHECKOUT_STATE_PARTIALLY_REFUNDED' => (int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_PARTIAL_REFUND'),
'PS_CHECKOUT_STATE_PARTIALLY_PAID' => (int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_PARTIALLY_PAID'),
'PS_CHECKOUT_STATE_AUTHORIZED' => (int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_AUTHORIZED'),
];
$moduleOrderStatesId = array_values($moduleOrderStates);
$moduleOrderStatesIdToDelete = [
(int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT'),
(int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT'),
(int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT'),
(int) Configuration::getGlobalValue('PS_CHECKOUT_STATE_WAITING_CAPTURE'),
];
$orderStateCollection = new PrestaShopCollection(OrderState::class);
$orderStateCollection->where('module_name', '=', $module->name);
$orderStateCollection->where('deleted', '=', '0');
/** @var OrderState[] $orderStates */
$orderStates = $orderStateCollection->getResults();
$currentModuleOrderStatesId = [];
if (!empty($orderStates)) {
foreach ($orderStates as $orderState) {
$orderStateId = (int) $orderState->id;
if (
!in_array($orderStateId, $moduleOrderStatesId, true)
|| in_array($orderState->id, $moduleOrderStatesIdToDelete, true)
) {
$orderState->deleted = true;
$orderState->save();
} else {
$currentModuleOrderStatesId[] = $orderStateId;
}
}
}
foreach ($moduleOrderStates as $configuration_key => $id_order_state) {
if (
!$id_order_state
|| !in_array((int) $id_order_state, $currentModuleOrderStatesId, true)
) {
switch ($configuration_key) {
case 'PS_CHECKOUT_STATE_AUTHORIZED':
ps_checkout_create_order_state_8_3_4_0(
'PS_CHECKOUT_STATE_AUTHORIZED',
'#3498D8',
[
'en' => 'Authorized. To be captured by merchant',
'fr' => 'Autorisation. A capturer par le marchand',
'es' => 'Autorizado. El vendedor lo capturará',
'it' => 'Autorizzato. Sarà acquisito dal commerciante',
'nl' => 'Goedgekeurd. Door retailer te registreren.',
'de' => 'Autorisiert. Wird von Händler erfasst.',
'pl' => 'Pomyślna autoryzacja. Transfer do przeprowadzenia przez sklep',
'pt' => 'Autorizado. A ser capturado pelo comerciante',
]
);
break;
case 'PS_CHECKOUT_STATE_PARTIALLY_REFUNDED':
ps_checkout_create_order_state_8_3_4_0(
'PS_CHECKOUT_STATE_PARTIALLY_REFUNDED',
'#01B887',
[
'en' => 'Partial refund',
'fr' => 'Remboursement partiel',
'es' => 'Reembolso parcial',
'it' => 'Rimborso parziale',
'nl' => 'Gedeeltelijke terugbetaling',
'de' => 'Teilweise Rückerstattung',
'pl' => 'Częściowy zwrot',
'pt' => 'Reembolso parcial',
]
);
break;
case 'PS_CHECKOUT_STATE_PENDING':
ps_checkout_create_order_state_8_3_4_0('PS_CHECKOUT_STATE_PENDING', '#34209E', [
'en' => 'Waiting for payment',
'fr' => 'En attente de paiement',
'es' => 'Esperando el pago',
'it' => 'In attesa di pagamento',
'nl' => 'Wachten op betaling',
'de' => 'Warten auf Zahlung',
'pl' => 'Oczekiwanie na płatność',
'pt' => 'Aguardando pagamento',
]);
break;
case 'PS_CHECKOUT_STATE_PARTIALLY_PAID':
ps_checkout_create_order_state_8_3_4_0(
'PS_CHECKOUT_STATE_PARTIALLY_PAID',
'#3498D8',
[
'en' => 'Partial payment',
'fr' => 'Paiement partiel',
'es' => 'Pago parcial',
'it' => 'Pagamento parziale',
'nl' => 'Gedeeltelijke betaling',
'de' => 'Teilweise Zahlung',
'pl' => 'Częściowa płatność',
'pt' => 'Pagamento parcial',
]
);
break;
default:
Configuration::updateGlobalValue($configuration_key, $id_order_state);
}
} else {
Configuration::updateGlobalValue($configuration_key, $id_order_state);
}
}
// Installing FundingSource if table pscheckout_funding_source is empty or incomplete - including BLIK
$fundingSources = ['paypal', 'paylater', 'card', 'bancontact', 'eps', 'ideal', 'mybank', 'p24', 'blik'];
$availableFundingSourcesByShops = [];
$maxPositionByShops = [];
$availableFundingSources = $db->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'pscheckout_funding_source');
if (!empty($availableFundingSources)) {
foreach ($availableFundingSources as $availableFundingSource) {
$currentPosition = (int) $availableFundingSource['position'];
$shopId = (int) $availableFundingSource['id_shop'];
if (
!isset($maxPositionByShops[$shopId])
|| $maxPositionByShops[$shopId] < $currentPosition
) {
$maxPositionByShops[$shopId] = $currentPosition;
}
$availableFundingSourcesByShops[$shopId][] = $availableFundingSource['name'];
}
}
foreach ($shopsList as $shopId) {
$currentPosition = isset($maxPositionByShops[(int) $shopId]) ? $maxPositionByShops[(int) $shopId] + 1 : 1;
foreach ($fundingSources as $fundingSource) {
if (
!isset($availableFundingSourcesByShops[(int) $shopId])
|| !in_array($fundingSource, $availableFundingSourcesByShops[(int) $shopId], true)
) {
$db->insert(
'pscheckout_funding_source',
[
'name' => pSQL($fundingSource),
'active' => 1,
'position' => (int) $currentPosition,
'id_shop' => (int) $shopId,
]
);
++$currentPosition;
}
}
}
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 3, $exception->getCode(), 'Module', $module->id);
return false;
}
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
return true;
}
function ps_checkout_create_order_state_8_3_4_0($configuration_key, $color, $nameByLangIsoCode)
{
$orderStateNameByLangId = [];
foreach (Language::getLanguages(false) as $language) {
$languageIsoCode = Tools::strtolower($language['iso_code']);
if (isset($nameByLangIsoCode[$languageIsoCode])) {
$orderStateNameByLangId[(int) $language['id_lang']] = $nameByLangIsoCode[$languageIsoCode];
} elseif (isset($nameByLangIsoCode['en'])) {
$orderStateNameByLangId[(int) $language['id_lang']] = $nameByLangIsoCode['en'];
}
}
$orderState = new OrderState();
$orderState->name = $orderStateNameByLangId;
$orderState->module_name = 'ps_checkout';
$orderState->unremovable = true;
$orderState->color = $color;
$orderState->delivery = false;
$orderState->shipped = false;
$orderState->pdf_delivery = false;
$orderState->pdf_invoice = false;
$orderState->hidden = false;
$orderState->invoice = false;
$orderState->send_email = false;
$orderState->paid = false;
$orderState->logable = false;
$orderState->deleted = false;
$orderState->template = [];
$orderState->save();
Configuration::updateGlobalValue($configuration_key, $orderState->id);
$orderStateImage = $configuration_key === 'PS_CHECKOUT_STATE_PARTIALLY_REFUNDED' ? 'refund.gif' : 'waiting.gif';
$moduleOrderStateImgPath = _PS_MODULE_DIR_ . 'ps_checkout/views/img/OrderStatesIcons/' . $orderStateImage;
$coreOrderStateImgPath = _PS_IMG_DIR_ . 'os/' . $orderState->id . '.gif';
if (
Tools::file_exists_cache($moduleOrderStateImgPath)
&& !Tools::file_exists_cache($coreOrderStateImgPath)
&& is_writable(_PS_IMG_DIR_ . 'os/')
) {
Tools::copy($moduleOrderStateImgPath, $coreOrderStateImgPath);
}
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.3.5.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_3_5_0(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$databaseFields = [];
$fields = $db->executeS('SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'pscheckout_cart`');
if (!empty($fields)) {
foreach ($fields as $field) {
if (isset($field['Field'])) {
$databaseFields[] = $field['Field'];
}
}
}
if (!empty($databaseFields) && !in_array('environment', $databaseFields, true)) {
$db->execute('ALTER TABLE `' . _DB_PREFIX_ . 'pscheckout_cart` ADD COLUMN `environment` varchar(20) DEFAULT NULL;');
}
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.3.6.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_3_6_0(Ps_checkout $module)
{
// Force PrestaShop to upgrade for all shop to avoid issues
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
try {
$shopsList = Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
// Require the liability shift for all shops
Configuration::updateValue('PS_CHECKOUT_LIABILITY_SHIFT_REQ', '1', false, null, (int) $shopId);
// Update global value only if it is not already set to SCA_ALWAYS
if (Configuration::get('PS_CHECKOUT_HOSTED_FIELDS_CONTINGENCIES', null, null, $shopId) !== 'SCA_ALWAYS') {
Configuration::updateValue('PS_CHECKOUT_HOSTED_FIELDS_CONTINGENCIES', 'SCA_WHEN_REQUIRED', false, null, (int) $shopId);
}
}
// Require the liability shift for all shops
Configuration::updateGlobalValue('PS_CHECKOUT_LIABILITY_SHIFT_REQ', '1');
// Update global value only if it is not already set to SCA_ALWAYS
if (Configuration::getGlobalValue('PS_CHECKOUT_HOSTED_FIELDS_CONTINGENCIES') !== 'SCA_ALWAYS') {
Configuration::updateGlobalValue('PS_CHECKOUT_HOSTED_FIELDS_CONTINGENCIES', 'SCA_WHEN_REQUIRED');
}
// Add new configuration for displaying the logo on the product page and the cart
Configuration::updateGlobalValue('PS_CHECKOUT_DISPLAY_LOGO_PRODUCT', '1');
Configuration::updateGlobalValue('PS_CHECKOUT_DISPLAY_LOGO_CART', '1');
// Remove Sofort
Db::getInstance()->delete(
'pscheckout_funding_source',
'name LIKE "sofort"'
);
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 3, $exception->getCode(), 'Module', $module->id);
return false;
}
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
return true;
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.3.6.3
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_3_6_3(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$db->update('pscheckout_cart', ['paypal_token' => null, 'paypal_token_expire' => null], 'paypal_token IS NOT NULL', 0, true);
$db->update('pscheckout_cart', ['paypal_status' => 'CANCELED'], 'paypal_status = "CREATED" AND date_add < DATE_SUB(NOW(), INTERVAL 1 HOUR)');
$db->delete('pscheckout_cart', 'paypal_order IS NULL OR paypal_order = ""');
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
}
return true;
}

View File

@@ -0,0 +1,125 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.4.0.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_4_0_0(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_order` (
`id` varchar(50) NOT NULL,
`id_cart` int unsigned NOT NULL,
`status` varchar(30) NOT NULL,
`intent` varchar(50) DEFAULT "CAPTURE",
`funding_source` varchar(50) NOT NULL,
`payment_source` text,
`environment` varchar(50) NOT NULL,
`is_card_fields` tinyint(1) NOT NULL,
`is_express_checkout` tinyint(1) NOT NULL,
`customer_intent` varchar(50),
`payment_token_id` varchar(50),
PRIMARY KEY (`id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_capture` (
`id` varchar(50) NOT NULL,
`id_order` varchar(50) NOT NULL,
`status` varchar(30) NOT NULL,
`final_capture` tinyint(1) NOT NULL,
`created_at` varchar(50) NOT NULL,
`updated_at` varchar(50) NOT NULL,
`seller_protection` text,
`seller_receivable_breakdown` text,
PRIMARY KEY (`id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_refund` (
`id` varchar(50) NOT NULL,
`id_order` varchar(50) NOT NULL,
`status` varchar(30) NOT NULL,
`invoice_id` varchar(50) NOT NULL,
`custom_id` varchar(50) NOT NULL,
`acquirer_reference_number` varchar(50) NOT NULL,
`seller_payable_breakdown` text,
`id_order_slip` INT UNSIGNED,
PRIMARY KEY (`id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_authorization` (
`id` varchar(50) NOT NULL,
`id_order` varchar(50) NOT NULL,
`status` varchar(30) NOT NULL,
`expiration_time` varchar(50) NOT NULL,
`seller_protection` text,
PRIMARY KEY (`id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_purchase_unit` (
`id_order` varchar(50) NOT NULL,
`checksum` varchar(50) NOT NULL,
`reference_id` varchar(50) NOT NULL,
`items` text,
PRIMARY KEY (`reference_id`, `id_order`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_customer` (
`id_customer` int unsigned NOT NULL,
`paypal_customer_id` varchar(50) NOT NULL,
PRIMARY KEY (`id_customer`, `paypal_customer_id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_payment_token` (
`id` INT UNSIGNED AUTO_INCREMENT,
`token_id` varchar(50) NOT NULL,
`paypal_customer_id` varchar(50) NOT NULL,
`payment_source` varchar(50) NOT NULL,
`data` text NOT NULL,
`merchant_id` varchar(50) NOT NULL,
`status` varchar(50) NOT NULL,
`is_favorite` tinyint(1) unsigned DEFAULT 0 NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token_id_merchant_id_paypal_customer_id` (`token_id`, `merchant_id`, `paypal_customer_id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$db->execute('ALTER TABLE `' . _DB_PREFIX_ . 'pscheckout_cart` CHANGE `paypal_status` `paypal_status` VARCHAR(30) NULL; ');
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.4.1.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_4_1_0(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$shopsList = \Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
$isGooglePayEligible = (bool) \Configuration::get(
'PS_CHECKOUT_GOOGLE_PAY',
null,
null,
$shopId
);
$hasFundingSourceGooglePay = (bool) $db->getValue(
'
SELECT 1
FROM `' . _DB_PREFIX_ . 'pscheckout_funding_source`
WHERE `name` = "google_pay"
AND `id_shop` = ' . (int) $shopId
);
if (!$hasFundingSourceGooglePay) {
$db->insert(
'pscheckout_funding_source',
[
'name' => 'google_pay',
'position' => 11,
'active' => (int) $isGooglePayEligible,
'id_shop' => (int) $shopId,
]
);
}
}
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

View File

@@ -0,0 +1,67 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.4.2.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_8_4_2_0(Ps_checkout $module)
{
try {
$module->registerHook('moduleRoutes');
$db = Db::getInstance();
$shopsList = \Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
$hasFundingSourceApplePay = (bool) $db->getValue(
'
SELECT 1
FROM `' . _DB_PREFIX_ . 'pscheckout_funding_source`
WHERE `name` = "apple_pay"
AND `id_shop` = ' . (int) $shopId
);
if (!$hasFundingSourceApplePay) {
$db->insert(
'pscheckout_funding_source',
[
'name' => 'apple_pay',
'position' => 12,
'active' => 0,
'id_shop' => (int) $shopId,
]
);
}
}
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

View File

@@ -0,0 +1,86 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 8.5.0.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_9_5_0_0(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$db->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pscheckout_tracking` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_order` int(10) unsigned NOT NULL,
`tracking_number` varchar(64) NOT NULL,
`carrier_id` int(10) unsigned NOT NULL,
`carrier_name` varchar(64) NOT NULL,
`paypal_order_id` varchar(50) NOT NULL,
`paypal_capture_id` varchar(50) NOT NULL,
`tracker_id` varchar(64) DEFAULT NULL,
`items` text DEFAULT NULL,
`status` varchar(20) NOT NULL DEFAULT "PENDING",
`paypal_tracking_status` varchar(20) DEFAULT NULL,
`payload_checksum` varchar(64) NOT NULL,
`sent_to_paypal` tinyint(1) NOT NULL DEFAULT 0,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `id_order` (`id_order`),
KEY `tracking_number` (`tracking_number`),
KEY `paypal_order_id` (`paypal_order_id`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;
');
$fields = $db->executeS('SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'pscheckout_order`');
if (!empty($fields)) {
$field = array_filter($fields, function ($field) {
return $field['Field'] === 'tags';
});
if (empty($field)) {
$db->execute('ALTER TABLE `' . _DB_PREFIX_ . 'pscheckout_order` ADD COLUMN `tags` varchar(255) DEFAULT NULL;');
}
}
$module->registerHook('actionGetOrderShipments');
$module->registerHook('actionObjectOrderCarrierUpdateAfter');
// Remove Giropay
Db::getInstance()->delete(
'pscheckout_funding_source',
'name LIKE "giropay"'
);
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

View File

@@ -0,0 +1,152 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Update main function for module version 9.5.1.0
*
* @param Ps_checkout $module
*
* @return bool
*/
function upgrade_module_9_5_1_0(Ps_checkout $module)
{
try {
$db = Db::getInstance();
$savedShopContext = Shop::getContext();
$savedShopId = Shop::getContextShopID();
$savedGroupShopId = Shop::getContextShopGroupID();
Shop::setContext(Shop::CONTEXT_ALL);
$shopsList = \Shop::getShops(false, null, true);
foreach ($shopsList as $shopId) {
$configuration = json_encode([
'cart' => [
'placement' => 'cart',
'status' => (bool) \Configuration::get(
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
null,
null,
$shopId
) ? 'enabled' : 'disabled',
'layout' => 'text',
'logo-type' => 'inline',
'text-color' => 'black',
'text-size' => '12',
],
'category' => [
'placement' => 'category',
'status' => (bool) \Configuration::get(
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
null,
null,
$shopId
) ? 'enabled' : 'disabled',
'color' => 'white',
'layout' => 'flex',
'ratio' => '8x1',
],
'checkout' => [
'placement' => 'checkout',
'status' => (bool) \Configuration::get(
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
null,
null,
$shopId
) ? 'enabled' : 'disabled',
'layout' => 'text',
'logo-type' => 'inline',
'text-color' => 'black',
'text-size' => '12',
],
'homepage' => [
'placement' => 'homepage',
'status' => (bool) \Configuration::get(
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
null,
null,
$shopId
) ? 'enabled' : 'disabled',
'color' => 'white',
'layout' => 'flex',
'ratio' => '8x1',
],
'product' => [
'placement' => 'product',
'status' => (bool) \Configuration::get(
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
null,
null,
$shopId
) ? 'enabled' : 'disabled',
'layout' => 'text',
'logo-type' => 'inline',
'text-color' => 'black',
'text-size' => '12',
],
]);
Configuration::updateValue('PS_CHECKOUT_PAY_LATER_CONFIG', $configuration, false, null, (int) $shopId);
foreach (['venmo', 'pay_upon_invoice'] as $paymentOption) {
$maxPosition = (int) $db->getValue(
'
SELECT MAX(position)
FROM `' . _DB_PREFIX_ . 'pscheckout_funding_source`
WHERE `id_shop` = ' . (int) $shopId
);
$paymentExists = $db->getValue(
'
SELECT COUNT(*)
FROM `' . _DB_PREFIX_ . 'pscheckout_funding_source`
WHERE `name` = "' . pSQL($paymentOption) . '" AND `id_shop` = ' . (int) $shopId
);
if (!$paymentExists) {
$db->insert('pscheckout_funding_source', [
'name' => pSQL($paymentOption),
'active' => 0,
'position' => $maxPosition + 1,
'id_shop' => (int) $shopId,
]);
}
}
}
// Restore initial PrestaShop shop context
if (Shop::CONTEXT_SHOP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedShopId);
} elseif (Shop::CONTEXT_GROUP === $savedShopContext) {
Shop::setContext($savedShopContext, $savedGroupShopId);
} else {
Shop::setContext($savedShopContext);
}
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 4, 1, 'Module', $module->id);
return false;
}
return true;
}

10
modules/ps_checkout/vendor/.htaccess vendored Normal file
View File

@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

22
modules/ps_checkout/vendor/autoload.php vendored Normal file
View File

@@ -0,0 +1,22 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
throw new RuntimeException($err);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInita6446bd035c925f2c8a48f3e27fad5bf::getLoader();

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Christian Lück
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,120 @@
<?php
namespace Clue\StreamFilter;
/**
* @internal
* @see append()
* @see prepend()
*/
class CallbackFilter extends \php_user_filter
{
private $callback;
private $closed = true;
private $supportsClose = false;
/** @return bool */
#[\ReturnTypeWillChange]
public function onCreate()
{
$this->closed = false;
if (!\is_callable($this->params)) {
throw new \InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)');
}
$this->callback = $this->params;
// callback supports end event if it accepts invocation without arguments
$ref = new \ReflectionFunction($this->callback);
$this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0);
return true;
}
/** @return void */
#[\ReturnTypeWillChange]
public function onClose()
{
$this->closed = true;
// callback supports closing and is not already closed
if ($this->supportsClose) {
$this->supportsClose = false;
// invoke without argument to signal end and discard resulting buffer
try {
\call_user_func($this->callback);
} catch (\Exception $ignored) {
// this might be called during engine shutdown, so it's not safe
// to raise any errors or exceptions here
// trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING);
}
}
$this->callback = null;
}
/** @return int */
#[\ReturnTypeWillChange]
public function filter($in, $out, &$consumed, $closing)
{
// concatenate whole buffer from input brigade
$data = '';
while ($bucket = \stream_bucket_make_writeable($in)) {
$consumed += $bucket->datalen;
$data .= $bucket->data;
}
// skip processing callback that already ended
if ($this->closed) {
return \PSFS_FEED_ME;
}
// only invoke filter function if buffer is not empty
// this may skip flushing a closing filter
if ($data !== '') {
try {
$data = \call_user_func($this->callback, $data);
} catch (\Exception $e) {
// exception should mark filter as closed
$this->onClose();
\trigger_error('Error invoking filter: ' . $e->getMessage(), \E_USER_WARNING);
return \PSFS_ERR_FATAL;
}
}
// mark filter as closed after processing closing chunk
if ($closing) {
$this->closed = true;
// callback supports closing and is not already closed
if ($this->supportsClose) {
$this->supportsClose = false;
// invoke without argument to signal end and append resulting buffer
try {
$data .= \call_user_func($this->callback);
} catch (\Exception $e) {
\trigger_error('Error ending filter: ' . $e->getMessage(), \E_USER_WARNING);
return \PSFS_ERR_FATAL;
}
}
}
if ($data !== '') {
// create a new bucket for writing the resulting buffer to the output brigade
// reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM)
$bucket = @\stream_bucket_new($this->stream, $data);
// legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler
// because closing the stream invalidates the stream and its stream bucket brigade before
// invoking the filter close handler.
if ($bucket !== false) {
\stream_bucket_append($out, $bucket);
}
}
return \PSFS_PASS_ON;
}
}

View File

@@ -0,0 +1,380 @@
<?php
namespace Clue\StreamFilter;
/**
* Append a filter callback to the given stream.
*
* Each stream can have a list of filters attached.
* This function appends a filter to the end of this list.
*
* If the given filter can not be added, it throws an `Exception`.
*
* The `$stream` can be any valid stream resource, such as:
*
* ```php
* $stream = fopen('demo.txt', 'w+');
* ```
*
* The `$callback` should be a valid callable function which accepts
* an individual chunk of data and should return the updated chunk:
*
* ```php
* $filter = Clue\StreamFilter\append($stream, function ($chunk) {
* // will be called each time you read or write a $chunk to/from the stream
* return $chunk;
* });
* ```
*
* As such, you can also use native PHP functions or any other `callable`:
*
* ```php
* Clue\StreamFilter\append($stream, 'strtoupper');
*
* // will write "HELLO" to the underlying stream
* fwrite($stream, 'hello');
* ```
*
* If the `$callback` accepts invocation without parameters,
* then this signature will be invoked once ending (flushing) the filter:
*
* ```php
* Clue\StreamFilter\append($stream, function ($chunk = null) {
* if ($chunk === null) {
* // will be called once ending the filter
* return 'end';
* }
* // will be called each time you read or write a $chunk to/from the stream
* return $chunk;
* });
*
* fclose($stream);
* ```
*
* > Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data
* from the end signal handler if the stream is being closed.
*
* If your callback throws an `Exception`, then the filter process will be aborted.
* In order to play nice with PHP's stream handling,
* the `Exception` will be transformed to a PHP warning instead:
*
* ```php
* Clue\StreamFilter\append($stream, function ($chunk) {
* throw new \RuntimeException('Unexpected chunk');
* });
*
* // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk"
* fwrite($stream, 'hello');
* ```
*
* The optional `$read_write` parameter can be used to only invoke the `$callback`
* when either writing to the stream or only when reading from the stream:
*
* ```php
* Clue\StreamFilter\append($stream, function ($chunk) {
* // will be called each time you write to the stream
* return $chunk;
* }, STREAM_FILTER_WRITE);
*
* Clue\StreamFilter\append($stream, function ($chunk) {
* // will be called each time you read from the stream
* return $chunk;
* }, STREAM_FILTER_READ);
* ```
*
* This function returns a filter resource which can be passed to [`remove()`](#remove).
*
* > Note that once a filter has been added to stream, the stream can no longer be passed to
* > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
* > (and family).
* >
* > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line}
* >
* > This is due to limitations of PHP's stream filter support, as it can no longer reliably
* > tell when the underlying stream resource is actually ready.
* > As an alternative, consider calling `stream_select()` on the unfiltered stream and
* > then pass the unfiltered data through the [`fun()`](#fun) function.
*
* @param resource $stream
* @param callable $callback
* @param int $read_write
* @return resource filter resource which can be used for `remove()`
* @throws \Exception on error
* @uses stream_filter_append()
*/
function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
{
$errstr = '';
\set_error_handler(function ($_, $error) use (&$errstr) {
// Match errstr from PHP's warning message.
// stream_filter_append() expects parameter 1 to be resource,...
$errstr = $error; // @codeCoverageIgnore
});
try {
$ret = \stream_filter_append($stream, register(), $read_write, $callback);
} catch (\TypeError $e) { // @codeCoverageIgnoreStart
// Throws TypeError on PHP 8.0+
\restore_error_handler();
throw $e;
} // @codeCoverageIgnoreEnd
\restore_error_handler();
// PHP 8 throws above on type errors, older PHP and memory issues can throw here
// @codeCoverageIgnoreStart
if ($ret === false) {
throw new \RuntimeException('Unable to append filter: ' . $errstr);
}
// @codeCoverageIgnoreEnd
return $ret;
}
/**
* Prepend a filter callback to the given stream.
*
* Each stream can have a list of filters attached.
* This function prepends a filter to the start of this list.
*
* If the given filter can not be added, it throws an `Exception`.
*
* ```php
* $filter = Clue\StreamFilter\prepend($stream, function ($chunk) {
* // will be called each time you read or write a $chunk to/from the stream
* return $chunk;
* });
* ```
*
* This function returns a filter resource which can be passed to [`remove()`](#remove).
*
* Except for the position in the list of filters, this function behaves exactly
* like the [`append()`](#append) function.
* For more details about its behavior, see also the [`append()`](#append) function.
*
* @param resource $stream
* @param callable $callback
* @param int $read_write
* @return resource filter resource which can be used for `remove()`
* @throws \Exception on error
* @uses stream_filter_prepend()
*/
function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)
{
$errstr = '';
\set_error_handler(function ($_, $error) use (&$errstr) {
// Match errstr from PHP's warning message.
// stream_filter_prepend() expects parameter 1 to be resource,...
$errstr = $error; // @codeCoverageIgnore
});
try {
$ret = \stream_filter_prepend($stream, register(), $read_write, $callback);
} catch (\TypeError $e) { // @codeCoverageIgnoreStart
// Throws TypeError on PHP 8.0+
\restore_error_handler();
throw $e;
} // @codeCoverageIgnoreEnd
\restore_error_handler();
// PHP 8 throws above on type errors, older PHP and memory issues can throw here
// @codeCoverageIgnoreStart
if ($ret === false) {
throw new \RuntimeException('Unable to prepend filter: ' . $errstr);
}
// @codeCoverageIgnoreEnd
return $ret;
}
/**
* Create a filter function which uses the given built-in `$filter`.
*
* PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
* Using `fun()` makes accessing these as easy as passing an input string to filter
* and getting the filtered output string.
*
* ```php
* $fun = Clue\StreamFilter\fun('string.rot13');
*
* assert('grfg' === $fun('test'));
* assert('test' === $fun($fun('test'));
* ```
*
* Please note that not all filter functions may be available depending
* on installed PHP extensions and the PHP version in use.
* In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
* or parameters as Zend PHP.
* Accessing an unknown filter function will result in a `RuntimeException`:
*
* ```php
* Clue\StreamFilter\fun('unknown'); // throws RuntimeException
* ```
*
* Some filters may accept or require additional filter parameters most
* filters do not require filter parameters.
* If given, the optional `$parameters` argument will be passed to the
* underlying filter handler as-is.
* In particular, note how *not passing* this parameter at all differs from
* explicitly passing a `null` value (which many filters do not accept).
* Please refer to the individual filter definition for more details.
* For example, the `string.strip_tags` filter can be invoked like this:
*
* ```php
* $fun = Clue\StreamFilter\fun('string.strip_tags', '<a><b>');
*
* $ret = $fun('<b>h<br>i</b>');
* assert('<b>hi</b>' === $ret);
* ```
*
* Under the hood, this function allocates a temporary memory stream, so it's
* recommended to clean up the filter function after use.
* Also, some filter functions (in particular the
* [zlib compression filters](https://www.php.net/manual/en/filters.compression.php))
* may use internal buffers and may emit a final data chunk on close.
* The filter function can be closed by invoking without any arguments:
*
* ```php
* $fun = Clue\StreamFilter\fun('zlib.deflate');
*
* $ret = $fun('hello') . $fun('world') . $fun();
* assert('helloworld' === gzinflate($ret));
* ```
*
* The filter function must not be used anymore after it has been closed.
* Doing so will result in a `RuntimeException`:
*
* ```php
* $fun = Clue\StreamFilter\fun('string.rot13');
* $fun();
*
* $fun('test'); // throws RuntimeException
* ```
*
* > Note: If you're using the zlib compression filters, then you should be wary
* about engine inconsistencies between different PHP versions and HHVM.
* These inconsistencies exist in the underlying PHP engines and there's little we
* can do about this in this library.
* [Our test suite](tests/) contains several test cases that exhibit these issues.
* If you feel some test case is missing or outdated, we're happy to accept PRs! :)
*
* @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php
* @param mixed $parameters (optional) parameters to pass to the built-in filter as-is
* @return callable a filter callback which can be append()'ed or prepend()'ed
* @throws \RuntimeException on error
* @link http://php.net/manual/en/filters.php
* @see stream_get_filters()
* @see append()
*/
function fun($filter, $parameters = null)
{
$fp = \fopen('php://memory', 'w');
$errstr = '';
\set_error_handler(function ($_, $error) use (&$errstr) {
// Match errstr from PHP's warning message.
// stream_filter_append() expects parameter 1 to be resource,...
$errstr = $error;
});
if (\func_num_args() === 1) {
$filter = \stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE);
} else {
$filter = \stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters);
}
\restore_error_handler();
if ($filter === false) {
\fclose($fp);
throw new \RuntimeException('Unable to access built-in filter: ' . $errstr);
}
// append filter function which buffers internally
$buffer = '';
append($fp, function ($chunk) use (&$buffer) {
$buffer .= $chunk;
// always return empty string in order to skip actually writing to stream resource
return '';
}, \STREAM_FILTER_WRITE);
$closed = false;
return function ($chunk = null) use ($fp, $filter, &$buffer, &$closed) {
if ($closed) {
throw new \RuntimeException('Unable to perform operation on closed stream');
}
if ($chunk === null) {
$closed = true;
$buffer = '';
\fclose($fp);
return $buffer;
}
// initialize buffer and invoke filters by attempting to write to stream
$buffer = '';
\fwrite($fp, $chunk);
// buffer now contains everything the filter function returned
return $buffer;
};
}
/**
* Remove a filter previously added via `append()` or `prepend()`.
*
* ```php
* $filter = Clue\StreamFilter\append($stream, function () {
* // …
* });
* Clue\StreamFilter\remove($filter);
* ```
*
* @param resource $filter
* @return bool true on success or false on error
* @throws \RuntimeException on error
* @uses stream_filter_remove()
*/
function remove($filter)
{
$errstr = '';
\set_error_handler(function ($_, $error) use (&$errstr) {
// Match errstr from PHP's warning message.
// stream_filter_remove() expects parameter 1 to be resource,...
$errstr = $error;
});
try {
$ret = \stream_filter_remove($filter);
} catch (\TypeError $e) { // @codeCoverageIgnoreStart
// Throws TypeError on PHP 8.0+
\restore_error_handler();
throw $e;
} // @codeCoverageIgnoreEnd
\restore_error_handler();
if ($ret === false) {
// PHP 8 throws above on type errors, older PHP and memory issues can throw here
throw new \RuntimeException('Unable to remove filter: ' . $errstr);
}
}
/**
* Registers the callback filter and returns the resulting filter name
*
* There should be little reason to call this function manually.
*
* @return string filter name
* @uses CallbackFilter
*/
function register()
{
static $registered = null;
if ($registered === null) {
$registered = 'stream-callback';
\stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter');
}
return $registered;
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Clue\StreamFilter;
// @codeCoverageIgnoreStart
if (!\function_exists(__NAMESPACE__ . '\\append')) {
require __DIR__ . '/functions.php';
}
// @codeCoverageIgnoreEnd

View File

@@ -0,0 +1,579 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

View File

@@ -0,0 +1,396 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
return $installed;
}
}

View File

@@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,256 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Clue\\StreamFilter\\CallbackFilter' => $vendorDir . '/clue/stream-filter/src/CallbackFilter.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Giggsey\\Locale\\Locale' => $vendorDir . '/giggsey/locale/src/Locale.php',
'GuzzleHttp\\BodySummarizer' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizer.php',
'GuzzleHttp\\BodySummarizerInterface' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
'GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php',
'GuzzleHttp\\ClientInterface' => $vendorDir . '/guzzlehttp/guzzle/src/ClientInterface.php',
'GuzzleHttp\\ClientTrait' => $vendorDir . '/guzzlehttp/guzzle/src/ClientTrait.php',
'GuzzleHttp\\Cookie\\CookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php',
'GuzzleHttp\\Cookie\\CookieJarInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php',
'GuzzleHttp\\Cookie\\FileCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php',
'GuzzleHttp\\Cookie\\SessionCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php',
'GuzzleHttp\\Cookie\\SetCookie' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php',
'GuzzleHttp\\Exception\\BadResponseException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php',
'GuzzleHttp\\Exception\\ClientException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ClientException.php',
'GuzzleHttp\\Exception\\ConnectException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ConnectException.php',
'GuzzleHttp\\Exception\\GuzzleException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php',
'GuzzleHttp\\Exception\\InvalidArgumentException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php',
'GuzzleHttp\\Exception\\RequestException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/RequestException.php',
'GuzzleHttp\\Exception\\ServerException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ServerException.php',
'GuzzleHttp\\Exception\\TooManyRedirectsException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php',
'GuzzleHttp\\Exception\\TransferException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TransferException.php',
'GuzzleHttp\\HandlerStack' => $vendorDir . '/guzzlehttp/guzzle/src/HandlerStack.php',
'GuzzleHttp\\Handler\\CurlFactory' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php',
'GuzzleHttp\\Handler\\CurlFactoryInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php',
'GuzzleHttp\\Handler\\CurlHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php',
'GuzzleHttp\\Handler\\CurlMultiHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php',
'GuzzleHttp\\Handler\\EasyHandle' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php',
'GuzzleHttp\\Handler\\HeaderProcessor' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php',
'GuzzleHttp\\Handler\\MockHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/MockHandler.php',
'GuzzleHttp\\Handler\\Proxy' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/Proxy.php',
'GuzzleHttp\\Handler\\StreamHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php',
'GuzzleHttp\\MessageFormatter' => $vendorDir . '/guzzlehttp/guzzle/src/MessageFormatter.php',
'GuzzleHttp\\MessageFormatterInterface' => $vendorDir . '/guzzlehttp/guzzle/src/MessageFormatterInterface.php',
'GuzzleHttp\\Middleware' => $vendorDir . '/guzzlehttp/guzzle/src/Middleware.php',
'GuzzleHttp\\Pool' => $vendorDir . '/guzzlehttp/guzzle/src/Pool.php',
'GuzzleHttp\\PrepareBodyMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php',
'GuzzleHttp\\Promise\\AggregateException' => $vendorDir . '/guzzlehttp/promises/src/AggregateException.php',
'GuzzleHttp\\Promise\\CancellationException' => $vendorDir . '/guzzlehttp/promises/src/CancellationException.php',
'GuzzleHttp\\Promise\\Coroutine' => $vendorDir . '/guzzlehttp/promises/src/Coroutine.php',
'GuzzleHttp\\Promise\\Create' => $vendorDir . '/guzzlehttp/promises/src/Create.php',
'GuzzleHttp\\Promise\\Each' => $vendorDir . '/guzzlehttp/promises/src/Each.php',
'GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php',
'GuzzleHttp\\Promise\\Is' => $vendorDir . '/guzzlehttp/promises/src/Is.php',
'GuzzleHttp\\Promise\\Promise' => $vendorDir . '/guzzlehttp/promises/src/Promise.php',
'GuzzleHttp\\Promise\\PromiseInterface' => $vendorDir . '/guzzlehttp/promises/src/PromiseInterface.php',
'GuzzleHttp\\Promise\\PromisorInterface' => $vendorDir . '/guzzlehttp/promises/src/PromisorInterface.php',
'GuzzleHttp\\Promise\\RejectedPromise' => $vendorDir . '/guzzlehttp/promises/src/RejectedPromise.php',
'GuzzleHttp\\Promise\\RejectionException' => $vendorDir . '/guzzlehttp/promises/src/RejectionException.php',
'GuzzleHttp\\Promise\\TaskQueue' => $vendorDir . '/guzzlehttp/promises/src/TaskQueue.php',
'GuzzleHttp\\Promise\\TaskQueueInterface' => $vendorDir . '/guzzlehttp/promises/src/TaskQueueInterface.php',
'GuzzleHttp\\Promise\\Utils' => $vendorDir . '/guzzlehttp/promises/src/Utils.php',
'GuzzleHttp\\Psr7\\AppendStream' => $vendorDir . '/guzzlehttp/psr7/src/AppendStream.php',
'GuzzleHttp\\Psr7\\BufferStream' => $vendorDir . '/guzzlehttp/psr7/src/BufferStream.php',
'GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php',
'GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php',
'GuzzleHttp\\Psr7\\Exception\\MalformedUriException' => $vendorDir . '/guzzlehttp/psr7/src/Exception/MalformedUriException.php',
'GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php',
'GuzzleHttp\\Psr7\\Header' => $vendorDir . '/guzzlehttp/psr7/src/Header.php',
'GuzzleHttp\\Psr7\\HttpFactory' => $vendorDir . '/guzzlehttp/psr7/src/HttpFactory.php',
'GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
'GuzzleHttp\\Psr7\\Message' => $vendorDir . '/guzzlehttp/psr7/src/Message.php',
'GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php',
'GuzzleHttp\\Psr7\\MimeType' => $vendorDir . '/guzzlehttp/psr7/src/MimeType.php',
'GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
'GuzzleHttp\\Psr7\\Query' => $vendorDir . '/guzzlehttp/psr7/src/Query.php',
'GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php',
'GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php',
'GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php',
'GuzzleHttp\\Psr7\\ServerRequest' => $vendorDir . '/guzzlehttp/psr7/src/ServerRequest.php',
'GuzzleHttp\\Psr7\\Stream' => $vendorDir . '/guzzlehttp/psr7/src/Stream.php',
'GuzzleHttp\\Psr7\\StreamDecoratorTrait' => $vendorDir . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php',
'GuzzleHttp\\Psr7\\StreamWrapper' => $vendorDir . '/guzzlehttp/psr7/src/StreamWrapper.php',
'GuzzleHttp\\Psr7\\UploadedFile' => $vendorDir . '/guzzlehttp/psr7/src/UploadedFile.php',
'GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php',
'GuzzleHttp\\Psr7\\UriComparator' => $vendorDir . '/guzzlehttp/psr7/src/UriComparator.php',
'GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php',
'GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php',
'GuzzleHttp\\Psr7\\Utils' => $vendorDir . '/guzzlehttp/psr7/src/Utils.php',
'GuzzleHttp\\RedirectMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
'GuzzleHttp\\RequestOptions' => $vendorDir . '/guzzlehttp/guzzle/src/RequestOptions.php',
'GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
'GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php',
'GuzzleHttp\\Utils' => $vendorDir . '/guzzlehttp/guzzle/src/Utils.php',
'GuzzleLogMiddleware\\Handler\\AbstractHandler' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/AbstractHandler.php',
'GuzzleLogMiddleware\\Handler\\HandlerInterface' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/HandlerInterface.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\FixedStrategy' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/FixedStrategy.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\LogLevelStrategyInterface' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/LogLevelStrategyInterface.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\StatusCodeStrategy' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/StatusCodeStrategy.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\ThresholdStrategy' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/ThresholdStrategy.php',
'GuzzleLogMiddleware\\Handler\\MultiRecordArrayHandler' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/MultiRecordArrayHandler.php',
'GuzzleLogMiddleware\\Handler\\StringHandler' => $vendorDir . '/gmponos/guzzle_logger/src/Handler/StringHandler.php',
'GuzzleLogMiddleware\\LogMiddleware' => $vendorDir . '/gmponos/guzzle_logger/src/LogMiddleware.php',
'Http\\Client\\Exception' => $vendorDir . '/php-http/httplug/src/Exception.php',
'Http\\Client\\Exception\\HttpException' => $vendorDir . '/php-http/httplug/src/Exception/HttpException.php',
'Http\\Client\\Exception\\NetworkException' => $vendorDir . '/php-http/httplug/src/Exception/NetworkException.php',
'Http\\Client\\Exception\\RequestAwareTrait' => $vendorDir . '/php-http/httplug/src/Exception/RequestAwareTrait.php',
'Http\\Client\\Exception\\RequestException' => $vendorDir . '/php-http/httplug/src/Exception/RequestException.php',
'Http\\Client\\Exception\\TransferException' => $vendorDir . '/php-http/httplug/src/Exception/TransferException.php',
'Http\\Client\\HttpAsyncClient' => $vendorDir . '/php-http/httplug/src/HttpAsyncClient.php',
'Http\\Client\\HttpClient' => $vendorDir . '/php-http/httplug/src/HttpClient.php',
'Http\\Client\\Promise\\HttpFulfilledPromise' => $vendorDir . '/php-http/httplug/src/Promise/HttpFulfilledPromise.php',
'Http\\Client\\Promise\\HttpRejectedPromise' => $vendorDir . '/php-http/httplug/src/Promise/HttpRejectedPromise.php',
'Http\\Message\\Authentication' => $vendorDir . '/php-http/message/src/Authentication.php',
'Http\\Message\\Authentication\\AutoBasicAuth' => $vendorDir . '/php-http/message/src/Authentication/AutoBasicAuth.php',
'Http\\Message\\Authentication\\BasicAuth' => $vendorDir . '/php-http/message/src/Authentication/BasicAuth.php',
'Http\\Message\\Authentication\\Bearer' => $vendorDir . '/php-http/message/src/Authentication/Bearer.php',
'Http\\Message\\Authentication\\Chain' => $vendorDir . '/php-http/message/src/Authentication/Chain.php',
'Http\\Message\\Authentication\\Header' => $vendorDir . '/php-http/message/src/Authentication/Header.php',
'Http\\Message\\Authentication\\Matching' => $vendorDir . '/php-http/message/src/Authentication/Matching.php',
'Http\\Message\\Authentication\\QueryParam' => $vendorDir . '/php-http/message/src/Authentication/QueryParam.php',
'Http\\Message\\Authentication\\RequestConditional' => $vendorDir . '/php-http/message/src/Authentication/RequestConditional.php',
'Http\\Message\\Authentication\\Wsse' => $vendorDir . '/php-http/message/src/Authentication/Wsse.php',
'Http\\Message\\Builder\\ResponseBuilder' => $vendorDir . '/php-http/message/src/Builder/ResponseBuilder.php',
'Http\\Message\\Cookie' => $vendorDir . '/php-http/message/src/Cookie.php',
'Http\\Message\\CookieJar' => $vendorDir . '/php-http/message/src/CookieJar.php',
'Http\\Message\\CookieUtil' => $vendorDir . '/php-http/message/src/CookieUtil.php',
'Http\\Message\\Decorator\\MessageDecorator' => $vendorDir . '/php-http/message/src/Decorator/MessageDecorator.php',
'Http\\Message\\Decorator\\RequestDecorator' => $vendorDir . '/php-http/message/src/Decorator/RequestDecorator.php',
'Http\\Message\\Decorator\\ResponseDecorator' => $vendorDir . '/php-http/message/src/Decorator/ResponseDecorator.php',
'Http\\Message\\Decorator\\StreamDecorator' => $vendorDir . '/php-http/message/src/Decorator/StreamDecorator.php',
'Http\\Message\\Encoding\\ChunkStream' => $vendorDir . '/php-http/message/src/Encoding/ChunkStream.php',
'Http\\Message\\Encoding\\CompressStream' => $vendorDir . '/php-http/message/src/Encoding/CompressStream.php',
'Http\\Message\\Encoding\\DechunkStream' => $vendorDir . '/php-http/message/src/Encoding/DechunkStream.php',
'Http\\Message\\Encoding\\DecompressStream' => $vendorDir . '/php-http/message/src/Encoding/DecompressStream.php',
'Http\\Message\\Encoding\\DeflateStream' => $vendorDir . '/php-http/message/src/Encoding/DeflateStream.php',
'Http\\Message\\Encoding\\Filter\\Chunk' => $vendorDir . '/php-http/message/src/Encoding/Filter/Chunk.php',
'Http\\Message\\Encoding\\FilteredStream' => $vendorDir . '/php-http/message/src/Encoding/FilteredStream.php',
'Http\\Message\\Encoding\\GzipDecodeStream' => $vendorDir . '/php-http/message/src/Encoding/GzipDecodeStream.php',
'Http\\Message\\Encoding\\GzipEncodeStream' => $vendorDir . '/php-http/message/src/Encoding/GzipEncodeStream.php',
'Http\\Message\\Encoding\\InflateStream' => $vendorDir . '/php-http/message/src/Encoding/InflateStream.php',
'Http\\Message\\Exception' => $vendorDir . '/php-http/message/src/Exception.php',
'Http\\Message\\Exception\\UnexpectedValueException' => $vendorDir . '/php-http/message/src/Exception/UnexpectedValueException.php',
'Http\\Message\\Formatter' => $vendorDir . '/php-http/message/src/Formatter.php',
'Http\\Message\\Formatter\\CurlCommandFormatter' => $vendorDir . '/php-http/message/src/Formatter/CurlCommandFormatter.php',
'Http\\Message\\Formatter\\FullHttpMessageFormatter' => $vendorDir . '/php-http/message/src/Formatter/FullHttpMessageFormatter.php',
'Http\\Message\\Formatter\\SimpleFormatter' => $vendorDir . '/php-http/message/src/Formatter/SimpleFormatter.php',
'Http\\Message\\MessageFactory\\DiactorosMessageFactory' => $vendorDir . '/php-http/message/src/MessageFactory/DiactorosMessageFactory.php',
'Http\\Message\\MessageFactory\\GuzzleMessageFactory' => $vendorDir . '/php-http/message/src/MessageFactory/GuzzleMessageFactory.php',
'Http\\Message\\MessageFactory\\SlimMessageFactory' => $vendorDir . '/php-http/message/src/MessageFactory/SlimMessageFactory.php',
'Http\\Message\\RequestMatcher' => $vendorDir . '/php-http/message/src/RequestMatcher.php',
'Http\\Message\\RequestMatcher\\CallbackRequestMatcher' => $vendorDir . '/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php',
'Http\\Message\\RequestMatcher\\RegexRequestMatcher' => $vendorDir . '/php-http/message/src/RequestMatcher/RegexRequestMatcher.php',
'Http\\Message\\RequestMatcher\\RequestMatcher' => $vendorDir . '/php-http/message/src/RequestMatcher/RequestMatcher.php',
'Http\\Message\\StreamFactory\\DiactorosStreamFactory' => $vendorDir . '/php-http/message/src/StreamFactory/DiactorosStreamFactory.php',
'Http\\Message\\StreamFactory\\GuzzleStreamFactory' => $vendorDir . '/php-http/message/src/StreamFactory/GuzzleStreamFactory.php',
'Http\\Message\\StreamFactory\\SlimStreamFactory' => $vendorDir . '/php-http/message/src/StreamFactory/SlimStreamFactory.php',
'Http\\Message\\Stream\\BufferedStream' => $vendorDir . '/php-http/message/src/Stream/BufferedStream.php',
'Http\\Message\\UriFactory\\DiactorosUriFactory' => $vendorDir . '/php-http/message/src/UriFactory/DiactorosUriFactory.php',
'Http\\Message\\UriFactory\\GuzzleUriFactory' => $vendorDir . '/php-http/message/src/UriFactory/GuzzleUriFactory.php',
'Http\\Message\\UriFactory\\SlimUriFactory' => $vendorDir . '/php-http/message/src/UriFactory/SlimUriFactory.php',
'Http\\Promise\\FulfilledPromise' => $vendorDir . '/php-http/promise/src/FulfilledPromise.php',
'Http\\Promise\\Promise' => $vendorDir . '/php-http/promise/src/Promise.php',
'Http\\Promise\\RejectedPromise' => $vendorDir . '/php-http/promise/src/RejectedPromise.php',
'PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider' => $vendorDir . '/prestashop/module-lib-cache-directory-provider/src/Cache/CacheDirectoryProvider.php',
'PrestaShop\\ModuleLibServiceContainer\\DependencyInjection\\ContainerProvider' => $vendorDir . '/prestashop/module-lib-service-container/src/DependencyInjection/ContainerProvider.php',
'PrestaShop\\ModuleLibServiceContainer\\DependencyInjection\\ServiceContainer' => $vendorDir . '/prestashop/module-lib-service-container/src/DependencyInjection/ServiceContainer.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\InstallerException' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/InstallerException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\ModuleNotInstalledException' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/ModuleNotInstalledException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\ModuleVersionException' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/ModuleVersionException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Facade\\PsAccounts' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Facade/PsAccounts.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Installer' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Installer.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Presenter\\InstallerPresenter' => $vendorDir . '/prestashop/prestashop-accounts-installer/src/Installer/Presenter/InstallerPresenter.php',
'Prestashop\\ModuleLibGuzzleAdapter\\ClientFactory' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/ClientFactory.php',
'Prestashop\\ModuleLibGuzzleAdapter\\ConfigInterface' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/ConfigInterface.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle5\\Client' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle5/Client.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle5\\Config' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle5/Config.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Client' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Client.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Config' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Config.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Exception\\UnexpectedValueException' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Exception/UnexpectedValueException.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Promise' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Promise.php',
'Prestashop\\ModuleLibGuzzleAdapter\\VersionDetection' => $vendorDir . '/prestashop/module-lib-guzzle-adapter/src/VersionDetection.php',
'Prestashop\\ModuleLibMboInstaller\\DependencyBuilder' => $vendorDir . '/prestashop/module-lib-mbo-installer/src/DependencyBuilder.php',
'Prestashop\\ModuleLibMboInstaller\\Installer' => $vendorDir . '/prestashop/module-lib-mbo-installer/src/Installer.php',
'Prestashop\\ModuleLibMboInstaller\\Presenter' => $vendorDir . '/prestashop/module-lib-mbo-installer/src/Presenter.php',
'PsCheckout\\Module\\Presentation\\Translator' => $baseDir . '/src/Presentation/Translator.php',
'Psr\\Http\\Client\\ClientExceptionInterface' => $vendorDir . '/psr/http-client/src/ClientExceptionInterface.php',
'Psr\\Http\\Client\\ClientInterface' => $vendorDir . '/psr/http-client/src/ClientInterface.php',
'Psr\\Http\\Client\\NetworkExceptionInterface' => $vendorDir . '/psr/http-client/src/NetworkExceptionInterface.php',
'Psr\\Http\\Client\\RequestExceptionInterface' => $vendorDir . '/psr/http-client/src/RequestExceptionInterface.php',
'Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php',
'Psr\\Http\\Message\\RequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/RequestFactoryInterface.php',
'Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php',
'Psr\\Http\\Message\\ResponseFactoryInterface' => $vendorDir . '/psr/http-factory/src/ResponseFactoryInterface.php',
'Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php',
'Psr\\Http\\Message\\ServerRequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/ServerRequestFactoryInterface.php',
'Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php',
'Psr\\Http\\Message\\StreamFactoryInterface' => $vendorDir . '/psr/http-factory/src/StreamFactoryInterface.php',
'Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php',
'Psr\\Http\\Message\\UploadedFileFactoryInterface' => $vendorDir . '/psr/http-factory/src/UploadedFileFactoryInterface.php',
'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php',
'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php',
'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php',
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/src/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/src/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/src/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/src/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/src/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/src/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
'libphonenumber\\AlternateFormatsCountryCodeSet' => $vendorDir . '/giggsey/libphonenumber-for-php/src/AlternateFormatsCountryCodeSet.php',
'libphonenumber\\AsYouTypeFormatter' => $vendorDir . '/giggsey/libphonenumber-for-php/src/AsYouTypeFormatter.php',
'libphonenumber\\CountryCodeSource' => $vendorDir . '/giggsey/libphonenumber-for-php/src/CountryCodeSource.php',
'libphonenumber\\CountryCodeToRegionCodeMap' => $vendorDir . '/giggsey/libphonenumber-for-php/src/CountryCodeToRegionCodeMap.php',
'libphonenumber\\DefaultMetadataLoader' => $vendorDir . '/giggsey/libphonenumber-for-php/src/DefaultMetadataLoader.php',
'libphonenumber\\Leniency' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency.php',
'libphonenumber\\Leniency\\AbstractLeniency' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency/AbstractLeniency.php',
'libphonenumber\\Leniency\\ExactGrouping' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency/ExactGrouping.php',
'libphonenumber\\Leniency\\Possible' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency/Possible.php',
'libphonenumber\\Leniency\\StrictGrouping' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency/StrictGrouping.php',
'libphonenumber\\Leniency\\Valid' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Leniency/Valid.php',
'libphonenumber\\MatchType' => $vendorDir . '/giggsey/libphonenumber-for-php/src/MatchType.php',
'libphonenumber\\Matcher' => $vendorDir . '/giggsey/libphonenumber-for-php/src/Matcher.php',
'libphonenumber\\MatcherAPIInterface' => $vendorDir . '/giggsey/libphonenumber-for-php/src/MatcherAPIInterface.php',
'libphonenumber\\MetadataLoaderInterface' => $vendorDir . '/giggsey/libphonenumber-for-php/src/MetadataLoaderInterface.php',
'libphonenumber\\MetadataSourceInterface' => $vendorDir . '/giggsey/libphonenumber-for-php/src/MetadataSourceInterface.php',
'libphonenumber\\MultiFileMetadataSourceImpl' => $vendorDir . '/giggsey/libphonenumber-for-php/src/MultiFileMetadataSourceImpl.php',
'libphonenumber\\NumberFormat' => $vendorDir . '/giggsey/libphonenumber-for-php/src/NumberFormat.php',
'libphonenumber\\NumberParseException' => $vendorDir . '/giggsey/libphonenumber-for-php/src/NumberParseException.php',
'libphonenumber\\PhoneMetadata' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneMetadata.php',
'libphonenumber\\PhoneNumber' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumber.php',
'libphonenumber\\PhoneNumberDesc' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberDesc.php',
'libphonenumber\\PhoneNumberFormat' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberFormat.php',
'libphonenumber\\PhoneNumberMatch' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberMatch.php',
'libphonenumber\\PhoneNumberMatcher' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberMatcher.php',
'libphonenumber\\PhoneNumberToCarrierMapper' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberToCarrierMapper.php',
'libphonenumber\\PhoneNumberToTimeZonesMapper' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberToTimeZonesMapper.php',
'libphonenumber\\PhoneNumberType' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberType.php',
'libphonenumber\\PhoneNumberUtil' => $vendorDir . '/giggsey/libphonenumber-for-php/src/PhoneNumberUtil.php',
'libphonenumber\\RegexBasedMatcher' => $vendorDir . '/giggsey/libphonenumber-for-php/src/RegexBasedMatcher.php',
'libphonenumber\\RegionCode' => $vendorDir . '/giggsey/libphonenumber-for-php/src/RegionCode.php',
'libphonenumber\\ShortNumberCost' => $vendorDir . '/giggsey/libphonenumber-for-php/src/ShortNumberCost.php',
'libphonenumber\\ShortNumberInfo' => $vendorDir . '/giggsey/libphonenumber-for-php/src/ShortNumberInfo.php',
'libphonenumber\\ShortNumbersRegionCodeSet' => $vendorDir . '/giggsey/libphonenumber-for-php/src/ShortNumbersRegionCodeSet.php',
'libphonenumber\\ValidationResult' => $vendorDir . '/giggsey/libphonenumber-for-php/src/ValidationResult.php',
'libphonenumber\\geocoding\\PhoneNumberOfflineGeocoder' => $vendorDir . '/giggsey/libphonenumber-for-php/src/geocoding/PhoneNumberOfflineGeocoder.php',
'libphonenumber\\prefixmapper\\MappingFileProvider' => $vendorDir . '/giggsey/libphonenumber-for-php/src/prefixmapper/MappingFileProvider.php',
'libphonenumber\\prefixmapper\\PhonePrefixMap' => $vendorDir . '/giggsey/libphonenumber-for-php/src/prefixmapper/PhonePrefixMap.php',
'libphonenumber\\prefixmapper\\PrefixFileReader' => $vendorDir . '/giggsey/libphonenumber-for-php/src/prefixmapper/PrefixFileReader.php',
'libphonenumber\\prefixmapper\\PrefixTimeZonesMap' => $vendorDir . '/giggsey/libphonenumber-for-php/src/prefixmapper/PrefixTimeZonesMap.php',
);

View File

@@ -0,0 +1,15 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'9c67151ae59aff4788964ce8eb2a0f43' => $vendorDir . '/clue/stream-filter/src/functions_include.php',
'8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,34 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'libphonenumber\\' => array($vendorDir . '/giggsey/libphonenumber-for-php/src'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'PsCheckout\\Utility\\' => array($vendorDir . '/invertus/utility/src'),
'PsCheckout\\Presentation\\' => array($vendorDir . '/invertus/presentation/src'),
'PsCheckout\\Module\\' => array($baseDir . '/src'),
'PsCheckout\\Infrastructure\\' => array($vendorDir . '/invertus/infrastructure/src'),
'PsCheckout\\Core\\' => array($vendorDir . '/invertus/core/src'),
'PsCheckout\\Api\\' => array($vendorDir . '/invertus/api/src'),
'Prestashop\\ModuleLibMboInstaller\\' => array($vendorDir . '/prestashop/module-lib-mbo-installer/src'),
'Prestashop\\ModuleLibGuzzleAdapter\\' => array($vendorDir . '/prestashop/module-lib-guzzle-adapter/src'),
'PrestaShop\\PsAccountsInstaller\\' => array($vendorDir . '/prestashop/prestashop-accounts-installer/src'),
'PrestaShop\\ModuleLibServiceContainer\\' => array($vendorDir . '/prestashop/module-lib-service-container/src'),
'PrestaShop\\ModuleLibCacheDirectoryProvider\\' => array($vendorDir . '/prestashop/module-lib-cache-directory-provider/src'),
'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'),
'Http\\Message\\' => array($vendorDir . '/php-http/message/src'),
'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'),
'GuzzleLogMiddleware\\' => array($vendorDir . '/gmponos/guzzle_logger/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Giggsey\\Locale\\' => array($vendorDir . '/giggsey/locale/src'),
'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'),
);

View File

@@ -0,0 +1,48 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita6446bd035c925f2c8a48f3e27fad5bf
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita6446bd035c925f2c8a48f3e27fad5bf', 'loadClassLoader'), true, false);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInita6446bd035c925f2c8a48f3e27fad5bf', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf::getInitializer($loader));
$loader->register(false);
$filesToLoad = \Composer\Autoload\ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}

View File

@@ -0,0 +1,427 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf
{
public static $files = array (
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'9c67151ae59aff4788964ce8eb2a0f43' => __DIR__ . '/..' . '/clue/stream-filter/src/functions_include.php',
'8cff32064859f4559445b89279f3199c' => __DIR__ . '/..' . '/php-http/message/src/filters.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
);
public static $prefixLengthsPsr4 = array (
'l' =>
array (
'libphonenumber\\' => 15,
),
'S' =>
array (
'Symfony\\Polyfill\\Mbstring\\' => 26,
),
'P' =>
array (
'Psr\\Log\\' => 8,
'Psr\\Http\\Message\\' => 17,
'Psr\\Http\\Client\\' => 16,
'PsCheckout\\Utility\\' => 19,
'PsCheckout\\Presentation\\' => 24,
'PsCheckout\\Module\\' => 18,
'PsCheckout\\Infrastructure\\' => 26,
'PsCheckout\\Core\\' => 16,
'PsCheckout\\Api\\' => 15,
'Prestashop\\ModuleLibMboInstaller\\' => 33,
'Prestashop\\ModuleLibGuzzleAdapter\\' => 34,
'PrestaShop\\PsAccountsInstaller\\' => 31,
'PrestaShop\\ModuleLibServiceContainer\\' => 37,
'PrestaShop\\ModuleLibCacheDirectoryProvider\\' => 43,
),
'H' =>
array (
'Http\\Promise\\' => 13,
'Http\\Message\\' => 13,
'Http\\Client\\' => 12,
),
'G' =>
array (
'GuzzleLogMiddleware\\' => 20,
'GuzzleHttp\\Psr7\\' => 16,
'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11,
'Giggsey\\Locale\\' => 15,
),
'C' =>
array (
'Clue\\StreamFilter\\' => 18,
),
);
public static $prefixDirsPsr4 = array (
'libphonenumber\\' =>
array (
0 => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src',
),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/src',
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-factory/src',
1 => __DIR__ . '/..' . '/psr/http-message/src',
),
'Psr\\Http\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-client/src',
),
'PsCheckout\\Utility\\' =>
array (
0 => __DIR__ . '/..' . '/invertus/utility/src',
),
'PsCheckout\\Presentation\\' =>
array (
0 => __DIR__ . '/..' . '/invertus/presentation/src',
),
'PsCheckout\\Module\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
'PsCheckout\\Infrastructure\\' =>
array (
0 => __DIR__ . '/..' . '/invertus/infrastructure/src',
),
'PsCheckout\\Core\\' =>
array (
0 => __DIR__ . '/..' . '/invertus/core/src',
),
'PsCheckout\\Api\\' =>
array (
0 => __DIR__ . '/..' . '/invertus/api/src',
),
'Prestashop\\ModuleLibMboInstaller\\' =>
array (
0 => __DIR__ . '/..' . '/prestashop/module-lib-mbo-installer/src',
),
'Prestashop\\ModuleLibGuzzleAdapter\\' =>
array (
0 => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src',
),
'PrestaShop\\PsAccountsInstaller\\' =>
array (
0 => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src',
),
'PrestaShop\\ModuleLibServiceContainer\\' =>
array (
0 => __DIR__ . '/..' . '/prestashop/module-lib-service-container/src',
),
'PrestaShop\\ModuleLibCacheDirectoryProvider\\' =>
array (
0 => __DIR__ . '/..' . '/prestashop/module-lib-cache-directory-provider/src',
),
'Http\\Promise\\' =>
array (
0 => __DIR__ . '/..' . '/php-http/promise/src',
),
'Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/php-http/message/src',
),
'Http\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/php-http/httplug/src',
),
'GuzzleLogMiddleware\\' =>
array (
0 => __DIR__ . '/..' . '/gmponos/guzzle_logger/src',
),
'GuzzleHttp\\Psr7\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
),
'GuzzleHttp\\Promise\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
),
'GuzzleHttp\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
),
'Giggsey\\Locale\\' =>
array (
0 => __DIR__ . '/..' . '/giggsey/locale/src',
),
'Clue\\StreamFilter\\' =>
array (
0 => __DIR__ . '/..' . '/clue/stream-filter/src',
),
);
public static $classMap = array (
'Clue\\StreamFilter\\CallbackFilter' => __DIR__ . '/..' . '/clue/stream-filter/src/CallbackFilter.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Giggsey\\Locale\\Locale' => __DIR__ . '/..' . '/giggsey/locale/src/Locale.php',
'GuzzleHttp\\BodySummarizer' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizer.php',
'GuzzleHttp\\BodySummarizerInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
'GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php',
'GuzzleHttp\\ClientInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientInterface.php',
'GuzzleHttp\\ClientTrait' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientTrait.php',
'GuzzleHttp\\Cookie\\CookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php',
'GuzzleHttp\\Cookie\\CookieJarInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php',
'GuzzleHttp\\Cookie\\FileCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php',
'GuzzleHttp\\Cookie\\SessionCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php',
'GuzzleHttp\\Cookie\\SetCookie' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php',
'GuzzleHttp\\Exception\\BadResponseException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php',
'GuzzleHttp\\Exception\\ClientException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ClientException.php',
'GuzzleHttp\\Exception\\ConnectException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ConnectException.php',
'GuzzleHttp\\Exception\\GuzzleException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php',
'GuzzleHttp\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php',
'GuzzleHttp\\Exception\\RequestException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/RequestException.php',
'GuzzleHttp\\Exception\\ServerException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ServerException.php',
'GuzzleHttp\\Exception\\TooManyRedirectsException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php',
'GuzzleHttp\\Exception\\TransferException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TransferException.php',
'GuzzleHttp\\HandlerStack' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/HandlerStack.php',
'GuzzleHttp\\Handler\\CurlFactory' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php',
'GuzzleHttp\\Handler\\CurlFactoryInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php',
'GuzzleHttp\\Handler\\CurlHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php',
'GuzzleHttp\\Handler\\CurlMultiHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php',
'GuzzleHttp\\Handler\\EasyHandle' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php',
'GuzzleHttp\\Handler\\HeaderProcessor' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php',
'GuzzleHttp\\Handler\\MockHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/MockHandler.php',
'GuzzleHttp\\Handler\\Proxy' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/Proxy.php',
'GuzzleHttp\\Handler\\StreamHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php',
'GuzzleHttp\\MessageFormatter' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/MessageFormatter.php',
'GuzzleHttp\\MessageFormatterInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/MessageFormatterInterface.php',
'GuzzleHttp\\Middleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Middleware.php',
'GuzzleHttp\\Pool' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Pool.php',
'GuzzleHttp\\PrepareBodyMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php',
'GuzzleHttp\\Promise\\AggregateException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/AggregateException.php',
'GuzzleHttp\\Promise\\CancellationException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/CancellationException.php',
'GuzzleHttp\\Promise\\Coroutine' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Coroutine.php',
'GuzzleHttp\\Promise\\Create' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Create.php',
'GuzzleHttp\\Promise\\Each' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Each.php',
'GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php',
'GuzzleHttp\\Promise\\Is' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Is.php',
'GuzzleHttp\\Promise\\Promise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Promise.php',
'GuzzleHttp\\Promise\\PromiseInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromiseInterface.php',
'GuzzleHttp\\Promise\\PromisorInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromisorInterface.php',
'GuzzleHttp\\Promise\\RejectedPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectedPromise.php',
'GuzzleHttp\\Promise\\RejectionException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectionException.php',
'GuzzleHttp\\Promise\\TaskQueue' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueue.php',
'GuzzleHttp\\Promise\\TaskQueueInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueueInterface.php',
'GuzzleHttp\\Promise\\Utils' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Utils.php',
'GuzzleHttp\\Psr7\\AppendStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/AppendStream.php',
'GuzzleHttp\\Psr7\\BufferStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/BufferStream.php',
'GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php',
'GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php',
'GuzzleHttp\\Psr7\\Exception\\MalformedUriException' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Exception/MalformedUriException.php',
'GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php',
'GuzzleHttp\\Psr7\\Header' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Header.php',
'GuzzleHttp\\Psr7\\HttpFactory' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/HttpFactory.php',
'GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
'GuzzleHttp\\Psr7\\Message' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Message.php',
'GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php',
'GuzzleHttp\\Psr7\\MimeType' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MimeType.php',
'GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
'GuzzleHttp\\Psr7\\Query' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Query.php',
'GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php',
'GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php',
'GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php',
'GuzzleHttp\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/ServerRequest.php',
'GuzzleHttp\\Psr7\\Stream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Stream.php',
'GuzzleHttp\\Psr7\\StreamDecoratorTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php',
'GuzzleHttp\\Psr7\\StreamWrapper' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamWrapper.php',
'GuzzleHttp\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UploadedFile.php',
'GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php',
'GuzzleHttp\\Psr7\\UriComparator' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriComparator.php',
'GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php',
'GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php',
'GuzzleHttp\\Psr7\\Utils' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Utils.php',
'GuzzleHttp\\RedirectMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
'GuzzleHttp\\RequestOptions' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RequestOptions.php',
'GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
'GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php',
'GuzzleHttp\\Utils' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Utils.php',
'GuzzleLogMiddleware\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/AbstractHandler.php',
'GuzzleLogMiddleware\\Handler\\HandlerInterface' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/HandlerInterface.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\FixedStrategy' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/FixedStrategy.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\LogLevelStrategyInterface' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/LogLevelStrategyInterface.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\StatusCodeStrategy' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/StatusCodeStrategy.php',
'GuzzleLogMiddleware\\Handler\\LogLevelStrategy\\ThresholdStrategy' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/LogLevelStrategy/ThresholdStrategy.php',
'GuzzleLogMiddleware\\Handler\\MultiRecordArrayHandler' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/MultiRecordArrayHandler.php',
'GuzzleLogMiddleware\\Handler\\StringHandler' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/Handler/StringHandler.php',
'GuzzleLogMiddleware\\LogMiddleware' => __DIR__ . '/..' . '/gmponos/guzzle_logger/src/LogMiddleware.php',
'Http\\Client\\Exception' => __DIR__ . '/..' . '/php-http/httplug/src/Exception.php',
'Http\\Client\\Exception\\HttpException' => __DIR__ . '/..' . '/php-http/httplug/src/Exception/HttpException.php',
'Http\\Client\\Exception\\NetworkException' => __DIR__ . '/..' . '/php-http/httplug/src/Exception/NetworkException.php',
'Http\\Client\\Exception\\RequestAwareTrait' => __DIR__ . '/..' . '/php-http/httplug/src/Exception/RequestAwareTrait.php',
'Http\\Client\\Exception\\RequestException' => __DIR__ . '/..' . '/php-http/httplug/src/Exception/RequestException.php',
'Http\\Client\\Exception\\TransferException' => __DIR__ . '/..' . '/php-http/httplug/src/Exception/TransferException.php',
'Http\\Client\\HttpAsyncClient' => __DIR__ . '/..' . '/php-http/httplug/src/HttpAsyncClient.php',
'Http\\Client\\HttpClient' => __DIR__ . '/..' . '/php-http/httplug/src/HttpClient.php',
'Http\\Client\\Promise\\HttpFulfilledPromise' => __DIR__ . '/..' . '/php-http/httplug/src/Promise/HttpFulfilledPromise.php',
'Http\\Client\\Promise\\HttpRejectedPromise' => __DIR__ . '/..' . '/php-http/httplug/src/Promise/HttpRejectedPromise.php',
'Http\\Message\\Authentication' => __DIR__ . '/..' . '/php-http/message/src/Authentication.php',
'Http\\Message\\Authentication\\AutoBasicAuth' => __DIR__ . '/..' . '/php-http/message/src/Authentication/AutoBasicAuth.php',
'Http\\Message\\Authentication\\BasicAuth' => __DIR__ . '/..' . '/php-http/message/src/Authentication/BasicAuth.php',
'Http\\Message\\Authentication\\Bearer' => __DIR__ . '/..' . '/php-http/message/src/Authentication/Bearer.php',
'Http\\Message\\Authentication\\Chain' => __DIR__ . '/..' . '/php-http/message/src/Authentication/Chain.php',
'Http\\Message\\Authentication\\Header' => __DIR__ . '/..' . '/php-http/message/src/Authentication/Header.php',
'Http\\Message\\Authentication\\Matching' => __DIR__ . '/..' . '/php-http/message/src/Authentication/Matching.php',
'Http\\Message\\Authentication\\QueryParam' => __DIR__ . '/..' . '/php-http/message/src/Authentication/QueryParam.php',
'Http\\Message\\Authentication\\RequestConditional' => __DIR__ . '/..' . '/php-http/message/src/Authentication/RequestConditional.php',
'Http\\Message\\Authentication\\Wsse' => __DIR__ . '/..' . '/php-http/message/src/Authentication/Wsse.php',
'Http\\Message\\Builder\\ResponseBuilder' => __DIR__ . '/..' . '/php-http/message/src/Builder/ResponseBuilder.php',
'Http\\Message\\Cookie' => __DIR__ . '/..' . '/php-http/message/src/Cookie.php',
'Http\\Message\\CookieJar' => __DIR__ . '/..' . '/php-http/message/src/CookieJar.php',
'Http\\Message\\CookieUtil' => __DIR__ . '/..' . '/php-http/message/src/CookieUtil.php',
'Http\\Message\\Decorator\\MessageDecorator' => __DIR__ . '/..' . '/php-http/message/src/Decorator/MessageDecorator.php',
'Http\\Message\\Decorator\\RequestDecorator' => __DIR__ . '/..' . '/php-http/message/src/Decorator/RequestDecorator.php',
'Http\\Message\\Decorator\\ResponseDecorator' => __DIR__ . '/..' . '/php-http/message/src/Decorator/ResponseDecorator.php',
'Http\\Message\\Decorator\\StreamDecorator' => __DIR__ . '/..' . '/php-http/message/src/Decorator/StreamDecorator.php',
'Http\\Message\\Encoding\\ChunkStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/ChunkStream.php',
'Http\\Message\\Encoding\\CompressStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/CompressStream.php',
'Http\\Message\\Encoding\\DechunkStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/DechunkStream.php',
'Http\\Message\\Encoding\\DecompressStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/DecompressStream.php',
'Http\\Message\\Encoding\\DeflateStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/DeflateStream.php',
'Http\\Message\\Encoding\\Filter\\Chunk' => __DIR__ . '/..' . '/php-http/message/src/Encoding/Filter/Chunk.php',
'Http\\Message\\Encoding\\FilteredStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/FilteredStream.php',
'Http\\Message\\Encoding\\GzipDecodeStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/GzipDecodeStream.php',
'Http\\Message\\Encoding\\GzipEncodeStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/GzipEncodeStream.php',
'Http\\Message\\Encoding\\InflateStream' => __DIR__ . '/..' . '/php-http/message/src/Encoding/InflateStream.php',
'Http\\Message\\Exception' => __DIR__ . '/..' . '/php-http/message/src/Exception.php',
'Http\\Message\\Exception\\UnexpectedValueException' => __DIR__ . '/..' . '/php-http/message/src/Exception/UnexpectedValueException.php',
'Http\\Message\\Formatter' => __DIR__ . '/..' . '/php-http/message/src/Formatter.php',
'Http\\Message\\Formatter\\CurlCommandFormatter' => __DIR__ . '/..' . '/php-http/message/src/Formatter/CurlCommandFormatter.php',
'Http\\Message\\Formatter\\FullHttpMessageFormatter' => __DIR__ . '/..' . '/php-http/message/src/Formatter/FullHttpMessageFormatter.php',
'Http\\Message\\Formatter\\SimpleFormatter' => __DIR__ . '/..' . '/php-http/message/src/Formatter/SimpleFormatter.php',
'Http\\Message\\MessageFactory\\DiactorosMessageFactory' => __DIR__ . '/..' . '/php-http/message/src/MessageFactory/DiactorosMessageFactory.php',
'Http\\Message\\MessageFactory\\GuzzleMessageFactory' => __DIR__ . '/..' . '/php-http/message/src/MessageFactory/GuzzleMessageFactory.php',
'Http\\Message\\MessageFactory\\SlimMessageFactory' => __DIR__ . '/..' . '/php-http/message/src/MessageFactory/SlimMessageFactory.php',
'Http\\Message\\RequestMatcher' => __DIR__ . '/..' . '/php-http/message/src/RequestMatcher.php',
'Http\\Message\\RequestMatcher\\CallbackRequestMatcher' => __DIR__ . '/..' . '/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php',
'Http\\Message\\RequestMatcher\\RegexRequestMatcher' => __DIR__ . '/..' . '/php-http/message/src/RequestMatcher/RegexRequestMatcher.php',
'Http\\Message\\RequestMatcher\\RequestMatcher' => __DIR__ . '/..' . '/php-http/message/src/RequestMatcher/RequestMatcher.php',
'Http\\Message\\StreamFactory\\DiactorosStreamFactory' => __DIR__ . '/..' . '/php-http/message/src/StreamFactory/DiactorosStreamFactory.php',
'Http\\Message\\StreamFactory\\GuzzleStreamFactory' => __DIR__ . '/..' . '/php-http/message/src/StreamFactory/GuzzleStreamFactory.php',
'Http\\Message\\StreamFactory\\SlimStreamFactory' => __DIR__ . '/..' . '/php-http/message/src/StreamFactory/SlimStreamFactory.php',
'Http\\Message\\Stream\\BufferedStream' => __DIR__ . '/..' . '/php-http/message/src/Stream/BufferedStream.php',
'Http\\Message\\UriFactory\\DiactorosUriFactory' => __DIR__ . '/..' . '/php-http/message/src/UriFactory/DiactorosUriFactory.php',
'Http\\Message\\UriFactory\\GuzzleUriFactory' => __DIR__ . '/..' . '/php-http/message/src/UriFactory/GuzzleUriFactory.php',
'Http\\Message\\UriFactory\\SlimUriFactory' => __DIR__ . '/..' . '/php-http/message/src/UriFactory/SlimUriFactory.php',
'Http\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/php-http/promise/src/FulfilledPromise.php',
'Http\\Promise\\Promise' => __DIR__ . '/..' . '/php-http/promise/src/Promise.php',
'Http\\Promise\\RejectedPromise' => __DIR__ . '/..' . '/php-http/promise/src/RejectedPromise.php',
'PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider' => __DIR__ . '/..' . '/prestashop/module-lib-cache-directory-provider/src/Cache/CacheDirectoryProvider.php',
'PrestaShop\\ModuleLibServiceContainer\\DependencyInjection\\ContainerProvider' => __DIR__ . '/..' . '/prestashop/module-lib-service-container/src/DependencyInjection/ContainerProvider.php',
'PrestaShop\\ModuleLibServiceContainer\\DependencyInjection\\ServiceContainer' => __DIR__ . '/..' . '/prestashop/module-lib-service-container/src/DependencyInjection/ServiceContainer.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\InstallerException' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/InstallerException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\ModuleNotInstalledException' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/ModuleNotInstalledException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Exception\\ModuleVersionException' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Exception/ModuleVersionException.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Facade\\PsAccounts' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Facade/PsAccounts.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Installer' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Installer.php',
'PrestaShop\\PsAccountsInstaller\\Installer\\Presenter\\InstallerPresenter' => __DIR__ . '/..' . '/prestashop/prestashop-accounts-installer/src/Installer/Presenter/InstallerPresenter.php',
'Prestashop\\ModuleLibGuzzleAdapter\\ClientFactory' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/ClientFactory.php',
'Prestashop\\ModuleLibGuzzleAdapter\\ConfigInterface' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/ConfigInterface.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle5\\Client' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle5/Client.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle5\\Config' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle5/Config.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Client' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Client.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Config' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Config.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Exception\\UnexpectedValueException' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Exception/UnexpectedValueException.php',
'Prestashop\\ModuleLibGuzzleAdapter\\Guzzle7\\Promise' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/Guzzle7/Promise.php',
'Prestashop\\ModuleLibGuzzleAdapter\\VersionDetection' => __DIR__ . '/..' . '/prestashop/module-lib-guzzle-adapter/src/VersionDetection.php',
'Prestashop\\ModuleLibMboInstaller\\DependencyBuilder' => __DIR__ . '/..' . '/prestashop/module-lib-mbo-installer/src/DependencyBuilder.php',
'Prestashop\\ModuleLibMboInstaller\\Installer' => __DIR__ . '/..' . '/prestashop/module-lib-mbo-installer/src/Installer.php',
'Prestashop\\ModuleLibMboInstaller\\Presenter' => __DIR__ . '/..' . '/prestashop/module-lib-mbo-installer/src/Presenter.php',
'PsCheckout\\Module\\Presentation\\Translator' => __DIR__ . '/../..' . '/src/Presentation/Translator.php',
'Psr\\Http\\Client\\ClientExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientExceptionInterface.php',
'Psr\\Http\\Client\\ClientInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientInterface.php',
'Psr\\Http\\Client\\NetworkExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/NetworkExceptionInterface.php',
'Psr\\Http\\Client\\RequestExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/RequestExceptionInterface.php',
'Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php',
'Psr\\Http\\Message\\RequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/RequestFactoryInterface.php',
'Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php',
'Psr\\Http\\Message\\ResponseFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ResponseFactoryInterface.php',
'Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php',
'Psr\\Http\\Message\\ServerRequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ServerRequestFactoryInterface.php',
'Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php',
'Psr\\Http\\Message\\StreamFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/StreamFactoryInterface.php',
'Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php',
'Psr\\Http\\Message\\UploadedFileFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UploadedFileFactoryInterface.php',
'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php',
'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php',
'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php',
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/src/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/src/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/src/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
'libphonenumber\\AlternateFormatsCountryCodeSet' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/AlternateFormatsCountryCodeSet.php',
'libphonenumber\\AsYouTypeFormatter' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/AsYouTypeFormatter.php',
'libphonenumber\\CountryCodeSource' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/CountryCodeSource.php',
'libphonenumber\\CountryCodeToRegionCodeMap' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/CountryCodeToRegionCodeMap.php',
'libphonenumber\\DefaultMetadataLoader' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/DefaultMetadataLoader.php',
'libphonenumber\\Leniency' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency.php',
'libphonenumber\\Leniency\\AbstractLeniency' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency/AbstractLeniency.php',
'libphonenumber\\Leniency\\ExactGrouping' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency/ExactGrouping.php',
'libphonenumber\\Leniency\\Possible' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency/Possible.php',
'libphonenumber\\Leniency\\StrictGrouping' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency/StrictGrouping.php',
'libphonenumber\\Leniency\\Valid' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Leniency/Valid.php',
'libphonenumber\\MatchType' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/MatchType.php',
'libphonenumber\\Matcher' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/Matcher.php',
'libphonenumber\\MatcherAPIInterface' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/MatcherAPIInterface.php',
'libphonenumber\\MetadataLoaderInterface' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/MetadataLoaderInterface.php',
'libphonenumber\\MetadataSourceInterface' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/MetadataSourceInterface.php',
'libphonenumber\\MultiFileMetadataSourceImpl' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/MultiFileMetadataSourceImpl.php',
'libphonenumber\\NumberFormat' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/NumberFormat.php',
'libphonenumber\\NumberParseException' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/NumberParseException.php',
'libphonenumber\\PhoneMetadata' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneMetadata.php',
'libphonenumber\\PhoneNumber' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumber.php',
'libphonenumber\\PhoneNumberDesc' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberDesc.php',
'libphonenumber\\PhoneNumberFormat' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberFormat.php',
'libphonenumber\\PhoneNumberMatch' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberMatch.php',
'libphonenumber\\PhoneNumberMatcher' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberMatcher.php',
'libphonenumber\\PhoneNumberToCarrierMapper' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberToCarrierMapper.php',
'libphonenumber\\PhoneNumberToTimeZonesMapper' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberToTimeZonesMapper.php',
'libphonenumber\\PhoneNumberType' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberType.php',
'libphonenumber\\PhoneNumberUtil' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/PhoneNumberUtil.php',
'libphonenumber\\RegexBasedMatcher' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/RegexBasedMatcher.php',
'libphonenumber\\RegionCode' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/RegionCode.php',
'libphonenumber\\ShortNumberCost' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/ShortNumberCost.php',
'libphonenumber\\ShortNumberInfo' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/ShortNumberInfo.php',
'libphonenumber\\ShortNumbersRegionCodeSet' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/ShortNumbersRegionCodeSet.php',
'libphonenumber\\ValidationResult' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/ValidationResult.php',
'libphonenumber\\geocoding\\PhoneNumberOfflineGeocoder' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/geocoding/PhoneNumberOfflineGeocoder.php',
'libphonenumber\\prefixmapper\\MappingFileProvider' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/prefixmapper/MappingFileProvider.php',
'libphonenumber\\prefixmapper\\PhonePrefixMap' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/prefixmapper/PhonePrefixMap.php',
'libphonenumber\\prefixmapper\\PrefixFileReader' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/prefixmapper/PrefixFileReader.php',
'libphonenumber\\prefixmapper\\PrefixTimeZonesMap' => __DIR__ . '/..' . '/giggsey/libphonenumber-for-php/src/prefixmapper/PrefixTimeZonesMap.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita6446bd035c925f2c8a48f3e27fad5bf::$classMap;
}, null, ClassLoader::class);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
<?php return array(
'root' => array(
'name' => '__root__',
'pretty_version' => 'v5.1.1',
'version' => '5.1.1.0',
'reference' => '5846da751d8542e6814651626eacd7fe5470c270',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => false,
),
'versions' => array(
'__root__' => array(
'pretty_version' => 'v5.1.1',
'version' => '5.1.1.0',
'reference' => '5846da751d8542e6814651626eacd7fe5470c270',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'clue/stream-filter' => array(
'pretty_version' => 'v1.7.0',
'version' => '1.7.0.0',
'reference' => '049509fef80032cb3f051595029ab75b49a3c2f7',
'type' => 'library',
'install_path' => __DIR__ . '/../clue/stream-filter',
'aliases' => array(),
'dev_requirement' => false,
),
'giggsey/libphonenumber-for-php' => array(
'pretty_version' => '8.13.55',
'version' => '8.13.55.0',
'reference' => '6e28b3d53cf96d7f41c83d9b80b6021ecbd00537',
'type' => 'library',
'install_path' => __DIR__ . '/../giggsey/libphonenumber-for-php',
'aliases' => array(),
'dev_requirement' => false,
),
'giggsey/libphonenumber-for-php-lite' => array(
'dev_requirement' => false,
'replaced' => array(
0 => '8.13.55',
),
),
'giggsey/locale' => array(
'pretty_version' => '2.9.0',
'version' => '2.9.0.0',
'reference' => 'fe741e99ae6ccbe8132f3d63d8ec89924e689778',
'type' => 'library',
'install_path' => __DIR__ . '/../giggsey/locale',
'aliases' => array(),
'dev_requirement' => false,
),
'gmponos/guzzle_logger' => array(
'pretty_version' => 'v2.2.0',
'version' => '2.2.0.0',
'reference' => '8784459b18f332beb49363a4d71399e784d8c298',
'type' => 'library',
'install_path' => __DIR__ . '/../gmponos/guzzle_logger',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
'pretty_version' => '7.10.0',
'version' => '7.10.0.0',
'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
'pretty_version' => '2.3.0',
'version' => '2.3.0.0',
'reference' => '481557b130ef3790cf82b713667b43030dc9c957',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.8.0',
'version' => '2.8.0.0',
'reference' => '21dc724a0583619cd1652f673303492272778051',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'dev_requirement' => false,
),
'php-http/client-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'php-http/httplug' => array(
'pretty_version' => '2.4.1',
'version' => '2.4.1.0',
'reference' => '5cad731844891a4c282f3f3e1b582c46839d22f4',
'type' => 'library',
'install_path' => __DIR__ . '/../php-http/httplug',
'aliases' => array(),
'dev_requirement' => false,
),
'php-http/message' => array(
'pretty_version' => '1.16.2',
'version' => '1.16.2.0',
'reference' => '06dd5e8562f84e641bf929bfe699ee0f5ce8080a',
'type' => 'library',
'install_path' => __DIR__ . '/../php-http/message',
'aliases' => array(),
'dev_requirement' => false,
),
'php-http/message-factory-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'php-http/promise' => array(
'pretty_version' => '1.3.1',
'version' => '1.3.1.0',
'reference' => 'fc85b1fba37c169a69a07ef0d5a8075770cc1f83',
'type' => 'library',
'install_path' => __DIR__ . '/../php-http/promise',
'aliases' => array(),
'dev_requirement' => false,
),
'prestashop/module-lib-cache-directory-provider' => array(
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'reference' => '34a577b66a7e52ae16d6f40efd1db17290bad453',
'type' => 'project',
'install_path' => __DIR__ . '/../prestashop/module-lib-cache-directory-provider',
'aliases' => array(),
'dev_requirement' => false,
),
'prestashop/module-lib-guzzle-adapter' => array(
'pretty_version' => 'v1.0',
'version' => '1.0.0.0',
'reference' => 'f008a7a8d5ab32504281acdc1855e3492b5d8b20',
'type' => 'library',
'install_path' => __DIR__ . '/../prestashop/module-lib-guzzle-adapter',
'aliases' => array(),
'dev_requirement' => false,
),
'prestashop/module-lib-mbo-installer' => array(
'pretty_version' => 'v2.0.0',
'version' => '2.0.0.0',
'reference' => '58cde161e40ba62638be2dbc5fde3e09f1733d48',
'type' => 'library',
'install_path' => __DIR__ . '/../prestashop/module-lib-mbo-installer',
'aliases' => array(),
'dev_requirement' => false,
),
'prestashop/module-lib-service-container' => array(
'pretty_version' => 'v2.0',
'version' => '2.0.0.0',
'reference' => '5525b56513d9ddad6e4232dfd93a24e028efdca7',
'type' => 'library',
'install_path' => __DIR__ . '/../prestashop/module-lib-service-container',
'aliases' => array(),
'dev_requirement' => false,
),
'prestashop/prestashop-accounts-installer' => array(
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'reference' => '0ad934bc540558db3944a9a1e5b08b852bb46e8b',
'type' => 'library',
'install_path' => __DIR__ . '/../prestashop/prestashop-accounts-installer',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-client' => array(
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-client-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-factory' => array(
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-factory-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-message' => array(
'pretty_version' => '1.1',
'version' => '1.1.0.0',
'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-message-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/log' => array(
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'dev_requirement' => false,
),
'ralouphie/getallheaders' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
'type' => 'library',
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v3.6.0',
'version' => '3.6.0.0',
'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__);
$config = new PhpCsFixer\Config();
return $config->setRules(
[
'@PER-CS2.0' => true,
'@PHP74Migration' => true,
'single_quote' => true,
'no_unused_imports' => true,
'no_superfluous_phpdoc_tags' => [
'allow_hidden_params' => true,
'allow_mixed' => true,
'remove_inheritdoc' => true,
],
'phpdoc_trim' => true,
]
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setFinder($finder);

Some files were not shown because too many files have changed in this diff Show More