Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author e4jvikwp

    (@e4jvikwp)

    Hello José,

    Thanks for your message. A WordPress Critical Error is a generic error message displayed when the debug mode is turned off, otherwise the full server error would have been displayed.

    The first thing we suggest doing is to turn on the debug mode to see what’s actually causing the “Critical Error”. For sure the custom payment plugin you created is declaring or extending invalid classes, or it’s doing something wrongly. If you are developing a custom payment plugin, then the debug mode should be enabled in your WordPress configuration, or you won’t be able to detect any potential conflict with what you are coding.

    Once your website will start showing the full error message (either on screen or on the log file), you should act accordingly to fix the errors reported.

    We hope this helps!

    The VikWP Team

    Thread Starter José Mundarain

    (@jemundarain)

    Hello! Thank you for answering so quickly, I include fragments of the .log

    PHP Warning: session_start(): Cannot start session when headers already sent in …/httpdocs/wp-content/plugins/vikbooking/libraries/adapter/session/handler.php on line 31

    PHP Notice: Undefined offset: 0 in /var/www/vhosts/hotelrosabela.com/httpdocs/wp-includes/capabilities.php on line 218

    PHP Fatal error: Uncaught Error: Using $this when not in object context in /var/www/vhosts/hotelrosabela.com/httpdocs/wp-content/plugins/vikbdv/vikbooking/mypay.php:47

    That error references this line
    $txname = $this->get(‘sid’) . ‘-‘ . $this->get(‘oid’) . ‘.tx’;

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    Thanks for sharing the error message. The problem is that the line of code highlighted as responsible of the Fatal Error is code you wrote on your own, because the plugin responsible is “vikbdv”, not Vik Booking, it’s the custom payment plugin you are developing.

    Given the description of the error message, you are using $this outside a class method, maybe you are inside a function to be passed as a callback to a custom hook needed by Vik Booking? The technical documentation on our website that shows how to create a custom payment plugin is using $payment to access the “->get()” method, not $this.

    You should review the code of your custom plugin because it is not working in the way it is right now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with a Custom Payment Plugin’ is closed to new replies.