Changeset 3398960
- Timestamp:
- 11/19/2025 12:40:56 PM (5 months ago)
- Location:
- svea-checkout-for-woocommerce
- Files:
-
- 6 added
- 26 edited
- 4 copied
-
tags/3.4.0 (copied) (copied from svea-checkout-for-woocommerce/trunk)
-
tags/3.4.0/assets/css/backend (added)
-
tags/3.4.0/assets/css/backend/application.min.css (added)
-
tags/3.4.0/inc/Admin.php (modified) (10 diffs)
-
tags/3.4.0/inc/Models/Svea_Checkout.php (modified) (2 diffs)
-
tags/3.4.0/inc/Models/Svea_Item.php (copied) (copied from svea-checkout-for-woocommerce/trunk/inc/Models/Svea_Item.php)
-
tags/3.4.0/inc/Rule_Integration.php (added)
-
tags/3.4.0/inc/Scripts.php (modified) (1 diff)
-
tags/3.4.0/inc/Template_Handler.php (modified) (3 diffs)
-
tags/3.4.0/inc/WC_Gateway_Svea_Checkout.php (modified) (5 diffs)
-
tags/3.4.0/inc/Webhook_Handler.php (modified) (6 diffs)
-
tags/3.4.0/inc/settings-svea-checkout.php (modified) (2 diffs)
-
tags/3.4.0/languages/svea-checkout-for-woocommerce-sv_SE.mo (modified) (previous)
-
tags/3.4.0/languages/svea-checkout-for-woocommerce-sv_SE.po (modified) (1 diff)
-
tags/3.4.0/readme.txt (copied) (copied from svea-checkout-for-woocommerce/trunk/readme.txt) (3 diffs)
-
tags/3.4.0/svea-checkout-for-woocommerce.php (copied) (copied from svea-checkout-for-woocommerce/trunk/svea-checkout-for-woocommerce.php) (4 diffs)
-
tags/3.4.0/templates/backend/metabox.php (modified) (1 diff)
-
tags/3.4.0/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/3.4.0/vendor/composer/autoload_static.php (modified) (4 diffs)
-
trunk/assets/css/backend (added)
-
trunk/assets/css/backend/application.min.css (added)
-
trunk/inc/Admin.php (modified) (10 diffs)
-
trunk/inc/Models/Svea_Checkout.php (modified) (2 diffs)
-
trunk/inc/Rule_Integration.php (added)
-
trunk/inc/Scripts.php (modified) (1 diff)
-
trunk/inc/Template_Handler.php (modified) (3 diffs)
-
trunk/inc/WC_Gateway_Svea_Checkout.php (modified) (5 diffs)
-
trunk/inc/Webhook_Handler.php (modified) (6 diffs)
-
trunk/inc/settings-svea-checkout.php (modified) (2 diffs)
-
trunk/languages/svea-checkout-for-woocommerce-sv_SE.mo (modified) (previous)
-
trunk/languages/svea-checkout-for-woocommerce-sv_SE.po (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/svea-checkout-for-woocommerce.php (modified) (4 diffs)
-
trunk/templates/backend/metabox.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_static.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
svea-checkout-for-woocommerce/tags/3.4.0/inc/Admin.php
r3359045 r3398960 27 27 28 28 /** 29 * Awaiting Svea leasing approval order status 30 */ 31 const AWAITING_LEASING_ORDER_STATUS = 'svea-leasing'; 32 33 /** 34 * Awaiting Svea leasing approval order status (full key) 35 */ 36 const AWAITING_LEASING_ORDER_STATUS_FULL = 'wc-svea-leasing'; 37 38 /** 29 39 * Order items that have been removed in this request 30 40 * This is used since Svea has a delay in updating their API … … 72 82 add_filter( 'woocommerce_email_actions', [ $this, 'allow_email_trigger' ] ); 73 83 74 // Allow emails to be sent when going from awaiting s veato processing84 // Allow emails to be sent when going from awaiting statuses to processing 75 85 add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 ); 76 86 add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed_notification', [ $this, 'add_completed_email_trigger' ], 10, 2 ); 87 add_action( 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 ); 88 add_action( 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed_notification', [ $this, 'add_completed_email_trigger' ], 10, 2 ); 89 90 add_action( 'woocommerce_admin_order_data_after_order_details', [ $this, 'maybe_add_leasing_information' ], 150 ); 77 91 78 92 add_action( 'sco_check_pa_order_status', [ $this, 'cron_check_pa_order_status' ] ); 79 93 80 add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_s vea_status_to_be_completed' ] );94 add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_statuses_to_be_completed' ] ); 81 95 82 96 add_action( 'wp_ajax_sco-check-order-status', [ $this, 'ajax_check_order_status' ] ); … … 94 108 add_action( 'woocommerce_process_product_meta', [ $this, 'save_product_fields' ] ); 95 109 add_action( 'woocommerce_save_product_variation', [ $this, 'save_variation_fields' ] ); 110 } 111 112 /** 113 * Maybe display information about leasing on the order edit page 114 * 115 * @param \WC_Order $wc_order 116 * @return void 117 */ 118 public function maybe_add_leasing_information( $wc_order ) { 119 $is_leasing = $wc_order->get_status() === self::AWAITING_LEASING_ORDER_STATUS; 120 if ( ! $is_leasing ) { 121 return; 122 } 123 ?> 124 <p class="svea-leasing-information"> 125 <strong><?php esc_html_e( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ); ?></strong><br> 126 <?php esc_html_e( 'Review this leasing agreement in StorePay. Once it is approved manually, move the order to processing or completed.', 'svea-checkout-for-woocommerce' ); ?> 127 </p> 128 <?php 96 129 } 97 130 … … 312 345 313 346 /** 314 * Allow the awaiting s vea status to be completed347 * Allow the awaiting statuses to be completed 315 348 * 316 349 * @param string[] $statuses 317 350 * @return string[] 318 351 */ 319 public function allow_awaiting_s vea_status_to_be_completed( $statuses ) {352 public function allow_awaiting_statuses_to_be_completed( $statuses ) { 320 353 $statuses[] = self::AWAITING_ORDER_STATUS; 321 return $statuses; 354 $statuses[] = self::AWAITING_LEASING_ORDER_STATUS; 355 return array_unique( $statuses ); 322 356 } 323 357 … … 383 417 // From pending to awaiting 384 418 $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_ORDER_STATUS; 419 $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_LEASING_ORDER_STATUS; 385 420 386 421 // From awaiting to processing 387 422 $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing'; 423 $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing'; 388 424 389 425 // From awaiting to completed 390 426 $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed'; 427 $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed'; 391 428 392 429 return $actions; … … 401 438 public function add_order_status( $statuses ) { 402 439 $statuses[ self::AWAITING_ORDER_STATUS_FULL ] = esc_html__( 'Awaiting status', 'svea-checkout-for-woocommerce' ); 440 $statuses[ self::AWAITING_LEASING_ORDER_STATUS_FULL ] = esc_html__( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ); 403 441 404 442 return $statuses; … … 434 472 ]; 435 473 474 $statuses[ self::AWAITING_LEASING_ORDER_STATUS_FULL ] = [ 475 'label' => esc_html__( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ), 476 'public' => true, 477 'show_in_admin_status_list' => true, 478 'show_in_admin_all_list' => true, 479 'exclude_from_search' => false, 480 /* translators: %s is the number of posts found */ 481 'label_count' => _n_noop( 'Leasing awaiting approval <span class="count">(%s)</span>', 'Leasing awaiting approval <span class="count">(%s)</span>' ), 482 ]; 483 436 484 return $statuses; 437 485 } … … 459 507 public static function save_refs( $wc_order, $svea_order ) { 460 508 if ( $svea_order['IsCompany'] ) { 509 $gateway = WC_Gateway_Svea_Checkout::get_instance(); 510 $use_company_name_as_full_name = $gateway->get_option( 'use_company_name_as_full_name' ) === 'yes'; 511 $billing_full_name = wc_clean( $svea_order['BillingAddress']['FullName'] ?? '' ); 512 $shipping_full_name = wc_clean( $svea_order['ShippingAddress']['FullName'] ?? '' ); 461 513 $ref = wc_clean( $svea_order['CustomerReference'] ); 462 514 … … 467 519 if ( $svea_order['PaymentType'] === 'Invoice' && ! empty( $svea_order['BillingReferences'] ) ) { 468 520 // Get billing reference name 469 $gateway = WC_Gateway_Svea_Checkout::get_instance();470 521 foreach ( $svea_order['BillingReferences'] as $reference ) { 471 522 $svea_ref = $gateway->get_billing_reference_value( $reference['Type'] ); … … 494 545 $wc_order->update_meta_data( '_svea_co_company_reg_number', $reg_nr ); 495 546 496 // Save reference as name 497 $name = Helper::split_customer_name( $ref ); 547 // Save reference or company name as WooCommerce name 548 if ( $use_company_name_as_full_name && ! empty( $billing_full_name ) ) { 549 $billing_name = [ 550 'first_name' => $billing_full_name, 551 'last_name' => '', 552 ]; 553 } else { 554 $billing_name = Helper::split_customer_name( $ref ); 555 } 556 557 $wc_order->set_billing_first_name( $billing_name['first_name'] ); 558 $wc_order->set_billing_last_name( $billing_name['last_name'] ); 559 $wc_order->set_billing_company( $billing_full_name ); 560 561 if ( $wc_order->needs_shipping_address() ) { 562 if ( $use_company_name_as_full_name && ! empty( $shipping_full_name ) ) { 563 $shipping_name = [ 564 'first_name' => $shipping_full_name, 565 'last_name' => '', 566 ]; 567 } else { 568 $shipping_name = $billing_name; 569 } 570 571 $wc_order->set_shipping_first_name( $shipping_name['first_name'] ); 572 $wc_order->set_shipping_last_name( $shipping_name['last_name'] ); 573 $wc_order->set_shipping_company( $shipping_full_name ); 574 } 575 } else { 576 // Always use the provided names for individuals 577 $name = Helper::split_customer_name( $svea_order['ShippingAddress']['FullName'] ); 578 579 $wc_order->set_shipping_first_name( $name['first_name'] ); 580 $wc_order->set_shipping_last_name( $name['last_name'] ); 581 $wc_order->set_shipping_address_1( wc_clean( $svea_order['ShippingAddress']['StreetAddress'] ) ); 582 $wc_order->set_shipping_address_2( wc_clean( $svea_order['ShippingAddress']['CoAddress'] ) ); 583 $wc_order->set_shipping_city( wc_clean( $svea_order['ShippingAddress']['City'] ) ); 584 $wc_order->set_shipping_postcode( wc_clean( $svea_order['ShippingAddress']['PostalCode'] ) ); 585 $wc_order->set_shipping_country( wc_clean( $svea_order['ShippingAddress']['CountryCode'] ) ); 586 587 $name = Helper::split_customer_name( $svea_order['BillingAddress']['FullName'] ); 498 588 499 589 $wc_order->set_billing_first_name( $name['first_name'] ); 500 590 $wc_order->set_billing_last_name( $name['last_name'] ); 501 $wc_order->set_billing_company( wc_clean( $svea_order['BillingAddress']['FullName'] ) ); 502 503 if ( $wc_order->needs_shipping_address() ) { 504 $wc_order->set_shipping_first_name( $name['first_name'] ); 505 $wc_order->set_shipping_last_name( $name['last_name'] ); 506 $wc_order->set_shipping_company( wc_clean( $svea_order['ShippingAddress']['FullName'] ) ); 507 } 508 } else { 509 if ( $wc_order->needs_shipping_address() ) { 510 $name = Helper::split_customer_name( $svea_order['ShippingAddress']['FullName'] ); 511 512 $wc_order->set_shipping_first_name( $name['first_name'] ); 513 $wc_order->set_shipping_last_name( $name['last_name'] ); 514 $wc_order->set_shipping_address_1( wc_clean( $svea_order['ShippingAddress']['StreetAddress'] ) ); 515 $wc_order->set_shipping_address_2( wc_clean( $svea_order['ShippingAddress']['CoAddress'] ) ); 516 $wc_order->set_shipping_city( wc_clean( $svea_order['ShippingAddress']['City'] ) ); 517 $wc_order->set_shipping_postcode( wc_clean( $svea_order['ShippingAddress']['PostalCode'] ) ); 518 $wc_order->set_shipping_country( wc_clean( $svea_order['ShippingAddress']['CountryCode'] ) ); 519 } 591 $wc_order->set_billing_address_1( wc_clean( $svea_order['BillingAddress']['StreetAddress'] ) ); 592 $wc_order->set_billing_address_2( wc_clean( $svea_order['BillingAddress']['CoAddress'] ) ); 593 $wc_order->set_billing_city( wc_clean( $svea_order['BillingAddress']['City'] ) ); 594 $wc_order->set_billing_postcode( wc_clean( $svea_order['BillingAddress']['PostalCode'] ) ); 595 $wc_order->set_billing_country( wc_clean( $svea_order['BillingAddress']['CountryCode'] ) ); 520 596 } 521 597 -
svea-checkout-for-woocommerce/tags/3.4.0/inc/Models/Svea_Checkout.php
r3385269 r3398960 541 541 public function create_temp_client_id( $data ): string { 542 542 $string = is_array( $data ) ? implode( '', $data ) : $data; 543 544 $full_hash = hash( 'sha256', $string, true ); 545 $digest_24_chars = substr( $full_hash, 0, 24 ); 546 547 // base64 encode to get a-z, A-Z, 0-9, - and _ characters. This will give 32 characters. 548 $hash_string = rtrim( strtr( base64_encode( $digest_24_chars ), '+/', '-_' ), '=' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 549 550 return $hash_string; 543 return md5( $string ); 551 544 } 552 545 … … 770 763 */ 771 764 public function get_current_cart_hash() { 765 $args = [ 766 $this->get_items(), 767 WC()->cart->get_total(), 768 $this->get_min_age(), 769 $this->get_plugin_version(), 770 ]; 771 772 772 return apply_filters( 773 773 'woocommerce_sco_cart_hash', 774 md5( 775 wp_json_encode( 776 [ 777 $this->get_items(), 778 WC()->cart->get_total(), 779 $this->get_min_age(), 780 $this->get_plugin_version(), 781 ] 782 ) 783 ) 774 md5( wp_json_encode( $args ) ), 775 $args, 784 776 ); 785 777 } -
svea-checkout-for-woocommerce/tags/3.4.0/inc/Scripts.php
r3202226 r3398960 28 28 public function enqueue_admin_scripts( $hook ) { 29 29 wp_enqueue_script( 'svea-checkout-for-woocommerce-admin', plugins_url( 'assets/js/backend/application.min.js', SVEA_CHECKOUT_FOR_WOOCOMMERCE_FILE ), [], Plugin::VERSION, true ); 30 30 wp_enqueue_style( 'svea-checkout-for-woocommerce-admin', plugins_url( 'assets/css/backend/application.min.css', SVEA_CHECKOUT_FOR_WOOCOMMERCE_FILE ), [], Plugin::VERSION ); 31 31 $post_id = null; 32 32 -
svea-checkout-for-woocommerce/tags/3.4.0/inc/Template_Handler.php
r3324844 r3398960 701 701 do_action( 'woocommerce_sco_session_data' ); 702 702 703 $country_changed = ( WC()->customer->get_billing_country() !== $_POST['billing_country'] ?: '' ) ? true : false; 703 $posted_billing_country = isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : ''; 704 $country_changed = WC()->customer->get_billing_country() !== $posted_billing_country; 704 705 705 706 $props = [ 706 'billing_country' => isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '',707 'shipping_country' => isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '',707 'billing_country' => $posted_billing_country, 708 'shipping_country' => $posted_billing_country, 708 709 ]; 709 710 710 711 // "••••" would be a known customer and we'll use the postcode from the checkout instead 711 if ( isset( $_POST['billing_postcode'] ) && $_POST['billing_postcode'] !== '••••' ) { 712 $props['billing_postcode'] = sanitize_text_field( $_POST['billing_postcode'] ); 713 $props['shipping_postcode'] = sanitize_text_field( $_POST['billing_postcode'] ); 712 $posted_billing_postcode = isset( $_POST['billing_postcode'] ) ? sanitize_text_field( $_POST['billing_postcode'] ) : ''; 713 714 if ( ! empty( $posted_billing_postcode ) && $posted_billing_postcode !== '••••' ) { 715 $props['billing_postcode'] = $posted_billing_postcode; 716 $props['shipping_postcode'] = $posted_billing_postcode; 714 717 } 715 718 … … 792 795 } 793 796 797 do_action( 'woocommerce_sco_session_module_data', $svea_checkout_module ); 798 794 799 // Get messages if reload checkout is not true 795 800 $messages = ''; … … 843 848 } 844 849 850 do_action( 'woocommerce_sco_after_refresh_sco_snippet', $svea_checkout_module ); 851 845 852 wp_send_json( 846 853 [ -
svea-checkout-for-woocommerce/tags/3.4.0/inc/WC_Gateway_Svea_Checkout.php
r3359045 r3398960 25 25 26 26 /** 27 * Gateway ID28 *29 * @var string30 */27 * Gateway ID 28 * 29 * @var string 30 */ 31 31 const GATEWAY_ID = 'svea_checkout'; 32 32 … … 270 270 271 271 /** 272 * @var bool Whether or not to display the product widget273 */272 * @var bool Whether or not to display the product widget 273 */ 274 274 public $display_product_widget; 275 276 /** 277 * Whether the Rule integration is enabled. 278 * 279 * @var bool 280 */ 281 private $rule_integration_enabled = false; 282 283 /** 284 * Rule API key. 285 * 286 * @var string 287 */ 288 private $rule_api_key = ''; 275 289 276 290 /** … … 399 413 'MOBILEPAY' => esc_html__( 'Mobilepay', 'svea-checkout-for-woocommerce' ), 400 414 'ZEROSUM' => esc_html__( 'Zero sum', 'svea-checkout-for-woocommerce' ), 415 'LEASINGMANUAL' => esc_html__( 'Leasing', 'svea-checkout-for-woocommerce' ), 416 'APPLEPAY' => esc_html__( 'Apple Pay', 'svea-checkout-for-woocommerce' ), 417 'APPLEPAY_PF' => esc_html__( 'Apple Pay', 'svea-checkout-for-woocommerce' ), 401 418 ]; 402 419 … … 496 513 $this->display_product_widget = apply_filters( 'woocommerce_sco_settings_product_widget', $this->get_option( 'display_product_widget' ) ); 497 514 515 $this->rule_integration_enabled = apply_filters( 'woocommerce_sco_settings_rule_integration_enabled', $this->get_option( 'rule_integration_enabled' ) === 'yes' ); 516 $this->rule_api_key = apply_filters( 'woocommerce_sco_settings_rule_api_key', (string) $this->get_option( 'rule_api_key' ) ); 517 498 518 // Prevent duplicate hooks 499 519 if ( ! self::$hooks_enabled ) { 500 520 $this->add_hooks(); 501 521 } 522 } 523 524 /** 525 * Get the instore expire time in minutes 526 * 527 * @return int 528 */ 529 public function get_instore_link_expire_minutes() { 530 return (int) $this->instore_link_expire_minutes; 502 531 } 503 532 … … 1924 1953 $refund_amount = (float) $wc_order->get_total( 'edit' ) - (float) $wc_order->get_total_refunded(); 1925 1954 1926 return $this->process_refund( $order_id, $refund_amount ); 1955 return $this->process_refund( $order_id, $refund_amount ); 1956 } 1957 1958 /** 1959 * Check if the Rule integration is enabled and has credentials. 1960 * 1961 * @return bool 1962 */ 1963 public function is_rule_integration_enabled() { 1964 return (bool) $this->rule_integration_enabled && ! empty( $this->rule_api_key ); 1965 } 1966 1967 /** 1968 * Get the configured Rule API key. 1969 * 1970 * @return string 1971 */ 1972 public function get_rule_api_key() { 1973 return $this->rule_api_key; 1927 1974 } 1928 1975 -
svea-checkout-for-woocommerce/tags/3.4.0/inc/Webhook_Handler.php
r3353744 r3398960 34 34 */ 35 35 private static $svea_order; 36 37 /** 38 * Svea Checkout order response 39 * 40 * @var array 41 */ 42 private $checkout_order = []; 36 43 37 44 /** … … 403 410 404 411 /** 412 * Get Svea Checkout order data 413 * 414 * @param \WC_Order $wc_order 415 * @return array 416 */ 417 private function get_svea_order_by_checkout( $wc_order ) { 418 if ( ! empty( $this->checkout_order ) ) { 419 return $this->checkout_order; 420 } 421 422 $svea_checkout = new Svea_Checkout( false ); 423 $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() ); 424 425 try { 426 $this->checkout_order = $svea_checkout->get( $this->svea_order_id ); 427 } catch ( \Exception $e ) { 428 $this->gateway::log( sprintf( 'Error fetching checkout order %s: %s', $this->svea_order_id, $e->getMessage() ) ); 429 $this->checkout_order = []; 430 } 431 432 return $this->checkout_order; 433 } 434 435 /** 436 * Check if the push should rely on checkout data. 437 * 438 * @param array $checkout_order 439 * @return bool 440 */ 441 private function should_use_checkout_for_push( $checkout_order ) { 442 if ( empty( $checkout_order ) || ! is_array( $checkout_order ) ) { 443 return false; 444 } 445 446 $payment_type = isset( $checkout_order['PaymentType'] ) ? strtoupper( sanitize_text_field( $checkout_order['PaymentType'] ) ) : ''; 447 448 return $payment_type === 'LEASINGMANUAL'; 449 } 450 451 /** 452 * Finalize leasing orders awaiting manual approval. 453 * 454 * @param \WC_Order $wc_order 455 * @param array $checkout_order 456 * @return void 457 */ 458 private function finalize_leasing_order( $wc_order, $checkout_order ) { 459 self::$svea_order = $checkout_order; 460 461 $this->gateway::log( sprintf( 'Svea leasing order %s awaiting manual approval.', $this->svea_order_id ) ); 462 463 $payment_type = isset( $checkout_order['PaymentType'] ) ? strtoupper( sanitize_text_field( $checkout_order['PaymentType'] ) ) : ''; 464 $payment_method_type = ''; 465 466 if ( isset( $checkout_order['Payment']['PaymentMethodType'] ) ) { 467 $payment_method_type = sanitize_text_field( $checkout_order['Payment']['PaymentMethodType'] ); 468 } 469 470 if ( ! empty( $payment_type ) ) { 471 $wc_order->update_meta_data( '_svea_co_svea_payment_type', $payment_type ); 472 } 473 474 if ( ! empty( $payment_method_type ) ) { 475 $wc_order->update_meta_data( '_svea_co_payment_method_type', $payment_method_type ); 476 } 477 478 $method_name = $this->gateway->get_payment_method_name( $payment_type ); 479 480 if ( empty( $method_name ) && ! empty( $payment_method_type ) ) { 481 $method_name = ucfirst( $payment_method_type ); 482 } 483 484 if ( ! empty( $method_name ) ) { 485 $wc_order->set_payment_method_title( sprintf( '%s (%s)', $this->gateway->get_title(), $method_name ) ); 486 $wc_order->update_meta_data( '_svea_co_payment_type', $method_name ); 487 } 488 489 if ( isset( $checkout_order['Customer']['IsCompany'] ) ) { 490 $wc_order->update_meta_data( '_svea_co_is_company', (bool) $checkout_order['Customer']['IsCompany'] ); 491 } 492 493 $wc_order->set_status( Admin::AWAITING_LEASING_ORDER_STATUS ); 494 $wc_order->save(); 495 496 do_action( 'woocommerce_sco_after_push_order_leasing', $wc_order, self::$svea_order ); 497 498 status_header( 200 ); 499 echo 'Order awaiting leasing approval'; // phpcs:ignore 500 die(); 501 } 502 503 /** 405 504 * Process push notifications for the order 406 505 * … … 449 548 $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() ); 450 549 $svea_checkout_order = $svea_checkout->get( $this->svea_order_id ); 550 $this->checkout_order = $svea_checkout_order; 451 551 452 552 // Check if the order is canceled as it could be a push from the checkout for a order that doesn't exist in PA … … 576 676 $this->gateway::log( sprintf( 'Finalizing order: %s', $this->svea_order_id ) ); 577 677 678 $checkout_order = $this->get_svea_order_by_checkout( $wc_order ); 679 680 if ( $this->should_use_checkout_for_push( $checkout_order ) ) { 681 $this->finalize_leasing_order( $wc_order, $checkout_order ); 682 return; 683 } 684 578 685 // Get order from Svea Payment Admin 579 686 self::$svea_order = $this->get_svea_order_by_payment_admin( $wc_order, true ); … … 608 715 $method_name = $this->gateway->get_payment_method_name( $svea_payment_type ); 609 716 717 if ( $svea_payment_type === 'INVOICE' ) { 718 $svea_will_buy_order = null; 719 720 if ( array_key_exists( 'SveaWillBuy', self::$svea_order ) ) { 721 $svea_will_buy_order = self::$svea_order['SveaWillBuy']; 722 } 723 724 if ( $svea_will_buy_order === false ) { 725 $method_name = esc_html__( 'Admin invoice', 'svea-checkout-for-woocommerce' ); 726 } 727 } 728 610 729 if ( ! empty( $method_name ) ) { 611 730 $wc_order->set_payment_method_title( … … 631 750 } else { 632 751 $wc_order->payment_complete( (string) $this->svea_order_id ); 752 do_action( 'woocommerce_sco_checkout_webhook_payment_complete', $wc_order, $this->svea_order_id ); 633 753 } 634 754 -
svea-checkout-for-woocommerce/tags/3.4.0/inc/settings-svea-checkout.php
r3219490 r3398960 55 55 'description' => __( 'Select which customer type you want to be selected by default. Only applicable if the store accepts companies and individuals.', 'svea-checkout-for-woocommerce' ), 56 56 ], 57 'use_company_name_as_full_name' => [ 58 'title' => esc_html__( 'Use company name as complete name', 'svea-checkout-for-woocommerce' ), 59 'label' => esc_html__( 'Use the company name for billing and shipping names on company orders', 'svea-checkout-for-woocommerce' ), 60 'type' => 'checkbox', 61 'default' => 'no', 62 'description' => __( 'When enabled, Svea company orders will populate the WooCommerce name fields with the company name instead of the Svea customer reference.', 'svea-checkout-for-woocommerce' ), 63 'desc_tip' => true, 64 ], 57 65 'preset_value_email_read_only' => [ 58 66 'title' => esc_html__( 'E-mail read-only when logged in', 'svea-checkout-for-woocommerce' ), … … 378 386 'default' => 'no', 379 387 ], 380 // phpcs:ignore Squiz.PHP.CommentedOutCode.Found 388 'rule_integration_hr' => [ 389 'title' => '<hr>', 390 'type' => 'title', 391 ], 392 'rule_integration_title' => [ 393 'title' => esc_html__( 'Rule integration', 'svea-checkout-for-woocommerce' ), 394 'type' => 'title', 395 'description' => esc_html__( 'Enable the Rule marketing automation integration to send abandoned cart data. Some requirements:', 'svea-checkout-for-woocommerce' ) . '<br>' . 396 '- ' . esc_html__( 'A Rule account.', 'svea-checkout-for-woocommerce' ) . '<br>' . 397 '- ' . esc_html__( 'The plugin WP Consent API (used for communicating given consents)', 'svea-checkout-for-woocommerce' ) . '<br>' . 398 '- ' . esc_html__( 'A cookie banner that uses the WP Consent API', 'svea-checkout-for-woocommerce' ) . '<br>' . 399 esc_html__( 'The Rule integration will only be effective if the customer has given consent to marketing.', 'svea-checkout-for-woocommerce' ), 400 ], 401 'rule_integration_enabled' => [ 402 'title' => esc_html__( 'Enable Rule integration', 'svea-checkout-for-woocommerce' ), 403 'label' => esc_html__( 'Send cart and checkout events to Rule for abandoned cart automation.', 'svea-checkout-for-woocommerce' ), 404 'type' => 'checkbox', 405 'default' => 'no', 406 ], 407 'rule_api_key' => [ 408 'title' => esc_html__( 'Rule API key', 'svea-checkout-for-woocommerce' ), 409 'type' => 'password', 410 'description' => esc_html__( 'Enter the API key generated in your Rule account.', 'svea-checkout-for-woocommerce' ), 411 'default' => '', 412 'desc_tip' => true, 413 'sanitize_callback' => [ String_Utils::class, 'remove_whitespace' ], 414 ], 415 // phpcs:ignore Squiz.PHP.CommentedOutCode.Found 381 416 // 'nshift_use_fallback' => [ 382 417 // 'title' => esc_html__( 'Enable nShift fallback options', 'svea-checkout-for-woocommerce' ), -
svea-checkout-for-woocommerce/tags/3.4.0/languages/svea-checkout-for-woocommerce-sv_SE.po
r3359045 r3398960 363 363 msgstr "Faktura" 364 364 365 #: inc/Webhook_Handler.php:614 366 msgid "Admin invoice" 367 msgstr "Admin faktura" 368 365 369 #: inc/WC_Gateway_Svea_Checkout.php:374 366 370 msgid "Payment Plan" -
svea-checkout-for-woocommerce/tags/3.4.0/readme.txt
r3393639 r3398960 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 3. 3.812 Stable tag: 3.4.0 13 13 14 14 Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout! … … 91 91 == Upgrade Notice == 92 92 93 = 3.4.0 = 94 3.4.0 is a minor release 95 93 96 = 3.3.8 = 94 97 3.3.8 is a patch release … … 408 411 409 412 == Changelog == 413 414 = 3.4.0 2025-11-19 = 415 - Rule integration: By enabling Svea Rule in your Svea Checkout settings you can send ongoing orders to Rule and create automated emails if the visitor never checked out their cart. To learn more reach out to Svea Support. 416 - Added support for leasing payment method. Orders using leasing will be set to a new order status "Awaiting leasing approval" 417 - Added option to use company name as full name for company orders 418 - Now shows if an invoice order is made via Svea invoice (regular) or admin invoice (Svea will not buy) 419 - Update billing information based on PaymentAdmin during finalize push 420 - Modified handling of temporary client ID to lower the chance hash collisions 421 - Added label for Apple Pay in admin order view 410 422 411 423 = 3.3.8 2025-11-11 = -
svea-checkout-for-woocommerce/tags/3.4.0/svea-checkout-for-woocommerce.php
r3393639 r3398960 14 14 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/ 15 15 * Description: Process payments in WooCommerce via Svea Checkout. 16 * Version: 3. 3.816 * Version: 3.4.0 17 17 * Requires Plugins: woocommerce 18 18 * Author: The Generation AB … … 47 47 * Version of plugin 48 48 */ 49 const VERSION = '3. 3.8';49 const VERSION = '3.4.0'; 50 50 51 51 /** … … 103 103 */ 104 104 public $compat; 105 106 /** 107 * Rule integration class 108 * 109 * @var Rule_Integration 110 */ 111 public $rule_integration; 105 112 106 113 /** … … 445 452 $this->compat = new Compat(); 446 453 $this->compat->init(); 454 455 $this->rule_integration = new Rule_Integration(); 456 $this->rule_integration->init(); 447 457 } 448 458 } -
svea-checkout-for-woocommerce/tags/3.4.0/templates/backend/metabox.php
r3320066 r3398960 3 3 4 4 if ( isset( $is_awaiting_status ) && $is_awaiting_status ) : ?> 5 <p>6 <strong><?php esc_html_e( 'Awaiting status', 'svea-checkout-for-woocommerce' ); ?></strong><br>7 <?php esc_html_e( 'This order is awaiting the final status from Svea and will update itself automatically. You do not need to do anything with this order but if you would like to check the status right now you can do so by clicking the button below', 'svea-checkout-for-woocommerce' ); ?>8 </p>9 <a href="#" id="sco-check-svea-status" data-loading-text="<?php esc_html_e( 'Fetching status', 'svea-checkout-for-woocommerce' ); ?>..." class="button"><?php esc_html_e( 'Check status now', 'svea-checkout-for-woocommerce' ); ?></a>10 <hr>5 <p> 6 <strong><?php esc_html_e( 'Awaiting status', 'svea-checkout-for-woocommerce' ); ?></strong><br> 7 <?php esc_html_e( 'This order is awaiting the final status from Svea and will update itself automatically. You do not need to do anything with this order but if you would like to check the status right now you can do so by clicking the button below', 'svea-checkout-for-woocommerce' ); ?> 8 </p> 9 <a href="#" id="sco-check-svea-status" data-loading-text="<?php esc_html_e( 'Fetching status', 'svea-checkout-for-woocommerce' ); ?>..." class="button"><?php esc_html_e( 'Check status now', 'svea-checkout-for-woocommerce' ); ?></a> 10 <hr> 11 11 <?php endif; ?> 12 12 13 13 <?php if ( ! empty( $fields ) ) : ?> 14 <p>15 <strong><?php esc_html_e( 'Order information', 'svea-checkout-for-woocommerce' ); ?></strong>16 </p>17 <table style="width:100%; font-size: 80%;">18 <?php foreach ( $fields as $key => $val ) : ?>19 <tr>20 <td><?php echo esc_html( $key ); ?>:</td>21 <td><i><?php echo esc_html( $val ); ?></i></td>22 </tr>23 <?php endforeach; ?>24 </table>14 <p> 15 <strong><?php esc_html_e( 'Order information', 'svea-checkout-for-woocommerce' ); ?></strong> 16 </p> 17 <table style="width:100%; font-size: 80%;"> 18 <?php foreach ( $fields as $key => $val ) : ?> 19 <tr> 20 <td><?php echo esc_html( $key ); ?>:</td> 21 <td><i><?php echo esc_html( $val ); ?></i></td> 22 </tr> 23 <?php endforeach; ?> 24 </table> 25 25 <?php endif; ?> 26 26 27 27 <?php if ( ! empty( $nshift_fields ) ) : ?> 28 <p>29 <strong><?php echo esc_html_e( 'nShift data', 'svea-checkout-for-woocommerce'); ?></strong>30 </p>31 <pre>32 <?php echo esc_html( wp_json_encode( $nshift_fields, JSON_PRETTY_PRINT ) ); ?>33 </pre>28 <p> 29 <strong><?php echo esc_html_e( 'nShift data', 'svea-checkout-for-woocommerce' ); ?></strong> 30 </p> 31 <pre> 32 <?php echo esc_html( wp_json_encode( $nshift_fields, JSON_PRETTY_PRINT ) ); ?> 33 </pre> 34 34 <?php endif; ?> -
svea-checkout-for-woocommerce/tags/3.4.0/vendor/composer/autoload_classmap.php
r3320066 r3398960 210 210 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => $baseDir . '/inc/Models/Traits/Items_From_Order.php', 211 211 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Logger' => $baseDir . '/inc/Models/Traits/Logger.php', 212 'Svea_Checkout_For_Woocommerce\\Rule_Integration' => $baseDir . '/inc/Rule_Integration.php', 212 213 'Svea_Checkout_For_Woocommerce\\Scripts' => $baseDir . '/inc/Scripts.php', 213 214 'Svea_Checkout_For_Woocommerce\\Session_Table' => $baseDir . '/inc/Session_Table.php', -
svea-checkout-for-woocommerce/tags/3.4.0/vendor/composer/autoload_static.php
r3320066 r3398960 14 14 15 15 public static $prefixLengthsPsr4 = array ( 16 'S' => 16 'S' => 17 17 array ( 18 18 'Svea_Checkout_For_Woocommerce\\' => 30, … … 20 20 'Svea\\Checkout\\' => 14, 21 21 ), 22 'P' => 22 'P' => 23 23 array ( 24 24 'Psr\\Http\\Message\\' => 17, 25 25 'Psr\\Http\\Client\\' => 16, 26 26 ), 27 'G' => 27 'G' => 28 28 array ( 29 29 'GuzzleHttp\\Psr7\\' => 16, … … 34 34 35 35 public static $prefixDirsPsr4 = array ( 36 'Svea_Checkout_For_Woocommerce\\' => 36 'Svea_Checkout_For_Woocommerce\\' => 37 37 array ( 38 38 0 => __DIR__ . '/../..' . '/inc', 39 39 ), 40 'Svea\\Instore\\' => 40 'Svea\\Instore\\' => 41 41 array ( 42 42 0 => __DIR__ . '/..' . '/sveaekonomi/php-instore/lib', 43 43 ), 44 'Svea\\Checkout\\' => 44 'Svea\\Checkout\\' => 45 45 array ( 46 46 0 => __DIR__ . '/..' . '/sveaekonomi/checkout/src', 47 47 ), 48 'Psr\\Http\\Message\\' => 48 'Psr\\Http\\Message\\' => 49 49 array ( 50 50 0 => __DIR__ . '/..' . '/psr/http-factory/src', 51 51 1 => __DIR__ . '/..' . '/psr/http-message/src', 52 52 ), 53 'Psr\\Http\\Client\\' => 53 'Psr\\Http\\Client\\' => 54 54 array ( 55 55 0 => __DIR__ . '/..' . '/psr/http-client/src', 56 56 ), 57 'GuzzleHttp\\Psr7\\' => 57 'GuzzleHttp\\Psr7\\' => 58 58 array ( 59 59 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', 60 60 ), 61 'GuzzleHttp\\Promise\\' => 61 'GuzzleHttp\\Promise\\' => 62 62 array ( 63 63 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', 64 64 ), 65 'GuzzleHttp\\' => 65 'GuzzleHttp\\' => 66 66 array ( 67 67 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', … … 273 273 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => __DIR__ . '/../..' . '/inc/Models/Traits/Items_From_Order.php', 274 274 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Logger' => __DIR__ . '/../..' . '/inc/Models/Traits/Logger.php', 275 'Svea_Checkout_For_Woocommerce\\Rule_Integration' => __DIR__ . '/../..' . '/inc/Rule_Integration.php', 275 276 'Svea_Checkout_For_Woocommerce\\Scripts' => __DIR__ . '/../..' . '/inc/Scripts.php', 276 277 'Svea_Checkout_For_Woocommerce\\Session_Table' => __DIR__ . '/../..' . '/inc/Session_Table.php', -
svea-checkout-for-woocommerce/trunk/inc/Admin.php
r3359045 r3398960 27 27 28 28 /** 29 * Awaiting Svea leasing approval order status 30 */ 31 const AWAITING_LEASING_ORDER_STATUS = 'svea-leasing'; 32 33 /** 34 * Awaiting Svea leasing approval order status (full key) 35 */ 36 const AWAITING_LEASING_ORDER_STATUS_FULL = 'wc-svea-leasing'; 37 38 /** 29 39 * Order items that have been removed in this request 30 40 * This is used since Svea has a delay in updating their API … … 72 82 add_filter( 'woocommerce_email_actions', [ $this, 'allow_email_trigger' ] ); 73 83 74 // Allow emails to be sent when going from awaiting s veato processing84 // Allow emails to be sent when going from awaiting statuses to processing 75 85 add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 ); 76 86 add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed_notification', [ $this, 'add_completed_email_trigger' ], 10, 2 ); 87 add_action( 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 ); 88 add_action( 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed_notification', [ $this, 'add_completed_email_trigger' ], 10, 2 ); 89 90 add_action( 'woocommerce_admin_order_data_after_order_details', [ $this, 'maybe_add_leasing_information' ], 150 ); 77 91 78 92 add_action( 'sco_check_pa_order_status', [ $this, 'cron_check_pa_order_status' ] ); 79 93 80 add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_s vea_status_to_be_completed' ] );94 add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_statuses_to_be_completed' ] ); 81 95 82 96 add_action( 'wp_ajax_sco-check-order-status', [ $this, 'ajax_check_order_status' ] ); … … 94 108 add_action( 'woocommerce_process_product_meta', [ $this, 'save_product_fields' ] ); 95 109 add_action( 'woocommerce_save_product_variation', [ $this, 'save_variation_fields' ] ); 110 } 111 112 /** 113 * Maybe display information about leasing on the order edit page 114 * 115 * @param \WC_Order $wc_order 116 * @return void 117 */ 118 public function maybe_add_leasing_information( $wc_order ) { 119 $is_leasing = $wc_order->get_status() === self::AWAITING_LEASING_ORDER_STATUS; 120 if ( ! $is_leasing ) { 121 return; 122 } 123 ?> 124 <p class="svea-leasing-information"> 125 <strong><?php esc_html_e( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ); ?></strong><br> 126 <?php esc_html_e( 'Review this leasing agreement in StorePay. Once it is approved manually, move the order to processing or completed.', 'svea-checkout-for-woocommerce' ); ?> 127 </p> 128 <?php 96 129 } 97 130 … … 312 345 313 346 /** 314 * Allow the awaiting s vea status to be completed347 * Allow the awaiting statuses to be completed 315 348 * 316 349 * @param string[] $statuses 317 350 * @return string[] 318 351 */ 319 public function allow_awaiting_s vea_status_to_be_completed( $statuses ) {352 public function allow_awaiting_statuses_to_be_completed( $statuses ) { 320 353 $statuses[] = self::AWAITING_ORDER_STATUS; 321 return $statuses; 354 $statuses[] = self::AWAITING_LEASING_ORDER_STATUS; 355 return array_unique( $statuses ); 322 356 } 323 357 … … 383 417 // From pending to awaiting 384 418 $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_ORDER_STATUS; 419 $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_LEASING_ORDER_STATUS; 385 420 386 421 // From awaiting to processing 387 422 $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing'; 423 $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing'; 388 424 389 425 // From awaiting to completed 390 426 $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed'; 427 $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed'; 391 428 392 429 return $actions; … … 401 438 public function add_order_status( $statuses ) { 402 439 $statuses[ self::AWAITING_ORDER_STATUS_FULL ] = esc_html__( 'Awaiting status', 'svea-checkout-for-woocommerce' ); 440 $statuses[ self::AWAITING_LEASING_ORDER_STATUS_FULL ] = esc_html__( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ); 403 441 404 442 return $statuses; … … 434 472 ]; 435 473 474 $statuses[ self::AWAITING_LEASING_ORDER_STATUS_FULL ] = [ 475 'label' => esc_html__( 'Leasing awaiting approval', 'svea-checkout-for-woocommerce' ), 476 'public' => true, 477 'show_in_admin_status_list' => true, 478 'show_in_admin_all_list' => true, 479 'exclude_from_search' => false, 480 /* translators: %s is the number of posts found */ 481 'label_count' => _n_noop( 'Leasing awaiting approval <span class="count">(%s)</span>', 'Leasing awaiting approval <span class="count">(%s)</span>' ), 482 ]; 483 436 484 return $statuses; 437 485 } … … 459 507 public static function save_refs( $wc_order, $svea_order ) { 460 508 if ( $svea_order['IsCompany'] ) { 509 $gateway = WC_Gateway_Svea_Checkout::get_instance(); 510 $use_company_name_as_full_name = $gateway->get_option( 'use_company_name_as_full_name' ) === 'yes'; 511 $billing_full_name = wc_clean( $svea_order['BillingAddress']['FullName'] ?? '' ); 512 $shipping_full_name = wc_clean( $svea_order['ShippingAddress']['FullName'] ?? '' ); 461 513 $ref = wc_clean( $svea_order['CustomerReference'] ); 462 514 … … 467 519 if ( $svea_order['PaymentType'] === 'Invoice' && ! empty( $svea_order['BillingReferences'] ) ) { 468 520 // Get billing reference name 469 $gateway = WC_Gateway_Svea_Checkout::get_instance();470 521 foreach ( $svea_order['BillingReferences'] as $reference ) { 471 522 $svea_ref = $gateway->get_billing_reference_value( $reference['Type'] ); … … 494 545 $wc_order->update_meta_data( '_svea_co_company_reg_number', $reg_nr ); 495 546 496 // Save reference as name 497 $name = Helper::split_customer_name( $ref ); 547 // Save reference or company name as WooCommerce name 548 if ( $use_company_name_as_full_name && ! empty( $billing_full_name ) ) { 549 $billing_name = [ 550 'first_name' => $billing_full_name, 551 'last_name' => '', 552 ]; 553 } else { 554 $billing_name = Helper::split_customer_name( $ref ); 555 } 556 557 $wc_order->set_billing_first_name( $billing_name['first_name'] ); 558 $wc_order->set_billing_last_name( $billing_name['last_name'] ); 559 $wc_order->set_billing_company( $billing_full_name ); 560 561 if ( $wc_order->needs_shipping_address() ) { 562 if ( $use_company_name_as_full_name && ! empty( $shipping_full_name ) ) { 563 $shipping_name = [ 564 'first_name' => $shipping_full_name, 565 'last_name' => '', 566 ]; 567 } else { 568 $shipping_name = $billing_name; 569 } 570 571 $wc_order->set_shipping_first_name( $shipping_name['first_name'] ); 572 $wc_order->set_shipping_last_name( $shipping_name['last_name'] ); 573 $wc_order->set_shipping_company( $shipping_full_name ); 574 } 575 } else { 576 // Always use the provided names for individuals 577 $name = Helper::split_customer_name( $svea_order['ShippingAddress']['FullName'] ); 578 579 $wc_order->set_shipping_first_name( $name['first_name'] ); 580 $wc_order->set_shipping_last_name( $name['last_name'] ); 581 $wc_order->set_shipping_address_1( wc_clean( $svea_order['ShippingAddress']['StreetAddress'] ) ); 582 $wc_order->set_shipping_address_2( wc_clean( $svea_order['ShippingAddress']['CoAddress'] ) ); 583 $wc_order->set_shipping_city( wc_clean( $svea_order['ShippingAddress']['City'] ) ); 584 $wc_order->set_shipping_postcode( wc_clean( $svea_order['ShippingAddress']['PostalCode'] ) ); 585 $wc_order->set_shipping_country( wc_clean( $svea_order['ShippingAddress']['CountryCode'] ) ); 586 587 $name = Helper::split_customer_name( $svea_order['BillingAddress']['FullName'] ); 498 588 499 589 $wc_order->set_billing_first_name( $name['first_name'] ); 500 590 $wc_order->set_billing_last_name( $name['last_name'] ); 501 $wc_order->set_billing_company( wc_clean( $svea_order['BillingAddress']['FullName'] ) ); 502 503 if ( $wc_order->needs_shipping_address() ) { 504 $wc_order->set_shipping_first_name( $name['first_name'] ); 505 $wc_order->set_shipping_last_name( $name['last_name'] ); 506 $wc_order->set_shipping_company( wc_clean( $svea_order['ShippingAddress']['FullName'] ) ); 507 } 508 } else { 509 if ( $wc_order->needs_shipping_address() ) { 510 $name = Helper::split_customer_name( $svea_order['ShippingAddress']['FullName'] ); 511 512 $wc_order->set_shipping_first_name( $name['first_name'] ); 513 $wc_order->set_shipping_last_name( $name['last_name'] ); 514 $wc_order->set_shipping_address_1( wc_clean( $svea_order['ShippingAddress']['StreetAddress'] ) ); 515 $wc_order->set_shipping_address_2( wc_clean( $svea_order['ShippingAddress']['CoAddress'] ) ); 516 $wc_order->set_shipping_city( wc_clean( $svea_order['ShippingAddress']['City'] ) ); 517 $wc_order->set_shipping_postcode( wc_clean( $svea_order['ShippingAddress']['PostalCode'] ) ); 518 $wc_order->set_shipping_country( wc_clean( $svea_order['ShippingAddress']['CountryCode'] ) ); 519 } 591 $wc_order->set_billing_address_1( wc_clean( $svea_order['BillingAddress']['StreetAddress'] ) ); 592 $wc_order->set_billing_address_2( wc_clean( $svea_order['BillingAddress']['CoAddress'] ) ); 593 $wc_order->set_billing_city( wc_clean( $svea_order['BillingAddress']['City'] ) ); 594 $wc_order->set_billing_postcode( wc_clean( $svea_order['BillingAddress']['PostalCode'] ) ); 595 $wc_order->set_billing_country( wc_clean( $svea_order['BillingAddress']['CountryCode'] ) ); 520 596 } 521 597 -
svea-checkout-for-woocommerce/trunk/inc/Models/Svea_Checkout.php
r3385269 r3398960 541 541 public function create_temp_client_id( $data ): string { 542 542 $string = is_array( $data ) ? implode( '', $data ) : $data; 543 544 $full_hash = hash( 'sha256', $string, true ); 545 $digest_24_chars = substr( $full_hash, 0, 24 ); 546 547 // base64 encode to get a-z, A-Z, 0-9, - and _ characters. This will give 32 characters. 548 $hash_string = rtrim( strtr( base64_encode( $digest_24_chars ), '+/', '-_' ), '=' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 549 550 return $hash_string; 543 return md5( $string ); 551 544 } 552 545 … … 770 763 */ 771 764 public function get_current_cart_hash() { 765 $args = [ 766 $this->get_items(), 767 WC()->cart->get_total(), 768 $this->get_min_age(), 769 $this->get_plugin_version(), 770 ]; 771 772 772 return apply_filters( 773 773 'woocommerce_sco_cart_hash', 774 md5( 775 wp_json_encode( 776 [ 777 $this->get_items(), 778 WC()->cart->get_total(), 779 $this->get_min_age(), 780 $this->get_plugin_version(), 781 ] 782 ) 783 ) 774 md5( wp_json_encode( $args ) ), 775 $args, 784 776 ); 785 777 } -
svea-checkout-for-woocommerce/trunk/inc/Scripts.php
r3202226 r3398960 28 28 public function enqueue_admin_scripts( $hook ) { 29 29 wp_enqueue_script( 'svea-checkout-for-woocommerce-admin', plugins_url( 'assets/js/backend/application.min.js', SVEA_CHECKOUT_FOR_WOOCOMMERCE_FILE ), [], Plugin::VERSION, true ); 30 30 wp_enqueue_style( 'svea-checkout-for-woocommerce-admin', plugins_url( 'assets/css/backend/application.min.css', SVEA_CHECKOUT_FOR_WOOCOMMERCE_FILE ), [], Plugin::VERSION ); 31 31 $post_id = null; 32 32 -
svea-checkout-for-woocommerce/trunk/inc/Template_Handler.php
r3324844 r3398960 701 701 do_action( 'woocommerce_sco_session_data' ); 702 702 703 $country_changed = ( WC()->customer->get_billing_country() !== $_POST['billing_country'] ?: '' ) ? true : false; 703 $posted_billing_country = isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : ''; 704 $country_changed = WC()->customer->get_billing_country() !== $posted_billing_country; 704 705 705 706 $props = [ 706 'billing_country' => isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '',707 'shipping_country' => isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '',707 'billing_country' => $posted_billing_country, 708 'shipping_country' => $posted_billing_country, 708 709 ]; 709 710 710 711 // "••••" would be a known customer and we'll use the postcode from the checkout instead 711 if ( isset( $_POST['billing_postcode'] ) && $_POST['billing_postcode'] !== '••••' ) { 712 $props['billing_postcode'] = sanitize_text_field( $_POST['billing_postcode'] ); 713 $props['shipping_postcode'] = sanitize_text_field( $_POST['billing_postcode'] ); 712 $posted_billing_postcode = isset( $_POST['billing_postcode'] ) ? sanitize_text_field( $_POST['billing_postcode'] ) : ''; 713 714 if ( ! empty( $posted_billing_postcode ) && $posted_billing_postcode !== '••••' ) { 715 $props['billing_postcode'] = $posted_billing_postcode; 716 $props['shipping_postcode'] = $posted_billing_postcode; 714 717 } 715 718 … … 792 795 } 793 796 797 do_action( 'woocommerce_sco_session_module_data', $svea_checkout_module ); 798 794 799 // Get messages if reload checkout is not true 795 800 $messages = ''; … … 843 848 } 844 849 850 do_action( 'woocommerce_sco_after_refresh_sco_snippet', $svea_checkout_module ); 851 845 852 wp_send_json( 846 853 [ -
svea-checkout-for-woocommerce/trunk/inc/WC_Gateway_Svea_Checkout.php
r3359045 r3398960 25 25 26 26 /** 27 * Gateway ID28 *29 * @var string30 */27 * Gateway ID 28 * 29 * @var string 30 */ 31 31 const GATEWAY_ID = 'svea_checkout'; 32 32 … … 270 270 271 271 /** 272 * @var bool Whether or not to display the product widget273 */272 * @var bool Whether or not to display the product widget 273 */ 274 274 public $display_product_widget; 275 276 /** 277 * Whether the Rule integration is enabled. 278 * 279 * @var bool 280 */ 281 private $rule_integration_enabled = false; 282 283 /** 284 * Rule API key. 285 * 286 * @var string 287 */ 288 private $rule_api_key = ''; 275 289 276 290 /** … … 399 413 'MOBILEPAY' => esc_html__( 'Mobilepay', 'svea-checkout-for-woocommerce' ), 400 414 'ZEROSUM' => esc_html__( 'Zero sum', 'svea-checkout-for-woocommerce' ), 415 'LEASINGMANUAL' => esc_html__( 'Leasing', 'svea-checkout-for-woocommerce' ), 416 'APPLEPAY' => esc_html__( 'Apple Pay', 'svea-checkout-for-woocommerce' ), 417 'APPLEPAY_PF' => esc_html__( 'Apple Pay', 'svea-checkout-for-woocommerce' ), 401 418 ]; 402 419 … … 496 513 $this->display_product_widget = apply_filters( 'woocommerce_sco_settings_product_widget', $this->get_option( 'display_product_widget' ) ); 497 514 515 $this->rule_integration_enabled = apply_filters( 'woocommerce_sco_settings_rule_integration_enabled', $this->get_option( 'rule_integration_enabled' ) === 'yes' ); 516 $this->rule_api_key = apply_filters( 'woocommerce_sco_settings_rule_api_key', (string) $this->get_option( 'rule_api_key' ) ); 517 498 518 // Prevent duplicate hooks 499 519 if ( ! self::$hooks_enabled ) { 500 520 $this->add_hooks(); 501 521 } 522 } 523 524 /** 525 * Get the instore expire time in minutes 526 * 527 * @return int 528 */ 529 public function get_instore_link_expire_minutes() { 530 return (int) $this->instore_link_expire_minutes; 502 531 } 503 532 … … 1924 1953 $refund_amount = (float) $wc_order->get_total( 'edit' ) - (float) $wc_order->get_total_refunded(); 1925 1954 1926 return $this->process_refund( $order_id, $refund_amount ); 1955 return $this->process_refund( $order_id, $refund_amount ); 1956 } 1957 1958 /** 1959 * Check if the Rule integration is enabled and has credentials. 1960 * 1961 * @return bool 1962 */ 1963 public function is_rule_integration_enabled() { 1964 return (bool) $this->rule_integration_enabled && ! empty( $this->rule_api_key ); 1965 } 1966 1967 /** 1968 * Get the configured Rule API key. 1969 * 1970 * @return string 1971 */ 1972 public function get_rule_api_key() { 1973 return $this->rule_api_key; 1927 1974 } 1928 1975 -
svea-checkout-for-woocommerce/trunk/inc/Webhook_Handler.php
r3353744 r3398960 34 34 */ 35 35 private static $svea_order; 36 37 /** 38 * Svea Checkout order response 39 * 40 * @var array 41 */ 42 private $checkout_order = []; 36 43 37 44 /** … … 403 410 404 411 /** 412 * Get Svea Checkout order data 413 * 414 * @param \WC_Order $wc_order 415 * @return array 416 */ 417 private function get_svea_order_by_checkout( $wc_order ) { 418 if ( ! empty( $this->checkout_order ) ) { 419 return $this->checkout_order; 420 } 421 422 $svea_checkout = new Svea_Checkout( false ); 423 $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() ); 424 425 try { 426 $this->checkout_order = $svea_checkout->get( $this->svea_order_id ); 427 } catch ( \Exception $e ) { 428 $this->gateway::log( sprintf( 'Error fetching checkout order %s: %s', $this->svea_order_id, $e->getMessage() ) ); 429 $this->checkout_order = []; 430 } 431 432 return $this->checkout_order; 433 } 434 435 /** 436 * Check if the push should rely on checkout data. 437 * 438 * @param array $checkout_order 439 * @return bool 440 */ 441 private function should_use_checkout_for_push( $checkout_order ) { 442 if ( empty( $checkout_order ) || ! is_array( $checkout_order ) ) { 443 return false; 444 } 445 446 $payment_type = isset( $checkout_order['PaymentType'] ) ? strtoupper( sanitize_text_field( $checkout_order['PaymentType'] ) ) : ''; 447 448 return $payment_type === 'LEASINGMANUAL'; 449 } 450 451 /** 452 * Finalize leasing orders awaiting manual approval. 453 * 454 * @param \WC_Order $wc_order 455 * @param array $checkout_order 456 * @return void 457 */ 458 private function finalize_leasing_order( $wc_order, $checkout_order ) { 459 self::$svea_order = $checkout_order; 460 461 $this->gateway::log( sprintf( 'Svea leasing order %s awaiting manual approval.', $this->svea_order_id ) ); 462 463 $payment_type = isset( $checkout_order['PaymentType'] ) ? strtoupper( sanitize_text_field( $checkout_order['PaymentType'] ) ) : ''; 464 $payment_method_type = ''; 465 466 if ( isset( $checkout_order['Payment']['PaymentMethodType'] ) ) { 467 $payment_method_type = sanitize_text_field( $checkout_order['Payment']['PaymentMethodType'] ); 468 } 469 470 if ( ! empty( $payment_type ) ) { 471 $wc_order->update_meta_data( '_svea_co_svea_payment_type', $payment_type ); 472 } 473 474 if ( ! empty( $payment_method_type ) ) { 475 $wc_order->update_meta_data( '_svea_co_payment_method_type', $payment_method_type ); 476 } 477 478 $method_name = $this->gateway->get_payment_method_name( $payment_type ); 479 480 if ( empty( $method_name ) && ! empty( $payment_method_type ) ) { 481 $method_name = ucfirst( $payment_method_type ); 482 } 483 484 if ( ! empty( $method_name ) ) { 485 $wc_order->set_payment_method_title( sprintf( '%s (%s)', $this->gateway->get_title(), $method_name ) ); 486 $wc_order->update_meta_data( '_svea_co_payment_type', $method_name ); 487 } 488 489 if ( isset( $checkout_order['Customer']['IsCompany'] ) ) { 490 $wc_order->update_meta_data( '_svea_co_is_company', (bool) $checkout_order['Customer']['IsCompany'] ); 491 } 492 493 $wc_order->set_status( Admin::AWAITING_LEASING_ORDER_STATUS ); 494 $wc_order->save(); 495 496 do_action( 'woocommerce_sco_after_push_order_leasing', $wc_order, self::$svea_order ); 497 498 status_header( 200 ); 499 echo 'Order awaiting leasing approval'; // phpcs:ignore 500 die(); 501 } 502 503 /** 405 504 * Process push notifications for the order 406 505 * … … 449 548 $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() ); 450 549 $svea_checkout_order = $svea_checkout->get( $this->svea_order_id ); 550 $this->checkout_order = $svea_checkout_order; 451 551 452 552 // Check if the order is canceled as it could be a push from the checkout for a order that doesn't exist in PA … … 576 676 $this->gateway::log( sprintf( 'Finalizing order: %s', $this->svea_order_id ) ); 577 677 678 $checkout_order = $this->get_svea_order_by_checkout( $wc_order ); 679 680 if ( $this->should_use_checkout_for_push( $checkout_order ) ) { 681 $this->finalize_leasing_order( $wc_order, $checkout_order ); 682 return; 683 } 684 578 685 // Get order from Svea Payment Admin 579 686 self::$svea_order = $this->get_svea_order_by_payment_admin( $wc_order, true ); … … 608 715 $method_name = $this->gateway->get_payment_method_name( $svea_payment_type ); 609 716 717 if ( $svea_payment_type === 'INVOICE' ) { 718 $svea_will_buy_order = null; 719 720 if ( array_key_exists( 'SveaWillBuy', self::$svea_order ) ) { 721 $svea_will_buy_order = self::$svea_order['SveaWillBuy']; 722 } 723 724 if ( $svea_will_buy_order === false ) { 725 $method_name = esc_html__( 'Admin invoice', 'svea-checkout-for-woocommerce' ); 726 } 727 } 728 610 729 if ( ! empty( $method_name ) ) { 611 730 $wc_order->set_payment_method_title( … … 631 750 } else { 632 751 $wc_order->payment_complete( (string) $this->svea_order_id ); 752 do_action( 'woocommerce_sco_checkout_webhook_payment_complete', $wc_order, $this->svea_order_id ); 633 753 } 634 754 -
svea-checkout-for-woocommerce/trunk/inc/settings-svea-checkout.php
r3219490 r3398960 55 55 'description' => __( 'Select which customer type you want to be selected by default. Only applicable if the store accepts companies and individuals.', 'svea-checkout-for-woocommerce' ), 56 56 ], 57 'use_company_name_as_full_name' => [ 58 'title' => esc_html__( 'Use company name as complete name', 'svea-checkout-for-woocommerce' ), 59 'label' => esc_html__( 'Use the company name for billing and shipping names on company orders', 'svea-checkout-for-woocommerce' ), 60 'type' => 'checkbox', 61 'default' => 'no', 62 'description' => __( 'When enabled, Svea company orders will populate the WooCommerce name fields with the company name instead of the Svea customer reference.', 'svea-checkout-for-woocommerce' ), 63 'desc_tip' => true, 64 ], 57 65 'preset_value_email_read_only' => [ 58 66 'title' => esc_html__( 'E-mail read-only when logged in', 'svea-checkout-for-woocommerce' ), … … 378 386 'default' => 'no', 379 387 ], 380 // phpcs:ignore Squiz.PHP.CommentedOutCode.Found 388 'rule_integration_hr' => [ 389 'title' => '<hr>', 390 'type' => 'title', 391 ], 392 'rule_integration_title' => [ 393 'title' => esc_html__( 'Rule integration', 'svea-checkout-for-woocommerce' ), 394 'type' => 'title', 395 'description' => esc_html__( 'Enable the Rule marketing automation integration to send abandoned cart data. Some requirements:', 'svea-checkout-for-woocommerce' ) . '<br>' . 396 '- ' . esc_html__( 'A Rule account.', 'svea-checkout-for-woocommerce' ) . '<br>' . 397 '- ' . esc_html__( 'The plugin WP Consent API (used for communicating given consents)', 'svea-checkout-for-woocommerce' ) . '<br>' . 398 '- ' . esc_html__( 'A cookie banner that uses the WP Consent API', 'svea-checkout-for-woocommerce' ) . '<br>' . 399 esc_html__( 'The Rule integration will only be effective if the customer has given consent to marketing.', 'svea-checkout-for-woocommerce' ), 400 ], 401 'rule_integration_enabled' => [ 402 'title' => esc_html__( 'Enable Rule integration', 'svea-checkout-for-woocommerce' ), 403 'label' => esc_html__( 'Send cart and checkout events to Rule for abandoned cart automation.', 'svea-checkout-for-woocommerce' ), 404 'type' => 'checkbox', 405 'default' => 'no', 406 ], 407 'rule_api_key' => [ 408 'title' => esc_html__( 'Rule API key', 'svea-checkout-for-woocommerce' ), 409 'type' => 'password', 410 'description' => esc_html__( 'Enter the API key generated in your Rule account.', 'svea-checkout-for-woocommerce' ), 411 'default' => '', 412 'desc_tip' => true, 413 'sanitize_callback' => [ String_Utils::class, 'remove_whitespace' ], 414 ], 415 // phpcs:ignore Squiz.PHP.CommentedOutCode.Found 381 416 // 'nshift_use_fallback' => [ 382 417 // 'title' => esc_html__( 'Enable nShift fallback options', 'svea-checkout-for-woocommerce' ), -
svea-checkout-for-woocommerce/trunk/languages/svea-checkout-for-woocommerce-sv_SE.po
r3359045 r3398960 363 363 msgstr "Faktura" 364 364 365 #: inc/Webhook_Handler.php:614 366 msgid "Admin invoice" 367 msgstr "Admin faktura" 368 365 369 #: inc/WC_Gateway_Svea_Checkout.php:374 366 370 msgid "Payment Plan" -
svea-checkout-for-woocommerce/trunk/readme.txt
r3393639 r3398960 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 3. 3.812 Stable tag: 3.4.0 13 13 14 14 Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout! … … 91 91 == Upgrade Notice == 92 92 93 = 3.4.0 = 94 3.4.0 is a minor release 95 93 96 = 3.3.8 = 94 97 3.3.8 is a patch release … … 408 411 409 412 == Changelog == 413 414 = 3.4.0 2025-11-19 = 415 - Rule integration: By enabling Svea Rule in your Svea Checkout settings you can send ongoing orders to Rule and create automated emails if the visitor never checked out their cart. To learn more reach out to Svea Support. 416 - Added support for leasing payment method. Orders using leasing will be set to a new order status "Awaiting leasing approval" 417 - Added option to use company name as full name for company orders 418 - Now shows if an invoice order is made via Svea invoice (regular) or admin invoice (Svea will not buy) 419 - Update billing information based on PaymentAdmin during finalize push 420 - Modified handling of temporary client ID to lower the chance hash collisions 421 - Added label for Apple Pay in admin order view 410 422 411 423 = 3.3.8 2025-11-11 = -
svea-checkout-for-woocommerce/trunk/svea-checkout-for-woocommerce.php
r3393639 r3398960 14 14 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/ 15 15 * Description: Process payments in WooCommerce via Svea Checkout. 16 * Version: 3. 3.816 * Version: 3.4.0 17 17 * Requires Plugins: woocommerce 18 18 * Author: The Generation AB … … 47 47 * Version of plugin 48 48 */ 49 const VERSION = '3. 3.8';49 const VERSION = '3.4.0'; 50 50 51 51 /** … … 103 103 */ 104 104 public $compat; 105 106 /** 107 * Rule integration class 108 * 109 * @var Rule_Integration 110 */ 111 public $rule_integration; 105 112 106 113 /** … … 445 452 $this->compat = new Compat(); 446 453 $this->compat->init(); 454 455 $this->rule_integration = new Rule_Integration(); 456 $this->rule_integration->init(); 447 457 } 448 458 } -
svea-checkout-for-woocommerce/trunk/templates/backend/metabox.php
r3320066 r3398960 3 3 4 4 if ( isset( $is_awaiting_status ) && $is_awaiting_status ) : ?> 5 <p>6 <strong><?php esc_html_e( 'Awaiting status', 'svea-checkout-for-woocommerce' ); ?></strong><br>7 <?php esc_html_e( 'This order is awaiting the final status from Svea and will update itself automatically. You do not need to do anything with this order but if you would like to check the status right now you can do so by clicking the button below', 'svea-checkout-for-woocommerce' ); ?>8 </p>9 <a href="#" id="sco-check-svea-status" data-loading-text="<?php esc_html_e( 'Fetching status', 'svea-checkout-for-woocommerce' ); ?>..." class="button"><?php esc_html_e( 'Check status now', 'svea-checkout-for-woocommerce' ); ?></a>10 <hr>5 <p> 6 <strong><?php esc_html_e( 'Awaiting status', 'svea-checkout-for-woocommerce' ); ?></strong><br> 7 <?php esc_html_e( 'This order is awaiting the final status from Svea and will update itself automatically. You do not need to do anything with this order but if you would like to check the status right now you can do so by clicking the button below', 'svea-checkout-for-woocommerce' ); ?> 8 </p> 9 <a href="#" id="sco-check-svea-status" data-loading-text="<?php esc_html_e( 'Fetching status', 'svea-checkout-for-woocommerce' ); ?>..." class="button"><?php esc_html_e( 'Check status now', 'svea-checkout-for-woocommerce' ); ?></a> 10 <hr> 11 11 <?php endif; ?> 12 12 13 13 <?php if ( ! empty( $fields ) ) : ?> 14 <p>15 <strong><?php esc_html_e( 'Order information', 'svea-checkout-for-woocommerce' ); ?></strong>16 </p>17 <table style="width:100%; font-size: 80%;">18 <?php foreach ( $fields as $key => $val ) : ?>19 <tr>20 <td><?php echo esc_html( $key ); ?>:</td>21 <td><i><?php echo esc_html( $val ); ?></i></td>22 </tr>23 <?php endforeach; ?>24 </table>14 <p> 15 <strong><?php esc_html_e( 'Order information', 'svea-checkout-for-woocommerce' ); ?></strong> 16 </p> 17 <table style="width:100%; font-size: 80%;"> 18 <?php foreach ( $fields as $key => $val ) : ?> 19 <tr> 20 <td><?php echo esc_html( $key ); ?>:</td> 21 <td><i><?php echo esc_html( $val ); ?></i></td> 22 </tr> 23 <?php endforeach; ?> 24 </table> 25 25 <?php endif; ?> 26 26 27 27 <?php if ( ! empty( $nshift_fields ) ) : ?> 28 <p>29 <strong><?php echo esc_html_e( 'nShift data', 'svea-checkout-for-woocommerce'); ?></strong>30 </p>31 <pre>32 <?php echo esc_html( wp_json_encode( $nshift_fields, JSON_PRETTY_PRINT ) ); ?>33 </pre>28 <p> 29 <strong><?php echo esc_html_e( 'nShift data', 'svea-checkout-for-woocommerce' ); ?></strong> 30 </p> 31 <pre> 32 <?php echo esc_html( wp_json_encode( $nshift_fields, JSON_PRETTY_PRINT ) ); ?> 33 </pre> 34 34 <?php endif; ?> -
svea-checkout-for-woocommerce/trunk/vendor/composer/autoload_classmap.php
r3320066 r3398960 210 210 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => $baseDir . '/inc/Models/Traits/Items_From_Order.php', 211 211 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Logger' => $baseDir . '/inc/Models/Traits/Logger.php', 212 'Svea_Checkout_For_Woocommerce\\Rule_Integration' => $baseDir . '/inc/Rule_Integration.php', 212 213 'Svea_Checkout_For_Woocommerce\\Scripts' => $baseDir . '/inc/Scripts.php', 213 214 'Svea_Checkout_For_Woocommerce\\Session_Table' => $baseDir . '/inc/Session_Table.php', -
svea-checkout-for-woocommerce/trunk/vendor/composer/autoload_static.php
r3320066 r3398960 14 14 15 15 public static $prefixLengthsPsr4 = array ( 16 'S' => 16 'S' => 17 17 array ( 18 18 'Svea_Checkout_For_Woocommerce\\' => 30, … … 20 20 'Svea\\Checkout\\' => 14, 21 21 ), 22 'P' => 22 'P' => 23 23 array ( 24 24 'Psr\\Http\\Message\\' => 17, 25 25 'Psr\\Http\\Client\\' => 16, 26 26 ), 27 'G' => 27 'G' => 28 28 array ( 29 29 'GuzzleHttp\\Psr7\\' => 16, … … 34 34 35 35 public static $prefixDirsPsr4 = array ( 36 'Svea_Checkout_For_Woocommerce\\' => 36 'Svea_Checkout_For_Woocommerce\\' => 37 37 array ( 38 38 0 => __DIR__ . '/../..' . '/inc', 39 39 ), 40 'Svea\\Instore\\' => 40 'Svea\\Instore\\' => 41 41 array ( 42 42 0 => __DIR__ . '/..' . '/sveaekonomi/php-instore/lib', 43 43 ), 44 'Svea\\Checkout\\' => 44 'Svea\\Checkout\\' => 45 45 array ( 46 46 0 => __DIR__ . '/..' . '/sveaekonomi/checkout/src', 47 47 ), 48 'Psr\\Http\\Message\\' => 48 'Psr\\Http\\Message\\' => 49 49 array ( 50 50 0 => __DIR__ . '/..' . '/psr/http-factory/src', 51 51 1 => __DIR__ . '/..' . '/psr/http-message/src', 52 52 ), 53 'Psr\\Http\\Client\\' => 53 'Psr\\Http\\Client\\' => 54 54 array ( 55 55 0 => __DIR__ . '/..' . '/psr/http-client/src', 56 56 ), 57 'GuzzleHttp\\Psr7\\' => 57 'GuzzleHttp\\Psr7\\' => 58 58 array ( 59 59 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', 60 60 ), 61 'GuzzleHttp\\Promise\\' => 61 'GuzzleHttp\\Promise\\' => 62 62 array ( 63 63 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', 64 64 ), 65 'GuzzleHttp\\' => 65 'GuzzleHttp\\' => 66 66 array ( 67 67 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', … … 273 273 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => __DIR__ . '/../..' . '/inc/Models/Traits/Items_From_Order.php', 274 274 'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Logger' => __DIR__ . '/../..' . '/inc/Models/Traits/Logger.php', 275 'Svea_Checkout_For_Woocommerce\\Rule_Integration' => __DIR__ . '/../..' . '/inc/Rule_Integration.php', 275 276 'Svea_Checkout_For_Woocommerce\\Scripts' => __DIR__ . '/../..' . '/inc/Scripts.php', 276 277 'Svea_Checkout_For_Woocommerce\\Session_Table' => __DIR__ . '/../..' . '/inc/Session_Table.php',
Note: See TracChangeset
for help on using the changeset viewer.