Plugin Directory

Changeset 2837230


Ignore:
Timestamp:
12/21/2022 10:46:24 AM (3 years ago)
Author:
Biont
Message:

Add 1.1.0 to trunk

Location:
payoneer-checkout/trunk
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • payoneer-checkout/trunk/inc/bootstrap.php

    r2801406 r2837230  
    55use Inpsyde\Modularity\Module\Module;
    66use Inpsyde\Modularity\Package;
    7 use Inpsyde\Modularity\Properties\PluginProperties;
     7use Inpsyde\PayoneerForWoocommerce\Core\PayoneerProperties;
    88
    99return static function (string $mainPluginFile, callable $onError, Module ...$modules): Package {
     
    1414    }
    1515
    16     $properties = PluginProperties::new($mainPluginFile);
     16    $properties = PayoneerProperties::new($mainPluginFile);
    1717    $package = Package::new($properties);
    1818    add_action($package->hookName(Package::ACTION_FAILED_BOOT), $onError);
  • payoneer-checkout/trunk/inc/modules.php

    r2814348 r2837230  
    2222use Inpsyde\PayoneerForWoocommerce\Wp\WpModule;
    2323use Inpsyde\PayoneerSdk\SdkModule;
     24use Inpsyde\PayoneerForWoocommerce\AdminBanner\AdminBannerModule;
    2425
    2526return
     
    4748            new MigrationModule(),
    4849            new ThirdPartyCompatModule(),
     50            new AdminBannerModule(),
    4951        ];
    5052    };
  • payoneer-checkout/trunk/inc/services.php

    r2814348 r2837230  
    9292        'core.plugin.version' =>
    9393            new Factory([
    94                 Package::PROPERTIES,
     94                'core.plugin.version_string',
    9595                'core.string_version_factory',
    9696            ], static function (
    97                 Properties $properties,
     97                string $pluginVersion,
    9898                StringVersionFactoryInterface $versionFactory
    9999            ): VersionInterface {
    100                 $product = $versionFactory->createVersionFromString($properties->version());
    101 
     100                $product = $versionFactory
     101                    ->createVersionFromString($pluginVersion);
    102102                return $product;
    103103            }),
     104
     105        'core.plugin.version_string' => new Factory(
     106            [
     107                Package::PROPERTIES,
     108            ],
     109            static function (PluginProperties $properties): string {
     110                return $properties->version();
     111            }
     112        ),
    104113
    105114        'core.plugin.plugin_action_links' =>
     
    480489
    481490        'core.is_debug' =>
    482             new Alias('wp.is_debug'),
     491            new Factory(
     492                [Package::PROPERTIES],
     493                static function (PluginProperties $properties): bool {
     494                    return $properties->isDebug();
     495                }
     496            ),
    483497
    484498        'core.order_item_types_for_product' =>
     
    490504        'core.embedded_payment.custom_css.default' =>
    491505            new Alias('embedded_payment.settings.checkout_css_custom_css.default'),
     506
     507        'core.settings_option_key' =>
     508            new Alias('inpsyde_payment_gateway.settings_option_key'),
    492509
    493510        # Essential factories
     
    14361453            new Alias('core.payment_gateway.is_enabled'),
    14371454
     1455        'checkout.plugin.version_string' =>
     1456            new Alias('core.plugin.version_string'),
     1457
     1458       'checkout.list_session_manager.cache_key.salt.update_on_events' =>
     1459            new Factory([
     1460                'inpsyde_payment_gateway.gateway.id',
     1461            ], static function (string $gatewayId): array {
     1462                return [
     1463                    sprintf('woocommerce_update_options_payment_gateways_%1$s', $gatewayId),
     1464                ];
     1465            }),
     1466
    14381467        ## webhooks
    14391468        # --------------------------
     
    15641593        'inpsyde_payment_gateway.webhooks.security_header_name' =>
    15651594            new Alias('core.webhooks.security_header_name'),
     1595
     1596        'inpsyde_payment_gateway.plugin.version_string' =>
     1597            new Alias('core.plugin.version_string'),
    15661598
    15671599        ## core.page_detector
     
    16021634        'migration.embedded_payment.custom_css.default' =>
    16031635            new Alias('core.embedded_payment.custom_css.default'),
     1636
     1637        ## admin_banner
     1638        # --------------------------
     1639
     1640        'admin_banner.main_plugin_file' =>
     1641            new Alias('core.main_plugin_file'),
     1642
     1643        'admin_banner.local_modules_directory_name' =>
     1644            new Alias('core.local_modules_directory_name'),
     1645
     1646        'admin_banner.configure_url' => new Alias('core.http.settings_url'),
    16041647    ];
    16051648};
  • payoneer-checkout/trunk/languages/en_GB.pot

    r2814348 r2837230  
    3939msgstr ""
    4040
    41 #: ../inc/services.php:112
     41#: ../inc/services.php:121
    4242msgid "Settings"
    4343msgstr ""
    4444
    45 #: ../inc/services.php:799
     45#: ../inc/services.php:816
    4646msgid "live"
    4747msgstr ""
    4848
    49 #: ../inc/services.php:802
     49#: ../inc/services.php:819
    5050msgid "sandbox"
     51msgstr ""
     52
     53#: ../modules.local/admin-banner/src/AdminBannerRenderer.php:69
     54msgid ""
     55"Ready to convert more customers and deliver checkout experiences that build\n"
     56"                        loyalty?"
     57msgstr ""
     58
     59#: ../modules.local/admin-banner/src/AdminBannerRenderer.php:75
     60msgid ""
     61"Register for your Payoneer Checkout account and start selling around the\n"
     62"                        world."
     63msgstr ""
     64
     65#: ../modules.local/admin-banner/src/AdminBannerRenderer.php:86
     66msgid "Register for Checkout"
     67msgstr ""
     68
     69#: ../modules.local/admin-banner/src/AdminBannerRenderer.php:91
     70msgid "Configure Checkout plugin"
    5171msgstr ""
    5272
     
    5575msgstr ""
    5676
    57 #: ../modules.local/checkout/inc/services.php:476
     77#: ../modules.local/checkout/inc/services.php:518
    5878msgid "Select the payment flow for every transaction."
    5979msgstr ""
    6080
    61 #: ../modules.local/checkout/src/CheckoutModule.php:197
     81#: ../modules.local/checkout/src/CheckoutModule.php:204
    6282msgid "Payment failed. Please try again"
    6383msgstr ""
    6484
    65 #: ../modules.local/checkout/src/CheckoutModule.php:199
     85#: ../modules.local/checkout/src/CheckoutModule.php:206
    6686msgid "Payment canceled. Please try again or choose another payment method."
    6787msgstr ""
    6888
    69 #: ../modules.local/checkout/src/CheckoutModule.php:220
     89#: ../modules.local/checkout/src/CheckoutModule.php:227
    7090msgid "Payment has been aborted"
    7191msgstr ""
    7292
    73 #: ../modules.local/embedded-payment/inc/extensions.php:35
     93#: ../modules.local/embedded-payment/inc/extensions.php:33
    7494msgid "Embedded"
    7595msgstr ""
    7696
    77 #: ../modules.local/embedded-payment/inc/extensions.php:42
     97#: ../modules.local/embedded-payment/inc/extensions.php:40
    7898msgid "Embedded (default): customers get a payment page that's embedded in your shop."
    7999msgstr ""
     
    176196msgstr ""
    177197
    178 #: ../modules.local/payment-gateway/inc/fields.php:117, ../modules.local/payment-gateway/inc/services.php:126
     198#: ../modules.local/payment-gateway/inc/fields.php:117, ../modules.local/payment-gateway/inc/services.php:125
    179199msgid "Credit / Debit Card"
    180200msgstr ""
     
    188208msgstr ""
    189209
    190 #: ../modules.local/payment-gateway/inc/services.php:130
     210#: ../modules.local/payment-gateway/inc/services.php:129
    191211msgid "Payoneer payment gateway"
    192212msgstr ""
    193213
    194214#. translators: %1$s is replaced with the refund long ID
    195 #: ../modules.local/payment-gateway/inc/services.php:145
     215#: ../modules.local/payment-gateway/inc/services.php:144
    196216msgid " Refunded by Payoneer Checkout - long ID: %1$s"
    197217msgstr ""
    198218
    199 #: ../modules.local/payment-gateway/inc/services.php:692
     219#: ../modules.local/payment-gateway/inc/services.php:678
    200220msgid "Are you sure you want to reset this field to its default value?"
    201221msgstr ""
    202222
    203 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:213
     223#: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:211
    204224msgid "Payoneer test mode active"
    205225msgstr ""
    206226
    207 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:214
     227#: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:212
    208228msgid "Remember to disable test mode when you are ready to take live transactions"
    209229msgstr ""
     
    229249msgstr ""
    230250
    231 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:93
     251#: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:90
    232252msgid "API call failed. Please try again or contact the shop admin. Error details can be found in logs."
    233253msgstr ""
    234254
    235255#. translators: Transaction ID supplied by WooCommerce plugin
    236 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:139
     256#: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:136
    237257msgid "Initiating payment with transaction ID \"%1$s\""
    238258msgstr ""
    239259
    240 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:176, ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:127
     260#: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:173, ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:126
    241261msgid "An error occurred during payment processing"
    242262msgstr ""
    243263
    244 #: ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:106
     264#: ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:105
    245265msgid "The customer is being redirected to an external payment page."
    246266msgstr ""
     
    277297msgid "Failed to create an order refund on incoming webhook. Error message: %1$s"
    278298msgstr ""
     299
     300#: ../modules.local/payment-gateway/src/Gateway/Factory/Product/DiscountedProductItemBasedProductFactory.php:51
     301msgid "Discount for"
     302msgstr ""
  • payoneer-checkout/trunk/modules.local/checkout/inc/services.php

    r2814348 r2837230  
    151151                return new CachingListSessionManager($compositeProvider);
    152152            }),
     153
     154            'checkout.list_session_manager.cache_key.salt.option_name' =>
     155                new Factory([
     156                    'checkout.plugin.version_string',
     157                ], static function (string $pluginVersion): string {
     158                    $versionHash = md5($pluginVersion);
     159                    $versionShortHash = (string) substr($versionHash, 0, 8);
     160
     161                    return sprintf('payoneer_list_session_cache_key_salt_%1$s', $versionShortHash);
     162                }),
     163
     164            'checkout.list_session_manager.cache_key.salt' =>
     165                new Factory(
     166                    [
     167                    'checkout.list_session_manager.cache_key.salt.option_name',
     168                    ],
     169                    static function (string $optionName): string {
     170                        $salt = (string) get_option($optionName);
     171
     172                        if (! $salt) {
     173                            $salt = wp_generate_password();
     174                            update_option($optionName, $salt);
     175                        }
     176
     177                        return $salt;
     178                    }
     179                ),
     180
    153181            'checkout.list_session_manager.cache_key.checkout' => new StringService(
    154                 'payoneer_list_{0}_checkout',
    155                 ['wc.session.customer_id']
     182                'payoneer_list_{0}_checkout_{1}',
     183                ['wc.session.customer_id', 'checkout.list_session_manager.cache_key.salt']
    156184            ),
    157185            'checkout.list_session_manager.cache_key.payment' => new StringService(
    158                 'payoneer_list_{0}_pay_{1}',
    159                 ['wc.session.customer_id', 'wc.pay_for_order_id']
     186                'payoneer_list_{0}_pay_{1}_{2}',
     187                [
     188                    'wc.session.customer_id',
     189                    'wc.pay_for_order_id',
     190                    'checkout.list_session_manager.cache_key.salt',
     191                ]
    160192            ),
    161193            'checkout.list_session_manager.cache_key' => static function (
     
    216248                    'wc.currency',
    217249                    'checkout.list_session_system',
     250                    'checkout.transaction_id_generator',
    218251                    'inpsyde_payment_gateway.merchant_division',
    219252                ],
     
    230263                    string $currency,
    231264                    SystemInterface $system,
     265                    TransactionIdGeneratorInterface $transactionIdGenerator,
    232266                    string $division
    233267                ): WcBasedListSessionFactory {
     
    244278                        $currency,
    245279                        $system,
     280                        $transactionIdGenerator,
    246281                        $division
    247282                    );
     
    260295                    'checkout.wc_order_based_products_factory',
    261296                    'checkout.list_session_system',
     297                    'checkout.transaction_id_generator',
    262298                    'checkout.merchant_division',
    263299                ]
    264300            ),
    265             'checkout.list_session_system' => new Value(
    266                 new System(
    267                     'SHOP_PLATFORM',
    268                     'WOOCOMMERCE'
    269                 )
     301            'checkout.list_session_system' => new Factory(
     302                [],
     303                static function (): SystemInterface {
     304                    return new System(
     305                        'SHOP_PLATFORM',
     306                        'WOOCOMMERCE'
     307                    );
     308                }
    270309            ),
    271310            'checkout.list_session_persistor' => new Alias('checkout.list_session_provider'),
     
    395434                TokenGenerator::class
    396435            ),
     436
     437            'checkout.transaction_id_generator' =>
     438                new Constructor(TransactionIdGenerator::class),
    397439
    398440            'checkout.wc_based_customer_factory' => new Constructor(
  • payoneer-checkout/trunk/modules.local/checkout/src/CheckoutModule.php

    r2814348 r2837230  
    1010use Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
    1111use Inpsyde\Modularity\Module\ServiceModule;
    12 use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutListSession\Controller\CheckoutListSessionControllerInterface;
    1312use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionRemover;
    14 use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface;
    1513use Psr\Container\ContainerInterface;
    16 use WC_Cart;
    17 use WC_Customer;
    1814use WC_Order;
    1915
     
    2925    /**
    3026     * @var array<string, callable>
    31      * @psalm-var array<string, callable(ContainerInterface): mixed>
     27     * @psalm-var array<string, callable(mixed $service, \Psr\Container\ContainerInterface $container):mixed>
    3228     */
    3329    protected $extensions;
     
    5551    public function run(ContainerInterface $container): bool
    5652    {
     53        $saltOptionName = $container->get('checkout.list_session_manager.cache_key.salt.option_name');
     54        $eventsToUpdateSaltOn = $container->get('checkout.list_session_manager.cache_key.salt.update_on_events');
     55        assert(is_string($saltOptionName));
     56        assert(is_array($eventsToUpdateSaltOn));
     57        /** @psalm-var string[] $eventsToUpdateSaltOn */
     58        foreach ($eventsToUpdateSaltOn as $event) {
     59            add_action($event, static function () use ($saltOptionName): void {
     60                delete_option($saltOptionName);
     61            });
     62        }
     63
    5764        add_action('woocommerce_init', function () use ($container) {
    5865            $gatewayEnabled = (bool) $container->get('checkout.payment_gateway.is_enabled');
     
    229236    }
    230237
     238    /**
     239     * @inheritDoc
     240     */
    231241    public function extensions(): array
    232242    {
  • payoneer-checkout/trunk/modules.local/checkout/src/Factory/ListSession/OrderBasedListSessionFactory.php

    r2814348 r2837230  
    66
    77use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\FactoryException;
     8use Inpsyde\PayoneerForWoocommerce\Checkout\TransactionIdGeneratorInterface;
    89use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Callback\WcOrderBasedCallbackFactoryInterface;
    910use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Customer\WcOrderBasedCustomerFactoryInterface;
     
    6162     */
    6263    protected $division;
     64
    6365    /**
    6466     * @var SystemInterface
    6567     */
    6668    protected $system;
     69
     70    /**
     71     * @var TransactionIdGeneratorInterface
     72     */
     73    protected $transactionIdGenerator;
    6774
    6875    /**
     
    7582     * @param WcOrderBasedProductsFactoryInterface $wcOrderBasedProductsFactory
    7683     * @param SystemInterface $system
     84     * @param TransactionIdGeneratorInterface $transactionIdGenerator
    7785     * @param string|null $division
    7886     */
     
    8694        WcOrderBasedProductsFactoryInterface $wcOrderBasedProductsFactory,
    8795        SystemInterface $system,
     96        TransactionIdGeneratorInterface $transactionIdGenerator,
    8897        ?string $division
    8998    ) {
     
    97106        $this->wcOrderBasedProductsFactory = $wcOrderBasedProductsFactory;
    98107        $this->system = $system;
     108        $this->transactionIdGenerator = $transactionIdGenerator;
    99109        $this->division = $division;
    100110    }
     
    105115    public function createList(WC_Order $order, string $listSecurityToken): ListInterface
    106116    {
    107         $transactionId = $this->createTransactionId($order);
     117        $transactionId = $this->transactionIdGenerator
     118            ->generateTransactionId();
    108119        $country = $order->get_billing_country();
    109120
     
    149160    }
    150161
    151     protected function createTransactionId(WC_Order $order): string
    152     {
    153         return sprintf('tr-%1$s', time());
    154     }
    155 
    156162    public function createListCommand(\WC_Order $order): CreateListCommandInterface
    157163    {
    158164        $command = $this->payoneer->getListCommand();
     165        $transactionId = $this->transactionIdGenerator->generateTransactionId();
    159166
    160         $command = $command->withTransactionId($this->createTransactionId($order))
     167        $command = $command->withTransactionId($transactionId)
    161168                           ->withCountry($order->get_billing_country())
    162169                           ->withCallback($this->callbackFactory->createCallback($order))
  • payoneer-checkout/trunk/modules.local/checkout/src/Factory/ListSession/WcBasedListSessionFactory.php

    r2814348 r2837230  
    88use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\FactoryException;
    99use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\Product\WcCartBasedProductListFactoryInterface;
     10use Inpsyde\PayoneerForWoocommerce\Checkout\TransactionIdGeneratorInterface;
    1011use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\SecurityHeader\SecurityHeaderFactoryInterface;
    1112use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface;
     
    7475     */
    7576    protected $system;
     77    /**
     78     * @var TransactionIdGeneratorInterface
     79     */
     80    protected $transactionIdGenerator;
    7681
    7782    public function __construct(
     
    8792        string $currency,
    8893        SystemInterface $system,
     94        TransactionIdGeneratorInterface $transactionIdGenerator,
    8995        ?string $division = null
    9096    ) {
     
    102108        $this->system = $system;
    103109        $this->division = $division;
     110        $this->transactionIdGenerator = $transactionIdGenerator;
    104111    }
    105112
     
    110117    ): ListInterface {
    111118
    112         $transactionId = sprintf('tr-%1$s', time());
     119        $transactionId = $this->transactionIdGenerator->generateTransactionId();
    113120        $country = $customer->get_billing_country();
    114121        $callback = $this->createCallback(
  • payoneer-checkout/trunk/modules.local/embedded-payment/inc/extensions.php

    r2814348 r2837230  
    55use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionProvider;
    66use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\AjaxOrderPay\OrderPayload;
    7 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\InteractionCodePaymentRequestValidator;
    87use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\ListUrlPaymentRequestValidator;
    98use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\CheckoutHashFieldRenderer;
    109use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\HostedFlowOverrideFlagRenderer;
    11 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\InteractionCodeFieldRenderer;
    1210use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\ListDebugFieldRenderer;
    1311use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\ListUrlFieldRenderer;
  • payoneer-checkout/trunk/modules.local/embedded-payment/inc/services.php

    r2814348 r2837230  
    8686        //Any content provided as array element with an 'extra_css' key
    8787        //will be applied to generated CSS unconditionally.
    88         'embedded_payment.widget.asset.template.extra_options' => new Factory(
    89             [],
    90             static function (): array {
    91                 return [
    92                     'extra_css' => '',
    93                 ];
    94             }
    95         ),
     88        'embedded_payment.widget.asset.template.extra_options' => new Value([
     89            'extra_css' => '',
     90        ]),
    9691
    9792        'embedded_payment.widget.custom_css_url' => new Factory([
     
    169164        ),
    170165        'embedded_payment.path.js.suffix' => new Factory([
    171             'wp.is_debug',
     166            'core.is_debug',
    172167        ], static function (
    173168            bool $isDebug
     
    180175        ),
    181176        'embedded_payment.path.css.suffix' => new Factory([
    182             'wp.is_debug',
     177            'core.is_debug',
    183178        ], static function (
    184179            bool $isDebug
  • payoneer-checkout/trunk/modules.local/embedded-payment/src/EmbeddedPaymentModule.php

    r2814348 r2837230  
    571571        }
    572572
    573         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $services */
     573        /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */
    574574        return $services();
    575575    }
     
    586586        }
    587587
    588         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $extensions */
     588        /** @var callable(): array<string, callable(mixed $service, \Psr\Container\ContainerInterface $container):mixed> $extensions */
    589589        return $extensions();
    590590    }
  • payoneer-checkout/trunk/modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php

    r2814348 r2837230  
    88use Exception;
    99use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutExceptionInterface;
    10 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionProvider;
    1110use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionPersistor;
    1211use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionProvider;
     
    1716use Inpsyde\PayoneerSdk\Api\Command\Exception\CommandExceptionInterface;
    1817use Inpsyde\PayoneerSdk\Api\Command\Exception\InteractionExceptionInterface;
    19 use Inpsyde\PayoneerSdk\Api\Command\ResponseValidator\InteractionCodeFailureInterface;
    2018use Inpsyde\PayoneerSdk\Api\Command\UpdateListCommandInterface;
    2119use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface;
    22 use Throwable;
    2320use WC_Order;
    2421
  • payoneer-checkout/trunk/modules.local/hosted-payment/src/HostedPaymentModule.php

    r2814348 r2837230  
    55namespace Inpsyde\PayoneerForWoocommerce\HostedPayment;
    66
    7 use Dhii\Services\Factories\FuncService;
    87use Inpsyde\Modularity\Module\ExecutableModule;
    98use Inpsyde\Modularity\Module\ExtendingModule;
     
    1110use Inpsyde\Modularity\Module\ServiceModule;
    1211use Psr\Container\ContainerInterface;
    13 use WC_Order;
    1412
    1513class HostedPaymentModule implements ExecutableModule, ServiceModule, ExtendingModule
     
    4240        }
    4341
    44         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $services */
     42        /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */
    4543        return $services();
    4644    }
     
    5755        }
    5856
    59         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $extensions */
     57        /** @var callable(): array<string, callable(mixed $service, \Psr\Container\ContainerInterface $container):mixed> $extensions */
    6058        return $extensions();
    6159    }
  • payoneer-checkout/trunk/modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php

    r2814348 r2837230  
    1414use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface;
    1515use Inpsyde\PayoneerSdk\Api\Command\Exception\CommandExceptionInterface;
    16 use Inpsyde\PayoneerSdk\Api\Command\ResponseValidator\InteractionCodeFailureInterface;
    1716use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface;
    1817use Inpsyde\PayoneerSdk\Api\Entities\Style\Style;
  • payoneer-checkout/trunk/modules.local/payment-gateway/composer.json

    r2814348 r2837230  
    3535    "brain/monkey": "^2",
    3636    "php-stubs/wordpress-stubs": "^5.0",
    37     "php-stubs/woocommerce-stubs": "^5.0"
     37    "php-stubs/woocommerce-stubs": "^5.0",
     38    "slevomat/coding-standard": "^8.6.4"
    3839  }
    3940}
  • payoneer-checkout/trunk/modules.local/payment-gateway/inc/services.php

    r2814348 r2837230  
    1717use Inpsyde\Assets\Asset;
    1818use Inpsyde\Assets\Script;
    19 use Inpsyde\PayoneerForWoocommerce\Filesystem\PathResolverInterface;
    20 use Inpsyde\PayoneerForWoocommerce\Filesystem\UrlResolverInterface;
    2119use Inpsyde\PayoneerForWoocommerce\PageDetector\PageDetectorInterface;
    2220use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Api\BasicTokenProviderFactory;
     
    3129use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Payment\WcOrderBasedPaymentFactory;
    3230use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\CouponItemBasedProductFactory;
     31use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\DiscountedProductItemBasedProductFactory;
    3332use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\FeeItemBasedProductFactory;
    3433use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\ProductItemBasedProductFactory;
     
    193192                    'inpsyde_payment_gateway.fee_item_based_product_factory',
    194193                    'inpsyde_payment_gateway.coupon_item_based_product_factory',
     194                    'inpsyde_payment_gateway.discounted_product_item_based_product_factory',
    195195                    'inpsyde_payment_gateway.order_item_types_for_product',
    196196                ]),
     
    227227                    'inpsyde_payment_gateway.product_factory',
    228228                    'inpsyde_payment_gateway.quantity_normalizer',
     229                ]),
     230
     231            'inpsyde_payment_gateway.discounted_product_item_based_product_factory' =>
     232                new Constructor(DiscountedProductItemBasedProductFactory::class, [
     233                    'inpsyde_payment_gateway.product_factory',
    229234                ]),
    230235
     
    604609                }),
    605610
    606             'inpsyde_payment_gateway.assets.admin_settings_script.location' =>
    607                 new Value('payment-gateway/assets/js/admin-settings.js'),
    608 
    609             'inpsyde_payment_gateway.assets.admin_settings_script.url' =>
    610                 new Factory([
    611                     'core.url_resolver',
    612                     'core.path_resolver',
    613                     'inpsyde_payment_gateway.assets.admin_settings_script.location',
    614                 ], static function (
    615                     UrlResolverInterface $urlResolver,
    616                     PathResolverInterface $pathResolver,
    617                     string $location
    618                 ): UriInterface {
    619                     $path = $pathResolver->resolvePath($location);
    620                     $product = $urlResolver->resolveUrl($path);
    621 
    622                     return $product;
    623                 }),
    624 
    625611            'inpsyde_payment_gateway.assets.admin_settings_script.deps' =>
    626612                new Value([]),
  • payoneer-checkout/trunk/modules.local/payment-gateway/src/Gateway/Factory/Product/WcOrderBasedProductsFactory.php

    r2801406 r2837230  
    1717     * @var ProductItemBasedProductFactoryInterface
    1818     */
    19     protected $productBasedProductFactory;
     19    protected $productItemBasedProductFactory;
    2020
    2121    /**
     
    3838     */
    3939    protected $orderItemTypes;
     40    /**
     41     * @var ProductItemBasedProductFactoryInterface
     42     */
     43    protected $discountedProductItemBasedFactory;
    4044
    4145    /**
     
    4448     * @param FeeItemBasedProductFactoryInterface $feeBasedProductFactory
    4549     * @param CouponItemBasedProductFactoryInterface $couponItemBasedProductFactory
     50     * @param ProductItemBasedProductFactoryInterface $discountedProductItemBasedFactory
    4651     * @param string[] $orderItemTypes Possible order item classes
    4752     */
     
    5156        FeeItemBasedProductFactoryInterface $feeBasedProductFactory,
    5257        CouponItemBasedProductFactoryInterface $couponItemBasedProductFactory,
     58        ProductItemBasedProductFactoryInterface $discountedProductItemBasedFactory,
    5359        array $orderItemTypes
    5460    ) {
    5561
    56         $this->productBasedProductFactory = $productBasedProductFactory;
     62        $this->productItemBasedProductFactory = $productBasedProductFactory;
    5763        $this->shippingBasedProductFactory = $shippingBasedProductFactory;
    5864        $this->feeBasedProductFactory = $feeBasedProductFactory;
    5965        $this->couponItemBasedProductFactory = $couponItemBasedProductFactory;
    6066        $this->orderItemTypes = $orderItemTypes;
     67        $this->discountedProductItemBasedFactory = $discountedProductItemBasedFactory;
    6168    }
    6269
     
    7380            switch (true) {
    7481                case $item instanceof WC_Order_Item_Product:
    75                     $products[] = $this->productBasedProductFactory
     82                    $products[] = $this->productItemBasedProductFactory
    7683                        ->createProduct($item, $currency);
     84                    $subtotal = $item->get_subtotal();
     85                    $total = $item->get_total();
     86
     87                    if ($subtotal !== $total) {
     88                        $products[] = $this->discountedProductItemBasedFactory
     89                            ->createProduct($item, $currency);
     90                    }
     91
    7792                    break;
    7893
  • payoneer-checkout/trunk/modules.local/payment-gateway/src/Gateway/RefundProcessor/RefundProcessor.php

    r2814348 r2837230  
    88use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutExceptionInterface;
    99use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionProvider;
    10 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\WcOrderListSessionProvider;
    1110use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface;
    1211use Inpsyde\PayoneerSdk\Api\Command\PayoutCommandInterface;
  • payoneer-checkout/trunk/modules.local/payment-gateway/src/PaymentGatewayModule.php

    r2814348 r2837230  
    55namespace Inpsyde\PayoneerForWoocommerce\PaymentGateway;
    66
    7 use Dhii\Container\SegmentingContainer;
    87use Dhii\Services\Factories\FuncService;
    98use Inpsyde\Assets\Asset;
     
    1312use Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
    1413use Inpsyde\Modularity\Module\ServiceModule;
    15 use Inpsyde\PayoneerForWoocommerce\PageDetector\PageDetectorInterface;
    1614use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\PaymentGateway;
    1715use Psr\Container\ContainerInterface;
     16use Psr\Http\Message\UriInterface;
    1817use Stringable;
    19 use UnexpectedValueException;
    2018use WC_Order;
    2119
     
    119117                    'inpsyde_payment_gateway.is_settings_page',
    120118                    'inpsyde_payment_gateway.gateway',
     119                    'core.http.settings_url',
    121120                ],
    122121                \Closure::fromCallable([$this, 'reloadSettingsPage'])
     
    156155    public function reloadSettingsPage(
    157156        bool $isSettingsPage,
    158         PaymentGateway $paymentGateway
     157        PaymentGateway $paymentGateway,
     158        UriInterface $settingsUrl
    159159    ): void {
    160160
     
    166166            $errorParams["error[{$i}]"] = $error;
    167167        }
    168         $adminSettingsUrl = home_url(
    169             sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'] ?? ''))
    170         );
    171         $adminSettingsUrl = add_query_arg($errorParams, $adminSettingsUrl);
    172 
    173         wp_safe_redirect($adminSettingsUrl);
     168
     169        $settingsUrl = add_query_arg($errorParams, $settingsUrl);
     170
     171        wp_safe_redirect($settingsUrl);
    174172        exit;
    175173    }
     
    206204            return;
    207205        }
    208         add_action('admin_notices', static function () {
     206        add_action('all_admin_notices', static function () {
    209207            $class = 'notice notice-warning';
    210208            printf(
     
    217215                )
    218216            );
    219         });
     217        }, 11);
    220218    }
    221219
  • payoneer-checkout/trunk/modules.local/third-party-compat/src/ThirdPartyCompatModule.php

    r2814392 r2837230  
    55namespace Inpsyde\PayoneerForWoocommerce\ThirdPartyCompat;
    66
     7use Automattic\WooCommerce\Utilities\FeaturesUtil;
    78use Inpsyde\Modularity\Module\ExecutableModule;
    89use Inpsyde\Modularity\Module\ExtendingModule;
     
    2627            return $scripts;
    2728        });
     29
     30        $mainPluginFile = (string)$container->get('core.main_plugin_file');
     31
     32        /**
     33         * WooCommerce High Performance Order Storage
     34         * @psalm-suppress UnusedVariable
     35         */
     36        add_action('before_woocommerce_init', static function () use ($mainPluginFile) {
     37            if (!class_exists(FeaturesUtil::class)) {
     38                return;
     39            }
     40            FeaturesUtil::declare_compatibility(
     41                'custom_order_tables',
     42                $mainPluginFile,
     43                true
     44            );
     45        });
     46
    2847        return true;
    2948    }
     
    4160        }
    4261
    43         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $services */
     62        /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */
    4463        return $services();
    4564    }
     
    5675        }
    5776
    58         /** @var callable(): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $extensions */
     77        /** @var callable(): array<string, callable(mixed $service, \Psr\Container\ContainerInterface $container):mixed> $extensions */
    5978        return $extensions();
    6079    }
  • payoneer-checkout/trunk/modules.local/wp/inc/services.php

    r2814348 r2837230  
    55use Dhii\Collection\MutableContainerInterface;
    66use Dhii\Services\Factories\Alias;
     7use Dhii\Services\Factories\Value;
    78use Dhii\Services\Factory;
    8 use Inpsyde\Modularity\Package;
    9 use Inpsyde\Modularity\Properties\PluginProperties;
    109use Inpsyde\PayoneerForWoocommerce\Core\Exception\PayoneerException;
    1110use Inpsyde\PayoneerForWoocommerce\Environment\WpEnvironmentInterface;
     
    9695
    9796            'wp.is_debug' =>
    98                 new Factory([Package::PROPERTIES], static function (PluginProperties $properties): bool {
    99                     return $properties->isDebug();
    100                 }),
     97                new Value(defined('WP_DEBUG') && WP_DEBUG),
    10198
    10299            'wc' =>
  • payoneer-checkout/trunk/payoneer-checkout.php

    r2814348 r2837230  
    44 * Plugin Name: Payoneer Checkout
    55 * Description: Payoneer Checkout for WooCommerce
    6  * Version: 1.0.0
     6 * Version: 1.1.0
    77 * Author:      Payoneer
    88 * Requires at least: 5.4
     
    1515 * Text Domain: payoneer-checkout
    1616 * Domain Path: /languages
    17  * SHA: 28173aa
     17 * SHA: 8a788b1
    1818 */
    1919
  • payoneer-checkout/trunk/readme.txt

    r2815889 r2837230  
    5959
    6060== Changelog ==
     61
     62= 1.1.0 - 2022-12-15 =
     63* Add: Display banner with onboarding assistant after initial plugin activation
    6164
    6265= 1.0.0 - 2022-11-02 =
  • payoneer-checkout/trunk/src/Core/CoreModule.php

    r2801406 r2837230  
    4646        }
    4747
    48         /** @var callable(string): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $services */
     48        /** @var callable(string): array<string, callable(ContainerInterface $container):mixed> $services */
    4949        return $services($moduleRootPath);
    5050    }
     
    6363        }
    6464
    65         /** @var callable(string): array<string, callable(\Psr\Container\ContainerInterface $container):mixed> $extensions */
     65        /** @var callable(string): array<string, callable(mixed $service, \Psr\Container\ContainerInterface $container):mixed> $extensions */
    6666        return $extensions($moduleRootPath);
    6767    }
  • payoneer-checkout/trunk/vendor/autoload.php

    r2814348 r2837230  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitc8750899a923b93b328730c8cb20ba8d::getLoader();
     25return ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f::getLoader();
  • payoneer-checkout/trunk/vendor/composer/ClassLoader.php

    r2801406 r2837230  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private $includeFile;
     47
    4548    /** @var ?string */
    4649    private $vendorDir;
     
    107110    {
    108111        $this->vendorDir = $vendorDir;
     112
     113        /**
     114         * Scope isolated include.
     115         *
     116         * Prevents access to $this/self from included files.
     117         *
     118         * @param  string $file
     119         * @return void
     120         */
     121        $this->includeFile = static function($file) {
     122            include $file;
     123        };
    109124    }
    110125
     
    426441    {
    427442        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     443            ($this->includeFile)($file);
    429444
    430445            return true;
     
    557572    }
    558573}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • payoneer-checkout/trunk/vendor/composer/autoload_classmap.php

    r2814348 r2837230  
    139139    'Inpsyde\\Modularity\\Properties\\Properties' => $vendorDir . '/inpsyde/modularity/src/Properties/Properties.php',
    140140    'Inpsyde\\Modularity\\Properties\\ThemeProperties' => $vendorDir . '/inpsyde/modularity/src/Properties/ThemeProperties.php',
     141    'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerModule' => $baseDir . '/modules.local/admin-banner/src/AdminBannerModule.php',
     142    'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerRenderer' => $baseDir . '/modules.local/admin-banner/src/AdminBannerRenderer.php',
     143    'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerRendererInterface' => $baseDir . '/modules.local/admin-banner/src/AdminBannerRendererInterface.php',
    141144    'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetCustomizerModule' => $baseDir . '/modules.local/asset-customizer/src/AssetCustomizerModule.php',
    142145    'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetProcessorInterface' => $baseDir . '/modules.local/asset-customizer/src/AssetProcessorInterface.php',
     
    205208    'Inpsyde\\PayoneerForWoocommerce\\Checkout\\RegisterCheckoutAssets' => $baseDir . '/modules.local/checkout/src/RegisterCheckoutAssets.php',
    206209    'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TimeoutIncreasingApiClient' => $baseDir . '/modules.local/checkout/src/TimeoutIncreasingApiClient.php',
     210    'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TransactionIdGenerator' => $baseDir . '/modules.local/checkout/src/TransactionIdGenerator.php',
     211    'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TransactionIdGeneratorInterface' => $baseDir . '/modules.local/checkout/src/TransactionIdGeneratorInterface.php',
    207212    'Inpsyde\\PayoneerForWoocommerce\\Core\\CoreModule' => $baseDir . '/src/Core/CoreModule.php',
    208213    'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerException' => $baseDir . '/src/Core/Exception/PayoneerException.php',
    209214    'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerExceptionInterface' => $baseDir . '/src/Core/Exception/PayoneerExceptionInterface.php',
     215    'Inpsyde\\PayoneerForWoocommerce\\Core\\PayoneerProperties' => $baseDir . '/src/Core/PayoneerProperties.php',
    210216    'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLink' => $baseDir . '/src/Core/PluginActionLink/PluginActionLink.php',
    211217    'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLinkRegistry' => $baseDir . '/src/Core/PluginActionLink/PluginActionLinkRegistry.php',
     
    287293    'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactory' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactory.php',
    288294    'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactoryInterface' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactoryInterface.php',
     295    'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\DiscountedProductItemBasedProductFactory' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/DiscountedProductItemBasedProductFactory.php',
    289296    'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactory' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactory.php',
    290297    'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactoryInterface' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactoryInterface.php',
  • payoneer-checkout/trunk/vendor/composer/autoload_psr4.php

    r2814348 r2837230  
    3434    'Inpsyde\\PayoneerForWoocommerce\\Cache\\' => array($baseDir . '/modules.local/cache/src'),
    3535    'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\' => array($baseDir . '/modules.local/asset-customizer/src'),
     36    'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' => array($baseDir . '/modules.local/admin-banner/src'),
    3637    'Inpsyde\\PayoneerForWoocommerce\\' => array($baseDir . '/src'),
    3738    'Inpsyde\\Modularity\\' => array($vendorDir . '/inpsyde/modularity/src'),
  • payoneer-checkout/trunk/vendor/composer/autoload_real.php

    r2814348 r2837230  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc8750899a923b93b328730c8cb20ba8d
     5class ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc8750899a923b93b328730c8cb20ba8d', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc8750899a923b93b328730c8cb20ba8d', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitc8750899a923b93b328730c8cb20ba8d::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInitc8750899a923b93b328730c8cb20ba8d::$files;
    37         foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequirec8750899a923b93b328730c8cb20ba8d($fileIdentifier, $file);
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$files;
     37        $requireFile = static function ($fileIdentifier, $file) {
     38            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     39                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     40
     41                require $file;
     42            }
     43        };
     44        foreach ($filesToLoad as $fileIdentifier => $file) {
     45            ($requireFile)($fileIdentifier, $file);
    3946        }
    4047
     
    4249    }
    4350}
    44 
    45 /**
    46  * @param string $fileIdentifier
    47  * @param string $file
    48  * @return void
    49  */
    50 function composerRequirec8750899a923b93b328730c8cb20ba8d($fileIdentifier, $file)
    51 {
    52     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
    53         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
    54 
    55         require $file;
    56     }
    57 }
  • payoneer-checkout/trunk/vendor/composer/autoload_static.php

    r2814348 r2837230  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc8750899a923b93b328730c8cb20ba8d
     7class ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f
    88{
    99    public static $files = array (
     
    5555            'Inpsyde\\PayoneerForWoocommerce\\Cache\\' => 37,
    5656            'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\' => 47,
     57            'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' => 43,
    5758            'Inpsyde\\PayoneerForWoocommerce\\' => 31,
    5859            'Inpsyde\\Modularity\\' => 19,
     
    187188        array (
    188189            0 => __DIR__ . '/../..' . '/modules.local/asset-customizer/src',
     190        ),
     191        'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' =>
     192        array (
     193            0 => __DIR__ . '/../..' . '/modules.local/admin-banner/src',
    189194        ),
    190195        'Inpsyde\\PayoneerForWoocommerce\\' =>
     
    375380        'Inpsyde\\Modularity\\Properties\\Properties' => __DIR__ . '/..' . '/inpsyde/modularity/src/Properties/Properties.php',
    376381        'Inpsyde\\Modularity\\Properties\\ThemeProperties' => __DIR__ . '/..' . '/inpsyde/modularity/src/Properties/ThemeProperties.php',
     382        'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerModule' => __DIR__ . '/../..' . '/modules.local/admin-banner/src/AdminBannerModule.php',
     383        'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerRenderer' => __DIR__ . '/../..' . '/modules.local/admin-banner/src/AdminBannerRenderer.php',
     384        'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\AdminBannerRendererInterface' => __DIR__ . '/../..' . '/modules.local/admin-banner/src/AdminBannerRendererInterface.php',
    377385        'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetCustomizerModule' => __DIR__ . '/../..' . '/modules.local/asset-customizer/src/AssetCustomizerModule.php',
    378386        'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetProcessorInterface' => __DIR__ . '/../..' . '/modules.local/asset-customizer/src/AssetProcessorInterface.php',
     
    441449        'Inpsyde\\PayoneerForWoocommerce\\Checkout\\RegisterCheckoutAssets' => __DIR__ . '/../..' . '/modules.local/checkout/src/RegisterCheckoutAssets.php',
    442450        'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TimeoutIncreasingApiClient' => __DIR__ . '/../..' . '/modules.local/checkout/src/TimeoutIncreasingApiClient.php',
     451        'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TransactionIdGenerator' => __DIR__ . '/../..' . '/modules.local/checkout/src/TransactionIdGenerator.php',
     452        'Inpsyde\\PayoneerForWoocommerce\\Checkout\\TransactionIdGeneratorInterface' => __DIR__ . '/../..' . '/modules.local/checkout/src/TransactionIdGeneratorInterface.php',
    443453        'Inpsyde\\PayoneerForWoocommerce\\Core\\CoreModule' => __DIR__ . '/../..' . '/src/Core/CoreModule.php',
    444454        'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerException' => __DIR__ . '/../..' . '/src/Core/Exception/PayoneerException.php',
    445455        'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerExceptionInterface' => __DIR__ . '/../..' . '/src/Core/Exception/PayoneerExceptionInterface.php',
     456        'Inpsyde\\PayoneerForWoocommerce\\Core\\PayoneerProperties' => __DIR__ . '/../..' . '/src/Core/PayoneerProperties.php',
    446457        'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLink' => __DIR__ . '/../..' . '/src/Core/PluginActionLink/PluginActionLink.php',
    447458        'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLinkRegistry' => __DIR__ . '/../..' . '/src/Core/PluginActionLink/PluginActionLinkRegistry.php',
     
    523534        'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactory' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactory.php',
    524535        'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactoryInterface' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactoryInterface.php',
     536        'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\DiscountedProductItemBasedProductFactory' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/DiscountedProductItemBasedProductFactory.php',
    525537        'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactory' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactory.php',
    526538        'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactoryInterface' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactoryInterface.php',
     
    850862    {
    851863        return \Closure::bind(function () use ($loader) {
    852             $loader->prefixLengthsPsr4 = ComposerStaticInitc8750899a923b93b328730c8cb20ba8d::$prefixLengthsPsr4;
    853             $loader->prefixDirsPsr4 = ComposerStaticInitc8750899a923b93b328730c8cb20ba8d::$prefixDirsPsr4;
    854             $loader->classMap = ComposerStaticInitc8750899a923b93b328730c8cb20ba8d::$classMap;
     864            $loader->prefixLengthsPsr4 = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$prefixLengthsPsr4;
     865            $loader->prefixDirsPsr4 = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$prefixDirsPsr4;
     866            $loader->classMap = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$classMap;
    855867
    856868        }, null, ClassLoader::class);
  • payoneer-checkout/trunk/vendor/composer/installed.php

    r2814348 r2837230  
    22    'root' => array(
    33        'name' => 'inpsyde/payoneer-checkout',
    4         'pretty_version' => 'dev-release/1.0.0',
    5         'version' => 'dev-release/1.0.0',
    6         'reference' => '28173aa444eec57df468318410171dc193d26343',
     4        'pretty_version' => 'dev-release/1.1.0',
     5        'version' => 'dev-release/1.1.0',
     6        'reference' => '8a788b1129f013aeb6e7414191a71b896378d6bc',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    8484        ),
    8585        'inpsyde/assets' => array(
    86             'pretty_version' => '2.8.2',
    87             'version' => '2.8.2.0',
    88             'reference' => '116ff4c9500b315e67e0432370686ca7bc4befa4',
     86            'pretty_version' => '2.8.3',
     87            'version' => '2.8.3.0',
     88            'reference' => 'f198d7d8b726132851413a6a9b4918e02c077a4b',
    8989            'type' => 'library',
    9090            'install_path' => __DIR__ . '/../inpsyde/assets',
     
    111111        ),
    112112        'inpsyde/payoneer-checkout' => array(
    113             'pretty_version' => 'dev-release/1.0.0',
    114             'version' => 'dev-release/1.0.0',
    115             'reference' => '28173aa444eec57df468318410171dc193d26343',
     113            'pretty_version' => 'dev-release/1.1.0',
     114            'version' => 'dev-release/1.1.0',
     115            'reference' => '8a788b1129f013aeb6e7414191a71b896378d6bc',
    116116            'type' => 'wordpress-plugin',
    117117            'install_path' => __DIR__ . '/../../',
     
    255255        ),
    256256        'symfony/polyfill-php80' => array(
    257             'pretty_version' => 'v1.26.0',
    258             'version' => '1.26.0.0',
    259             'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace',
     257            'pretty_version' => 'v1.27.0',
     258            'version' => '1.27.0.0',
     259            'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936',
    260260            'type' => 'library',
    261261            'install_path' => __DIR__ . '/../symfony/polyfill-php80',
  • payoneer-checkout/trunk/vendor/inpsyde/assets/README.md

    r2814392 r2837230  
    1010
    1111## Introduction
    12 Inpsyde Assets is a Composer package (not a plugin) that allows to deal with scripts and styles in a WordPress site.
     12Inpsyde Assets is a Composer package (not a WordPress plugin) that allows to deal with scripts and styles in a WordPress site.
    1313
    1414## Installation
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/AssetFactory.php

    r2801406 r2837230  
    7676        ];
    7777
    78         if ($class === Script::class) {
    79             /** @var Script $asset */
    80 
     78        if ($asset instanceof Script) {
    8179            foreach ($config['localize'] as $objectName => $data) {
    8280                $asset->withLocalize((string) $objectName, $data);
     
    110108        }
    111109
    112         if ($class === Style::class) {
     110        if ($asset instanceof Style) {
    113111            $propertiesToMethod['media'] = 'forMedia';
    114112            $propertiesToMethod['inlineStyles'] = 'withInlineStyles';
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/BaseAsset.php

    r2801406 r2837230  
    214214
    215215    /**
    216      * @param string[] $dependencies
     216     * @param string ...$dependencies
    217217     *
    218218     * @return static
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Handler/OutputFilterAwareAssetHandlerTrait.php

    r2801406 r2837230  
    5353    {
    5454        $filters = $this->currentOutputFilters($asset);
    55         if (count($filters) < 1) {
     55        if (count($filters) === 0) {
    5656            return false;
    5757        }
     
    7474        );
    7575
    76         return count($filters) > 0;
     76        return true;
    7777    }
    7878
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Handler/ScriptHandler.php

    r2801406 r2837230  
    2020use Inpsyde\Assets\Asset;
    2121use Inpsyde\Assets\Script;
     22use WP_Scripts;
    2223
    2324class ScriptHandler implements AssetHandler, OutputFilterAwareAssetHandler
     
    3334     * ScriptHandler constructor.
    3435     *
    35      * @param \WP_Styles $wpStyles
     36     * @param \WP_Scripts $wpScripts
    3637     * @param array<string, callable> $outputFilters
    3738     */
    38     public function __construct(\WP_Scripts $wpScripts, array $outputFilters = [])
     39    public function __construct(WP_Scripts $wpScripts, array $outputFilters = [])
    3940    {
    4041        $this->withOutputFilter(AsyncScriptOutputFilter::class, new AsyncScriptOutputFilter());
     
    9697        $translation = $asset->translation();
    9798        if ($translation['domain'] !== '') {
     99            /**
     100             * The $path is allowed to be "null"- or a "string"-value.
     101             * @psalm-suppress PossiblyNullArgument
     102             */
    98103            wp_set_script_translations($handle, $translation['domain'], $translation['path']);
    99104        }
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/AbstractWebpackLoader.php

    r2801406 r2837230  
    117117    protected function buildAsset(string $handle, string $fileUrl, string $filePath): ?Asset
    118118    {
    119         /** @var array{filename:string, extension:string} $pathInfo */
    120         $pathInfo = pathinfo($filePath);
    121         $extension = (string) ($pathInfo['extension'] ?? '');
    122         $filename = (string) ($pathInfo['filename'] ?? '');
    123 
    124119        $extensionsToClass = [
    125120            'css' => Style::class,
    126121            'js' => Script::class,
    127122        ];
    128         $class = $extensionsToClass[$extension] ?? null;
    129         if ($class === null) {
     123
     124        /** @var array{filename?:string, extension?:string} $pathInfo */
     125        $pathInfo = pathinfo($filePath);
     126        $filename = $pathInfo['filename'] ?? '';
     127        $extension = $pathInfo['extension'] ?? '';
     128
     129        if (!in_array($extension, array_keys($extensionsToClass), true)) {
    130130            return null;
    131131        }
    132132
    133         $location = $this->resolveLocation($filename);
     133        $class = $extensionsToClass[$extension];
     134
    134135        /** @var Asset|BaseAsset $asset */
    135         $asset = new $class($handle, $fileUrl, $location);
     136        $asset = new $class($handle, $fileUrl, $this->resolveLocation($filename));
    136137        $asset->withFilePath($filePath);
    137138        $asset->canEnqueue(true);
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/ArrayLoader.php

    r2801406 r2837230  
    2828    /**
    2929     * @param mixed $resource
     30     *
    3031     * @return array
    3132     *
     
    4041        );
    4142
    42         if (!$this->autodiscoverVersion) {
    43             $assets = array_map(
    44                 static function (Asset $asset): Asset {
    45                     /** @var BaseAsset $asset */
    46                     return $asset->disableAutodiscoverVersion();
    47                 },
    48                 $assets
    49             );
    50         }
    51 
    52         return $assets;
     43        return array_map(
     44            function (Asset $asset): Asset {
     45                if ($asset instanceof BaseAsset) {
     46                    $this->autodiscoverVersion
     47                        ? $asset->enableAutodiscoverVersion()
     48                        : $asset->disableAutodiscoverVersion();
     49                }
     50                return $asset;
     51            },
     52            $assets
     53        );
    5354    }
    5455}
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/EncoreEntrypointsLoader.php

    r2801406 r2837230  
    3030    {
    3131        $directory = trailingslashit(dirname($resource));
    32         /** @var array{entrypoints:array{css:string[], js:string[]}} $data */
     32        /** @var array{entrypoints:array{css?:string[], js?:string[]}} $data */
    3333        $data = $data['entrypoints'] ?? [];
    3434
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/OutputFilter/AttributesOutputFilter.php

    r2801406 r2837230  
    5353        $scripts = $doc->getElementsByTagName('script');
    5454        foreach ($scripts as $script) {
    55             // Only extend the <script> with "src"-attribute and
    56             // don't extend inline <script></script> before and after.
     55            // Only extend <script> elements with "src" attribute
     56            // and don't extend inline <script></script> before and after.
    5757            if (!$script->hasAttribute('src')) {
    5858                continue;
     
    9595
    9696    /**
    97      * @param \DOMNode $script
     97     * @param \DOMElement $script
    9898     * @param array $attributes
    9999     *
    100100     * @return void
    101101     */
    102     protected function applyAttributes(\DOMNode $script, array $attributes)
     102    protected function applyAttributes(\DOMElement $script, array $attributes)
    103103    {
    104104        foreach ($attributes as $key => $value) {
  • payoneer-checkout/trunk/vendor/inpsyde/assets/src/Script.php

    r2801406 r2837230  
    262262        $this->withDependencies(...$dependencies);
    263263        if (!$this->version && $version) {
    264             $this->withVersion((string) $version);
     264            $this->withVersion($version);
    265265        }
    266266
     
    276276     *      - {fileName}.{hash}.asset.php
    277277     *
    278      * @return \DirectoryIterator|null $depsfile
     278     * @return \DirectoryIterator|null
    279279     */
    280280    protected function findDepdendencyFile(): ?\DirectoryIterator
     
    296296            $regex = '/' . $fileName . '(?:\.[a-zA-Z0-9]+)?\.asset\.(json|php)/';
    297297
    298             /** @var null|\DirectoryIterator $depsFile */
    299298            $depsFile = null;
    300299            foreach (new \DirectoryIterator($path) as $fileInfo) {
  • payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php

    r2801406 r2837230  
    11<?php
     2
     3/*
     4 * This file is part of the Symfony package.
     5 *
     6 * (c) Fabien Potencier <[email protected]>
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312#[Attribute(Attribute::TARGET_CLASS)]
  • payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php

    r2801406 r2837230  
    11<?php
    22
    3 if (\PHP_VERSION_ID < 80000 && \extension_loaded('tokenizer')) {
     3/*
     4 * This file is part of the Symfony package.
     5 *
     6 * (c) Fabien Potencier <[email protected]>
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
     11
     12if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) {
    413    class PhpToken extends Symfony\Polyfill\Php80\PhpToken
    514    {
  • payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php

    r2801406 r2837230  
    11<?php
     2
     3/*
     4 * This file is part of the Symfony package.
     5 *
     6 * (c) Fabien Potencier <[email protected]>
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312if (\PHP_VERSION_ID < 80000) {
  • payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php

    r2801406 r2837230  
    11<?php
     2
     3/*
     4 * This file is part of the Symfony package.
     5 *
     6 * (c) Fabien Potencier <[email protected]>
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312if (\PHP_VERSION_ID < 80000) {
  • payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php

    r2801406 r2837230  
    11<?php
     2
     3/*
     4 * This file is part of the Symfony package.
     5 *
     6 * (c) Fabien Potencier <[email protected]>
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312if (\PHP_VERSION_ID < 80000) {
Note: See TracChangeset for help on using the changeset viewer.