Plugin Directory

Changeset 2975761


Ignore:
Timestamp:
10/07/2023 03:55:54 AM (2 years ago)
Author:
bluempaymentservices
Message:

1.3.17.9: Updated BIC list in PHP library. Some improvements.

Location:
bluem
Files:
1304 added
7 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • bluem/trunk/README.md

    r2959619 r2975761  
    143143- delete `vendor/bluem-development/bluem-php/examples` to be sure as it is not necessary in production.
    144144
     145# InstantMandates (custom integration)
     146U can use our plug-in to initiate an eMandate transaction directly from, as example, within an App.
     147All u have to do is make a GET request to bluem-woocommerce/mandate_instant_request with the `debtorreference` as query.
     148Make sure the debtorreference is unique and refers to an customer/user.
     149Set the return URI within the Bluem plug-in settings.
     150
     151# Shortcodes
     152
     153## eMandate
     154It is possible to include our eMandate-meganism in a page, by using the `[bluem_machtigingsformulier]` shortcode.
     155
    145156# Integrations
    146 Besides of the integration with WooCommerce, we also have integrations with the popular ContactForm 7 and Gravity Forms. Below you'll find the instructions to active the integration.
     157Besides of the integration with WooCommerce, we also have integrations with the popular ContactForm 7 and Gravity Forms. Below you'll find the instructions to activate and use the integration.
    147158
    148159## Important notes
  • bluem/trunk/bluem-db.php

    r2932353 r2975761  
    1010function bluem_db_create_requests_table(): void {
    1111    global $wpdb, $bluem_db_version;
    12    
     12
    1313    $installed_ver = (float) get_option( "bluem_db_version" );
    1414
     
    1919
    2020        // Define table names
     21        $table_name_storage = $wpdb->prefix . 'bluem_storage';
    2122        $table_name_requests = $wpdb->prefix . 'bluem_requests';
    2223        $table_name_links = $wpdb->prefix . 'bluem_requests_links';
     
    4344        dbDelta( $sql );
    4445
    45         $sql2 = "CREATE TABLE IF NOT EXISTS `$table_name_logs` (
     46        $sql = "CREATE TABLE IF NOT EXISTS `$table_name_logs` (
    4647            id mediumint(9) NOT NULL AUTO_INCREMENT,
    4748            request_id mediumint(9) NOT NULL,
     
    4950            description varchar(512) NOT NULL,
    5051            user_id mediumint(9) NULL,
    51             PRIMARY KEY  (id)
     52            PRIMARY KEY (id)
    5253            ) $charset_collate;";
    53         dbDelta( $sql2 );
    54 
    55         $sql3 = "CREATE TABLE IF NOT EXISTS `$table_name_links` (
     54        dbDelta( $sql );
     55
     56        $sql = "CREATE TABLE IF NOT EXISTS `$table_name_links` (
    5657            id mediumint(9) NOT NULL AUTO_INCREMENT,
    5758            request_id mediumint(9) NOT NULL,
     
    5960            item_type varchar(32) NOT NULL DEFAULT 'order',
    6061            timestamp timestamp DEFAULT NOW() NOT NULL,
    61             PRIMARY KEY  (id)
     62            PRIMARY KEY (id)
    6263            ) $charset_collate;";
    63         dbDelta( $sql3 );
     64        dbDelta( $sql );
     65
     66        $sql = "CREATE TABLE IF NOT EXISTS `$table_name_storage` (
     67            id mediumint(9) NOT NULL AUTO_INCREMENT,
     68            token varchar(191) NOT NULL,
     69            secret varchar(191) NOT NULL,
     70            data longtext NOT NULL,
     71            timestamp timestamp DEFAULT NOW() NOT NULL,
     72            PRIMARY KEY (id)
     73            ) $charset_collate;";
     74        dbDelta( $sql );
    6475
    6576        // Check for previous installed versions
    66         if ( !empty( $installed_ver ) && $installed_ver <= '1.3' )
     77        if ( !empty( $installed_ver ) )
    6778        {
    6879            /**
    69              * Migrate old tables to new tables.
     80             * Migrate old tables to new tables including wp-prefix.
     81             * Old tables in release version <= 1.3.
    7082             */
    71             $bluem_requests_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests'") === 'bluem_requests';
    72             $bluem_requests_links_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests_log'") === 'bluem_requests_log';
    73             $bluem_requests_log_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests_links'") === 'bluem_requests_links';
    74 
    75             if ( $bluem_requests_table_exists ) {
    76                 $sql4 = "INSERT INTO `$table_name_requests` SELECT * FROM bluem_requests;";
    77                 dbDelta( $sql4 );
    78             }
    79 
    80             if ( $bluem_requests_log_table_exists ) {
    81                 $sql5 = "INSERT INTO `$table_name_logs` SELECT * FROM bluem_requests_log;";
    82                 dbDelta( $sql5 );
    83             }
    84 
    85             if ( $bluem_requests_links_table_exists ) {
    86                 $sql6 = "INSERT INTO `$table_name_links` SELECT * FROM bluem_requests_links;";
    87                 dbDelta( $sql6 );
     83            if ( $installed_ver <= '1.3' )
     84            {
     85                $bluem_requests_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests'") === 'bluem_requests';
     86                $bluem_requests_links_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests_log'") === 'bluem_requests_log';
     87                $bluem_requests_log_table_exists = $wpdb->get_var("SHOW TABLES LIKE 'bluem_requests_links'") === 'bluem_requests_links';
     88
     89                if ( $bluem_requests_table_exists ) {
     90                    $sql = "INSERT INTO `$table_name_requests` SELECT * FROM bluem_requests;";
     91                    dbDelta( $sql );
     92                }
     93
     94                if ( $bluem_requests_log_table_exists ) {
     95                    $sql = "INSERT INTO `$table_name_logs` SELECT * FROM bluem_requests_log;";
     96                    dbDelta( $sql );
     97                }
     98
     99                if ( $bluem_requests_links_table_exists ) {
     100                    $sql = "INSERT INTO `$table_name_links` SELECT * FROM bluem_requests_links;";
     101                    dbDelta( $sql );
     102                }
    88103            }
    89104        }
     
    98113function bluem_db_check() {
    99114    global $bluem_db_version;
    100    
     115
    101116    if ( (float) get_site_option( 'bluem_db_version' ) !== (float) $bluem_db_version ) {
    102117        bluem_db_create_requests_table();
     
    109124function bluem_db_create_request( $request_object ) {
    110125    global $wpdb;
    111    
     126
    112127    // date_default_timezone_set('Europe/Amsterdam');
    113128    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    128143
    129144        if ( isset( $request_object->order_id )
    130              && ! is_null( $request_object->order_id )
    131              && $request_object->order_id != ""
     145            && ! is_null( $request_object->order_id )
     146            && $request_object->order_id != ""
    132147        ) {
    133148            bluem_db_create_link(
     
    150165function bluem_db_request_log( $request_id, $description, $log_data = [] ) {
    151166    global $wpdb, $current_user;
    152    
    153     // date_default_timezone_set('Europe/Amsterdam');
    154     // $wpdb->time_zone = 'Europe/Amsterdam';
    155 
    156     $insert_result = $wpdb->insert(
     167
     168    // date_default_timezone_set('Europe/Amsterdam');
     169    // $wpdb->time_zone = 'Europe/Amsterdam';
     170
     171    return $wpdb->insert(
    157172        $wpdb->prefix . "bluem_requests_log",
    158173        [
     
    163178        ]
    164179    );
    165 
    166     return $insert_result;
     180}
     181
     182/**
     183 * Insert data into storage
     184 *
     185 * @param $object
     186 * @return bool
     187 * @throws Exception
     188 */
     189function bluem_db_insert_storage( $object ) {
     190    global $wpdb;
     191
     192    $table_name = $wpdb->prefix . 'bluem_storage';
     193
     194    $token = !empty( $_COOKIE['bluem_storage_token'] ) ? sanitize_text_field( $_COOKIE['bluem_storage_token'] ) : '';
     195
     196    $secret = !empty( $_COOKIE['bluem_storage_secret'] ) ? sanitize_text_field( $_COOKIE['bluem_storage_secret'] ) : '';
     197
     198    if ( !empty( $token ) && !empty( $secret ) )
     199    {
     200        $query = $wpdb->prepare( "SELECT id, data FROM $table_name WHERE token = %s AND secret = %s", $token, $secret );
     201
     202        $result = $wpdb->get_results( $query );
     203
     204        if ( $result ) {
     205            $decoded_data = json_decode( $result[0]->data, true );
     206
     207            $record_id = $result[0]->id;
     208
     209            if ( $decoded_data !== null ) {
     210                $new_object = [];
     211
     212                // Loop through current data
     213                foreach ($decoded_data as $key => $value) {
     214                    $new_object[$key] = $value;
     215                }
     216
     217                // Loop through new data
     218                foreach ($object as $key => $value) {
     219                    $new_object[$key] = $value; // Overwrite if key exists
     220                }
     221
     222                return bluem_db_update_storage($record_id, [
     223                    'data' => json_encode( $new_object ),
     224                ]);
     225            }
     226        }
     227    }
     228
     229    // Generate a 32-character token
     230    $token = bin2hex( random_bytes( 16 ) );
     231
     232    // Generate a 64-character secret
     233    $secret = bin2hex( random_bytes( 32 ) );
     234
     235    $db_result = $wpdb->insert(
     236        $wpdb->prefix . "bluem_storage",
     237        [
     238            'token' => $token,
     239            'secret' => $secret,
     240            'data' => json_encode( $object ),
     241            'timestamp' => date( "Y-m-d H:i:s" ),
     242        ]
     243    );
     244
     245    if ( $db_result !== false )
     246    {
     247        // Set cookies for token and secret for
     248        setcookie( 'bluem_storage_token', $token, 0, '/', $_SERVER['SERVER_NAME'], false, true );
     249        setcookie( 'bluem_storage_secret', $secret, 0, '/', $_SERVER['SERVER_NAME'], false, true );
     250
     251        return true;
     252    }
     253    return false;
     254}
     255
     256/**
     257 * Get data from storage.
     258 *
     259 * @param $key
     260 * @return false|mixed|void
     261 */
     262function bluem_db_get_storage( $key = null ) {
     263    global $wpdb;
     264
     265    $table_name = $wpdb->prefix . 'bluem_storage';
     266
     267    $token = !empty( $_COOKIE['bluem_storage_token'] ) ? sanitize_text_field( $_COOKIE['bluem_storage_token'] ) : '';
     268
     269    $secret = !empty( $_COOKIE['bluem_storage_secret'] ) ? sanitize_text_field( $_COOKIE['bluem_storage_secret'] ) : '';
     270
     271    if ( !empty( $token ) && !empty( $secret ) )
     272    {
     273        $query = $wpdb->prepare( "SELECT data FROM $table_name WHERE token = %s AND secret = %s", $token, $secret );
     274
     275        $result = $wpdb->get_var( $query );
     276
     277        if ( $result ) {
     278            // Decode the JSON data
     279            $decoded_data = json_decode( $result, true );
     280
     281            if ( $decoded_data !== null ) {
     282                if ( $key !== null && isset($decoded_data[ $key ]) ) {
     283                    return $decoded_data[ $key ]; // Return the specific key's value
     284                } else {
     285                    return $decoded_data; // Return the entire decoded JSON data as an array
     286                }
     287            }
     288        }
     289    }
     290    return false;
     291}
     292
     293/**
     294 * Update data from storage.
     295 *
     296 * @param $id
     297 * @param $object
     298 *
     299 * @return bool
     300 */
     301function bluem_db_update_storage( $id, $object ) {
     302    global $wpdb;
     303
     304    $table_name = $wpdb->prefix . 'bluem_storage';
     305
     306    $update_result = $wpdb->update(
     307        $table_name,
     308        $object,
     309        [
     310            'id' => $id
     311        ]
     312    );
     313
     314    if ( $update_result ) {
     315        return true;
     316    } else {
     317        return false;
     318    }
    167319}
    168320
     
    175327function bluem_db_update_request( $request_id, $request_object ) {
    176328    global $wpdb;
    177    
     329
    178330    // date_default_timezone_set('Europe/Amsterdam');
    179331    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    284436function bluem_db_delete_request_by_id( $request_id ) {
    285437    global $wpdb;
    286    
     438
    287439    // date_default_timezone_set('Europe/Amsterdam');
    288440    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    358510) {
    359511    global $wpdb;
    360    
     512
    361513    // date_default_timezone_set('Europe/Amsterdam');
    362514    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    367519    if ( count( $keyvalues ) > 0 ) {
    368520        $kvs = " WHERE ";
    369        
     521
    370522        $i = 0; foreach ($keyvalues as $key => $value) {
    371523            if ( empty($key) || $value === "" ) {
     
    381533    $query = "SELECT *  FROM  `" . $wpdb->prefix . "bluem_requests` {$kvs}";
    382534    if ( ! is_null( $sort_key ) && $sort_key !== ""
    383          && in_array( $sort_dir, [ 'ASC', 'DESC' ] )
     535        && in_array( $sort_dir, [ 'ASC', 'DESC' ] )
    384536    ) {
    385537        $query .= " ORDER BY {$sort_key} {$sort_dir}";
     
    387539
    388540    if ( ! is_null( $limit ) && $limit !== ""
    389          && is_numeric( $limit ) && $limit > 0
     541        && is_numeric( $limit ) && $limit > 0
    390542    ) {
    391543        $query .= " LIMIT {$limit}";
    392544    }
    393    
     545
    394546    try {
    395547        return $wpdb->get_results(
     
    453605
    454606    global $wpdb;
    455    
     607
    456608    // date_default_timezone_set('Europe/Amsterdam');
    457609    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    483635function bluem_db_put_request_payload( $request_id, $data ) {
    484636    $request = bluem_db_get_request_by_id( $request_id );
    485    
     637
    486638    if ( $request->payload !== "" ) {
    487639        try {
     
    507659function bluem_db_get_logs_for_request( $id ) {
    508660    global $wpdb;
    509    
     661
    510662    // date_default_timezone_set('Europe/Amsterdam');
    511663    // $wpdb->time_zone = 'Europe/Amsterdam';
     
    516668function bluem_db_get_links_for_order( $id ) {
    517669    global $wpdb;
    518    
    519     // date_default_timezone_set('Europe/Amsterdam');
    520     // $wpdb->time_zone = 'Europe/Amsterdam';
    521    
     670
     671    // date_default_timezone_set('Europe/Amsterdam');
     672    // $wpdb->time_zone = 'Europe/Amsterdam';
     673
    522674    return $wpdb->get_results( "SELECT *  FROM  `" . $wpdb->prefix . "bluem_requests_links` WHERE `item_id` = {$id} and `item_type` = 'order'ORDER BY `timestamp` DESC" );
    523675}
     
    525677function bluem_db_get_links_for_request( $id ) {
    526678    global $wpdb;
    527    
    528     // date_default_timezone_set('Europe/Amsterdam');
    529     // $wpdb->time_zone = 'Europe/Amsterdam';
    530    
     679
     680    // date_default_timezone_set('Europe/Amsterdam');
     681    // $wpdb->time_zone = 'Europe/Amsterdam';
     682
    531683    return $wpdb->get_results( "SELECT *  FROM  `" . $wpdb->prefix . "bluem_requests_links` WHERE `request_id` = {$id} ORDER BY `timestamp` DESC" );
    532684}
     
    534686function bluem_db_create_link( $request_id, $item_id, $item_type = "order" ) {
    535687    global $wpdb;
    536    
     688
    537689    // date_default_timezone_set('Europe/Amsterdam');
    538690    // $wpdb->time_zone = 'Europe/Amsterdam';
  • bluem/trunk/bluem-idin.php

    r2911421 r2975761  
    2121    }
    2222}
    23 
    24 /**
    25  * Create a session
    26  *
    27  * @return void
    28  */
    29 function bluem_register_session() {
    30     if ( empty(session_id()) ) {
    31         session_start();
    32     }
    33 }
    34 
    35 add_action( 'init', 'bluem_register_session' );
    3623
    3724function bluem_woocommerce_get_idin_option( $key ) {
     
    722709    }
    723710
    724     // ob_start();
    725     $html      = '';
     711    $html = '';
     712
    726713    $validated = false;
     714
     715    $storage = bluem_db_get_storage();
     716
    727717    if ( is_user_logged_in() ) {
    728718        $validated = get_user_meta( get_current_user_id(), "bluem_idin_validated", true ) == "1";
    729719    } else {
    730 
    731         if ( isset( $_SESSION['bluem_idin_validated'] ) && $_SESSION['bluem_idin_validated'] === true ) {
     720        if ( isset( $storage['bluem_idin_validated'] ) && $storage['bluem_idin_validated'] === true ) {
    732721            $validated = true;
    733722        }
    734         // @todo: handle $_SESSION['bluem_idin_report_agecheckresponse'] if necessary
    735 
     723        // @todo: handle $storage['bluem_idin_report_agecheckresponse'] if necessary
    736724    }
    737725
     
    771759            }
    772760
    773             if ( isset( $_SESSION['BluemIDINTransactionURL'] ) && $_SESSION['BluemIDINTransactionURL'] !== "" ) {
    774                 $retryURL = $_SESSION['BluemIDINTransactionURL'];
    775                 $html     .= "<p><a href='$retryURL' target='_self' alt='probeer opnieuw' class='button'>Probeer het opnieuw</a></p>";
     761            if ( !empty( $storage['bluem_idin_transaction_url'] ) ) {
     762                $retryURL = $storage['bluem_idin_transaction_url'];
     763                $html .= "<p><a href='$retryURL' target='_self' alt='probeer opnieuw' class='button'>Probeer het opnieuw</a></p>";
    776764            }
    777765            $html .= '</div>';
     
    785773        }
    786774    }
    787 
    788 
    789775    return $html;
    790     //ob_get_clean();
    791776}
    792777
     
    823808add_action( 'parse_request', 'bluem_idin_shortcode_callback' );
    824809/**
    825  * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in Session, sent for a SUD to the Bluem API.
     810 * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in user or Bluem session storage, sent for a SUD to the Bluem API.
    826811 *
    827812 */
     
    835820    // fallback until this is corrected in bluem-php
    836821    $bluem_config->brandID = $bluem_config->IDINBrandID;
     822
    837823    try {
    838824        $bluem = new Bluem( $bluem_config );
     
    841827    }
    842828
    843     // 27-09-2021
    844     // added retrieval of request for guest users if the session is lost
    845     // based on the debtor reference we can still retrieve valuable information
    846     // about the request
    847     $request_by_debtor_ref = false;//new Stdclass;
     829    $request_by_debtor_ref = false;
     830
    848831    if ( isset( $_GET['debtorReference'] ) && $_GET['debtorReference'] !== "" ) {
    849         $debtorReference       = $_GET['debtorReference'];
     832        $debtorReference = $_GET['debtorReference'];
    850833        $request_by_debtor_ref = bluem_db_get_request_by_debtor_reference( $debtorReference );
    851834    }
    852835
    853836    if ( is_user_logged_in() ) {
    854         $entranceCode   = get_user_meta( get_current_user_id(), "bluem_idin_entrance_code", true );
    855         $transactionID  = get_user_meta( get_current_user_id(), "bluem_idin_transaction_id", true );
     837        $entranceCode = get_user_meta( get_current_user_id(), "bluem_idin_entrance_code", true );
     838        $transactionID = get_user_meta( get_current_user_id(), "bluem_idin_transaction_id", true );
    856839        $transactionURL = get_user_meta( get_current_user_id(), "bluem_idin_transaction_url", true );
    857840    } else {
    858         if ( isset( $_SESSION["bluem_idin_entrance_code"] ) && ! is_null( $_SESSION["bluem_idin_entrance_code"] ) ) {
    859             $entranceCode = $_SESSION["bluem_idin_entrance_code"];
     841        $storage = bluem_db_get_storage();
     842
     843        if ( !empty( $storage["bluem_idin_entrance_code"] ) ) {
     844            $entranceCode = $storage["bluem_idin_entrance_code"];
    860845        } else {
    861846            if ( $request_by_debtor_ref !== false
     
    865850                $entranceCode = $request_by_debtor_ref->entrance_code;
    866851            } else {
    867                 $errormessage = "Error: bluem_idin_entrance_code from session missing - this is needed before you can complete any identification. Please go back to the shop and try again.";
     852                $errormessage = "Error: bluem_idin_entrance_code from user or Bluem session storage missing - this is needed before you can complete any identification. Please go back to the shop and try again.";
    868853                bluem_error_report_email(
    869854                    [
     
    877862            }
    878863        }
    879         if ( isset( $_SESSION["bluem_idin_transaction_id"] ) && ! is_null( $_SESSION["bluem_idin_transaction_id"] ) ) {
    880             $transactionID = $_SESSION["bluem_idin_transaction_id"];
     864
     865        if ( !empty( $storage["bluem_idin_transaction_id"] ) ) {
     866            $transactionID = $storage["bluem_idin_transaction_id"];
    881867        } else {
    882868            if ( $request_by_debtor_ref !== false
     
    886872                $transactionID = $request_by_debtor_ref->transaction_id;
    887873            } else {
    888                 $errormessage = "Error: bluem_idin_transaction_id from session missing - this is needed before you can complete any identification. Please go back to the shop and try again.";
     874                $errormessage = "Error: bluem_idin_transaction_id from user or Bluem session storage missing - this is needed before you can complete any identification. Please go back to the shop and try again.";
    889875                bluem_error_report_email(
    890876                    [
     
    911897    if ( ! $statusResponse->ReceivedResponse() ) {
    912898        $errormessage = "Error: kon verzoek met $transactionID en entrance $entranceCode niet vinden";
    913         // from session missing - this is needed before you can complete any identification. Please go back to the shop and try again.";
    914899        bluem_error_report_email(
    915900            [
     
    942927            );
    943928        } else {
    944             $_SESSION['bluem_idin_validated'] = false;
     929            bluem_db_insert_storage([
     930                'bluem_idin_validated' => false,
     931            ]);
    945932        }
    946933
     
    967954                    update_user_meta( get_current_user_id(), "bluem_idin_validated", true );
    968955                } else {
    969                     // As suggested by Joost Oostdyck | HeathenMead - juni 2021
    970                     $_SESSION['bluem_idin_validated'] = true;
    971                     $_SESSION['bluem_idin_results']   = json_encode( $identityReport );
    972                     //data van de validatie ook opslaan in de sessie, anders kun je de leeftijd etc niet ophalen
     956                    bluem_db_insert_storage([
     957                        'bluem_idin_validated' => true,
     958                        'bluem_idin_results' => json_encode( $identityReport ),
     959                    ]);
    973960                }
    974961
     
    983970                        update_user_meta( get_current_user_id(), "bluem_idin_report_agecheckresponse", $agecheckresponse );
    984971                    } else {
    985                         $_SESSION['bluem_idin_report_agecheckresponse'] = $agecheckresponse;
     972                        bluem_db_insert_storage([
     973                            'bluem_idin_report_agecheckresponse' => $agecheckresponse,
     974                        ]);
    986975                    }
    987976                }
     
    991980                        update_user_meta( get_current_user_id(), "bluem_idin_report_customeridresponse", $customeridresponse );
    992981                    } else {
    993                         $_SESSION['bluem_idin_report_customeridresponse'] = $customeridresponse;
     982                        bluem_db_insert_storage([
     983                            'bluem_idin_report_customeridresponse' => $customeridresponse,
     984                        ]);
    994985                    }
    995986                }
     
    999990                        update_user_meta( get_current_user_id(), "bluem_idin_report_last_verification_timestamp", $datetime );
    1000991                    } else {
    1001                         $_SESSION['bluem_idin_report_last_verification_timestamp'] = $datetime;
     992                        bluem_db_insert_storage([
     993                            'bluem_idin_report_last_verification_timestamp' => $datetime,
     994                        ]);
    1002995                    }
    1003996                }
     
    10121005                        );
    10131006                    } else {
    1014                         $_SESSION['bluem_idin_report_birthdate'] = $birthdate;
     1007                        bluem_db_insert_storage([
     1008                            'bluem_idin_report_birthdate' => $birthdate,
     1009                        ]);
    10151010                    }
    10161011                }
     
    10361031                }
    10371032
    1038 
    10391033                $min_age = bluem_idin_get_min_age();
     1034
    10401035                if ( $verification_scenario == 3
    10411036                     && isset( $identityReport->BirthDateResponse )
     
    10531048                            );
    10541049                        } else {
    1055                             $_SESSION['bluem_idin_report_agecheckresponse'] = "true";
     1050                            bluem_db_insert_storage([
     1051                                'bluem_idin_report_agecheckresponse' => true,
     1052                            ]);
    10561053                        }
    10571054                    }
    10581055                }
    1059                 // var_dump($request_from_db);
     1056
    10601057                if ( isset( $request_from_db ) && $request_from_db !== false ) {
    10611058                    if ( $request_from_db->payload !== "" ) {
     
    10871084            case 'Processing':
    10881085            case 'Pending':
    1089                 echo "Request has status Pending";
    1090                 echo "Request has status Processing";
    1091 
    10921086                // @todo: improve this flow
    10931087                // no break
     
    10971091                break;
    10981092            case 'Cancelled':
    1099                 echo "Request has status Cancelled";
    1100 
    11011093                // @todo: improve this flow
    11021094                // do something when the request has been canceled by the user
    11031095                break;
    11041096            case 'Open':
    1105                 echo "Request has status Open";
    1106 
    11071097                // @todo: improve this flow
    11081098                // do something when the request has not yet been completed by the user, redirecting to the transactionURL again
    11091099                break;
    11101100            case 'Expired':
    1111                 echo "Request has status Expired";
    1112 
    11131101                // @todo: improve this flow
    11141102                // do something when the request has expired
    11151103                break;
    1116             // case 'New':
    1117             //     echo "New request";
    1118             // break;
     1104            case 'New':
     1105                // @todo: improve this flow
     1106                // do something when the request is still new
     1107                break;
     1108            break;
    11191109            default:
    11201110                // unexpected status returned, show an error
     
    11261116        );
    11271117
    1128         wp_redirect(
    1129             home_url( $goto ) .
    1130             "?result=false&status=$statusCode"
    1131         );
     1118        wp_safe_redirect( $goto . "?result=false&status=$statusCode" );
     1119        exit;
    11321120    }
    11331121}
     
    13421330
    13431331function bluem_idin_retrieve_results() {
     1332    $storage = bluem_db_get_storage();
     1333
    13441334    if ( is_user_logged_in() ) {
    13451335        $raw = get_user_meta( get_current_user_id(), "bluem_idin_results", true );
    13461336    } else {
    1347         // As suggested by Joost Oostdyck | HeathenMead - juni 2021
    1348         $raw = $_SESSION['bluem_idin_results'];
     1337        $raw = $storage['bluem_idin_results'] ?? '';
    13491338    }
    13501339
     
    13711360
    13721361    $bluem_config = bluem_woocommerce_get_config();
     1362
    13731363    $bluem_config->brandID = $bluem_config->IDINBrandID;
    13741364
     
    14051395    global $current_user;
    14061396
     1397    $storage = bluem_db_get_storage();
     1398
    14071399    if ( is_user_logged_in() ) {
    14081400        return get_user_meta( get_current_user_id(), "bluem_idin_validated", true ) == "1";
    14091401    }
    14101402    // or as a guest:
    1411     if ( isset( $_SESSION['bluem_idin_validated'] ) && $_SESSION['bluem_idin_validated'] === true ) {
     1403    if ( isset( $storage['bluem_idin_validated'] ) && $storage['bluem_idin_validated'] === true ) {
    14121404        return true;
    14131405    }
     
    15211513        $response = $bluem->PerformRequest( $request );
    15221514
    1523         bluem_register_session();
    1524 
    15251515        if ( $response->ReceivedResponse() ) {
    1526             $entranceCode   = $response->GetEntranceCode();
    1527             $transactionID  = $response->GetTransactionID();
     1516            $entranceCode = $response->GetEntranceCode();
     1517            $transactionID = $response->GetTransactionID();
    15281518            $transactionURL = $response->GetTransactionURL();
    15291519
     
    15651555                );
    15661556            } else {
    1567                 $_SESSION["bluem_idin_entrance_code"]   = $entranceCode;
    1568                 $_SESSION["bluem_idin_transaction_id"]  = $transactionID;
    1569                 $_SESSION["bluem_idin_transaction_url"] = $transactionURL;
     1557                bluem_db_insert_storage([
     1558                    'bluem_idin_entrance_code' => $entranceCode,
     1559                    'bluem_idin_transaction_id' => $transactionID,
     1560                    'bluem_idin_transaction_url' => $transactionURL,
     1561                ]);
    15701562            }
    15711563
     
    17201712        echo "<h3>Identificatie</h3>";
    17211713
    1722         $validated          = bluem_idin_user_validated();
     1714        $validated = bluem_idin_user_validated();
     1715
    17231716        $validation_message = $idin_identity_topbar_no_verification_text;
    1724         // $validation_message = "Let op: Graag eerst eenmalig identificeren.";
    1725         //"Identificatie is vereist voordat de bestelling kan worden afgerond.";
    1726         $idin_logo_html = bluem_get_idin_logo_html();
    1727         // above 0: any form of verification is required
     1717
    17281718        if ( ! $validated ) {
    17291719            echo bluem_idin_generate_notice( $validation_message, true );
     
    17461736                );
    17471737            } else {
    1748                 // for debugging
    1749                 // $_SESSION['bluem_idin_report_agecheckresponse'] = "true";
    1750 
    1751                 $ageCheckResponse = $_SESSION['bluem_idin_report_agecheckresponse'];
     1738                $storage = bluem_db_get_storage();
     1739
     1740                $ageCheckResponse = $storage['bluem_idin_report_agecheckresponse'] ?? '';
    17521741            }
    1753             // var_dump($_SESSION['bluem_idin_report_agecheckresponse']);
    17541742
    17551743            // var_dump($ageCheckResponse);
     
    19451933                    );
    19461934                } else {
    1947                     $ageCheckResponse = $_SESSION['bluem_idin_report_agecheckresponse'];
     1935                    $storage = bluem_db_get_storage();
     1936
     1937                    $ageCheckResponse = $storage['bluem_idin_report_agecheckresponse'] ?? '';
    19481938                }
    19491939
     
    23542344add_action( 'user_register', 'bluem_link_idin_request_to_sesh', 10, 1 );
    23552345function bluem_link_idin_request_to_sesh( $user_id ) {
    2356     if ( ! isset( $_SESSION['bluem_idin_transaction_id'] ) ) {
     2346    $storage = bluem_db_get_storage();
     2347
     2348    if ( ! isset( $storage['bluem_idin_transaction_id'] ) ) {
    23572349        return;
    23582350    }
    23592351
    2360     $tid = $_SESSION['bluem_idin_transaction_id'];
     2352    $tid = $storage['bluem_idin_transaction_id'];
     2353
    23612354    $req = bluem_db_get_request_by_transaction_id( $tid );
    23622355
    2363     // only if the current respons from the session
     2356    // only if the current response from the Bluem session storage
    23642357    // IS NOT YET linked to any user, i.e. user_id == 0
    23652358    if ( $req->user_id == "0" ) {
     
    23882381        }
    23892382
    2390 
    23912383        update_user_meta(
    23922384            $user_id,
     
    23972389}
    23982390
    2399 
    24002391function bluem_prettyprint( $data ) {
    24012392    echo "<pre>";
  • bluem/trunk/bluem-integrations.php

    r2932353 r2975761  
    252252
    253253                // Save the necessary data to later request more information and refer to this transaction
    254                 $_SESSION['bluem_wpcf7_formId'] = $contact_form_id;
    255                 $_SESSION['bluem_mandateId'] = $request->mandateID;
    256                 $_SESSION['bluem_entranceCode'] = $request->entranceCode;
     254                bluem_db_insert_storage([
     255                    'bluem_integration_wpcf7_form_id' => $contact_form_id,
     256                    'bluem_mandate_transaction_id' => $request->mandateID,
     257                    'bluem_mandate_entrance_code' => $request->entranceCode,
     258                ]);
    257259
    258260                // Actually perform the request.
     
    289291                    $mandate_id = $response->EMandateTransactionResponse->MandateID . "";
    290292
    291                     $_SESSION['bluem_mandateId'] = $mandate_id;
    292 
    293293                    // redirect cast to string, necessary for AJAX response handling
    294294                    $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
    295295
    296                     $_SESSION['bluem_recentTransactionURL'] = $transactionURL;
     296                    bluem_db_insert_storage([
     297                        'bluem_mandate_transaction_id' => $mandate_id,
     298                        'bluem_mandate_transaction_url' => $transactionURL,
     299                    ]);
    297300
    298301                    $db_creation_result = bluem_db_create_request(
     
    430433
    431434                // Save the necessary data to later request more information and refer to this transaction
    432                 $_SESSION['bluem_wpcf7_formId'] = $contact_form_id;
    433                 $_SESSION['bluem_mandateId'] = $request->mandateID;
    434                 $_SESSION['bluem_entranceCode'] = $request->entranceCode;
     435                bluem_db_insert_storage([
     436                    'bluem_integration_wpcf7_form_id' => $contact_form_id,
     437                    'bluem_mandate_transaction_id' => $request->mandateID,
     438                    'bluem_mandate_entrance_code' => $request->entranceCode,
     439                ]);
    435440
    436441                // Actually perform the request.
     
    465470                    $mandate_id = $response->EMandateTransactionResponse->MandateID . "";
    466471
    467                     $_SESSION['bluem_mandateId'] = $mandate_id;
    468 
    469472                    // redirect cast to string, necessary for AJAX response handling
    470473                    $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
    471474
    472                     $_SESSION['bluem_recentTransactionURL'] = $transactionURL;
     475                    bluem_db_insert_storage([
     476                        'bluem_mandate_transaction_id' => $mandate_id,
     477                        'bluem_mandate_transaction_url' => $transactionURL,
     478                    ]);
    473479
    474480                    $db_creation_result = bluem_db_create_request(
     
    529535    $bluem_config = bluem_woocommerce_get_config();
    530536
     537    $storage = bluem_db_get_storage();
     538
    531539    if (strpos($_SERVER["REQUEST_URI"], 'bluem-woocommerce/bluem-integrations/wpcf7_callback') === false) {
    532540        return;
     
    543551    }
    544552
    545     $formID = $_SESSION['bluem_wpcf7_formId'];
    546 
    547     $mandateID = $_SESSION['bluem_mandateId'];
    548 
    549     $entranceCode = $_SESSION['bluem_entranceCode'];
     553    $formID = $storage['bluem_integration_wpcf7_form_id'] ?? 0;
     554
     555    $mandateID = $storage['bluem_mandate_transaction_id'] ?? 0;
     556
     557    $entranceCode = $storage['bluem_mandate_entrance_code'] ?? '';
    550558
    551559    if (empty($mandateID)) {
     
    865873
    866874                // Save the necessary data to later request more information and refer to this transaction
    867                 $_SESSION['bluem_gform_entryId'] = $payload['entry_id'];
    868                 $_SESSION['bluem_gform_formId'] = $payload['form_id'];
    869                 $_SESSION['bluem_mandateId'] = $request->mandateID;
    870                 $_SESSION['bluem_entranceCode'] = $request->entranceCode;
     875                bluem_db_insert_storage([
     876                    'bluem_integration_gform_form_id' => $payload['form_id'],
     877                    'bluem_integration_gform_entry_id' => $payload['entry_id'],
     878                    'bluem_mandate_transaction_id' => $request->mandateID,
     879                    'bluem_mandate_entrance_code' => $request->entranceCode,
     880                ]);
    871881
    872882                // Actually perform the request.
     
    901911                    $mandate_id = $response->EMandateTransactionResponse->MandateID . "";
    902912
    903                     $_SESSION['bluem_mandateId'] = $mandate_id;
    904 
    905913                    // redirect cast to string, necessary for AJAX response handling
    906914                    $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
    907915
    908                     $_SESSION['bluem_recentTransactionURL'] = $transactionURL;
     916                    bluem_db_insert_storage([
     917                        'bluem_mandate_transaction_id' => $mandate_id,
     918                        'bluem_mandate_transaction_url' => $transactionURL,
     919                    ]);
    909920
    910921                    $db_creation_result = bluem_db_create_request(
     
    9951006    $bluem_config = bluem_woocommerce_get_config();
    9961007
     1008    $storage = bluem_db_get_storage();
     1009
    9971010    if (strpos($_SERVER["REQUEST_URI"], 'bluem-woocommerce/bluem-integrations/gform_callback') === false) {
    9981011        return;
     
    10091022    }
    10101023
    1011     $formID = $_SESSION['bluem_gform_formId'];
    1012 
    1013     $entryID = $_SESSION['bluem_gform_entryId'];
    1014 
    1015     $mandateID = $_SESSION['bluem_mandateId'];
    1016 
    1017     $entranceCode = $_SESSION['bluem_entranceCode'];
     1024    $formID = $storage['bluem_integration_gform_form_id'] ?? 0;
     1025
     1026    $entryID = $storage['bluem_integration_gform_entry_id'] ?? 0;
     1027
     1028    $mandateID = $storage['bluem_mandate_transaction_id'] ?? 0;
     1029
     1030    $entranceCode = $storage['bluem_mandate_entrance_code'] ?? '';
    10181031
    10191032    if (empty($mandateID)) {
  • bluem/trunk/bluem-mandates-instant.php

    r2856097 r2975761  
    77if ( ! defined( 'ABSPATH' ) ) {
    88    exit;
    9 }
    10 
    11 if ( empty(session_id()) ) {
    12     session_start();
    139}
    1410
     
    7167
    7268            // Save the necessary data to later request more information and refer to this transaction
    73             $_SESSION['bluem_mandateId'] = $request->mandateID;
    74             $_SESSION['bluem_entranceCode'] = $request->entranceCode;
     69            bluem_db_insert_storage([
     70                'bluem_mandate_transaction_id' => $request->mandateID,
     71                'bluem_mandate_entrance_code' => $request->entranceCode,
     72            ]);
    7573
    7674            // Actually perform the request.
     
    104102                $mandate_id = $response->EMandateTransactionResponse->MandateID . "";
    105103
    106                 $_SESSION['bluem_mandateId'] = $mandate_id;
    107 
    108104                // redirect cast to string, necessary for AJAX response handling
    109105                $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
    110106
    111                 $_SESSION['bluem_recentTransactionURL'] = $transactionURL;
     107                bluem_db_insert_storage([
     108                    'bluem_mandate_transaction_id' => $mandate_id,
     109                    'bluem_mandate_transaction_url' => $transactionURL,
     110                ]);
    112111
    113112                $db_creation_result = bluem_db_create_request(
     
    155154
    156155/**
    157  * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in Session, sent for a SUD to the Bluem API.
     156 * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in Cookie, sent for a SUD to the Bluem API.
    158157 *
    159158 * @return void
     
    173172    }
    174173
    175     $mandateID = $_SESSION['bluem_mandateId'];
    176 
    177     $entranceCode = $_SESSION['bluem_entranceCode'];
     174    $storage = bluem_db_get_storage();
     175
     176    $mandateID = $storage['bluem_mandate_transaction_id'] ?? 0;
     177
     178    $entranceCode = $storage['bluem_mandate_entrance_code'] ?? '';
    178179
    179180    if (empty($mandateID)) {
     
    260261        if ( isset( $response->EMandateStatusUpdate->EMandateStatus->AcceptanceReport ) ) {
    261262            $newPayload->purchaseID = $response->EMandateStatusUpdate->EMandateStatus->PurchaseID . "";
    262             $newPayload->report     = $response->EMandateStatusUpdate->EMandateStatus->AcceptanceReport;
     263            $newPayload->report = $response->EMandateStatusUpdate->EMandateStatus->AcceptanceReport;
    263264
    264265            bluem_db_update_request(
  • bluem/trunk/bluem-mandates-shortcode.php

    r2856097 r2975761  
    77if ( ! defined( 'ABSPATH' ) ) {
    88    exit;
    9 }
    10 
    11 if ( empty(session_id()) ) {
    12     session_start();
    139}
    1410
     
    2117 *
    2218 * @return void
     19 * @throws DOMException
     20 * @throws HTTP_Request2_LogicException
     21 * @throws \Bluem\BluemPHP\Exceptions\InvalidBluemConfigurationException
    2322 */
    24 function bluem_mandate_shortcode_execute()
     23function bluem_mandate_shortcode_execute(): void
    2524{
    2625    if (substr($_SERVER["REQUEST_URI"], - 43) !== "bluem-woocommerce/mandate_shortcode_execute") {
     
    3029    global $current_user;
    3130
     31    $storage = bluem_db_get_storage();
     32
    3233    if (isset($_POST['bluem-submitted']))
    3334    {
     
    4344        if ($bluem_config->sequenceType === 'RCUR')
    4445        {
    45             if (!empty($_SESSION['bluem_debtorreference']))
     46            if (!empty($storage['bluem_mandate_debtorreference']))
    4647            {
    47                 $debtorReference = $_SESSION['bluem_debtorreference'];
     48                $debtorReference = $storage['bluem_mandate_debtorreference'];
    4849
    4950                $db_query = [
     
    5960                    $mandateID = $db_results[0]->transaction_id;
    6061
    61                     $_SESSION['bluem_mandateId'] = $mandateID;
     62                    bluem_db_insert_storage([
     63                        'bluem_mandate_transaction_id' => $mandateID,
     64                    ]);
    6265
    6366                    if (!empty($current_user)) {
     
    6972
    7073                    wp_redirect( home_url( $bluem_config->thanksPageURL ) . "?result=true" );
    71 
    72                     exit;
    73                 }
    74             }
    75             elseif (!empty($_COOKIE['bluem_debtorreference']))
    76             {
    77                 $debtorReference = $_COOKIE['bluem_debtorreference'];
    78 
    79                 $db_query = [
    80                     'debtor_reference' => $debtorReference,
    81                     'user_id' => get_current_user_id(),
    82                     'status' => 'Success',
    83                 ];
    84 
    85                 // Check for a successful transaction
    86                 $db_results = bluem_db_get_requests_by_keyvalues($db_query);
    87 
    88                 if ($db_results !== false && is_array($db_results) && sizeof($db_results) > 0) {
    89                     $mandateID = $db_results[0]->transaction_id;
    90 
    91                     $_SESSION['bluem_mandateId'] = $mandateID;
    92 
    93                     if (!empty($current_user)) {
    94                         if (current_user_can('edit_user', $current_user->ID)) {
    95                             update_user_meta( $current_user->ID, "bluem_mandates_validated", true );
    96                             update_user_meta( $current_user->ID, "bluem_latest_mandate_id", $mandateID );
    97                         }
    98                     }
    99 
    100                     wp_redirect( home_url( $bluem_config->thanksPageURL ) . "?result=true" );
    101 
    10274                    exit;
    10375                }
     
    10981                    $debtorReference = sanitize_text_field( $_POST["bluem_debtorReference"] );
    11082
    111                     $_SESSION['bluem_debtorreference'] = $debtorReference;
     83                    bluem_db_insert_storage([
     84                        'bluem_mandate_debtorreference' => $debtorReference,
     85                    ]);
    11286
    11387                    $db_query = [
     
    12397                        $mandateID = $db_results[0]->transaction_id;
    12498
    125                         $_SESSION['bluem_mandateId'] = $mandateID;
     99                        bluem_db_insert_storage([
     100                            'bluem_mandate_transaction_id' => $mandateID,
     101                        ]);
    126102
    127103                        if (!empty($current_user)) {
     
    142118                        $debtorReference = $current_user->user_nicename();
    143119
    144                         $_SESSION['bluem_debtorreference'] = $debtorReference;
     120                        bluem_db_insert_storage([
     121                            'bluem_mandate_debtorreference' => $debtorReference,
     122                        ]);
    145123                    }
    146124                }
     
    152130                $debtorReference = sanitize_text_field( $_POST["bluem_debtorReference"] );
    153131
    154                 $_SESSION['bluem_debtorreference'] = $debtorReference;
     132                bluem_db_insert_storage([
     133                    'bluem_mandate_debtorreference' => $debtorReference,
     134                ]);
    155135            } else {
    156136                if ( is_user_logged_in() ) {
    157137                    $debtorReference = $current_user->user_nicename();
    158138
    159                     $_SESSION['bluem_debtorreference'] = $debtorReference;
     139                    bluem_db_insert_storage([
     140                        'bluem_mandate_debtorreference' => $debtorReference,
     141                    ]);
    160142                }
    161143            }
     
    190172
    191173        // Save the necessary data to later request more information and refer to this transaction
    192         $_SESSION['bluem_mandateId'] = $request->mandateID;
    193         $_SESSION['bluem_entranceCode'] = $request->entranceCode;
     174        bluem_db_insert_storage([
     175            'bluem_mandate_transaction_id' => $request->mandateID,
     176            'bluem_mandate_entrance_code' => $request->entranceCode,
     177        ]);
    194178
    195179        if (!empty($current_user))
     
    199183                    $current_user->ID,
    200184                    "bluem_latest_mandate_entrance_code",
    201                     $request->entranceCode . ""
     185                    $request->entranceCode
    202186                );
    203187            }
     
    233217        $mandate_id = $response->EMandateTransactionResponse->MandateID . "";
    234218
    235         $_SESSION['bluem_mandateId'] = $mandate_id;
     219        // redirect cast to string, necessary for AJAX response handling
     220        $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
     221
     222        bluem_db_insert_storage([
     223            'bluem_mandate_transaction_id' => $mandate_id,
     224            'bluem_mandate_transaction_url' => $transactionURL,
     225        ]);
    236226
    237227        if (!empty($current_user))
     
    246236        }
    247237
    248         // redirect cast to string, necessary for AJAX response handling
    249         $transactionURL = ( $response->EMandateTransactionResponse->TransactionURL . "" );
    250 
    251         $_SESSION['bluem_recentTransactionURL'] = $transactionURL;
    252 
    253         $db_creation_result = bluem_db_create_request(
     238        bluem_db_create_request(
    254239            [
    255240                'entrance_code'    => $request->entranceCode,
     
    278263        ob_start();
    279264        wp_redirect( $transactionURL );
    280 
    281265        exit;
    282266    }
     
    286270add_action( 'parse_request', 'bluem_mandate_mandate_shortcode_callback' );
    287271/**
    288  * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in Session, sent for a SUD to the Bluem API.
     272 * This function is executed at a callback GET request with a given mandateId. This is then, together with the entranceCode in Cookie, sent for a SUD to the Bluem API.
    289273 *
    290274 * @return void
    291275 */
    292 function bluem_mandate_mandate_shortcode_callback()
     276function bluem_mandate_mandate_shortcode_callback(): void
    293277{
    294278    if (strpos($_SERVER["REQUEST_URI"], "bluem-woocommerce/mandate_shortcode_callback") === false) {
     
    301285
    302286    $bluem_config->merchantReturnURLBase = home_url( 'wc-api/bluem_mandates_callback' );
     287
     288    $storage = bluem_db_get_storage();
    303289
    304290    try {
     
    306292    } catch ( Exception $e ) {
    307293        // @todo: deal with incorrectly setup Bluem
     294        // $e->getMessage();
    308295    }
    309296
     
    313300        $entranceCode = get_user_meta( $current_user->ID, "bluem_latest_mandate_entrance_code", true );
    314301    } else {
    315         $mandateID = $_SESSION['bluem_mandateId'];
    316         $entranceCode = $_SESSION['bluem_entranceCode'];
     302        $mandateID = $storage['bluem_mandate_transaction_id'] ?? 0;
     303        $entranceCode = $storage['bluem_mandate_entrance_code'] ?? '';
    317304    }
    318305
     
    391378    {
    392379        // Define a cookie so that this will be recognised the next time
    393         setcookie('bluem_debtorreference', $debtorReference, time()+60*60*24*30, '/', $_SERVER['SERVER_NAME'], false, true);
     380        bluem_db_insert_storage([
     381            'bluem_mandate_transaction_id' => $mandateID,
     382        ]);
    394383
    395384        if (!empty($current_user)) {
     
    420409            );
    421410        }
    422 
    423         $request_from_db = bluem_db_get_request_by_transaction_id_and_type(
    424             $mandateID,
    425             "mandates"
    426         );
    427 
    428411        wp_redirect( home_url( $bluem_config->thanksPageURL ) . "?result=true" );
    429412        exit;
     
    454437                'service'  => 'mandates',
    455438                'function' => 'shortcode_callback',
    456                 'message'  => "Fout: Onbekende of foutieve status teruggekregen: {$statusCode}<br>Neem contact op met de webshop en vermeld deze status; gebruiker wel doorverwezen terug naar site"
     439                'message'  => "Fout: Onbekende of foutieve status teruggekregen: $statusCode<br>Neem contact op met de webshop en vermeld deze status; gebruiker wel doorverwezen terug naar site"
    457440            ]
    458441        );
     
    468451 * Shortcode: `[bluem_machtigingsformulier]`
    469452 *
    470  * @return void
     453 * @return string
    471454 */
    472 function bluem_mandateform()
     455function bluem_mandateform(): string
    473456{
    474457    global $current_user;
    475458
    476459    $bluem_config = bluem_woocommerce_get_config();
     460
     461    $storage = bluem_db_get_storage();
    477462
    478463    $bluem_config->merchantReturnURLBase = home_url(
    479464        'wc-api/bluem_mandates_callback'
    480465    );
    481 
    482     $bluem = new Bluem( $bluem_config );
    483466
    484467    $user_allowed = apply_filters(
     
    490473        return '';
    491474    }
     475
     476    $mandateID = 0;
    492477
    493478    $validated = false;
     
    528513         * Visitor not logged in. Check other storages.
    529514         */
    530         if (!empty($_SESSION['bluem_mandateId']))
    531         {
    532             $mandateID = $_SESSION['bluem_mandateId'];
     515        if (!empty($storage['bluem_mandate_transaction_id']))
     516        {
     517            $mandateID = $storage['bluem_mandate_transaction_id'];
    533518
    534519            // Check for recurring mode
     
    549534            }
    550535        }
    551         elseif (!empty($_SESSION['bluem_debtorreference']))
    552         {
    553             $debtorReference = $_SESSION['bluem_debtorreference'];
     536        elseif (!empty($storage['bluem_mandate_debtorreference']))
     537        {
     538            $debtorReference = $storage['bluem_mandate_debtorreference'];
    554539
    555540            // Check for recurring mode
     
    570555            }
    571556        }
    572         elseif (!empty($_COOKIE['bluem_debtorreference']))
    573         {
    574             $debtorReference = $_COOKIE['bluem_debtorreference'];
    575 
    576             // Check for recurring mode
    577             if ($bluem_config->sequenceType === 'RCUR') {
    578                 $db_query = [
    579                     'debtor_reference' => $debtorReference,
    580                     'user_id' => get_current_user_id(),
    581                     'status' => 'Success',
    582                 ];
    583 
    584                 $db_results = bluem_db_get_requests_by_keyvalues($db_query);
    585 
    586                 if ($db_results !== false && is_array($db_results) && sizeof($db_results) > 0) {
    587                     $mandateID = $db_results[0]->transaction_id;
    588 
    589                     $validated = true;
    590                 }
    591             }
    592         }
    593557    }
    594558
    595559    /**
    596      * Check if eMandate is valide..
     560     * Check if eMandate is valid..
    597561     */
    598562    if ($validated !== false) {
  • bluem/trunk/bluem.php

    r2959619 r2975761  
    22/**
    33 * Plugin Name: Bluem ePayments, iDIN and eMandates integration for shortcodes and WooCommerce checkout
    4  * Version: 1.3.17.8
     4 * Version: 1.3.17.9
    55 * Plugin URI: https://wordpress.org/plugins/bluem
    66 * Description: Bluem integration for WordPress and WooCommerce to facilitate Bluem services inside your site. Payments and eMandates payment gateway and iDIN identity verification
     
    1111 *
    1212 * WC requires at least: 5.0.0
    13  * WC tested up to: 8.0
     13 * WC tested up to: 8.1
    1414 *
    1515 * Text Domain: bluem
     
    2929
    3030global $bluem_db_version;
    31 $bluem_db_version = 1.4;
     31$bluem_db_version = 1.5;
    3232
    3333const BLUEM_WOOCOMMERCE_MANUAL_URL = "https://codexology.notion.site/Bluem-voor-WordPress-en-WooCommerce-Handleiding-9e2df5c5254a4b8f9cbd272fae641f5e";
     
    306306    $bluem_plugin_registration = get_option( 'bluem_plugin_registration' );
    307307
    308     if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
    309         $acc_senderid = sanitize_text_field($_POST['acc_senderid']);
    310         $acc_testtoken = sanitize_text_field($_POST['acc_testtoken']);
    311         $acc_prodtoken = sanitize_text_field($_POST['acc_prodtoken']);
    312 
    313         $company_name = sanitize_text_field($_POST['company_name']);
    314         $company_telephone = sanitize_text_field($_POST['company_telephone']);
    315         $company_email = sanitize_text_field($_POST['company_email']);
    316        
    317         $tech_name = sanitize_text_field($_POST['tech_name']);
    318         $tech_telephone = sanitize_text_field($_POST['tech_telephone']);
    319         $tech_email = sanitize_text_field($_POST['tech_email']);
    320 
    321         $bluem_options['senderID'] = $acc_senderid;
    322         $bluem_options['test_accessToken'] = $acc_testtoken;
    323         $bluem_options['production_accessToken'] = $acc_prodtoken;
    324 
    325         $bluem_registration['company']['name'] = $company_name;
    326         $bluem_registration['company']['telephone'] = $company_telephone;
    327         $bluem_registration['company']['email'] = $company_email;
    328        
    329         $bluem_registration['tech_contact']['name'] = $tech_name;
    330         $bluem_registration['tech_contact']['telephone'] = $tech_telephone;
    331         $bluem_registration['tech_contact']['email'] = $tech_email;
    332 
    333         // Sent registration notify email
    334         bluem_registration_report_email();
    335 
    336         // Update Bluem options
    337         update_option('bluem_woocommerce_options', $bluem_options);
    338 
    339         // Update Bluem registration
    340         update_option('bluem_woocommerce_registration', $bluem_registration);
    341 
    342         // Set plugin registration as done
    343         update_option('bluem_plugin_registration', true);
    344 
    345         wp_redirect(
    346             admin_url( "admin.php?page=bluem-activate" )
    347         );
     308    $required_fields = [
     309        'company_name',
     310        'company_telephone',
     311        'company_email',
     312        'tech_name',
     313        'tech_telephone',
     314        'tech_email'
     315    ];
     316
     317    if ( $_SERVER['REQUEST_METHOD'] === 'POST' )
     318    {
     319        // Validate input
     320        $is_valid = true;
     321
     322        foreach ($required_fields as $required_field)
     323        {
     324            $value = $_POST[$required_field];
     325
     326            if ( empty ($value) ) {
     327                $is_valid = false;
     328            }
     329        }
     330
     331        if ( $is_valid )
     332        {
     333            $acc_senderid = sanitize_text_field($_POST['acc_senderid']);
     334            $acc_testtoken = sanitize_text_field($_POST['acc_testtoken']);
     335            $acc_prodtoken = sanitize_text_field($_POST['acc_prodtoken']);
     336
     337            $company_name = sanitize_text_field($_POST['company_name']);
     338            $company_telephone = sanitize_text_field($_POST['company_telephone']);
     339            $company_email = sanitize_text_field($_POST['company_email']);
     340
     341            $tech_name = sanitize_text_field($_POST['tech_name']);
     342            $tech_telephone = sanitize_text_field($_POST['tech_telephone']);
     343            $tech_email = sanitize_text_field($_POST['tech_email']);
     344
     345            $bluem_options['senderID'] = $acc_senderid;
     346            $bluem_options['test_accessToken'] = $acc_testtoken;
     347            $bluem_options['production_accessToken'] = $acc_prodtoken;
     348
     349            $bluem_registration['company']['name'] = $company_name;
     350            $bluem_registration['company']['telephone'] = $company_telephone;
     351            $bluem_registration['company']['email'] = $company_email;
     352
     353            $bluem_registration['tech_contact']['name'] = $tech_name;
     354            $bluem_registration['tech_contact']['telephone'] = $tech_telephone;
     355            $bluem_registration['tech_contact']['email'] = $tech_email;
     356
     357            // Sent registration notify email
     358            bluem_registration_report_email();
     359
     360            // Update Bluem options
     361            update_option('bluem_woocommerce_options', $bluem_options);
     362
     363            // Update Bluem registration
     364            update_option('bluem_woocommerce_registration', $bluem_registration);
     365
     366            // Set plugin registration as done
     367            update_option('bluem_plugin_registration', true);
     368
     369            wp_redirect(
     370                admin_url( "admin.php?page=bluem-activate" )
     371            );
     372        }
    348373    }
    349374
     
    920945
    921946add_action( 'admin_init', 'bluem_woocommerce_register_settings' );
    922 
    923 function start_session() {
    924     if ( session_status() === PHP_SESSION_NONE ) {
    925         session_start();
    926     }
    927 }
    928 add_action('init', 'start_session');
    929947
    930948add_action( 'show_user_profile', 'bluem_woocommerce_show_general_profile_fields', 1 );
  • bluem/trunk/composer.lock

    r2959619 r2975761  
    99        {
    1010            "name": "bluem-development/bluem-php",
    11             "version": "2.3.2.4",
     11            "version": "2.3.2.6",
    1212            "source": {
    1313                "type": "git",
    1414                "url": "https://github.com/bluem-development/bluem-php.git",
    15                 "reference": "e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c"
    16             },
    17             "dist": {
    18                 "type": "zip",
    19                 "url": "https://api.github.com/repos/bluem-development/bluem-php/zipball/e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c",
    20                 "reference": "e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c",
     15                "reference": "55e4eb2dbf9220d12a5cb579dad66d2b92575b94"
     16            },
     17            "dist": {
     18                "type": "zip",
     19                "url": "https://api.github.com/repos/bluem-development/bluem-php/zipball/55e4eb2dbf9220d12a5cb579dad66d2b92575b94",
     20                "reference": "55e4eb2dbf9220d12a5cb579dad66d2b92575b94",
    2121                "shasum": ""
    2222            },
     
    7171            "support": {
    7272                "issues": "https://github.com/bluem-development/bluem-php",
    73                 "source": "https://github.com/bluem-development/bluem-php/tree/2.3.2.4"
    74             },
    75             "time": "2023-08-28T17:17:39+00:00"
     73                "source": "https://github.com/bluem-development/bluem-php/tree/2.3.2.6"
     74            },
     75            "time": "2023-09-29T17:12:12+00:00"
    7676        },
    7777        {
     
    127127        {
    128128            "name": "nesbot/carbon",
    129             "version": "2.69.0",
     129            "version": "2.71.0",
    130130            "source": {
    131131                "type": "git",
    132132                "url": "https://github.com/briannesbitt/Carbon.git",
    133                 "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c"
    134             },
    135             "dist": {
    136                 "type": "zip",
    137                 "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4308217830e4ca445583a37d1bf4aff4153fa81c",
    138                 "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c",
     133                "reference": "98276233188583f2ff845a0f992a235472d9466a"
     134            },
     135            "dist": {
     136                "type": "zip",
     137                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a",
     138                "reference": "98276233188583f2ff845a0f992a235472d9466a",
    139139                "shasum": ""
    140140            },
     
    229229                }
    230230            ],
    231             "time": "2023-08-03T09:00:52+00:00"
     231            "time": "2023-09-25T11:31:05+00:00"
    232232        },
    233233        {
     
    10551055        {
    10561056            "name": "composer/semver",
    1057             "version": "3.3.2",
     1057            "version": "3.4.0",
    10581058            "source": {
    10591059                "type": "git",
    10601060                "url": "https://github.com/composer/semver.git",
    1061                 "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9"
    1062             },
    1063             "dist": {
    1064                 "type": "zip",
    1065                 "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9",
    1066                 "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9",
     1061                "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
     1062            },
     1063            "dist": {
     1064                "type": "zip",
     1065                "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
     1066                "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
    10671067                "shasum": ""
    10681068            },
     
    11141114            ],
    11151115            "support": {
    1116                 "irc": "irc://irc.freenode.org/composer",
     1116                "irc": "ircs://irc.libera.chat:6697/composer",
    11171117                "issues": "https://github.com/composer/semver/issues",
    1118                 "source": "https://github.com/composer/semver/tree/3.3.2"
     1118                "source": "https://github.com/composer/semver/tree/3.4.0"
    11191119            },
    11201120            "funding": [
     
    11321132                }
    11331133            ],
    1134             "time": "2022-04-01T19:23:25+00:00"
     1134            "time": "2023-08-31T09:50:34+00:00"
    11351135        },
    11361136        {
     
    12391239        {
    12401240            "name": "doctrine/deprecations",
    1241             "version": "v1.1.1",
     1241            "version": "1.1.2",
    12421242            "source": {
    12431243                "type": "git",
    12441244                "url": "https://github.com/doctrine/deprecations.git",
    1245                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
    1246             },
    1247             "dist": {
    1248                 "type": "zip",
    1249                 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
    1250                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
     1245                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
     1246            },
     1247            "dist": {
     1248                "type": "zip",
     1249                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
     1250                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
    12511251                "shasum": ""
    12521252            },
     
    12801280            "support": {
    12811281                "issues": "https://github.com/doctrine/deprecations/issues",
    1282                 "source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
    1283             },
    1284             "time": "2023-06-03T09:27:29+00:00"
     1282                "source": "https://github.com/doctrine/deprecations/tree/1.1.2"
     1283            },
     1284            "time": "2023-09-27T20:04:15+00:00"
    12851285        },
    12861286        {
     
    19551955        {
    19561956            "name": "phpstan/phpdoc-parser",
    1957             "version": "1.23.1",
     1957            "version": "1.24.2",
    19581958            "source": {
    19591959                "type": "git",
    19601960                "url": "https://github.com/phpstan/phpdoc-parser.git",
    1961                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26"
    1962             },
    1963             "dist": {
    1964                 "type": "zip",
    1965                 "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26",
    1966                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26",
     1961                "reference": "bcad8d995980440892759db0c32acae7c8e79442"
     1962            },
     1963            "dist": {
     1964                "type": "zip",
     1965                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
     1966                "reference": "bcad8d995980440892759db0c32acae7c8e79442",
    19671967                "shasum": ""
    19681968            },
     
    19961996            "support": {
    19971997                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
    1998                 "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1"
    1999             },
    2000             "time": "2023-08-03T16:32:59+00:00"
     1998                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
     1999            },
     2000            "time": "2023-09-26T12:28:12+00:00"
    20012001        },
    20022002        {
    20032003            "name": "phpunit/php-code-coverage",
    2004             "version": "9.2.27",
     2004            "version": "9.2.29",
    20052005            "source": {
    20062006                "type": "git",
    20072007                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
    2008                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1"
    2009             },
    2010             "dist": {
    2011                 "type": "zip",
    2012                 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1",
    2013                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1",
     2008                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
     2009            },
     2010            "dist": {
     2011                "type": "zip",
     2012                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
     2013                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
    20142014                "shasum": ""
    20152015            },
     
    20682068                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
    20692069                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
    2070                 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27"
     2070                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
    20712071            },
    20722072            "funding": [
     
    20762076                }
    20772077            ],
    2078             "time": "2023-07-26T13:44:30+00:00"
     2078            "time": "2023-09-19T04:57:46+00:00"
    20792079        },
    20802080        {
     
    23212321        {
    23222322            "name": "phpunit/phpunit",
    2323             "version": "9.6.11",
     2323            "version": "9.6.13",
    23242324            "source": {
    23252325                "type": "git",
    23262326                "url": "https://github.com/sebastianbergmann/phpunit.git",
    2327                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0"
    2328             },
    2329             "dist": {
    2330                 "type": "zip",
    2331                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0",
    2332                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0",
     2327                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be"
     2328            },
     2329            "dist": {
     2330                "type": "zip",
     2331                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be",
     2332                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be",
    23332333                "shasum": ""
    23342334            },
     
    23452345                "phar-io/version": "^3.0.2",
    23462346                "php": ">=7.3",
    2347                 "phpunit/php-code-coverage": "^9.2.13",
     2347                "phpunit/php-code-coverage": "^9.2.28",
    23482348                "phpunit/php-file-iterator": "^3.0.5",
    23492349                "phpunit/php-invoker": "^3.1.1",
     
    24042404                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
    24052405                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
    2406                 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11"
     2406                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13"
    24072407            },
    24082408            "funding": [
     
    24202420                }
    24212421            ],
    2422             "time": "2023-08-19T07:10:56+00:00"
     2422            "time": "2023-09-19T05:39:22+00:00"
    24232423        },
    24242424        {
  • bluem/trunk/readme.txt

    r2959619 r2975761  
    66Tested up to: 6.3
    77Requires PHP: 7.4
    8 Stable tag: 1.3.17.8
     8Stable tag: 1.3.17.9
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676
    7777== Changelog ==
     78- 1.3.17.9: Updated BIC list in PHP library. Some improvements.
    7879- 1.3.17.8: Updated BIC list PHP library. Some improvements.
    7980- 1.3.17.7: Updated PHP library for certificates.
  • bluem/trunk/vendor/bluem-development/bluem-php/README.md

    r2959619 r2975761  
    864864- Revolut   <BR> BIC: `REVOLT21`
    865865- Yoursafe   <BR> BIC: `BITSNL2A`
     866- N26   <BR> BIC: `NTSBDEB1`
    866867#### eMandates CORE
    867868- ABN AMRO  <BR> BIC: `ABNANL2A`
     
    887888- SNS   <BR> BIC: `SNSBNL2A`
    888889
    889 Please note: Triodos Bank with BIC: `TRIONL2U` does not support Identity anymore as of 1st of June 2021.
     890Please note: Knab with BIC: `KNABNL2H` does not support eMandates CORE anymore as of 4th of October 2023.
    890891
    891892---
  • bluem/trunk/vendor/bluem-development/bluem-php/phpunit.xml

    r2959619 r2975761  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
     2<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
    33  <testsuites>
    44    <testsuite name="Unit">
  • bluem/trunk/vendor/bluem-development/bluem-php/src/Contexts/PaymentsContext.php

    r2959619 r2975761  
    4545                new BIC("ABNANL2A", "ABN AMRO"),
    4646                new BIC("ASNBNL21", "ASN Bank"),
    47                 new BIC("BUNQNL2A", "bunq"),
     47                new BIC("BUNQNL2A", "Bunq"),
    4848                new BIC("INGBNL2A", "ING"),
    4949                new BIC("KNABNL2H", "Knab"),
     
    5656                new BIC("BITSNL2A", "Yoursafe"),
    5757                new BIC("NTSBDEB1", "N26"),
     58                new BIC("NNBANL2G", "Nationale-Nederlanden"),
    5859            ]
    5960        );
  • bluem/trunk/vendor/bluem-development/bluem-php/src/Responses/IBANNameCheckBluemResponse.php

    r2959619 r2975761  
    3939    }
    4040
    41 
    4241    public function GetIBANResult(): string
    4342    {
    44         return $this->getKeyFromIBANCheckResult("IBANResult");
     43        return $this->getKeyFromIBANCheckResult("IBANResult", "IBANCheckResult");
    4544    }
    4645
    4746    public function GetNameResult(): string
    4847    {
    49         return $this->getKeyFromIBANCheckResult("NameResult");
     48        return $this->getKeyFromIBANCheckResult("NameResult", "IBANCheckResult");
    5049    }
    5150
    5251    public function GetSuggestedName(): string
    5352    {
    54         return $this->getKeyFromIBANCheckResult("SuggestedName");
     53        return $this->getKeyFromIBANCheckResult("SuggestedName", "IBANCheckResult");
    5554    }
    5655
    5756    public function GetAccountStatus(): string
    5857    {
    59         return $this->getKeyFromIBANCheckResult("AccountStatus");
     58        return $this->getKeyFromIBANCheckResult("AccountStatus", "IBANCheckResult");
    6059    }
    6160
    6261    public function GetAccountType(): string
    6362    {
    64         return $this->getKeyFromIBANCheckResult("AccountStatus", "AccountDetails");
     63        return $this->getKeyFromIBANCheckResult("AccountType", "AccountDetails");
    6564    }
    6665
     
    8079    }
    8180}
    82 
    83 /* Response:
    84  *
    85 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    86 <IBANCheckInterface mode="direct" senderID="S1018" version="1.0" createDateTime="2019-09-09T08:43:58.022Z" messageCount="1" type="TransactionResponse">
    87     <IBANCheckTransactionResponse entranceCode="S101820190909084357980">
    88         <IBAN>NL59INGB0748545824</IBAN>
    89         <AssumedName>Zeeland</AssumedName>
    90         <DebtorReference>12345678</DebtorReference>
    91         <IBANCheckResult>
    92             <IBANResult>KNOWN</IBANResult>
    93             <NameResult>MISTYPED</NameResult>
    94             <SuggestedName>Naar Zeeland</SuggestedName>
    95             <AccountStatus>ACTIVE</AccountStatus>
    96         </IBANCheckResult>
    97         <AccountDetails>
    98             <AccountType>NATURAL_PERSON</AccountType>
    99             <IsJointAccount>true</IsJointAccount>
    100             <NumberOfAccountHolders>2</NumberOfAccountHolders>
    101             <CountryName>Netherlands</CountryName>
    102         </AccountDetails>
    103     </IBANCheckTransactionResponse>
    104 </IBANCheckInterface>
    105  *
    106  */
  • bluem/trunk/vendor/bluem-development/bluem-php/tests/Integration/IPAPITest.php

    r2959619 r2975761  
    1414class IPAPITest extends TestCase
    1515{
     16    private IPAPI $IPAPI;
     17
    1618    protected function setUp(): void
    1719    {
  • bluem/trunk/vendor/composer/installed.json

    r2959619 r2975761  
    33        {
    44            "name": "bluem-development/bluem-php",
    5             "version": "2.3.2.4",
    6             "version_normalized": "2.3.2.4",
     5            "version": "2.3.2.6",
     6            "version_normalized": "2.3.2.6",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/bluem-development/bluem-php.git",
    10                 "reference": "e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/bluem-development/bluem-php/zipball/e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c",
    15                 "reference": "e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c",
     10                "reference": "55e4eb2dbf9220d12a5cb579dad66d2b92575b94"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/bluem-development/bluem-php/zipball/55e4eb2dbf9220d12a5cb579dad66d2b92575b94",
     15                "reference": "55e4eb2dbf9220d12a5cb579dad66d2b92575b94",
    1616                "shasum": ""
    1717            },
     
    3535                "vlucas/phpdotenv": "^5.4"
    3636            },
    37             "time": "2023-08-28T17:17:39+00:00",
     37            "time": "2023-09-29T17:12:12+00:00",
    3838            "type": "package",
    3939            "installation-source": "dist",
     
    6868            "support": {
    6969                "issues": "https://github.com/bluem-development/bluem-php",
    70                 "source": "https://github.com/bluem-development/bluem-php/tree/2.3.2.4"
     70                "source": "https://github.com/bluem-development/bluem-php/tree/2.3.2.6"
    7171            },
    7272            "install-path": "../bluem-development/bluem-php"
     
    127127        {
    128128            "name": "nesbot/carbon",
    129             "version": "2.69.0",
    130             "version_normalized": "2.69.0.0",
     129            "version": "2.71.0",
     130            "version_normalized": "2.71.0.0",
    131131            "source": {
    132132                "type": "git",
    133133                "url": "https://github.com/briannesbitt/Carbon.git",
    134                 "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c"
    135             },
    136             "dist": {
    137                 "type": "zip",
    138                 "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4308217830e4ca445583a37d1bf4aff4153fa81c",
    139                 "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c",
     134                "reference": "98276233188583f2ff845a0f992a235472d9466a"
     135            },
     136            "dist": {
     137                "type": "zip",
     138                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a",
     139                "reference": "98276233188583f2ff845a0f992a235472d9466a",
    140140                "shasum": ""
    141141            },
     
    164164                "squizlabs/php_codesniffer": "^3.4"
    165165            },
    166             "time": "2023-08-03T09:00:52+00:00",
     166            "time": "2023-09-25T11:31:05+00:00",
    167167            "bin": [
    168168                "bin/carbon"
  • bluem/trunk/vendor/composer/installed.php

    r2959619 r2975761  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '3188820c0082b4b69db61c8739f9885dea285efa',
     6        'reference' => 'f136d980d3c9db6ca0dee4da23d8a088c245e311',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'bluem-development/bluem-php' => array(
    14             'pretty_version' => '2.3.2.4',
    15             'version' => '2.3.2.4',
    16             'reference' => 'e101cb1b6fc8f7629f02cc0bad6e2124a6e4fd6c',
     14            'pretty_version' => '2.3.2.6',
     15            'version' => '2.3.2.6',
     16            'reference' => '55e4eb2dbf9220d12a5cb579dad66d2b92575b94',
    1717            'type' => 'package',
    1818            'install_path' => __DIR__ . '/../bluem-development/bluem-php',
     
    2323            'pretty_version' => 'dev-master',
    2424            'version' => 'dev-master',
    25             'reference' => '3188820c0082b4b69db61c8739f9885dea285efa',
     25            'reference' => 'f136d980d3c9db6ca0dee4da23d8a088c245e311',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../../',
     
    3939        ),
    4040        'nesbot/carbon' => array(
    41             'pretty_version' => '2.69.0',
    42             'version' => '2.69.0.0',
    43             'reference' => '4308217830e4ca445583a37d1bf4aff4153fa81c',
     41            'pretty_version' => '2.71.0',
     42            'version' => '2.71.0.0',
     43            'reference' => '98276233188583f2ff845a0f992a235472d9466a',
    4444            'type' => 'library',
    4545            'install_path' => __DIR__ . '/../nesbot/carbon',
  • bluem/trunk/vendor/nesbot/carbon/readme.md

    r2959619 r2975761  
    125125<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
    126126<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="89" height="64"></a>
    127 <a title="Gives a fun for our users" href="https://slotoking.ua?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Игровые автоматы" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
     127<a title="Gives a fun for our users" href="https://slotoking.ua/games/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Игровые автоматы" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
    128128<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
    129129<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.kyiv.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
     130<a title="Chudovo - international software development company with representative offices in Kyiv, Cologne, New York, Tallinn and London. It has been working on the market since 2006. Company has domain expertise in video security, logistics, medicine, finance and" href="https://chudovo.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Chudovo" src="https://opencollective-production.s3.us-west-1.amazonaws.com/326c19a0-2e87-11eb-a13a-c99a2a201d11.png" width="424" height="64"></a>
    130131<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations. " href="https://azuracast.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="64" height="64"></a>
    131132<a title="Triplebyte is the first software engineering job platform that is on the developer&#039;s side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="64" height="64"></a>
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php

    r2932353 r2975761  
    1616use Carbon\Exceptions\InvalidCastException;
    1717use Carbon\Exceptions\InvalidIntervalException;
     18use Carbon\Exceptions\OutOfRangeException;
    1819use Carbon\Exceptions\ParseErrorException;
    1920use Carbon\Exceptions\UnitNotConfiguredException;
     
    3334use DateTimeZone;
    3435use Exception;
     36use InvalidArgumentException;
    3537use ReflectionException;
    3638use ReturnTypeWillChange;
     39use RuntimeException;
    3740use Throwable;
    3841
     
    248251
    249252    /**
     253     * @var bool
     254     */
     255    private static $floatSettersEnabled = false;
     256
     257    /**
    250258     * The registered macros.
    251259     *
     
    348356    }
    349357
     358    /**
     359     * This option allow you to opt-in for the Carbon 3 behavior where float
     360     * values will no longer be cast to integer (so truncated).
     361     *
     362     * ⚠️ This settings will be applied globally, which mean your whole application
     363     * code including the third-party dependencies that also may use Carbon will
     364     * adopt the new behavior.
     365     */
     366    public static function enableFloatSetters(bool $floatSettersEnabled = true): void
     367    {
     368        self::$floatSettersEnabled = $floatSettersEnabled;
     369    }
     370
    350371    ///////////////////////////////////////////////////////////////////
    351372    //////////////////////////// CONSTRUCTORS /////////////////////////
     
    356377     *
    357378     * @param Closure|DateInterval|string|int|null $years
    358      * @param int|null                             $months
    359      * @param int|null                             $weeks
    360      * @param int|null                             $days
    361      * @param int|null                             $hours
    362      * @param int|null                             $minutes
    363      * @param int|null                             $seconds
    364      * @param int|null                             $microseconds
     379     * @param int|float|null                       $months
     380     * @param int|float|null                       $weeks
     381     * @param int|float|null                       $days
     382     * @param int|float|null                       $hours
     383     * @param int|float|null                       $minutes
     384     * @param int|float|null                       $seconds
     385     * @param int|float|null                       $microseconds
    365386     *
    366387     * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval.
     
    382403
    383404        $spec = $years;
    384 
    385         if (!\is_string($spec) || (float) $years || preg_match('/^[\d.]/', $years)) {
     405        $isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec));
     406
     407        if (!$isStringSpec || (float) $years) {
    386408            $spec = static::PERIOD_PREFIX;
    387409
     
    408430        }
    409431
    410         parent::__construct($spec);
     432        try {
     433            parent::__construct($spec);
     434        } catch (Throwable $exception) {
     435            try {
     436                parent::__construct('PT0S');
     437
     438                if ($isStringSpec) {
     439                    if (!preg_match('/^P
     440                        (?:(?<year>[+-]?\d*(?:\.\d+)?)Y)?
     441                        (?:(?<month>[+-]?\d*(?:\.\d+)?)M)?
     442                        (?:(?<week>[+-]?\d*(?:\.\d+)?)W)?
     443                        (?:(?<day>[+-]?\d*(?:\.\d+)?)D)?
     444                        (?:T
     445                            (?:(?<hour>[+-]?\d*(?:\.\d+)?)H)?
     446                            (?:(?<minute>[+-]?\d*(?:\.\d+)?)M)?
     447                            (?:(?<second>[+-]?\d*(?:\.\d+)?)S)?
     448                        )?
     449                    $/x', $spec, $match)) {
     450                        throw new InvalidArgumentException("Invalid duration: $spec");
     451                    }
     452
     453                    $years = (float) ($match['year'] ?? 0);
     454                    $this->assertSafeForInteger('year', $years);
     455                    $months = (float) ($match['month'] ?? 0);
     456                    $this->assertSafeForInteger('month', $months);
     457                    $weeks = (float) ($match['week'] ?? 0);
     458                    $this->assertSafeForInteger('week', $weeks);
     459                    $days = (float) ($match['day'] ?? 0);
     460                    $this->assertSafeForInteger('day', $days);
     461                    $hours = (float) ($match['hour'] ?? 0);
     462                    $this->assertSafeForInteger('hour', $hours);
     463                    $minutes = (float) ($match['minute'] ?? 0);
     464                    $this->assertSafeForInteger('minute', $minutes);
     465                    $seconds = (float) ($match['second'] ?? 0);
     466                    $this->assertSafeForInteger('second', $seconds);
     467                }
     468
     469                $totalDays = (($weeks * static::getDaysPerWeek()) + $days);
     470                $this->assertSafeForInteger('days total (including weeks)', $totalDays);
     471
     472                $this->y = (int) $years;
     473                $this->m = (int) $months;
     474                $this->d = (int) $totalDays;
     475                $this->h = (int) $hours;
     476                $this->i = (int) $minutes;
     477                $this->s = (int) $seconds;
     478
     479                if (
     480                    ((float) $this->y) !== $years ||
     481                    ((float) $this->m) !== $months ||
     482                    ((float) $this->d) !== $totalDays ||
     483                    ((float) $this->h) !== $hours ||
     484                    ((float) $this->i) !== $minutes ||
     485                    ((float) $this->s) !== $seconds
     486                ) {
     487                    $this->add(static::fromString(
     488                        ($years - $this->y).' years '.
     489                        ($months - $this->m).' months '.
     490                        ($totalDays - $this->d).' days '.
     491                        ($hours - $this->h).' hours '.
     492                        ($minutes - $this->i).' minutes '.
     493                        ($seconds - $this->s).' seconds '
     494                    ));
     495                }
     496            } catch (Throwable $secondException) {
     497                throw $secondException instanceof OutOfRangeException ? $secondException : $exception;
     498            }
     499        }
    411500
    412501        if ($microseconds !== null) {
     
    685774
    686775    /**
     776     * Evaluate the PHP generated by var_export() and recreate the exported CarbonInterval instance.
     777     *
     778     * @param array $dump data as exported by var_export()
     779     *
     780     * @return static
     781     */
     782    #[ReturnTypeWillChange]
     783    public static function __set_state($dump)
     784    {
     785        /** @noinspection PhpVoidFunctionResultUsedInspection */
     786        /** @var DateInterval $dateInterval */
     787        $dateInterval = parent::__set_state($dump);
     788
     789        return static::instance($dateInterval);
     790    }
     791
     792    /**
    687793     * Return the current context from inside a macro callee or a new one if static.
    688794     *
     
    9541060     *
    9551061     * @param DateInterval $interval
     1062     * @param bool         $skipCopy set to true to return the passed object
     1063     *                               (without copying it) if it's already of the
     1064     *                               current class
    9561065     *
    9571066     * @return static
    9581067     */
    959     public static function instance(DateInterval $interval, array $skip = [])
    960     {
     1068    public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false)
     1069    {
     1070        if ($skipCopy && $interval instanceof static) {
     1071            return $interval;
     1072        }
     1073
    9611074        return self::castIntervalToClass($interval, static::class, $skip);
    9621075    }
     
    9701083     * @param mixed|int|DateInterval|string|Closure|null $interval interval or number of the given $unit
    9711084     * @param string|null                                $unit     if specified, $interval must be an integer
     1085     * @param bool                                       $skipCopy set to true to return the passed object
     1086     *                                                             (without copying it) if it's already of the
     1087     *                                                             current class
    9721088     *
    9731089     * @return static|null
    9741090     */
    975     public static function make($interval, $unit = null)
     1091    public static function make($interval, $unit = null, bool $skipCopy = false)
    9761092    {
    9771093        if ($unit) {
     
    9801096
    9811097        if ($interval instanceof DateInterval) {
    982             return static::instance($interval);
     1098            return static::instance($interval, [], $skipCopy);
    9831099        }
    9841100
     
    11461262            switch (Carbon::singularUnit(rtrim($key, 'z'))) {
    11471263                case 'year':
     1264                    $this->checkIntegerValue($key, $value);
    11481265                    $this->y = $value;
     1266                    $this->handleDecimalPart('year', $value, $this->y);
    11491267
    11501268                    break;
    11511269
    11521270                case 'month':
     1271                    $this->checkIntegerValue($key, $value);
    11531272                    $this->m = $value;
     1273                    $this->handleDecimalPart('month', $value, $this->m);
    11541274
    11551275                    break;
    11561276
    11571277                case 'week':
    1158                     $this->d = $value * (int) static::getDaysPerWeek();
     1278                    $this->checkIntegerValue($key, $value);
     1279                    $days = $value * (int) static::getDaysPerWeek();
     1280                    $this->assertSafeForInteger('days total (including weeks)', $days);
     1281                    $this->d = $days;
     1282                    $this->handleDecimalPart('day', $days, $this->d);
    11591283
    11601284                    break;
    11611285
    11621286                case 'day':
     1287                    $this->checkIntegerValue($key, $value);
    11631288                    $this->d = $value;
     1289                    $this->handleDecimalPart('day', $value, $this->d);
    11641290
    11651291                    break;
     
    11671293                case 'daysexcludeweek':
    11681294                case 'dayzexcludeweek':
    1169                     $this->d = $this->weeks * (int) static::getDaysPerWeek() + $value;
     1295                    $this->checkIntegerValue($key, $value);
     1296                    $days = $this->weeks * (int) static::getDaysPerWeek() + $value;
     1297                    $this->assertSafeForInteger('days total (including weeks)', $days);
     1298                    $this->d = $days;
     1299                    $this->handleDecimalPart('day', $days, $this->d);
    11701300
    11711301                    break;
    11721302
    11731303                case 'hour':
     1304                    $this->checkIntegerValue($key, $value);
    11741305                    $this->h = $value;
     1306                    $this->handleDecimalPart('hour', $value, $this->h);
    11751307
    11761308                    break;
    11771309
    11781310                case 'minute':
     1311                    $this->checkIntegerValue($key, $value);
    11791312                    $this->i = $value;
     1313                    $this->handleDecimalPart('minute', $value, $this->i);
    11801314
    11811315                    break;
    11821316
    11831317                case 'second':
     1318                    $this->checkIntegerValue($key, $value);
    11841319                    $this->s = $value;
     1320                    $this->handleDecimalPart('second', $value, $this->s);
    11851321
    11861322                    break;
     
    28422978        }
    28432979    }
     2980
     2981    private function checkIntegerValue(string $name, $value)
     2982    {
     2983        if (\is_int($value)) {
     2984            return;
     2985        }
     2986
     2987        $this->assertSafeForInteger($name, $value);
     2988
     2989        if (\is_float($value) && (((float) (int) $value) === $value)) {
     2990            return;
     2991        }
     2992
     2993        if (!self::$floatSettersEnabled) {
     2994            $type = \gettype($value);
     2995            @trigger_error(
     2996                "Since 2.70.0, it's deprecated to pass $type value for $name.\n".
     2997                "It's truncated when stored as an integer interval unit.\n".
     2998                "From 3.0.0, decimal part will no longer be truncated and will be cascaded to smaller units.\n".
     2999                "- To maintain the current behavior, use explicit cast: $name((int) \$value)\n".
     3000                "- To adopt the new behavior globally, call CarbonInterval::enableFloatSetters()\n",
     3001                \E_USER_DEPRECATED
     3002            );
     3003        }
     3004    }
     3005
     3006    /**
     3007     * Throw an exception if precision loss when storing the given value as an integer would be >= 1.0.
     3008     */
     3009    private function assertSafeForInteger(string $name, $value)
     3010    {
     3011        if ($value && !\is_int($value) && ($value >= 0x7fffffffffffffff || $value <= -0x7fffffffffffffff)) {
     3012            throw new OutOfRangeException($name, -0x7fffffffffffffff, 0x7fffffffffffffff, $value);
     3013        }
     3014    }
     3015
     3016    private function handleDecimalPart(string $unit, $value, $integerValue)
     3017    {
     3018        if (self::$floatSettersEnabled) {
     3019            $floatValue = (float) $value;
     3020            $base = (float) $integerValue;
     3021
     3022            if ($floatValue === $base) {
     3023                return;
     3024            }
     3025
     3026            $units = [
     3027                'y' => 'year',
     3028                'm' => 'month',
     3029                'd' => 'day',
     3030                'h' => 'hour',
     3031                'i' => 'minute',
     3032                's' => 'second',
     3033            ];
     3034            $upper = true;
     3035
     3036            foreach ($units as $property => $name) {
     3037                if ($name === $unit) {
     3038                    $upper = false;
     3039
     3040                    continue;
     3041                }
     3042
     3043                if (!$upper && $this->$property !== 0) {
     3044                    throw new RuntimeException(
     3045                        "You cannot set $unit to a float value as $name would be overridden, ".
     3046                        'set it first to 0 explicitly if you really want to erase its value'
     3047                    );
     3048                }
     3049            }
     3050
     3051            $this->add($unit, $floatValue - $base);
     3052        }
     3053    }
    28443054}
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php

    r2959619 r2975761  
    8989 * @method static static seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance.
    9090 * @method static static second($seconds = 1) Alias for seconds().
     91 * @method static static milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance.
     92 * @method static static millisecond($milliseconds = 1) Alias for milliseconds().
     93 * @method static static microseconds($microseconds = 1) Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance.
     94 * @method static static microsecond($microseconds = 1) Alias for microseconds().
    9195 * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
    9296 * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
     
    664668        }
    665669
     670        $optionsSet = false;
     671
    666672        foreach ($arguments as $argument) {
    667673            $parsedDate = null;
     
    687693            } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) {
    688694                $this->setRecurrences($argument);
    689             } elseif ($this->options === null && (\is_int($argument) || $argument === null)) {
    690                 $this->setOptions($argument);
     695            } elseif (!$optionsSet && (\is_int($argument) || $argument === null)) {
     696                $optionsSet = true;
     697                $this->setOptions(((int) $this->options) | ((int) $argument));
    691698            } else {
    692699                throw new InvalidPeriodParameterException('Invalid constructor parameters.');
     
    18101817            case 'seconds':
    18111818            case 'second':
     1819            case 'milliseconds':
     1820            case 'millisecond':
     1821            case 'microseconds':
     1822            case 'microsecond':
    18121823                return $this->setDateInterval((
    18131824                    // Override default P1D when instantiating via fluent setters.
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php

    r2856097 r2975761  
    1616use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
    1717
     18// @codeCoverageIgnoreStart
    1819$transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format');
    1920
     
    2122    ? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php'
    2223    : __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php';
     24// @codeCoverageIgnoreEnd
    2325
    2426final class MessageFormatterMapper extends LazyMessageFormatter
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/Traits/Date.php

    r2841693 r2975761  
    23112311                'r' => true,
    23122312                'U' => true,
     2313                'T' => true,
    23132314            ];
    23142315        }
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php

    r2630744 r2975761  
    4141
    4242        if ($precision instanceof DateInterval) {
    43             $precision = (string) CarbonInterval::instance($precision);
     43            $precision = (string) CarbonInterval::instance($precision, [], true);
    4444        }
    4545
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php

    r2824418 r2975761  
    2424use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface;
    2525
     26// @codeCoverageIgnoreStart
    2627if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') &&
    2728    !interface_exists('Symfony\\Component\\Translation\\TranslatorInterface')
     
    3233    );
    3334}
     35// @codeCoverageIgnoreEnd
    3436
    3537/**
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php

    r2856097 r2975761  
    147147    {
    148148        // @codeCoverageIgnoreStart
    149         if (isset($this->timezone_type)) {
     149        if (isset($this->timezone_type, $this->timezone, $this->date)) {
    150150            return [
    151151                'date' => $this->date ?? null,
  • bluem/trunk/vendor/nesbot/carbon/src/Carbon/Traits/Units.php

    r2932353 r2975761  
    199199    {
    200200        if (\is_string($unit) && \func_num_args() === 1) {
    201             $unit = CarbonInterval::make($unit);
     201            $unit = CarbonInterval::make($unit, [], true);
    202202        }
    203203
     
    369369    {
    370370        if (\is_string($unit) && \func_num_args() === 1) {
    371             $unit = CarbonInterval::make($unit);
     371            $unit = CarbonInterval::make($unit, [], true);
    372372        }
    373373
     
    405405    {
    406406        if (\is_string($unit) && \func_num_args() === 1) {
    407             $unit = CarbonInterval::make($unit);
     407            $unit = CarbonInterval::make($unit, [], true);
    408408        }
    409409
  • bluem/trunk/views/activate.php

    r2959619 r2975761  
    1717    <?php } ?>
    1818
     19    <?php if ( isset ( $is_valid ) && ! $is_valid ) { ?>
     20        <div class="notice notice-warning is-dismissible">
     21            <p><span class="dashicons dashicons-warning"></span> Gelieve alle verplichte velden correct in te vullen.</p>
     22        </div>
     23    <?php } ?>
     24
    1925    <h3>Account vereist</h3>
    20     <p>Voor het gebruik van onze diensten is een account vereist.<br />Kijk voor meer informatie op de <a href="https://bluem.nl/direct-online-betalen/" title="Bluem website bezoeken" target="_blank">Bluem website</a>, of bel <a href="tel:+31852220400" title="Bellen naar Bluem">+31(0)85-2220400</a> of email naar <a href="mailto:[email protected]" title="Mailen naar Bluem">[email protected]</a>.</p>
     26    <p>Voor het gebruik van onze diensten is een account vereist.<br />Kijk voor meer informatie op de <a href="https://bluem.nl/direct-online-betalen/" title="Bluem website bezoeken" target="_blank">Bluem website</a>, bel <a href="tel:+31852220400" title="Bellen naar Bluem">+31(0)85-2220400</a> of e-mail naar <a href="mailto:[email protected]" title="Mailen naar Bluem">[email protected]</a>.</p>
    2127
    2228    <form id="activateform" method="POST">
     
    2834                <tr>
    2935                    <th scope="row">SenderID</th>
    30                     <td><input type="text" name="acc_senderid" id="acc_senderid" value="<?php echo !empty( $bluem_options['senderID'] ) ? $bluem_options['senderID'] : ''; ?>" class="form-control"></td>
     36                    <td><input type="text" name="acc_senderid" id="acc_senderid" value="<?php echo !empty( $_POST['acc_senderid'] ) ? $_POST['acc_senderid'] : (!empty( $bluem_options['senderID'] ) ? $bluem_options['senderID'] : ''); ?>" class="form-control"></td>
    3137                </tr>
    3238                <tr>
    3339                    <th scope="row">Test token</th>
    34                     <td><input type="password" name="acc_testtoken" id="acc_testtoken" value="<?php echo !empty( $bluem_options['test_accessToken'] ) ? $bluem_options['test_accessToken'] : ''; ?>" class="form-control" style="width: 425px;"></td>
     40                    <td><input type="password" name="acc_testtoken" id="acc_testtoken" value="<?php echo !empty( $_POST['acc_testtoken'] ) ? $_POST['acc_testtoken'] : (!empty( $bluem_options['test_accessToken'] ) ? $bluem_options['test_accessToken'] : ''); ?>" class="form-control" style="width: 425px;"></td>
    3541                </tr>
    3642                <tr>
    3743                    <th scope="row">Productie token</th>
    38                     <td><input type="password" name="acc_prodtoken" id="acc_prodtoken" value="<?php echo !empty( $bluem_options['production_accessToken'] ) ? $bluem_options['production_accessToken'] : ''; ?>" class="form-control" style="width: 425px;"></td>
     44                    <td><input type="password" name="acc_prodtoken" id="acc_prodtoken" value="<?php echo !empty( $_POST['acc_prodtoken'] ) ? $_POST['acc_prodtoken'] : (!empty( $bluem_options['production_accessToken'] ) ? $bluem_options['production_accessToken'] : ''); ?>" class="form-control" style="width: 425px;"></td>
    3945                </tr>
    4046            </tbody>
     
    4854                <tr>
    4955                    <th scope="row">Bedrijfsnaam *</th>
    50                     <td><input type="text" name="company_name" id="company_name" value="<?php echo !empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['name'] ) ? $bluem_registration['company']['name'] : ''; ?>" class="form-control" required></td>
     56                    <td><input type="text" name="company_name" id="company_name" value="<?php echo !empty( $_POST['company_name'] ) ? $_POST['company_name'] : (!empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['name'] ) ? $bluem_registration['company']['name'] : ''); ?>" class="form-control" required="required"></td>
    5157                </tr>
    5258                <tr>
    5359                    <th scope="row">Telefoonnummer *</th>
    54                     <td><input type="tel" name="company_telephone" id="company_telephone" value="<?php echo !empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['telephone'] ) ? $bluem_registration['company']['telephone'] : ''; ?>" class="form-control" required></td>
     60                    <td><input type="tel" name="company_telephone" id="company_telephone" value="<?php echo !empty( $_POST['company_telephone'] ) ? $_POST['company_telephone'] : (!empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['telephone'] ) ? $bluem_registration['company']['telephone'] : ''); ?>" class="form-control" required="required"></td>
    5561                </tr>
    5662                <tr>
    5763                    <th scope="row">E-mailadres *</th>
    58                     <td><input type="email" name="company_email" id="company_email" value="<?php echo !empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['email'] ) ? $bluem_registration['company']['email'] : ''; ?>" class="form-control" required></td>
     64                    <td><input type="email" name="company_email" id="company_email" value="<?php echo !empty( $_POST['company_email'] ) ? $_POST['company_email'] : (!empty( $bluem_registration['company'] ) && !empty( $bluem_registration['company']['email'] ) ? $bluem_registration['company']['email'] : ''); ?>" class="form-control" required="required"></td>
    5965                </tr>
    6066            </tbody>
     
    6874                <tr>
    6975                    <th scope="row">Voor- en achternaam *</th>
    70                     <td><input type="text" name="tech_name" id="tech_name" value="<?php echo !empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['name'] ) ? $bluem_registration['tech_contact']['name'] : ''; ?>" class="form-control" required></td>
     76                    <td><input type="text" name="tech_name" id="tech_name" value="<?php echo !empty( $_POST['tech_name'] ) ? $_POST['tech_name'] : (!empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['name'] ) ? $bluem_registration['tech_contact']['name'] : ''); ?>" class="form-control" required="required"></td>
    7177                </tr>
    7278                <tr>
    7379                    <th scope="row">Telefoonnummer *</th>
    74                     <td><input type="tel" name="tech_telephone" id="tech_telephone" value="<?php echo !empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['telephone'] ) ? $bluem_registration['tech_contact']['telephone'] : ''; ?>" class="form-control" required></td>
     80                    <td><input type="tel" name="tech_telephone" id="tech_telephone" value="<?php echo !empty( $_POST['tech_telephone'] ) ? $_POST['tech_telephone'] : (!empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['telephone'] ) ? $bluem_registration['tech_contact']['telephone'] : ''); ?>" class="form-control" required="required"></td>
    7581                </tr>
    7682                <tr>
    7783                    <th scope="row">E-mailadres *</th>
    78                     <td><input type="email" name="tech_email" id="tech_email" value="<?php echo !empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['email'] ) ? $bluem_registration['tech_contact']['email'] : ''; ?>" class="form-control" required></td>
     84                    <td><input type="email" name="tech_email" id="tech_email" value="<?php echo !empty( $_POST['tech_email'] ) ? $_POST['tech_email'] : (!empty( $bluem_registration['tech_contact'] ) && !empty( $bluem_registration['tech_contact']['email'] ) ? $bluem_registration['tech_contact']['email'] : ''); ?>" class="form-control" required="required"></td>
    7985                </tr>
    8086            </tbody>
     
    98104
    99105        // Select all input fields with the 'required' attribute
    100         $("input[required]").each(function() {
    101             if ($(this).val() === "") {
     106        jQuery("input[required]").each(function() {
     107            if (jQuery(this).val() === "") {
    102108                isValid = false;
    103                 $(this).addClass('error'); // Add an 'error' class for visual indication
     109
     110                jQuery(this).addClass('error'); // Add an 'error' class for visual indication
    104111            } else {
    105                 $(this).removeClass('error');
     112                jQuery(this).removeClass('error');
    106113            }
    107114        });
     
    110117    }
    111118
    112     $(document).ready(function() {
    113         $("#activateform").submit(function(e) {
    114             if (!validateRequiredInputs()) {
    115                 e.preventDefault(); // Prevent form submission if validation fails
     119    jQuery(document).ready(function() {
     120        jQuery("#activateform").on('submit', function(e) {
     121            if ( ! validateRequiredInputs() ) {
     122                e.preventDefault();
     123
    116124                alert("Gelieve alle verplichte velden correct in te vullen.");
    117125            }
Note: See TracChangeset for help on using the changeset viewer.