• Resolved jagenda

    (@jagenda)


    When migrating to the new Paytrail plugin I was receiving Fatal Errors at checkout after submitting the checkout form. I suspect this is because of localhost being an invalid redirectUrl. Localhost has not worked before when returning from Paytrail but this time the error occurs when creating a new payment. I was able to find the error message so I assume this would be visible in the checkout page if the TypeError were fixed.

    The problem does not occur when using a proper domain for the site.

    The error message that should presumably be displayed instead:

    stdClass Object
    (
        [status] => error
        [message] => All redirect and callback URLs must use https. IPs are not allowed in callback URLs.
    )

    The fatal error:

    PHP Fatal error:  Uncaught TypeError: Paytrail\SDK\Response\PaymentResponse::setTransactionId(): Argument #1 ($transactionId) must be of type string, null given, called in  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Client.php on line 216 and defined in  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Response/PaymentResponse.php:61
    Stack trace:
    #0  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Client.php(216): Paytrail\SDK\Response\PaymentResponse->setTransactionId(NULL)
    #1 [internal function]: Paytrail\SDK\Client->Paytrail\SDK\{closure}(Object(stdClass))
    #2  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/PaytrailClient.php(94): call_user_func(Object(Closure), Object(stdClass))
    #3  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Client.php(219): Paytrail\SDK\PaytrailClient->post('/payments', Object(Paytrail\SDK\Request\PaymentRequest), Object(Closure))
    #4  wp-content/plugins/paytrail-for-woocommerce/src/Gateway.php(958): Paytrail\SDK\Client->createPayment(Object(Paytrail\SDK\Request\PaymentRequest))
    #5  wp-content/plugins/paytrail-for-woocommerce/src/Gateway.php(914): Paytrail\WooCommercePaymentGateway\Gateway->create_normal_payment(Object(Paytrail\SDK\Request\PaymentRequest), Object(Automattic\WooCommerce\Admin\Overrides\Order), 'paytrail')
    #6  wp-content/plugins/woocommerce/includes/class-wc-checkout.php(982): Paytrail\WooCommercePaymentGateway\Gateway->process_payment(2044)
    #7  wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1206): WC_Checkout->process_order_payment(2044, 'paytrail')
    #8  wp-content/plugins/woocommerce/includes/class-wc-ajax.php(461): WC_Checkout->process_checkout()
    #9  wp-includes/class-wp-hook.php(307): WC_AJAX::checkout('')
    #10  wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #11  wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #12  wp-content/plugins/woocommerce/includes/class-wc-ajax.php(90): do_action('wc_ajax_checkou...')
    #13  wp-includes/class-wp-hook.php(307): WC_AJAX::do_wc_ajax('')
    #14  wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(false, Array)
    #15  wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #16  wp-includes/template-loader.php(13): do_action('template_redire...')
    #17  wp-blog-header.php(19): require_once('...')
    #18  index.php(17): require('...')
    #19 {main}
      thrown in  wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Response/PaymentResponse.php on line 61
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Localhost Fatal Error’ is closed to new replies.