Changeset 2837230
- Timestamp:
- 12/21/2022 10:46:24 AM (3 years ago)
- Location:
- payoneer-checkout/trunk
- Files:
-
- 46 edited
-
inc/bootstrap.php (modified) (2 diffs)
-
inc/modules.php (modified) (2 diffs)
-
inc/services.php (modified) (6 diffs)
-
languages/en_GB.pot (modified) (6 diffs)
-
modules.local/checkout/inc/services.php (modified) (6 diffs)
-
modules.local/checkout/src/CheckoutModule.php (modified) (4 diffs)
-
modules.local/checkout/src/Factory/ListSession/OrderBasedListSessionFactory.php (modified) (7 diffs)
-
modules.local/checkout/src/Factory/ListSession/WcBasedListSessionFactory.php (modified) (5 diffs)
-
modules.local/embedded-payment/inc/extensions.php (modified) (1 diff)
-
modules.local/embedded-payment/inc/services.php (modified) (3 diffs)
-
modules.local/embedded-payment/src/EmbeddedPaymentModule.php (modified) (2 diffs)
-
modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php (modified) (2 diffs)
-
modules.local/hosted-payment/src/HostedPaymentModule.php (modified) (4 diffs)
-
modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php (modified) (1 diff)
-
modules.local/payment-gateway/composer.json (modified) (1 diff)
-
modules.local/payment-gateway/inc/services.php (modified) (5 diffs)
-
modules.local/payment-gateway/src/Gateway/Factory/Product/WcOrderBasedProductsFactory.php (modified) (5 diffs)
-
modules.local/payment-gateway/src/Gateway/RefundProcessor/RefundProcessor.php (modified) (1 diff)
-
modules.local/payment-gateway/src/PaymentGatewayModule.php (modified) (7 diffs)
-
modules.local/third-party-compat/src/ThirdPartyCompatModule.php (modified) (4 diffs)
-
modules.local/wp/inc/services.php (modified) (2 diffs)
-
payoneer-checkout.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
src/Core/CoreModule.php (modified) (2 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (4 diffs)
-
vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/autoload_static.php (modified) (7 diffs)
-
vendor/composer/installed.php (modified) (4 diffs)
-
vendor/inpsyde/assets/README.md (modified) (1 diff)
-
vendor/inpsyde/assets/src/AssetFactory.php (modified) (2 diffs)
-
vendor/inpsyde/assets/src/BaseAsset.php (modified) (1 diff)
-
vendor/inpsyde/assets/src/Handler/OutputFilterAwareAssetHandlerTrait.php (modified) (2 diffs)
-
vendor/inpsyde/assets/src/Handler/ScriptHandler.php (modified) (3 diffs)
-
vendor/inpsyde/assets/src/Loader/AbstractWebpackLoader.php (modified) (1 diff)
-
vendor/inpsyde/assets/src/Loader/ArrayLoader.php (modified) (2 diffs)
-
vendor/inpsyde/assets/src/Loader/EncoreEntrypointsLoader.php (modified) (1 diff)
-
vendor/inpsyde/assets/src/OutputFilter/AttributesOutputFilter.php (modified) (2 diffs)
-
vendor/inpsyde/assets/src/Script.php (modified) (3 diffs)
-
vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php (modified) (1 diff)
-
vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php (modified) (1 diff)
-
vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php (modified) (1 diff)
-
vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php (modified) (1 diff)
-
vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
payoneer-checkout/trunk/inc/bootstrap.php
r2801406 r2837230 5 5 use Inpsyde\Modularity\Module\Module; 6 6 use Inpsyde\Modularity\Package; 7 use Inpsyde\ Modularity\Properties\PluginProperties;7 use Inpsyde\PayoneerForWoocommerce\Core\PayoneerProperties; 8 8 9 9 return static function (string $mainPluginFile, callable $onError, Module ...$modules): Package { … … 14 14 } 15 15 16 $properties = P luginProperties::new($mainPluginFile);16 $properties = PayoneerProperties::new($mainPluginFile); 17 17 $package = Package::new($properties); 18 18 add_action($package->hookName(Package::ACTION_FAILED_BOOT), $onError); -
payoneer-checkout/trunk/inc/modules.php
r2814348 r2837230 22 22 use Inpsyde\PayoneerForWoocommerce\Wp\WpModule; 23 23 use Inpsyde\PayoneerSdk\SdkModule; 24 use Inpsyde\PayoneerForWoocommerce\AdminBanner\AdminBannerModule; 24 25 25 26 return … … 47 48 new MigrationModule(), 48 49 new ThirdPartyCompatModule(), 50 new AdminBannerModule(), 49 51 ]; 50 52 }; -
payoneer-checkout/trunk/inc/services.php
r2814348 r2837230 92 92 'core.plugin.version' => 93 93 new Factory([ 94 Package::PROPERTIES,94 'core.plugin.version_string', 95 95 'core.string_version_factory', 96 96 ], static function ( 97 Properties $properties,97 string $pluginVersion, 98 98 StringVersionFactoryInterface $versionFactory 99 99 ): VersionInterface { 100 $product = $versionFactory ->createVersionFromString($properties->version());101 100 $product = $versionFactory 101 ->createVersionFromString($pluginVersion); 102 102 return $product; 103 103 }), 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 ), 104 113 105 114 'core.plugin.plugin_action_links' => … … 480 489 481 490 '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 ), 483 497 484 498 'core.order_item_types_for_product' => … … 490 504 'core.embedded_payment.custom_css.default' => 491 505 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'), 492 509 493 510 # Essential factories … … 1436 1453 new Alias('core.payment_gateway.is_enabled'), 1437 1454 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 1438 1467 ## webhooks 1439 1468 # -------------------------- … … 1564 1593 'inpsyde_payment_gateway.webhooks.security_header_name' => 1565 1594 new Alias('core.webhooks.security_header_name'), 1595 1596 'inpsyde_payment_gateway.plugin.version_string' => 1597 new Alias('core.plugin.version_string'), 1566 1598 1567 1599 ## core.page_detector … … 1602 1634 'migration.embedded_payment.custom_css.default' => 1603 1635 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'), 1604 1647 ]; 1605 1648 }; -
payoneer-checkout/trunk/languages/en_GB.pot
r2814348 r2837230 39 39 msgstr "" 40 40 41 #: ../inc/services.php:1 1241 #: ../inc/services.php:121 42 42 msgid "Settings" 43 43 msgstr "" 44 44 45 #: ../inc/services.php: 79945 #: ../inc/services.php:816 46 46 msgid "live" 47 47 msgstr "" 48 48 49 #: ../inc/services.php:8 0249 #: ../inc/services.php:819 50 50 msgid "sandbox" 51 msgstr "" 52 53 #: ../modules.local/admin-banner/src/AdminBannerRenderer.php:69 54 msgid "" 55 "Ready to convert more customers and deliver checkout experiences that build\n" 56 " loyalty?" 57 msgstr "" 58 59 #: ../modules.local/admin-banner/src/AdminBannerRenderer.php:75 60 msgid "" 61 "Register for your Payoneer Checkout account and start selling around the\n" 62 " world." 63 msgstr "" 64 65 #: ../modules.local/admin-banner/src/AdminBannerRenderer.php:86 66 msgid "Register for Checkout" 67 msgstr "" 68 69 #: ../modules.local/admin-banner/src/AdminBannerRenderer.php:91 70 msgid "Configure Checkout plugin" 51 71 msgstr "" 52 72 … … 55 75 msgstr "" 56 76 57 #: ../modules.local/checkout/inc/services.php: 47677 #: ../modules.local/checkout/inc/services.php:518 58 78 msgid "Select the payment flow for every transaction." 59 79 msgstr "" 60 80 61 #: ../modules.local/checkout/src/CheckoutModule.php: 19781 #: ../modules.local/checkout/src/CheckoutModule.php:204 62 82 msgid "Payment failed. Please try again" 63 83 msgstr "" 64 84 65 #: ../modules.local/checkout/src/CheckoutModule.php: 19985 #: ../modules.local/checkout/src/CheckoutModule.php:206 66 86 msgid "Payment canceled. Please try again or choose another payment method." 67 87 msgstr "" 68 88 69 #: ../modules.local/checkout/src/CheckoutModule.php:22 089 #: ../modules.local/checkout/src/CheckoutModule.php:227 70 90 msgid "Payment has been aborted" 71 91 msgstr "" 72 92 73 #: ../modules.local/embedded-payment/inc/extensions.php:3 593 #: ../modules.local/embedded-payment/inc/extensions.php:33 74 94 msgid "Embedded" 75 95 msgstr "" 76 96 77 #: ../modules.local/embedded-payment/inc/extensions.php:4 297 #: ../modules.local/embedded-payment/inc/extensions.php:40 78 98 msgid "Embedded (default): customers get a payment page that's embedded in your shop." 79 99 msgstr "" … … 176 196 msgstr "" 177 197 178 #: ../modules.local/payment-gateway/inc/fields.php:117, ../modules.local/payment-gateway/inc/services.php:12 6198 #: ../modules.local/payment-gateway/inc/fields.php:117, ../modules.local/payment-gateway/inc/services.php:125 179 199 msgid "Credit / Debit Card" 180 200 msgstr "" … … 188 208 msgstr "" 189 209 190 #: ../modules.local/payment-gateway/inc/services.php:1 30210 #: ../modules.local/payment-gateway/inc/services.php:129 191 211 msgid "Payoneer payment gateway" 192 212 msgstr "" 193 213 194 214 #. translators: %1$s is replaced with the refund long ID 195 #: ../modules.local/payment-gateway/inc/services.php:14 5215 #: ../modules.local/payment-gateway/inc/services.php:144 196 216 msgid " Refunded by Payoneer Checkout - long ID: %1$s" 197 217 msgstr "" 198 218 199 #: ../modules.local/payment-gateway/inc/services.php:6 92219 #: ../modules.local/payment-gateway/inc/services.php:678 200 220 msgid "Are you sure you want to reset this field to its default value?" 201 221 msgstr "" 202 222 203 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:21 3223 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:211 204 224 msgid "Payoneer test mode active" 205 225 msgstr "" 206 226 207 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:21 4227 #: ../modules.local/payment-gateway/src/PaymentGatewayModule.php:212 208 228 msgid "Remember to disable test mode when you are ready to take live transactions" 209 229 msgstr "" … … 229 249 msgstr "" 230 250 231 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:9 3251 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:90 232 252 msgid "API call failed. Please try again or contact the shop admin. Error details can be found in logs." 233 253 msgstr "" 234 254 235 255 #. translators: Transaction ID supplied by WooCommerce plugin 236 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:13 9256 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:136 237 257 msgid "Initiating payment with transaction ID \"%1$s\"" 238 258 msgstr "" 239 259 240 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:17 6, ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:127260 #: ../modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php:173, ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:126 241 261 msgid "An error occurred during payment processing" 242 262 msgstr "" 243 263 244 #: ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:10 6264 #: ../modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php:105 245 265 msgid "The customer is being redirected to an external payment page." 246 266 msgstr "" … … 277 297 msgid "Failed to create an order refund on incoming webhook. Error message: %1$s" 278 298 msgstr "" 299 300 #: ../modules.local/payment-gateway/src/Gateway/Factory/Product/DiscountedProductItemBasedProductFactory.php:51 301 msgid "Discount for" 302 msgstr "" -
payoneer-checkout/trunk/modules.local/checkout/inc/services.php
r2814348 r2837230 151 151 return new CachingListSessionManager($compositeProvider); 152 152 }), 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 153 181 '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'] 156 184 ), 157 185 '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 ] 160 192 ), 161 193 'checkout.list_session_manager.cache_key' => static function ( … … 216 248 'wc.currency', 217 249 'checkout.list_session_system', 250 'checkout.transaction_id_generator', 218 251 'inpsyde_payment_gateway.merchant_division', 219 252 ], … … 230 263 string $currency, 231 264 SystemInterface $system, 265 TransactionIdGeneratorInterface $transactionIdGenerator, 232 266 string $division 233 267 ): WcBasedListSessionFactory { … … 244 278 $currency, 245 279 $system, 280 $transactionIdGenerator, 246 281 $division 247 282 ); … … 260 295 'checkout.wc_order_based_products_factory', 261 296 'checkout.list_session_system', 297 'checkout.transaction_id_generator', 262 298 'checkout.merchant_division', 263 299 ] 264 300 ), 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 } 270 309 ), 271 310 'checkout.list_session_persistor' => new Alias('checkout.list_session_provider'), … … 395 434 TokenGenerator::class 396 435 ), 436 437 'checkout.transaction_id_generator' => 438 new Constructor(TransactionIdGenerator::class), 397 439 398 440 'checkout.wc_based_customer_factory' => new Constructor( -
payoneer-checkout/trunk/modules.local/checkout/src/CheckoutModule.php
r2814348 r2837230 10 10 use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; 11 11 use Inpsyde\Modularity\Module\ServiceModule; 12 use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutListSession\Controller\CheckoutListSessionControllerInterface;13 12 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionRemover; 14 use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface;15 13 use Psr\Container\ContainerInterface; 16 use WC_Cart;17 use WC_Customer;18 14 use WC_Order; 19 15 … … 29 25 /** 30 26 * @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> 32 28 */ 33 29 protected $extensions; … … 55 51 public function run(ContainerInterface $container): bool 56 52 { 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 57 64 add_action('woocommerce_init', function () use ($container) { 58 65 $gatewayEnabled = (bool) $container->get('checkout.payment_gateway.is_enabled'); … … 229 236 } 230 237 238 /** 239 * @inheritDoc 240 */ 231 241 public function extensions(): array 232 242 { -
payoneer-checkout/trunk/modules.local/checkout/src/Factory/ListSession/OrderBasedListSessionFactory.php
r2814348 r2837230 6 6 7 7 use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\FactoryException; 8 use Inpsyde\PayoneerForWoocommerce\Checkout\TransactionIdGeneratorInterface; 8 9 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Callback\WcOrderBasedCallbackFactoryInterface; 9 10 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Customer\WcOrderBasedCustomerFactoryInterface; … … 61 62 */ 62 63 protected $division; 64 63 65 /** 64 66 * @var SystemInterface 65 67 */ 66 68 protected $system; 69 70 /** 71 * @var TransactionIdGeneratorInterface 72 */ 73 protected $transactionIdGenerator; 67 74 68 75 /** … … 75 82 * @param WcOrderBasedProductsFactoryInterface $wcOrderBasedProductsFactory 76 83 * @param SystemInterface $system 84 * @param TransactionIdGeneratorInterface $transactionIdGenerator 77 85 * @param string|null $division 78 86 */ … … 86 94 WcOrderBasedProductsFactoryInterface $wcOrderBasedProductsFactory, 87 95 SystemInterface $system, 96 TransactionIdGeneratorInterface $transactionIdGenerator, 88 97 ?string $division 89 98 ) { … … 97 106 $this->wcOrderBasedProductsFactory = $wcOrderBasedProductsFactory; 98 107 $this->system = $system; 108 $this->transactionIdGenerator = $transactionIdGenerator; 99 109 $this->division = $division; 100 110 } … … 105 115 public function createList(WC_Order $order, string $listSecurityToken): ListInterface 106 116 { 107 $transactionId = $this->createTransactionId($order); 117 $transactionId = $this->transactionIdGenerator 118 ->generateTransactionId(); 108 119 $country = $order->get_billing_country(); 109 120 … … 149 160 } 150 161 151 protected function createTransactionId(WC_Order $order): string152 {153 return sprintf('tr-%1$s', time());154 }155 156 162 public function createListCommand(\WC_Order $order): CreateListCommandInterface 157 163 { 158 164 $command = $this->payoneer->getListCommand(); 165 $transactionId = $this->transactionIdGenerator->generateTransactionId(); 159 166 160 $command = $command->withTransactionId($t his->createTransactionId($order))167 $command = $command->withTransactionId($transactionId) 161 168 ->withCountry($order->get_billing_country()) 162 169 ->withCallback($this->callbackFactory->createCallback($order)) -
payoneer-checkout/trunk/modules.local/checkout/src/Factory/ListSession/WcBasedListSessionFactory.php
r2814348 r2837230 8 8 use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\FactoryException; 9 9 use Inpsyde\PayoneerForWoocommerce\Checkout\Factory\Product\WcCartBasedProductListFactoryInterface; 10 use Inpsyde\PayoneerForWoocommerce\Checkout\TransactionIdGeneratorInterface; 10 11 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\SecurityHeader\SecurityHeaderFactoryInterface; 11 12 use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface; … … 74 75 */ 75 76 protected $system; 77 /** 78 * @var TransactionIdGeneratorInterface 79 */ 80 protected $transactionIdGenerator; 76 81 77 82 public function __construct( … … 87 92 string $currency, 88 93 SystemInterface $system, 94 TransactionIdGeneratorInterface $transactionIdGenerator, 89 95 ?string $division = null 90 96 ) { … … 102 108 $this->system = $system; 103 109 $this->division = $division; 110 $this->transactionIdGenerator = $transactionIdGenerator; 104 111 } 105 112 … … 110 117 ): ListInterface { 111 118 112 $transactionId = sprintf('tr-%1$s', time());119 $transactionId = $this->transactionIdGenerator->generateTransactionId(); 113 120 $country = $customer->get_billing_country(); 114 121 $callback = $this->createCallback( -
payoneer-checkout/trunk/modules.local/embedded-payment/inc/extensions.php
r2814348 r2837230 5 5 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionProvider; 6 6 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\AjaxOrderPay\OrderPayload; 7 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\InteractionCodePaymentRequestValidator;8 7 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\ListUrlPaymentRequestValidator; 9 8 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\CheckoutHashFieldRenderer; 10 9 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\HostedFlowOverrideFlagRenderer; 11 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\InteractionCodeFieldRenderer;12 10 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\ListDebugFieldRenderer; 13 11 use Inpsyde\PayoneerForWoocommerce\EmbeddedPayment\PaymentFieldsRenderer\ListUrlFieldRenderer; -
payoneer-checkout/trunk/modules.local/embedded-payment/inc/services.php
r2814348 r2837230 86 86 //Any content provided as array element with an 'extra_css' key 87 87 //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 ]), 96 91 97 92 'embedded_payment.widget.custom_css_url' => new Factory([ … … 169 164 ), 170 165 'embedded_payment.path.js.suffix' => new Factory([ 171 ' wp.is_debug',166 'core.is_debug', 172 167 ], static function ( 173 168 bool $isDebug … … 180 175 ), 181 176 'embedded_payment.path.css.suffix' => new Factory([ 182 ' wp.is_debug',177 'core.is_debug', 183 178 ], static function ( 184 179 bool $isDebug -
payoneer-checkout/trunk/modules.local/embedded-payment/src/EmbeddedPaymentModule.php
r2814348 r2837230 571 571 } 572 572 573 /** @var callable(): array<string, callable( \Psr\Container\ContainerInterface $container):mixed> $services */573 /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */ 574 574 return $services(); 575 575 } … … 586 586 } 587 587 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 */ 589 589 return $extensions(); 590 590 } -
payoneer-checkout/trunk/modules.local/embedded-payment/src/PaymentProcessor/EmbeddedPaymentProcessor.php
r2814348 r2837230 8 8 use Exception; 9 9 use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutExceptionInterface; 10 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\ListSessionProvider;11 10 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionPersistor; 12 11 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionProvider; … … 17 16 use Inpsyde\PayoneerSdk\Api\Command\Exception\CommandExceptionInterface; 18 17 use Inpsyde\PayoneerSdk\Api\Command\Exception\InteractionExceptionInterface; 19 use Inpsyde\PayoneerSdk\Api\Command\ResponseValidator\InteractionCodeFailureInterface;20 18 use Inpsyde\PayoneerSdk\Api\Command\UpdateListCommandInterface; 21 19 use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface; 22 use Throwable;23 20 use WC_Order; 24 21 -
payoneer-checkout/trunk/modules.local/hosted-payment/src/HostedPaymentModule.php
r2814348 r2837230 5 5 namespace Inpsyde\PayoneerForWoocommerce\HostedPayment; 6 6 7 use Dhii\Services\Factories\FuncService;8 7 use Inpsyde\Modularity\Module\ExecutableModule; 9 8 use Inpsyde\Modularity\Module\ExtendingModule; … … 11 10 use Inpsyde\Modularity\Module\ServiceModule; 12 11 use Psr\Container\ContainerInterface; 13 use WC_Order;14 12 15 13 class HostedPaymentModule implements ExecutableModule, ServiceModule, ExtendingModule … … 42 40 } 43 41 44 /** @var callable(): array<string, callable( \Psr\Container\ContainerInterface $container):mixed> $services */42 /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */ 45 43 return $services(); 46 44 } … … 57 55 } 58 56 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 */ 60 58 return $extensions(); 61 59 } -
payoneer-checkout/trunk/modules.local/hosted-payment/src/PaymentProcessor/HostedPaymentProcessor.php
r2814348 r2837230 14 14 use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface; 15 15 use Inpsyde\PayoneerSdk\Api\Command\Exception\CommandExceptionInterface; 16 use Inpsyde\PayoneerSdk\Api\Command\ResponseValidator\InteractionCodeFailureInterface;17 16 use Inpsyde\PayoneerSdk\Api\Entities\ListSession\ListInterface; 18 17 use Inpsyde\PayoneerSdk\Api\Entities\Style\Style; -
payoneer-checkout/trunk/modules.local/payment-gateway/composer.json
r2814348 r2837230 35 35 "brain/monkey": "^2", 36 36 "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" 38 39 } 39 40 } -
payoneer-checkout/trunk/modules.local/payment-gateway/inc/services.php
r2814348 r2837230 17 17 use Inpsyde\Assets\Asset; 18 18 use Inpsyde\Assets\Script; 19 use Inpsyde\PayoneerForWoocommerce\Filesystem\PathResolverInterface;20 use Inpsyde\PayoneerForWoocommerce\Filesystem\UrlResolverInterface;21 19 use Inpsyde\PayoneerForWoocommerce\PageDetector\PageDetectorInterface; 22 20 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Api\BasicTokenProviderFactory; … … 31 29 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Payment\WcOrderBasedPaymentFactory; 32 30 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\CouponItemBasedProductFactory; 31 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\DiscountedProductItemBasedProductFactory; 33 32 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\FeeItemBasedProductFactory; 34 33 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\Factory\Product\ProductItemBasedProductFactory; … … 193 192 'inpsyde_payment_gateway.fee_item_based_product_factory', 194 193 'inpsyde_payment_gateway.coupon_item_based_product_factory', 194 'inpsyde_payment_gateway.discounted_product_item_based_product_factory', 195 195 'inpsyde_payment_gateway.order_item_types_for_product', 196 196 ]), … … 227 227 'inpsyde_payment_gateway.product_factory', 228 228 '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', 229 234 ]), 230 235 … … 604 609 }), 605 610 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 $location618 ): UriInterface {619 $path = $pathResolver->resolvePath($location);620 $product = $urlResolver->resolveUrl($path);621 622 return $product;623 }),624 625 611 'inpsyde_payment_gateway.assets.admin_settings_script.deps' => 626 612 new Value([]), -
payoneer-checkout/trunk/modules.local/payment-gateway/src/Gateway/Factory/Product/WcOrderBasedProductsFactory.php
r2801406 r2837230 17 17 * @var ProductItemBasedProductFactoryInterface 18 18 */ 19 protected $product BasedProductFactory;19 protected $productItemBasedProductFactory; 20 20 21 21 /** … … 38 38 */ 39 39 protected $orderItemTypes; 40 /** 41 * @var ProductItemBasedProductFactoryInterface 42 */ 43 protected $discountedProductItemBasedFactory; 40 44 41 45 /** … … 44 48 * @param FeeItemBasedProductFactoryInterface $feeBasedProductFactory 45 49 * @param CouponItemBasedProductFactoryInterface $couponItemBasedProductFactory 50 * @param ProductItemBasedProductFactoryInterface $discountedProductItemBasedFactory 46 51 * @param string[] $orderItemTypes Possible order item classes 47 52 */ … … 51 56 FeeItemBasedProductFactoryInterface $feeBasedProductFactory, 52 57 CouponItemBasedProductFactoryInterface $couponItemBasedProductFactory, 58 ProductItemBasedProductFactoryInterface $discountedProductItemBasedFactory, 53 59 array $orderItemTypes 54 60 ) { 55 61 56 $this->product BasedProductFactory = $productBasedProductFactory;62 $this->productItemBasedProductFactory = $productBasedProductFactory; 57 63 $this->shippingBasedProductFactory = $shippingBasedProductFactory; 58 64 $this->feeBasedProductFactory = $feeBasedProductFactory; 59 65 $this->couponItemBasedProductFactory = $couponItemBasedProductFactory; 60 66 $this->orderItemTypes = $orderItemTypes; 67 $this->discountedProductItemBasedFactory = $discountedProductItemBasedFactory; 61 68 } 62 69 … … 73 80 switch (true) { 74 81 case $item instanceof WC_Order_Item_Product: 75 $products[] = $this->product BasedProductFactory82 $products[] = $this->productItemBasedProductFactory 76 83 ->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 77 92 break; 78 93 -
payoneer-checkout/trunk/modules.local/payment-gateway/src/Gateway/RefundProcessor/RefundProcessor.php
r2814348 r2837230 8 8 use Inpsyde\PayoneerForWoocommerce\Checkout\CheckoutExceptionInterface; 9 9 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\OrderAwareListSessionProvider; 10 use Inpsyde\PayoneerForWoocommerce\Checkout\ListSession\WcOrderListSessionProvider;11 10 use Inpsyde\PayoneerSdk\Api\ApiExceptionInterface; 12 11 use Inpsyde\PayoneerSdk\Api\Command\PayoutCommandInterface; -
payoneer-checkout/trunk/modules.local/payment-gateway/src/PaymentGatewayModule.php
r2814348 r2837230 5 5 namespace Inpsyde\PayoneerForWoocommerce\PaymentGateway; 6 6 7 use Dhii\Container\SegmentingContainer;8 7 use Dhii\Services\Factories\FuncService; 9 8 use Inpsyde\Assets\Asset; … … 13 12 use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; 14 13 use Inpsyde\Modularity\Module\ServiceModule; 15 use Inpsyde\PayoneerForWoocommerce\PageDetector\PageDetectorInterface;16 14 use Inpsyde\PayoneerForWoocommerce\PaymentGateway\Gateway\PaymentGateway; 17 15 use Psr\Container\ContainerInterface; 16 use Psr\Http\Message\UriInterface; 18 17 use Stringable; 19 use UnexpectedValueException;20 18 use WC_Order; 21 19 … … 119 117 'inpsyde_payment_gateway.is_settings_page', 120 118 'inpsyde_payment_gateway.gateway', 119 'core.http.settings_url', 121 120 ], 122 121 \Closure::fromCallable([$this, 'reloadSettingsPage']) … … 156 155 public function reloadSettingsPage( 157 156 bool $isSettingsPage, 158 PaymentGateway $paymentGateway 157 PaymentGateway $paymentGateway, 158 UriInterface $settingsUrl 159 159 ): void { 160 160 … … 166 166 $errorParams["error[{$i}]"] = $error; 167 167 } 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); 174 172 exit; 175 173 } … … 206 204 return; 207 205 } 208 add_action('a dmin_notices', static function () {206 add_action('all_admin_notices', static function () { 209 207 $class = 'notice notice-warning'; 210 208 printf( … … 217 215 ) 218 216 ); 219 } );217 }, 11); 220 218 } 221 219 -
payoneer-checkout/trunk/modules.local/third-party-compat/src/ThirdPartyCompatModule.php
r2814392 r2837230 5 5 namespace Inpsyde\PayoneerForWoocommerce\ThirdPartyCompat; 6 6 7 use Automattic\WooCommerce\Utilities\FeaturesUtil; 7 8 use Inpsyde\Modularity\Module\ExecutableModule; 8 9 use Inpsyde\Modularity\Module\ExtendingModule; … … 26 27 return $scripts; 27 28 }); 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 28 47 return true; 29 48 } … … 41 60 } 42 61 43 /** @var callable(): array<string, callable( \Psr\Container\ContainerInterface $container):mixed> $services */62 /** @var callable(): array<string, callable(ContainerInterface $container):mixed> $services */ 44 63 return $services(); 45 64 } … … 56 75 } 57 76 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 */ 59 78 return $extensions(); 60 79 } -
payoneer-checkout/trunk/modules.local/wp/inc/services.php
r2814348 r2837230 5 5 use Dhii\Collection\MutableContainerInterface; 6 6 use Dhii\Services\Factories\Alias; 7 use Dhii\Services\Factories\Value; 7 8 use Dhii\Services\Factory; 8 use Inpsyde\Modularity\Package;9 use Inpsyde\Modularity\Properties\PluginProperties;10 9 use Inpsyde\PayoneerForWoocommerce\Core\Exception\PayoneerException; 11 10 use Inpsyde\PayoneerForWoocommerce\Environment\WpEnvironmentInterface; … … 96 95 97 96 '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), 101 98 102 99 'wc' => -
payoneer-checkout/trunk/payoneer-checkout.php
r2814348 r2837230 4 4 * Plugin Name: Payoneer Checkout 5 5 * Description: Payoneer Checkout for WooCommerce 6 * Version: 1. 0.06 * Version: 1.1.0 7 7 * Author: Payoneer 8 8 * Requires at least: 5.4 … … 15 15 * Text Domain: payoneer-checkout 16 16 * Domain Path: /languages 17 * SHA: 28173aa17 * SHA: 8a788b1 18 18 */ 19 19 -
payoneer-checkout/trunk/readme.txt
r2815889 r2837230 59 59 60 60 == Changelog == 61 62 = 1.1.0 - 2022-12-15 = 63 * Add: Display banner with onboarding assistant after initial plugin activation 61 64 62 65 = 1.0.0 - 2022-11-02 = -
payoneer-checkout/trunk/src/Core/CoreModule.php
r2801406 r2837230 46 46 } 47 47 48 /** @var callable(string): array<string, callable( \Psr\Container\ContainerInterface $container):mixed> $services */48 /** @var callable(string): array<string, callable(ContainerInterface $container):mixed> $services */ 49 49 return $services($moduleRootPath); 50 50 } … … 63 63 } 64 64 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 */ 66 66 return $extensions($moduleRootPath); 67 67 } -
payoneer-checkout/trunk/vendor/autoload.php
r2814348 r2837230 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit c8750899a923b93b328730c8cb20ba8d::getLoader();25 return ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f::getLoader(); -
payoneer-checkout/trunk/vendor/composer/ClassLoader.php
r2801406 r2837230 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */ 46 private $includeFile; 47 45 48 /** @var ?string */ 46 49 private $vendorDir; … … 107 110 { 108 111 $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 }; 109 124 } 110 125 … … 426 441 { 427 442 if ($file = $this->findFile($class)) { 428 includeFile($file);443 ($this->includeFile)($file); 429 444 430 445 return true; … … 557 572 } 558 573 } 559 560 /**561 * Scope isolated include.562 *563 * Prevents access to $this/self from included files.564 *565 * @param string $file566 * @return void567 * @private568 */569 function includeFile($file)570 {571 include $file;572 } -
payoneer-checkout/trunk/vendor/composer/autoload_classmap.php
r2814348 r2837230 139 139 'Inpsyde\\Modularity\\Properties\\Properties' => $vendorDir . '/inpsyde/modularity/src/Properties/Properties.php', 140 140 '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', 141 144 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetCustomizerModule' => $baseDir . '/modules.local/asset-customizer/src/AssetCustomizerModule.php', 142 145 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetProcessorInterface' => $baseDir . '/modules.local/asset-customizer/src/AssetProcessorInterface.php', … … 205 208 'Inpsyde\\PayoneerForWoocommerce\\Checkout\\RegisterCheckoutAssets' => $baseDir . '/modules.local/checkout/src/RegisterCheckoutAssets.php', 206 209 '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', 207 212 'Inpsyde\\PayoneerForWoocommerce\\Core\\CoreModule' => $baseDir . '/src/Core/CoreModule.php', 208 213 'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerException' => $baseDir . '/src/Core/Exception/PayoneerException.php', 209 214 'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerExceptionInterface' => $baseDir . '/src/Core/Exception/PayoneerExceptionInterface.php', 215 'Inpsyde\\PayoneerForWoocommerce\\Core\\PayoneerProperties' => $baseDir . '/src/Core/PayoneerProperties.php', 210 216 'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLink' => $baseDir . '/src/Core/PluginActionLink/PluginActionLink.php', 211 217 'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLinkRegistry' => $baseDir . '/src/Core/PluginActionLink/PluginActionLinkRegistry.php', … … 287 293 'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactory' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactory.php', 288 294 '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', 289 296 'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactory' => $baseDir . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactory.php', 290 297 '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 34 34 'Inpsyde\\PayoneerForWoocommerce\\Cache\\' => array($baseDir . '/modules.local/cache/src'), 35 35 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\' => array($baseDir . '/modules.local/asset-customizer/src'), 36 'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' => array($baseDir . '/modules.local/admin-banner/src'), 36 37 'Inpsyde\\PayoneerForWoocommerce\\' => array($baseDir . '/src'), 37 38 'Inpsyde\\Modularity\\' => array($vendorDir . '/inpsyde/modularity/src'), -
payoneer-checkout/trunk/vendor/composer/autoload_real.php
r2814348 r2837230 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit c8750899a923b93b328730c8cb20ba8d5 class ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit c8750899a923b93b328730c8cb20ba8d', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit c8750899a923b93b328730c8cb20ba8d', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit784095c19da94098ce9ae7ca509bcc7f', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit c8750899a923b93b328730c8cb20ba8d::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::getInitializer($loader)); 33 33 34 34 $loader->register(true); 35 35 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); 39 46 } 40 47 … … 42 49 } 43 50 } 44 45 /**46 * @param string $fileIdentifier47 * @param string $file48 * @return void49 */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 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit c8750899a923b93b328730c8cb20ba8d7 class ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f 8 8 { 9 9 public static $files = array ( … … 55 55 'Inpsyde\\PayoneerForWoocommerce\\Cache\\' => 37, 56 56 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\' => 47, 57 'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' => 43, 57 58 'Inpsyde\\PayoneerForWoocommerce\\' => 31, 58 59 'Inpsyde\\Modularity\\' => 19, … … 187 188 array ( 188 189 0 => __DIR__ . '/../..' . '/modules.local/asset-customizer/src', 190 ), 191 'Inpsyde\\PayoneerForWoocommerce\\AdminBanner\\' => 192 array ( 193 0 => __DIR__ . '/../..' . '/modules.local/admin-banner/src', 189 194 ), 190 195 'Inpsyde\\PayoneerForWoocommerce\\' => … … 375 380 'Inpsyde\\Modularity\\Properties\\Properties' => __DIR__ . '/..' . '/inpsyde/modularity/src/Properties/Properties.php', 376 381 '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', 377 385 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetCustomizerModule' => __DIR__ . '/../..' . '/modules.local/asset-customizer/src/AssetCustomizerModule.php', 378 386 'Inpsyde\\PayoneerForWoocommerce\\AssetCustomizer\\AssetProcessorInterface' => __DIR__ . '/../..' . '/modules.local/asset-customizer/src/AssetProcessorInterface.php', … … 441 449 'Inpsyde\\PayoneerForWoocommerce\\Checkout\\RegisterCheckoutAssets' => __DIR__ . '/../..' . '/modules.local/checkout/src/RegisterCheckoutAssets.php', 442 450 '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', 443 453 'Inpsyde\\PayoneerForWoocommerce\\Core\\CoreModule' => __DIR__ . '/../..' . '/src/Core/CoreModule.php', 444 454 'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerException' => __DIR__ . '/../..' . '/src/Core/Exception/PayoneerException.php', 445 455 'Inpsyde\\PayoneerForWoocommerce\\Core\\Exception\\PayoneerExceptionInterface' => __DIR__ . '/../..' . '/src/Core/Exception/PayoneerExceptionInterface.php', 456 'Inpsyde\\PayoneerForWoocommerce\\Core\\PayoneerProperties' => __DIR__ . '/../..' . '/src/Core/PayoneerProperties.php', 446 457 'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLink' => __DIR__ . '/../..' . '/src/Core/PluginActionLink/PluginActionLink.php', 447 458 'Inpsyde\\PayoneerForWoocommerce\\Core\\PluginActionLink\\PluginActionLinkRegistry' => __DIR__ . '/../..' . '/src/Core/PluginActionLink/PluginActionLinkRegistry.php', … … 523 534 'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\CouponItemBasedProductFactory' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/CouponItemBasedProductFactory.php', 524 535 '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', 525 537 'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactory' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactory.php', 526 538 'Inpsyde\\PayoneerForWoocommerce\\PaymentGateway\\Gateway\\Factory\\Product\\FeeItemBasedProductFactoryInterface' => __DIR__ . '/../..' . '/modules.local/payment-gateway/src/Gateway/Factory/Product/FeeItemBasedProductFactoryInterface.php', … … 850 862 { 851 863 return \Closure::bind(function () use ($loader) { 852 $loader->prefixLengthsPsr4 = ComposerStaticInit c8750899a923b93b328730c8cb20ba8d::$prefixLengthsPsr4;853 $loader->prefixDirsPsr4 = ComposerStaticInit c8750899a923b93b328730c8cb20ba8d::$prefixDirsPsr4;854 $loader->classMap = ComposerStaticInit c8750899a923b93b328730c8cb20ba8d::$classMap;864 $loader->prefixLengthsPsr4 = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$prefixLengthsPsr4; 865 $loader->prefixDirsPsr4 = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$prefixDirsPsr4; 866 $loader->classMap = ComposerStaticInit784095c19da94098ce9ae7ca509bcc7f::$classMap; 855 867 856 868 }, null, ClassLoader::class); -
payoneer-checkout/trunk/vendor/composer/installed.php
r2814348 r2837230 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 84 84 ), 85 85 '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', 89 89 'type' => 'library', 90 90 'install_path' => __DIR__ . '/../inpsyde/assets', … … 111 111 ), 112 112 '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', 116 116 'type' => 'wordpress-plugin', 117 117 'install_path' => __DIR__ . '/../../', … … 255 255 ), 256 256 'symfony/polyfill-php80' => array( 257 'pretty_version' => 'v1.2 6.0',258 'version' => '1.2 6.0.0',259 'reference' => ' cfa0ae98841b9e461207c13ab093d76b0fa7bace',257 'pretty_version' => 'v1.27.0', 258 'version' => '1.27.0.0', 259 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', 260 260 'type' => 'library', 261 261 'install_path' => __DIR__ . '/../symfony/polyfill-php80', -
payoneer-checkout/trunk/vendor/inpsyde/assets/README.md
r2814392 r2837230 10 10 11 11 ## Introduction 12 Inpsyde Assets is a Composer package (not a plugin) that allows to deal with scripts and styles in a WordPress site.12 Inpsyde Assets is a Composer package (not a WordPress plugin) that allows to deal with scripts and styles in a WordPress site. 13 13 14 14 ## Installation -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/AssetFactory.php
r2801406 r2837230 76 76 ]; 77 77 78 if ($class === Script::class) { 79 /** @var Script $asset */ 80 78 if ($asset instanceof Script) { 81 79 foreach ($config['localize'] as $objectName => $data) { 82 80 $asset->withLocalize((string) $objectName, $data); … … 110 108 } 111 109 112 if ($ class === Style::class) {110 if ($asset instanceof Style) { 113 111 $propertiesToMethod['media'] = 'forMedia'; 114 112 $propertiesToMethod['inlineStyles'] = 'withInlineStyles'; -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/BaseAsset.php
r2801406 r2837230 214 214 215 215 /** 216 * @param string []$dependencies216 * @param string ...$dependencies 217 217 * 218 218 * @return static -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Handler/OutputFilterAwareAssetHandlerTrait.php
r2801406 r2837230 53 53 { 54 54 $filters = $this->currentOutputFilters($asset); 55 if (count($filters) < 1) {55 if (count($filters) === 0) { 56 56 return false; 57 57 } … … 74 74 ); 75 75 76 return count($filters) > 0;76 return true; 77 77 } 78 78 -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Handler/ScriptHandler.php
r2801406 r2837230 20 20 use Inpsyde\Assets\Asset; 21 21 use Inpsyde\Assets\Script; 22 use WP_Scripts; 22 23 23 24 class ScriptHandler implements AssetHandler, OutputFilterAwareAssetHandler … … 33 34 * ScriptHandler constructor. 34 35 * 35 * @param \WP_S tyles $wpStyles36 * @param \WP_Scripts $wpScripts 36 37 * @param array<string, callable> $outputFilters 37 38 */ 38 public function __construct( \WP_Scripts $wpScripts, array $outputFilters = [])39 public function __construct(WP_Scripts $wpScripts, array $outputFilters = []) 39 40 { 40 41 $this->withOutputFilter(AsyncScriptOutputFilter::class, new AsyncScriptOutputFilter()); … … 96 97 $translation = $asset->translation(); 97 98 if ($translation['domain'] !== '') { 99 /** 100 * The $path is allowed to be "null"- or a "string"-value. 101 * @psalm-suppress PossiblyNullArgument 102 */ 98 103 wp_set_script_translations($handle, $translation['domain'], $translation['path']); 99 104 } -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/AbstractWebpackLoader.php
r2801406 r2837230 117 117 protected function buildAsset(string $handle, string $fileUrl, string $filePath): ?Asset 118 118 { 119 /** @var array{filename:string, extension:string} $pathInfo */120 $pathInfo = pathinfo($filePath);121 $extension = (string) ($pathInfo['extension'] ?? '');122 $filename = (string) ($pathInfo['filename'] ?? '');123 124 119 $extensionsToClass = [ 125 120 'css' => Style::class, 126 121 'js' => Script::class, 127 122 ]; 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)) { 130 130 return null; 131 131 } 132 132 133 $location = $this->resolveLocation($filename); 133 $class = $extensionsToClass[$extension]; 134 134 135 /** @var Asset|BaseAsset $asset */ 135 $asset = new $class($handle, $fileUrl, $ location);136 $asset = new $class($handle, $fileUrl, $this->resolveLocation($filename)); 136 137 $asset->withFilePath($filePath); 137 138 $asset->canEnqueue(true); -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/ArrayLoader.php
r2801406 r2837230 28 28 /** 29 29 * @param mixed $resource 30 * 30 31 * @return array 31 32 * … … 40 41 ); 41 42 42 if (!$this->autodiscoverVersion) {43 $assets = array_map(44 static function (Asset $asset): Asset{45 /** @var BaseAsset $asset */46 return $asset->disableAutodiscoverVersion();47 },48 $assets49 );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 ); 53 54 } 54 55 } -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Loader/EncoreEntrypointsLoader.php
r2801406 r2837230 30 30 { 31 31 $directory = trailingslashit(dirname($resource)); 32 /** @var array{entrypoints:array{css :string[], js:string[]}} $data */32 /** @var array{entrypoints:array{css?:string[], js?:string[]}} $data */ 33 33 $data = $data['entrypoints'] ?? []; 34 34 -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/OutputFilter/AttributesOutputFilter.php
r2801406 r2837230 53 53 $scripts = $doc->getElementsByTagName('script'); 54 54 foreach ($scripts as $script) { 55 // Only extend the <script> with "src"-attribute and56 // 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. 57 57 if (!$script->hasAttribute('src')) { 58 58 continue; … … 95 95 96 96 /** 97 * @param \DOM Node$script97 * @param \DOMElement $script 98 98 * @param array $attributes 99 99 * 100 100 * @return void 101 101 */ 102 protected function applyAttributes(\DOM Node$script, array $attributes)102 protected function applyAttributes(\DOMElement $script, array $attributes) 103 103 { 104 104 foreach ($attributes as $key => $value) { -
payoneer-checkout/trunk/vendor/inpsyde/assets/src/Script.php
r2801406 r2837230 262 262 $this->withDependencies(...$dependencies); 263 263 if (!$this->version && $version) { 264 $this->withVersion( (string)$version);264 $this->withVersion($version); 265 265 } 266 266 … … 276 276 * - {fileName}.{hash}.asset.php 277 277 * 278 * @return \DirectoryIterator|null $depsfile278 * @return \DirectoryIterator|null 279 279 */ 280 280 protected function findDepdendencyFile(): ?\DirectoryIterator … … 296 296 $regex = '/' . $fileName . '(?:\.[a-zA-Z0-9]+)?\.asset\.(json|php)/'; 297 297 298 /** @var null|\DirectoryIterator $depsFile */299 298 $depsFile = null; 300 299 foreach (new \DirectoryIterator($path) as $fileInfo) { -
payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
r2801406 r2837230 1 1 <?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 */ 2 11 3 12 #[Attribute(Attribute::TARGET_CLASS)] -
payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
r2801406 r2837230 1 1 <?php 2 2 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 12 if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { 4 13 class PhpToken extends Symfony\Polyfill\Php80\PhpToken 5 14 { -
payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
r2801406 r2837230 1 1 <?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 */ 2 11 3 12 if (\PHP_VERSION_ID < 80000) { -
payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
r2801406 r2837230 1 1 <?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 */ 2 11 3 12 if (\PHP_VERSION_ID < 80000) { -
payoneer-checkout/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
r2801406 r2837230 1 1 <?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 */ 2 11 3 12 if (\PHP_VERSION_ID < 80000) {
Note: See TracChangeset
for help on using the changeset viewer.