Plugin Directory

Changeset 3398960


Ignore:
Timestamp:
11/19/2025 12:40:56 PM (5 months ago)
Author:
thegeneration
Message:

Tagging version 3.4.0

Location:
svea-checkout-for-woocommerce
Files:
6 added
26 edited
4 copied

Legend:

Unmodified
Added
Removed
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/Admin.php

    r3359045 r3398960  
    2727
    2828    /**
     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    /**
    2939     * Order items that have been removed in this request
    3040     * This is used since Svea has a delay in updating their API
     
    7282        add_filter( 'woocommerce_email_actions', [ $this, 'allow_email_trigger' ] );
    7383
    74         // Allow emails to be sent when going from awaiting svea to processing
     84        // Allow emails to be sent when going from awaiting statuses to processing
    7585        add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 );
    7686        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 );
    7791
    7892        add_action( 'sco_check_pa_order_status', [ $this, 'cron_check_pa_order_status' ] );
    7993
    80         add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_svea_status_to_be_completed' ] );
     94        add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_statuses_to_be_completed' ] );
    8195
    8296        add_action( 'wp_ajax_sco-check-order-status', [ $this, 'ajax_check_order_status' ] );
     
    94108        add_action( 'woocommerce_process_product_meta', [ $this, 'save_product_fields' ] );
    95109        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
    96129    }
    97130
     
    312345
    313346    /**
    314      * Allow the awaiting svea status to be completed
     347     * Allow the awaiting statuses to be completed
    315348     *
    316349     * @param string[] $statuses
    317350     * @return string[]
    318351     */
    319     public function allow_awaiting_svea_status_to_be_completed( $statuses ) {
     352    public function allow_awaiting_statuses_to_be_completed( $statuses ) {
    320353        $statuses[] = self::AWAITING_ORDER_STATUS;
    321         return $statuses;
     354        $statuses[] = self::AWAITING_LEASING_ORDER_STATUS;
     355        return array_unique( $statuses );
    322356    }
    323357
     
    383417        // From pending to awaiting
    384418        $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_ORDER_STATUS;
     419        $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_LEASING_ORDER_STATUS;
    385420
    386421        // From awaiting to processing
    387422        $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing';
     423        $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing';
    388424
    389425        // From awaiting to completed
    390426        $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed';
     427        $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed';
    391428
    392429        return $actions;
     
    401438    public function add_order_status( $statuses ) {
    402439        $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' );
    403441
    404442        return $statuses;
     
    434472        ];
    435473
     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
    436484        return $statuses;
    437485    }
     
    459507    public static function save_refs( $wc_order, $svea_order ) {
    460508        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'] ?? '' );
    461513            $ref = wc_clean( $svea_order['CustomerReference'] );
    462514
     
    467519            if ( $svea_order['PaymentType'] === 'Invoice' && ! empty( $svea_order['BillingReferences'] ) ) {
    468520                // Get billing reference name
    469                 $gateway = WC_Gateway_Svea_Checkout::get_instance();
    470521                foreach ( $svea_order['BillingReferences'] as $reference ) {
    471522                    $svea_ref = $gateway->get_billing_reference_value( $reference['Type'] );
     
    494545            $wc_order->update_meta_data( '_svea_co_company_reg_number', $reg_nr );
    495546
    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'] );
    498588
    499589            $wc_order->set_billing_first_name( $name['first_name'] );
    500590            $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'] ) );
    520596        }
    521597
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/Models/Svea_Checkout.php

    r3385269 r3398960  
    541541    public function create_temp_client_id( $data ): string {
    542542        $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 );
    551544    }
    552545
     
    770763     */
    771764    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
    772772        return apply_filters(
    773773            '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,
    784776        );
    785777    }
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/Scripts.php

    r3202226 r3398960  
    2828    public function enqueue_admin_scripts( $hook ) {
    2929        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 );
    3131        $post_id = null;
    3232
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/Template_Handler.php

    r3324844 r3398960  
    701701        do_action( 'woocommerce_sco_session_data' );
    702702
    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;
    704705
    705706        $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,
    708709        ];
    709710
    710711        // "••••" 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;
    714717        }
    715718
     
    792795        }
    793796
     797        do_action( 'woocommerce_sco_session_module_data', $svea_checkout_module );
     798
    794799        // Get messages if reload checkout is not true
    795800        $messages = '';
     
    843848        }
    844849
     850        do_action( 'woocommerce_sco_after_refresh_sco_snippet', $svea_checkout_module );
     851
    845852        wp_send_json(
    846853            [
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/WC_Gateway_Svea_Checkout.php

    r3359045 r3398960  
    2525
    2626    /**
    27      * Gateway ID
    28      *
    29      * @var string
    30      */
     27    * Gateway ID
     28    *
     29    * @var string
     30    */
    3131    const GATEWAY_ID = 'svea_checkout';
    3232
     
    270270
    271271    /**
    272      * @var bool Whether or not to display the product widget
    273      */
     272    * @var bool Whether or not to display the product widget
     273    */
    274274    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 = '';
    275289
    276290    /**
     
    399413            'MOBILEPAY'        => esc_html__( 'Mobilepay', 'svea-checkout-for-woocommerce' ),
    400414            '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' ),
    401418        ];
    402419
     
    496513        $this->display_product_widget = apply_filters( 'woocommerce_sco_settings_product_widget', $this->get_option( 'display_product_widget' ) );
    497514
     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
    498518        // Prevent duplicate hooks
    499519        if ( ! self::$hooks_enabled ) {
    500520            $this->add_hooks();
    501521        }
     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;
    502531    }
    503532
     
    19241953        $refund_amount = (float) $wc_order->get_total( 'edit' ) - (float) $wc_order->get_total_refunded();
    19251954
    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;
    19271974    }
    19281975
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/Webhook_Handler.php

    r3353744 r3398960  
    3434     */
    3535    private static $svea_order;
     36
     37    /**
     38     * Svea Checkout order response
     39     *
     40     * @var array
     41     */
     42    private $checkout_order = [];
    3643
    3744    /**
     
    403410
    404411    /**
     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    /**
    405504     * Process push notifications for the order
    406505     *
     
    449548        $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() );
    450549        $svea_checkout_order = $svea_checkout->get( $this->svea_order_id );
     550        $this->checkout_order = $svea_checkout_order;
    451551
    452552        // Check if the order is canceled as it could be a push from the checkout for a order that doesn't exist in PA
     
    576676        $this->gateway::log( sprintf( 'Finalizing order: %s', $this->svea_order_id ) );
    577677
     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
    578685        // Get order from Svea Payment Admin
    579686        self::$svea_order = $this->get_svea_order_by_payment_admin( $wc_order, true );
     
    608715            $method_name = $this->gateway->get_payment_method_name( $svea_payment_type );
    609716
     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
    610729            if ( ! empty( $method_name ) ) {
    611730                $wc_order->set_payment_method_title(
     
    631750            } else {
    632751                $wc_order->payment_complete( (string) $this->svea_order_id );
     752                do_action( 'woocommerce_sco_checkout_webhook_payment_complete', $wc_order, $this->svea_order_id );
    633753            }
    634754
  • svea-checkout-for-woocommerce/tags/3.4.0/inc/settings-svea-checkout.php

    r3219490 r3398960  
    5555            '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' ),
    5656        ],
     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        ],
    5765        'preset_value_email_read_only'    => [
    5866            'title'       => esc_html__( 'E-mail read-only when logged in', 'svea-checkout-for-woocommerce' ),
     
    378386            'default' => 'no',
    379387        ],
    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
    381416        // 'nshift_use_fallback'             => [
    382417        //  '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  
    363363msgstr "Faktura"
    364364
     365#: inc/Webhook_Handler.php:614
     366msgid "Admin invoice"
     367msgstr "Admin faktura"
     368
    365369#: inc/WC_Gateway_Svea_Checkout.php:374
    366370msgid "Payment Plan"
  • svea-checkout-for-woocommerce/tags/3.4.0/readme.txt

    r3393639 r3398960  
    1010License: Apache 2.0
    1111License URI: https://www.apache.org/licenses/LICENSE-2.0
    12 Stable tag: 3.3.8
     12Stable tag: 3.4.0
    1313
    1414Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout!
     
    9191== Upgrade Notice ==
    9292
     93= 3.4.0 =
     943.4.0 is a minor release
     95
    9396= 3.3.8 =
    94973.3.8 is a patch release
     
    408411
    409412== 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
    410422
    411423= 3.3.8 2025-11-11 =
  • svea-checkout-for-woocommerce/tags/3.4.0/svea-checkout-for-woocommerce.php

    r3393639 r3398960  
    1414 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/
    1515 * Description: Process payments in WooCommerce via Svea Checkout.
    16  * Version: 3.3.8
     16 * Version: 3.4.0
    1717 * Requires Plugins: woocommerce
    1818 * Author: The Generation AB
     
    4747         * Version of plugin
    4848         */
    49         const VERSION = '3.3.8';
     49        const VERSION = '3.4.0';
    5050
    5151        /**
     
    103103         */
    104104        public $compat;
     105
     106        /**
     107         * Rule integration class
     108         *
     109         * @var Rule_Integration
     110         */
     111        public $rule_integration;
    105112
    106113        /**
     
    445452            $this->compat = new Compat();
    446453            $this->compat->init();
     454
     455            $this->rule_integration = new Rule_Integration();
     456            $this->rule_integration->init();
    447457        }
    448458    }
  • svea-checkout-for-woocommerce/tags/3.4.0/templates/backend/metabox.php

    r3320066 r3398960  
    33
    44if ( 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>
    1111<?php endif; ?>
    1212
    1313<?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>
    2525<?php endif; ?>
    2626
    2727<?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>
    3434<?php endif; ?>
  • svea-checkout-for-woocommerce/tags/3.4.0/vendor/composer/autoload_classmap.php

    r3320066 r3398960  
    210210    'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => $baseDir . '/inc/Models/Traits/Items_From_Order.php',
    211211    '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',
    212213    'Svea_Checkout_For_Woocommerce\\Scripts' => $baseDir . '/inc/Scripts.php',
    213214    '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  
    1414
    1515    public static $prefixLengthsPsr4 = array (
    16         'S' => 
     16        'S' =>
    1717        array (
    1818            'Svea_Checkout_For_Woocommerce\\' => 30,
     
    2020            'Svea\\Checkout\\' => 14,
    2121        ),
    22         'P' => 
     22        'P' =>
    2323        array (
    2424            'Psr\\Http\\Message\\' => 17,
    2525            'Psr\\Http\\Client\\' => 16,
    2626        ),
    27         'G' => 
     27        'G' =>
    2828        array (
    2929            'GuzzleHttp\\Psr7\\' => 16,
     
    3434
    3535    public static $prefixDirsPsr4 = array (
    36         'Svea_Checkout_For_Woocommerce\\' => 
     36        'Svea_Checkout_For_Woocommerce\\' =>
    3737        array (
    3838            0 => __DIR__ . '/../..' . '/inc',
    3939        ),
    40         'Svea\\Instore\\' => 
     40        'Svea\\Instore\\' =>
    4141        array (
    4242            0 => __DIR__ . '/..' . '/sveaekonomi/php-instore/lib',
    4343        ),
    44         'Svea\\Checkout\\' => 
     44        'Svea\\Checkout\\' =>
    4545        array (
    4646            0 => __DIR__ . '/..' . '/sveaekonomi/checkout/src',
    4747        ),
    48         'Psr\\Http\\Message\\' => 
     48        'Psr\\Http\\Message\\' =>
    4949        array (
    5050            0 => __DIR__ . '/..' . '/psr/http-factory/src',
    5151            1 => __DIR__ . '/..' . '/psr/http-message/src',
    5252        ),
    53         'Psr\\Http\\Client\\' => 
     53        'Psr\\Http\\Client\\' =>
    5454        array (
    5555            0 => __DIR__ . '/..' . '/psr/http-client/src',
    5656        ),
    57         'GuzzleHttp\\Psr7\\' => 
     57        'GuzzleHttp\\Psr7\\' =>
    5858        array (
    5959            0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
    6060        ),
    61         'GuzzleHttp\\Promise\\' => 
     61        'GuzzleHttp\\Promise\\' =>
    6262        array (
    6363            0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
    6464        ),
    65         'GuzzleHttp\\' => 
     65        'GuzzleHttp\\' =>
    6666        array (
    6767            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
     
    273273        'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => __DIR__ . '/../..' . '/inc/Models/Traits/Items_From_Order.php',
    274274        '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',
    275276        'Svea_Checkout_For_Woocommerce\\Scripts' => __DIR__ . '/../..' . '/inc/Scripts.php',
    276277        'Svea_Checkout_For_Woocommerce\\Session_Table' => __DIR__ . '/../..' . '/inc/Session_Table.php',
  • svea-checkout-for-woocommerce/trunk/inc/Admin.php

    r3359045 r3398960  
    2727
    2828    /**
     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    /**
    2939     * Order items that have been removed in this request
    3040     * This is used since Svea has a delay in updating their API
     
    7282        add_filter( 'woocommerce_email_actions', [ $this, 'allow_email_trigger' ] );
    7383
    74         // Allow emails to be sent when going from awaiting svea to processing
     84        // Allow emails to be sent when going from awaiting statuses to processing
    7585        add_action( 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing_notification', [ $this, 'add_processing_email_trigger' ], 10, 2 );
    7686        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 );
    7791
    7892        add_action( 'sco_check_pa_order_status', [ $this, 'cron_check_pa_order_status' ] );
    7993
    80         add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_svea_status_to_be_completed' ] );
     94        add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'allow_awaiting_statuses_to_be_completed' ] );
    8195
    8296        add_action( 'wp_ajax_sco-check-order-status', [ $this, 'ajax_check_order_status' ] );
     
    94108        add_action( 'woocommerce_process_product_meta', [ $this, 'save_product_fields' ] );
    95109        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
    96129    }
    97130
     
    312345
    313346    /**
    314      * Allow the awaiting svea status to be completed
     347     * Allow the awaiting statuses to be completed
    315348     *
    316349     * @param string[] $statuses
    317350     * @return string[]
    318351     */
    319     public function allow_awaiting_svea_status_to_be_completed( $statuses ) {
     352    public function allow_awaiting_statuses_to_be_completed( $statuses ) {
    320353        $statuses[] = self::AWAITING_ORDER_STATUS;
    321         return $statuses;
     354        $statuses[] = self::AWAITING_LEASING_ORDER_STATUS;
     355        return array_unique( $statuses );
    322356    }
    323357
     
    383417        // From pending to awaiting
    384418        $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_ORDER_STATUS;
     419        $actions[] = 'woocommerce_order_status_pending_to_' . self::AWAITING_LEASING_ORDER_STATUS;
    385420
    386421        // From awaiting to processing
    387422        $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_processing';
     423        $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_processing';
    388424
    389425        // From awaiting to completed
    390426        $actions[] = 'woocommerce_order_status_' . self::AWAITING_ORDER_STATUS . '_to_completed';
     427        $actions[] = 'woocommerce_order_status_' . self::AWAITING_LEASING_ORDER_STATUS . '_to_completed';
    391428
    392429        return $actions;
     
    401438    public function add_order_status( $statuses ) {
    402439        $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' );
    403441
    404442        return $statuses;
     
    434472        ];
    435473
     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
    436484        return $statuses;
    437485    }
     
    459507    public static function save_refs( $wc_order, $svea_order ) {
    460508        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'] ?? '' );
    461513            $ref = wc_clean( $svea_order['CustomerReference'] );
    462514
     
    467519            if ( $svea_order['PaymentType'] === 'Invoice' && ! empty( $svea_order['BillingReferences'] ) ) {
    468520                // Get billing reference name
    469                 $gateway = WC_Gateway_Svea_Checkout::get_instance();
    470521                foreach ( $svea_order['BillingReferences'] as $reference ) {
    471522                    $svea_ref = $gateway->get_billing_reference_value( $reference['Type'] );
     
    494545            $wc_order->update_meta_data( '_svea_co_company_reg_number', $reg_nr );
    495546
    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'] );
    498588
    499589            $wc_order->set_billing_first_name( $name['first_name'] );
    500590            $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'] ) );
    520596        }
    521597
  • svea-checkout-for-woocommerce/trunk/inc/Models/Svea_Checkout.php

    r3385269 r3398960  
    541541    public function create_temp_client_id( $data ): string {
    542542        $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 );
    551544    }
    552545
     
    770763     */
    771764    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
    772772        return apply_filters(
    773773            '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,
    784776        );
    785777    }
  • svea-checkout-for-woocommerce/trunk/inc/Scripts.php

    r3202226 r3398960  
    2828    public function enqueue_admin_scripts( $hook ) {
    2929        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 );
    3131        $post_id = null;
    3232
  • svea-checkout-for-woocommerce/trunk/inc/Template_Handler.php

    r3324844 r3398960  
    701701        do_action( 'woocommerce_sco_session_data' );
    702702
    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;
    704705
    705706        $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,
    708709        ];
    709710
    710711        // "••••" 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;
    714717        }
    715718
     
    792795        }
    793796
     797        do_action( 'woocommerce_sco_session_module_data', $svea_checkout_module );
     798
    794799        // Get messages if reload checkout is not true
    795800        $messages = '';
     
    843848        }
    844849
     850        do_action( 'woocommerce_sco_after_refresh_sco_snippet', $svea_checkout_module );
     851
    845852        wp_send_json(
    846853            [
  • svea-checkout-for-woocommerce/trunk/inc/WC_Gateway_Svea_Checkout.php

    r3359045 r3398960  
    2525
    2626    /**
    27      * Gateway ID
    28      *
    29      * @var string
    30      */
     27    * Gateway ID
     28    *
     29    * @var string
     30    */
    3131    const GATEWAY_ID = 'svea_checkout';
    3232
     
    270270
    271271    /**
    272      * @var bool Whether or not to display the product widget
    273      */
     272    * @var bool Whether or not to display the product widget
     273    */
    274274    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 = '';
    275289
    276290    /**
     
    399413            'MOBILEPAY'        => esc_html__( 'Mobilepay', 'svea-checkout-for-woocommerce' ),
    400414            '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' ),
    401418        ];
    402419
     
    496513        $this->display_product_widget = apply_filters( 'woocommerce_sco_settings_product_widget', $this->get_option( 'display_product_widget' ) );
    497514
     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
    498518        // Prevent duplicate hooks
    499519        if ( ! self::$hooks_enabled ) {
    500520            $this->add_hooks();
    501521        }
     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;
    502531    }
    503532
     
    19241953        $refund_amount = (float) $wc_order->get_total( 'edit' ) - (float) $wc_order->get_total_refunded();
    19251954
    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;
    19271974    }
    19281975
  • svea-checkout-for-woocommerce/trunk/inc/Webhook_Handler.php

    r3353744 r3398960  
    3434     */
    3535    private static $svea_order;
     36
     37    /**
     38     * Svea Checkout order response
     39     *
     40     * @var array
     41     */
     42    private $checkout_order = [];
    3643
    3744    /**
     
    403410
    404411    /**
     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    /**
    405504     * Process push notifications for the order
    406505     *
     
    449548        $svea_checkout->setup_client( $wc_order->get_currency(), $wc_order->get_billing_country() );
    450549        $svea_checkout_order = $svea_checkout->get( $this->svea_order_id );
     550        $this->checkout_order = $svea_checkout_order;
    451551
    452552        // Check if the order is canceled as it could be a push from the checkout for a order that doesn't exist in PA
     
    576676        $this->gateway::log( sprintf( 'Finalizing order: %s', $this->svea_order_id ) );
    577677
     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
    578685        // Get order from Svea Payment Admin
    579686        self::$svea_order = $this->get_svea_order_by_payment_admin( $wc_order, true );
     
    608715            $method_name = $this->gateway->get_payment_method_name( $svea_payment_type );
    609716
     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
    610729            if ( ! empty( $method_name ) ) {
    611730                $wc_order->set_payment_method_title(
     
    631750            } else {
    632751                $wc_order->payment_complete( (string) $this->svea_order_id );
     752                do_action( 'woocommerce_sco_checkout_webhook_payment_complete', $wc_order, $this->svea_order_id );
    633753            }
    634754
  • svea-checkout-for-woocommerce/trunk/inc/settings-svea-checkout.php

    r3219490 r3398960  
    5555            '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' ),
    5656        ],
     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        ],
    5765        'preset_value_email_read_only'    => [
    5866            'title'       => esc_html__( 'E-mail read-only when logged in', 'svea-checkout-for-woocommerce' ),
     
    378386            'default' => 'no',
    379387        ],
    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
    381416        // 'nshift_use_fallback'             => [
    382417        //  '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  
    363363msgstr "Faktura"
    364364
     365#: inc/Webhook_Handler.php:614
     366msgid "Admin invoice"
     367msgstr "Admin faktura"
     368
    365369#: inc/WC_Gateway_Svea_Checkout.php:374
    366370msgid "Payment Plan"
  • svea-checkout-for-woocommerce/trunk/readme.txt

    r3393639 r3398960  
    1010License: Apache 2.0
    1111License URI: https://www.apache.org/licenses/LICENSE-2.0
    12 Stable tag: 3.3.8
     12Stable tag: 3.4.0
    1313
    1414Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout!
     
    9191== Upgrade Notice ==
    9292
     93= 3.4.0 =
     943.4.0 is a minor release
     95
    9396= 3.3.8 =
    94973.3.8 is a patch release
     
    408411
    409412== 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
    410422
    411423= 3.3.8 2025-11-11 =
  • svea-checkout-for-woocommerce/trunk/svea-checkout-for-woocommerce.php

    r3393639 r3398960  
    1414 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/
    1515 * Description: Process payments in WooCommerce via Svea Checkout.
    16  * Version: 3.3.8
     16 * Version: 3.4.0
    1717 * Requires Plugins: woocommerce
    1818 * Author: The Generation AB
     
    4747         * Version of plugin
    4848         */
    49         const VERSION = '3.3.8';
     49        const VERSION = '3.4.0';
    5050
    5151        /**
     
    103103         */
    104104        public $compat;
     105
     106        /**
     107         * Rule integration class
     108         *
     109         * @var Rule_Integration
     110         */
     111        public $rule_integration;
    105112
    106113        /**
     
    445452            $this->compat = new Compat();
    446453            $this->compat->init();
     454
     455            $this->rule_integration = new Rule_Integration();
     456            $this->rule_integration->init();
    447457        }
    448458    }
  • svea-checkout-for-woocommerce/trunk/templates/backend/metabox.php

    r3320066 r3398960  
    33
    44if ( 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>
    1111<?php endif; ?>
    1212
    1313<?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>
    2525<?php endif; ?>
    2626
    2727<?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>
    3434<?php endif; ?>
  • svea-checkout-for-woocommerce/trunk/vendor/composer/autoload_classmap.php

    r3320066 r3398960  
    210210    'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => $baseDir . '/inc/Models/Traits/Items_From_Order.php',
    211211    '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',
    212213    'Svea_Checkout_For_Woocommerce\\Scripts' => $baseDir . '/inc/Scripts.php',
    213214    'Svea_Checkout_For_Woocommerce\\Session_Table' => $baseDir . '/inc/Session_Table.php',
  • svea-checkout-for-woocommerce/trunk/vendor/composer/autoload_static.php

    r3320066 r3398960  
    1414
    1515    public static $prefixLengthsPsr4 = array (
    16         'S' => 
     16        'S' =>
    1717        array (
    1818            'Svea_Checkout_For_Woocommerce\\' => 30,
     
    2020            'Svea\\Checkout\\' => 14,
    2121        ),
    22         'P' => 
     22        'P' =>
    2323        array (
    2424            'Psr\\Http\\Message\\' => 17,
    2525            'Psr\\Http\\Client\\' => 16,
    2626        ),
    27         'G' => 
     27        'G' =>
    2828        array (
    2929            'GuzzleHttp\\Psr7\\' => 16,
     
    3434
    3535    public static $prefixDirsPsr4 = array (
    36         'Svea_Checkout_For_Woocommerce\\' => 
     36        'Svea_Checkout_For_Woocommerce\\' =>
    3737        array (
    3838            0 => __DIR__ . '/../..' . '/inc',
    3939        ),
    40         'Svea\\Instore\\' => 
     40        'Svea\\Instore\\' =>
    4141        array (
    4242            0 => __DIR__ . '/..' . '/sveaekonomi/php-instore/lib',
    4343        ),
    44         'Svea\\Checkout\\' => 
     44        'Svea\\Checkout\\' =>
    4545        array (
    4646            0 => __DIR__ . '/..' . '/sveaekonomi/checkout/src',
    4747        ),
    48         'Psr\\Http\\Message\\' => 
     48        'Psr\\Http\\Message\\' =>
    4949        array (
    5050            0 => __DIR__ . '/..' . '/psr/http-factory/src',
    5151            1 => __DIR__ . '/..' . '/psr/http-message/src',
    5252        ),
    53         'Psr\\Http\\Client\\' => 
     53        'Psr\\Http\\Client\\' =>
    5454        array (
    5555            0 => __DIR__ . '/..' . '/psr/http-client/src',
    5656        ),
    57         'GuzzleHttp\\Psr7\\' => 
     57        'GuzzleHttp\\Psr7\\' =>
    5858        array (
    5959            0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
    6060        ),
    61         'GuzzleHttp\\Promise\\' => 
     61        'GuzzleHttp\\Promise\\' =>
    6262        array (
    6363            0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
    6464        ),
    65         'GuzzleHttp\\' => 
     65        'GuzzleHttp\\' =>
    6666        array (
    6767            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
     
    273273        'Svea_Checkout_For_Woocommerce\\Models\\Traits\\Items_From_Order' => __DIR__ . '/../..' . '/inc/Models/Traits/Items_From_Order.php',
    274274        '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',
    275276        'Svea_Checkout_For_Woocommerce\\Scripts' => __DIR__ . '/../..' . '/inc/Scripts.php',
    276277        'Svea_Checkout_For_Woocommerce\\Session_Table' => __DIR__ . '/../..' . '/inc/Session_Table.php',
Note: See TracChangeset for help on using the changeset viewer.