Changeset 2995309
- Timestamp:
- 11/13/2023 04:24:43 PM (2 years ago)
- Location:
- multisafepay
- Files:
-
- 4 added
- 20 edited
- 1 copied
-
tags/6.2.0 (copied) (copied from multisafepay/trunk)
-
tags/6.2.0/multisafepay.php (modified) (3 diffs)
-
tags/6.2.0/readme.txt (modified) (3 diffs)
-
tags/6.2.0/src/Main.php (modified) (3 diffs)
-
tags/6.2.0/src/PaymentMethods/Base/BaseRefunds.php (modified) (2 diffs)
-
tags/6.2.0/src/PaymentMethods/PaymentMethodCallback.php (modified) (4 diffs)
-
tags/6.2.0/src/PaymentMethods/PaymentMethodsController.php (modified) (4 diffs)
-
tags/6.2.0/src/Services/ShoppingCartService.php (modified) (5 diffs)
-
tags/6.2.0/src/Settings/ThirdPartyCompatibility.php (added)
-
tags/6.2.0/src/Utils/Hpos.php (added)
-
tags/6.2.0/vendor/composer/installed.json (modified) (3 diffs)
-
tags/6.2.0/vendor/composer/installed.php (modified) (3 diffs)
-
tags/6.2.0/vendor/nyholm/psr7/src/Stream.php (modified) (1 diff)
-
trunk/multisafepay.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/src/Main.php (modified) (3 diffs)
-
trunk/src/PaymentMethods/Base/BaseRefunds.php (modified) (2 diffs)
-
trunk/src/PaymentMethods/PaymentMethodCallback.php (modified) (4 diffs)
-
trunk/src/PaymentMethods/PaymentMethodsController.php (modified) (4 diffs)
-
trunk/src/Services/ShoppingCartService.php (modified) (5 diffs)
-
trunk/src/Settings/ThirdPartyCompatibility.php (added)
-
trunk/src/Utils/Hpos.php (added)
-
trunk/vendor/composer/installed.json (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
-
trunk/vendor/nyholm/psr7/src/Stream.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multisafepay/tags/6.2.0/multisafepay.php
r2981071 r2995309 5 5 * Plugin URI: https://docs.multisafepay.com/docs/woocommerce 6 6 * Description: MultiSafepay Payment Plugin 7 * Version: 6. 1.27 * Version: 6.2.0 8 8 * Author: MultiSafepay 9 9 * Author URI: https://www.multisafepay.com … … 12 12 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 13 13 * Requires at least: 6.0 14 * Tested up to: 6. 3.114 * Tested up to: 6.4.1 15 15 * WC requires at least: 6.0.0 16 * WC tested up to: 8.2. 116 * WC tested up to: 8.2.2 17 17 * Requires PHP: 7.3 18 18 * Text Domain: multisafepay … … 27 27 * Plugin version 28 28 */ 29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6. 1.2' );29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.2.0' ); 30 30 31 31 /** -
multisafepay/tags/6.2.0/readme.txt
r2981071 r2995309 3 3 Tags: multisafepay, credit card, credit cards, gateway, payments, woocommerce, ideal, bancontact, klarna, sofort, giropay, sepa direct debit 4 4 Requires at least: 6.0 5 Tested up to: 6. 3.15 Tested up to: 6.4.1 6 6 Requires PHP: 7.3 7 Stable tag: 6. 1.27 Stable tag: 6.2.0 8 8 License: MIT 9 9 … … 128 128 == Upgrade Notice == 129 129 130 = 6. 1.2=130 = 6.2.0 = 131 131 6.x.x is a major upgrade in which the MultiSafepay payment methods are registered dynamically via an API request to MultiSafepay. If you are upgrading from 5.X.X version, after the upgrade, please navigate to the MultiSafepay settings page, and to each one of the payment methods enabled in your account, and confirm the settings in each section are set up according to your preferences. 132 132 … … 144 144 145 145 == Changelog == 146 = Release Notes - WooCommerce 6.2.0 (Nov 13th, 2023) = 147 148 ### Added 149 + PLGWOOS-872: Add support for [High-Performance Order Storage](https://woo.com/document/high-performance-order-storage/) 150 146 151 = Release Notes - WooCommerce 6.1.2 (Oct 19th, 2023) = 147 152 -
multisafepay/tags/6.2.0/src/Main.php
r2974626 r2995309 6 6 use MultiSafepay\WooCommerce\PaymentMethods\PaymentMethodsController; 7 7 use MultiSafepay\WooCommerce\Settings\SettingsController; 8 use MultiSafepay\WooCommerce\Settings\ThirdPartyCompatibility; 8 9 use MultiSafepay\WooCommerce\Utils\CustomLinks; 9 10 use MultiSafepay\WooCommerce\Utils\Internationalization; … … 36 37 $this->define_settings_hooks(); 37 38 $this->define_payment_methods_hooks(); 39 $this->define_compatibilities(); 38 40 } 39 41 … … 64 66 } 65 67 68 /** 69 * Define compatibilities with third party plugins 70 * 71 * @return void 72 */ 73 private function define_compatibilities(): void { 74 $compatibilities = new ThirdPartyCompatibility(); 75 $this->loader->add_action( 'before_woocommerce_init', $compatibilities, 'declare_hpos_compatibility' ); 76 } 66 77 67 78 /** -
multisafepay/tags/6.2.0/src/PaymentMethods/Base/BaseRefunds.php
r2974626 r2995309 26 26 * 27 27 * @return mixed boolean|WP_Error 28 * 29 * @throws ClientExceptionInterface 28 30 */ 29 31 public function process_refund( $order_id, $amount = null, $reason = '' ) { … … 51 53 $refund_request->addDescriptionText( $reason ); 52 54 53 // If the used gateway is a billing suite gateway, or the generic requiring shopping cart, create the refund based on items 54 if ( 55 (bool) get_post_meta( $order->get_id(), 'order_require_shopping_cart', true ) || 56 $multisafepay_transaction->requiresShoppingCart() 57 ) { 58 55 if ( $multisafepay_transaction->requiresShoppingCart() ) { 59 56 $refunds = $order->get_refunds(); 60 57 $refund_merchant_item_id = reset( $refunds )->id; -
multisafepay/tags/6.2.0/src/PaymentMethods/PaymentMethodCallback.php
r2981071 r2995309 11 11 use MultiSafepay\WooCommerce\Utils\Logger; 12 12 use Psr\Http\Client\ClientExceptionInterface; 13 use WC_Data_Exception; 13 14 use WC_Order; 14 15 … … 185 186 * 186 187 * @return void 188 * @throws WC_Data_Exception 187 189 */ 188 190 public function process_callback(): void { … … 233 235 $default_order_status = SettingsFields::get_multisafepay_order_statuses(); 234 236 235 // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page236 if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {237 if ( get_option( 'multisafepay_debugmode', false ) ) {238 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';239 Logger::log_info( $message );240 $this->order->add_order_note( $message );241 }242 update_post_meta( $this->woocommerce_order_id, '_payment_method', $payment_method_id_registered_by_multisafepay );243 update_post_meta( $this->woocommerce_order_id, '_payment_method_title', $payment_method_title_registered_by_multisafepay );244 }245 246 237 // Check if the WooCommerce Order status do not match with the order status received in notification, to avoid to process repeated of notification. 247 238 // Or if the custom initial order status of the gateway is different than the general one, and the MultiSafepay transaction status is initialized, and custom initial order status is different than the current WooCommerce order status … … 282 273 } 283 274 275 // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page 276 if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) { 277 if ( get_option( 'multisafepay_debugmode', false ) ) { 278 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.'; 279 Logger::log_info( $message ); 280 $this->order->add_order_note( $message ); 281 } 282 283 $this->order = wc_get_order( $this->woocommerce_order_id ); 284 $this->order->set_payment_method( $registered_by_multisafepay_payment_method_object ); 285 $this->order->save(); 286 } 287 284 288 header( 'Content-type: text/plain' ); 285 289 die( 'OK' ); -
multisafepay/tags/6.2.0/src/PaymentMethods/PaymentMethodsController.php
r2974626 r2995309 11 11 use MultiSafepay\WooCommerce\Services\PaymentMethodService; 12 12 use MultiSafepay\WooCommerce\Services\SdkService; 13 use MultiSafepay\WooCommerce\Utils\Hpos; 13 14 use MultiSafepay\WooCommerce\Utils\Logger; 14 15 use Psr\Http\Client\ClientExceptionInterface; … … 212 213 * Takes an order generated in admin and pass the data to MultiSafepay to process the order request. 213 214 * 214 * @param int $order_id 215 * @return void 215 * @param int $order_id 216 * 217 * @return void 218 * @throws ClientExceptionInterface 216 219 */ 217 220 public function generate_orders_from_backend( int $order_id ): void { … … 243 246 244 247 if ( $transaction->getPaymentUrl() ) { 245 // Update order meta data with the payment link246 update_post_meta( $order_id, 'payment_url', $transaction->getPaymentUrl() );247 update_post_meta( $order_id, 'send_payment_link', '1' );248 // Update order metadata with the payment link 249 Hpos::update_meta( $order, 'payment_url', $transaction->getPaymentUrl() ); 250 Hpos::update_meta( $order, 'send_payment_link', '1' ); 248 251 249 252 if ( get_option( 'multisafepay_debugmode', false ) ) { … … 258 261 * @param string $default_payment_link 259 262 * @param WC_Order $order 263 * 264 * @return mixed|string 260 265 */ 261 266 public function replace_checkout_payment_url( string $default_payment_link, WC_Order $order ) { 262 $send_payment_link = get_post_meta( $order->get_id(), 'send_payment_link', true);267 $send_payment_link = Hpos::get_meta( $order, 'send_payment_link' ); 263 268 if ( $send_payment_link ) { 264 return get_post_meta( $order->get_id(), 'payment_url', true ); 265 } 266 269 return Hpos::get_meta( $order, 'payment_url' ); 270 } 267 271 return $default_payment_link; 268 272 } -
multisafepay/tags/6.2.0/src/Services/ShoppingCartService.php
r2974626 r2995309 6 6 use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\Item as CartItem; 7 7 use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\ShippingItem; 8 use MultiSafepay\WooCommerce\Utils\Hpos; 8 9 use MultiSafepay\WooCommerce\Utils\Logger; 9 10 use MultiSafepay\WooCommerce\Utils\MoneyUtil; … … 120 121 } 121 122 122 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {123 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 123 124 return 0; 124 125 } … … 164 165 } 165 166 166 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {167 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 167 168 return 0; 168 169 } … … 206 207 } 207 208 208 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {209 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 209 210 return 0; 210 211 } … … 228 229 * Returns if order is VAT exempt via WC->Customer->is_vat_exempt 229 230 * 230 * @param int $order_id231 * @param WC_Order $order 231 232 * @return boolean 232 233 */ 233 private function is_order_vat_exempt( int $order_id ): bool { 234 if ( get_post_meta( $order_id, 'is_vat_exempt', true ) === 'yes' ) { 235 return true; 236 } 237 return false; 234 public function is_order_vat_exempt( WC_Order $order ): bool { 235 return Hpos::get_meta( $order, 'is_vat_exempt' ) === 'yes'; 238 236 } 239 237 -
multisafepay/tags/6.2.0/vendor/composer/installed.json
r2979525 r2995309 59 59 { 60 60 "name": "nyholm/psr7", 61 "version": "1.8. 0",62 "version_normalized": "1.8. 0.0",61 "version": "1.8.1", 62 "version_normalized": "1.8.1.0", 63 63 "source": { 64 64 "type": "git", 65 65 "url": "https://github.com/Nyholm/psr7.git", 66 "reference": " 3cb4d163b58589e47b35103e8e5e6a6a475b47be"67 }, 68 "dist": { 69 "type": "zip", 70 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/ 3cb4d163b58589e47b35103e8e5e6a6a475b47be",71 "reference": " 3cb4d163b58589e47b35103e8e5e6a6a475b47be",66 "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e" 67 }, 68 "dist": { 69 "type": "zip", 70 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/aa5fc277a4f5508013d571341ade0c3886d4d00e", 71 "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e", 72 72 "shasum": "" 73 73 }, … … 89 89 "symfony/error-handler": "^4.4" 90 90 }, 91 "time": "2023- 05-02T11:26:24+00:00",91 "time": "2023-11-13T09:31:12+00:00", 92 92 "type": "library", 93 93 "extra": { … … 124 124 "support": { 125 125 "issues": "https://github.com/Nyholm/psr7/issues", 126 "source": "https://github.com/Nyholm/psr7/tree/1.8. 0"126 "source": "https://github.com/Nyholm/psr7/tree/1.8.1" 127 127 }, 128 128 "funding": [ -
multisafepay/tags/6.2.0/vendor/composer/installed.php
r2981071 r2995309 2 2 'root' => array( 3 3 'name' => 'multisafepay/woocommerce', 4 'pretty_version' => '6. 1.2',5 'version' => '6. 1.2.0',6 'reference' => ' 86dc85f0c559e73d73bcd3491cf5fab269e39733',4 'pretty_version' => '6.2.0', 5 'version' => '6.2.0.0', 6 'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'multisafepay/woocommerce' => array( 23 'pretty_version' => '6. 1.2',24 'version' => '6. 1.2.0',25 'reference' => ' 86dc85f0c559e73d73bcd3491cf5fab269e39733',23 'pretty_version' => '6.2.0', 24 'version' => '6.2.0.0', 25 'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'nyholm/psr7' => array( 32 'pretty_version' => '1.8. 0',33 'version' => '1.8. 0.0',34 'reference' => ' 3cb4d163b58589e47b35103e8e5e6a6a475b47be',32 'pretty_version' => '1.8.1', 33 'version' => '1.8.1.0', 34 'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../nyholm/psr7', -
multisafepay/tags/6.2.0/vendor/nyholm/psr7/src/Stream.php
r2927749 r2995309 261 261 } 262 262 263 if (false === $contents = @\stream_get_contents($this->stream)) { 264 throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? '')); 265 } 266 267 return $contents; 263 $exception = null; 264 265 \set_error_handler(static function ($type, $message) use (&$exception) { 266 throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message); 267 }); 268 269 try { 270 return \stream_get_contents($this->stream); 271 } catch (\Throwable $e) { 272 throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e); 273 } finally { 274 \restore_error_handler(); 275 } 268 276 } 269 277 -
multisafepay/trunk/multisafepay.php
r2981071 r2995309 5 5 * Plugin URI: https://docs.multisafepay.com/docs/woocommerce 6 6 * Description: MultiSafepay Payment Plugin 7 * Version: 6. 1.27 * Version: 6.2.0 8 8 * Author: MultiSafepay 9 9 * Author URI: https://www.multisafepay.com … … 12 12 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 13 13 * Requires at least: 6.0 14 * Tested up to: 6. 3.114 * Tested up to: 6.4.1 15 15 * WC requires at least: 6.0.0 16 * WC tested up to: 8.2. 116 * WC tested up to: 8.2.2 17 17 * Requires PHP: 7.3 18 18 * Text Domain: multisafepay … … 27 27 * Plugin version 28 28 */ 29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6. 1.2' );29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.2.0' ); 30 30 31 31 /** -
multisafepay/trunk/readme.txt
r2981071 r2995309 3 3 Tags: multisafepay, credit card, credit cards, gateway, payments, woocommerce, ideal, bancontact, klarna, sofort, giropay, sepa direct debit 4 4 Requires at least: 6.0 5 Tested up to: 6. 3.15 Tested up to: 6.4.1 6 6 Requires PHP: 7.3 7 Stable tag: 6. 1.27 Stable tag: 6.2.0 8 8 License: MIT 9 9 … … 128 128 == Upgrade Notice == 129 129 130 = 6. 1.2=130 = 6.2.0 = 131 131 6.x.x is a major upgrade in which the MultiSafepay payment methods are registered dynamically via an API request to MultiSafepay. If you are upgrading from 5.X.X version, after the upgrade, please navigate to the MultiSafepay settings page, and to each one of the payment methods enabled in your account, and confirm the settings in each section are set up according to your preferences. 132 132 … … 144 144 145 145 == Changelog == 146 = Release Notes - WooCommerce 6.2.0 (Nov 13th, 2023) = 147 148 ### Added 149 + PLGWOOS-872: Add support for [High-Performance Order Storage](https://woo.com/document/high-performance-order-storage/) 150 146 151 = Release Notes - WooCommerce 6.1.2 (Oct 19th, 2023) = 147 152 -
multisafepay/trunk/src/Main.php
r2974626 r2995309 6 6 use MultiSafepay\WooCommerce\PaymentMethods\PaymentMethodsController; 7 7 use MultiSafepay\WooCommerce\Settings\SettingsController; 8 use MultiSafepay\WooCommerce\Settings\ThirdPartyCompatibility; 8 9 use MultiSafepay\WooCommerce\Utils\CustomLinks; 9 10 use MultiSafepay\WooCommerce\Utils\Internationalization; … … 36 37 $this->define_settings_hooks(); 37 38 $this->define_payment_methods_hooks(); 39 $this->define_compatibilities(); 38 40 } 39 41 … … 64 66 } 65 67 68 /** 69 * Define compatibilities with third party plugins 70 * 71 * @return void 72 */ 73 private function define_compatibilities(): void { 74 $compatibilities = new ThirdPartyCompatibility(); 75 $this->loader->add_action( 'before_woocommerce_init', $compatibilities, 'declare_hpos_compatibility' ); 76 } 66 77 67 78 /** -
multisafepay/trunk/src/PaymentMethods/Base/BaseRefunds.php
r2974626 r2995309 26 26 * 27 27 * @return mixed boolean|WP_Error 28 * 29 * @throws ClientExceptionInterface 28 30 */ 29 31 public function process_refund( $order_id, $amount = null, $reason = '' ) { … … 51 53 $refund_request->addDescriptionText( $reason ); 52 54 53 // If the used gateway is a billing suite gateway, or the generic requiring shopping cart, create the refund based on items 54 if ( 55 (bool) get_post_meta( $order->get_id(), 'order_require_shopping_cart', true ) || 56 $multisafepay_transaction->requiresShoppingCart() 57 ) { 58 55 if ( $multisafepay_transaction->requiresShoppingCart() ) { 59 56 $refunds = $order->get_refunds(); 60 57 $refund_merchant_item_id = reset( $refunds )->id; -
multisafepay/trunk/src/PaymentMethods/PaymentMethodCallback.php
r2981071 r2995309 11 11 use MultiSafepay\WooCommerce\Utils\Logger; 12 12 use Psr\Http\Client\ClientExceptionInterface; 13 use WC_Data_Exception; 13 14 use WC_Order; 14 15 … … 185 186 * 186 187 * @return void 188 * @throws WC_Data_Exception 187 189 */ 188 190 public function process_callback(): void { … … 233 235 $default_order_status = SettingsFields::get_multisafepay_order_statuses(); 234 236 235 // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page236 if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {237 if ( get_option( 'multisafepay_debugmode', false ) ) {238 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';239 Logger::log_info( $message );240 $this->order->add_order_note( $message );241 }242 update_post_meta( $this->woocommerce_order_id, '_payment_method', $payment_method_id_registered_by_multisafepay );243 update_post_meta( $this->woocommerce_order_id, '_payment_method_title', $payment_method_title_registered_by_multisafepay );244 }245 246 237 // Check if the WooCommerce Order status do not match with the order status received in notification, to avoid to process repeated of notification. 247 238 // Or if the custom initial order status of the gateway is different than the general one, and the MultiSafepay transaction status is initialized, and custom initial order status is different than the current WooCommerce order status … … 282 273 } 283 274 275 // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page 276 if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) { 277 if ( get_option( 'multisafepay_debugmode', false ) ) { 278 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.'; 279 Logger::log_info( $message ); 280 $this->order->add_order_note( $message ); 281 } 282 283 $this->order = wc_get_order( $this->woocommerce_order_id ); 284 $this->order->set_payment_method( $registered_by_multisafepay_payment_method_object ); 285 $this->order->save(); 286 } 287 284 288 header( 'Content-type: text/plain' ); 285 289 die( 'OK' ); -
multisafepay/trunk/src/PaymentMethods/PaymentMethodsController.php
r2974626 r2995309 11 11 use MultiSafepay\WooCommerce\Services\PaymentMethodService; 12 12 use MultiSafepay\WooCommerce\Services\SdkService; 13 use MultiSafepay\WooCommerce\Utils\Hpos; 13 14 use MultiSafepay\WooCommerce\Utils\Logger; 14 15 use Psr\Http\Client\ClientExceptionInterface; … … 212 213 * Takes an order generated in admin and pass the data to MultiSafepay to process the order request. 213 214 * 214 * @param int $order_id 215 * @return void 215 * @param int $order_id 216 * 217 * @return void 218 * @throws ClientExceptionInterface 216 219 */ 217 220 public function generate_orders_from_backend( int $order_id ): void { … … 243 246 244 247 if ( $transaction->getPaymentUrl() ) { 245 // Update order meta data with the payment link246 update_post_meta( $order_id, 'payment_url', $transaction->getPaymentUrl() );247 update_post_meta( $order_id, 'send_payment_link', '1' );248 // Update order metadata with the payment link 249 Hpos::update_meta( $order, 'payment_url', $transaction->getPaymentUrl() ); 250 Hpos::update_meta( $order, 'send_payment_link', '1' ); 248 251 249 252 if ( get_option( 'multisafepay_debugmode', false ) ) { … … 258 261 * @param string $default_payment_link 259 262 * @param WC_Order $order 263 * 264 * @return mixed|string 260 265 */ 261 266 public function replace_checkout_payment_url( string $default_payment_link, WC_Order $order ) { 262 $send_payment_link = get_post_meta( $order->get_id(), 'send_payment_link', true);267 $send_payment_link = Hpos::get_meta( $order, 'send_payment_link' ); 263 268 if ( $send_payment_link ) { 264 return get_post_meta( $order->get_id(), 'payment_url', true ); 265 } 266 269 return Hpos::get_meta( $order, 'payment_url' ); 270 } 267 271 return $default_payment_link; 268 272 } -
multisafepay/trunk/src/Services/ShoppingCartService.php
r2974626 r2995309 6 6 use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\Item as CartItem; 7 7 use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\ShippingItem; 8 use MultiSafepay\WooCommerce\Utils\Hpos; 8 9 use MultiSafepay\WooCommerce\Utils\Logger; 9 10 use MultiSafepay\WooCommerce\Utils\MoneyUtil; … … 120 121 } 121 122 122 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {123 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 123 124 return 0; 124 125 } … … 164 165 } 165 166 166 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {167 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 167 168 return 0; 168 169 } … … 206 207 } 207 208 208 if ( $this->is_order_vat_exempt( $item->get_order _id() ) ) {209 if ( $this->is_order_vat_exempt( $item->get_order() ) ) { 209 210 return 0; 210 211 } … … 228 229 * Returns if order is VAT exempt via WC->Customer->is_vat_exempt 229 230 * 230 * @param int $order_id231 * @param WC_Order $order 231 232 * @return boolean 232 233 */ 233 private function is_order_vat_exempt( int $order_id ): bool { 234 if ( get_post_meta( $order_id, 'is_vat_exempt', true ) === 'yes' ) { 235 return true; 236 } 237 return false; 234 public function is_order_vat_exempt( WC_Order $order ): bool { 235 return Hpos::get_meta( $order, 'is_vat_exempt' ) === 'yes'; 238 236 } 239 237 -
multisafepay/trunk/vendor/composer/installed.json
r2979525 r2995309 59 59 { 60 60 "name": "nyholm/psr7", 61 "version": "1.8. 0",62 "version_normalized": "1.8. 0.0",61 "version": "1.8.1", 62 "version_normalized": "1.8.1.0", 63 63 "source": { 64 64 "type": "git", 65 65 "url": "https://github.com/Nyholm/psr7.git", 66 "reference": " 3cb4d163b58589e47b35103e8e5e6a6a475b47be"67 }, 68 "dist": { 69 "type": "zip", 70 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/ 3cb4d163b58589e47b35103e8e5e6a6a475b47be",71 "reference": " 3cb4d163b58589e47b35103e8e5e6a6a475b47be",66 "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e" 67 }, 68 "dist": { 69 "type": "zip", 70 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/aa5fc277a4f5508013d571341ade0c3886d4d00e", 71 "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e", 72 72 "shasum": "" 73 73 }, … … 89 89 "symfony/error-handler": "^4.4" 90 90 }, 91 "time": "2023- 05-02T11:26:24+00:00",91 "time": "2023-11-13T09:31:12+00:00", 92 92 "type": "library", 93 93 "extra": { … … 124 124 "support": { 125 125 "issues": "https://github.com/Nyholm/psr7/issues", 126 "source": "https://github.com/Nyholm/psr7/tree/1.8. 0"126 "source": "https://github.com/Nyholm/psr7/tree/1.8.1" 127 127 }, 128 128 "funding": [ -
multisafepay/trunk/vendor/composer/installed.php
r2981071 r2995309 2 2 'root' => array( 3 3 'name' => 'multisafepay/woocommerce', 4 'pretty_version' => '6. 1.2',5 'version' => '6. 1.2.0',6 'reference' => ' 86dc85f0c559e73d73bcd3491cf5fab269e39733',4 'pretty_version' => '6.2.0', 5 'version' => '6.2.0.0', 6 'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'multisafepay/woocommerce' => array( 23 'pretty_version' => '6. 1.2',24 'version' => '6. 1.2.0',25 'reference' => ' 86dc85f0c559e73d73bcd3491cf5fab269e39733',23 'pretty_version' => '6.2.0', 24 'version' => '6.2.0.0', 25 'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'nyholm/psr7' => array( 32 'pretty_version' => '1.8. 0',33 'version' => '1.8. 0.0',34 'reference' => ' 3cb4d163b58589e47b35103e8e5e6a6a475b47be',32 'pretty_version' => '1.8.1', 33 'version' => '1.8.1.0', 34 'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../nyholm/psr7', -
multisafepay/trunk/vendor/nyholm/psr7/src/Stream.php
r2927749 r2995309 261 261 } 262 262 263 if (false === $contents = @\stream_get_contents($this->stream)) { 264 throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? '')); 265 } 266 267 return $contents; 263 $exception = null; 264 265 \set_error_handler(static function ($type, $message) use (&$exception) { 266 throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message); 267 }); 268 269 try { 270 return \stream_get_contents($this->stream); 271 } catch (\Throwable $e) { 272 throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e); 273 } finally { 274 \restore_error_handler(); 275 } 268 276 } 269 277
Note: See TracChangeset
for help on using the changeset viewer.