• HI,

    Barion is now showing fatal errors on backend and even frontend after customers try to pay.

    That is really horrible.

    2021-11-29T16:21:07+00:00 CRITICAL Uncaught Error: Call to a member function format() on null in /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXXX/web/wp-content/plugins/pay-via-barion-for-woocommerce/includes/class-wc-gateway-barion-request.php:253
    Stack trace:
    #0 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-content/plugins/pay-via-barion-for-woocommerce/includes/class-wc-gateway-barion-request.php(52): WC_Gateway_Barion_Request->set_payer_account_information(Object(WC_Order), Object(PreparePaymentRequestModel))
    #1 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-content/plugins/pay-via-barion-for-woocommerce/class-wc-gateway-barion.php(212): WC_Gateway_Barion_Request->prepare_payment(Object(WC_Order))
    #2 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-content/plugins/woocommerce/includes/class-wc-form-handler.php(439): WC_Gateway_Barion->process_payment(6527)
    #3 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-includes/class-wp-hook.php(303): WC_Form_Handler::pay_action(Object(WP))
    #4 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
    #5 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-includes/plugin.php(518): WP_Hook->do_action(Array)
    #6 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-includes/class-wp.php(763): do_action_ref_array('wp', Array)
    #7 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-includes/functions.php(1291): WP->main('')
    #8 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-blog-header.php(16): wp()
    #9 /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/index.php(17): require('/data/f/c/fc2fe...')
    #10 {main}
      thrown in /data/f/c/fc2fe6bd-5916-44b4-b9c0-13c5319e4e79/XXXXXX/web/wp-content/plugins/pay-via-barion-for-woocommerce/includes/class-wc-gateway-barion-request.php on line 253

    The below highlighted line seems to be causing issues>

    $payerAccountInfo->AccountLastChanged = $customer->get_date_modified()->format(DateTime::ISO8601);

    Here is the part of the code where this line is included>

    private function set_payer_account_information($order, $paymentRequest) {
            $payerAccountInfo = new PayerAccountInformationModel();
            $paymentRequest->PayerAccountInformation = $payerAccountInfo;
    
            $user = wp_get_current_user();
            if (!$user->exists()) {
                $payerAccountInfo->AccountCreationIndicator = AccountCreationIndicator::NoAccount;
    
                return;
            }
    
            $customer = new WC_Customer($user->ID);
    
            $payerAccountInfo->AccountId = $customer->get_id();
            $payerAccountInfo->AccountCreated = $customer->get_date_created()->format(DateTime::ISO8601);
            $payerAccountInfo->AccountCreationIndicator = $this->get_account_creation_indicator($customer);
    
            $payerAccountInfo->AccountLastChanged = $customer->get_date_modified()->format(DateTime::ISO8601);
            $payerAccountInfo->AccountChangeIndicator = $this->get_account_change_indicator($customer);
            $this->set_password_changed_indicator($payerAccountInfo);

    Regards
    Michal

  • The topic ‘Fatal errors’ is closed to new replies.