Title: Error processing payment
Last modified: June 1, 2023

---

# Error processing payment

 *  Resolved [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/)
 * We are having issue checkout using paypal. We got Error processing checkout. 
   Please try again. issue same as this submitted issue [https://wordpress.org/support/topic/error-processing-payment-still-doesnt-work/](https://wordpress.org/support/topic/error-processing-payment-still-doesnt-work/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-processing-payment-8%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-processing-payment-8/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-processing-payment-8/page/2/?output_format=md)

 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16786852)
 * Hi [@augustus1996](https://wordpress.org/support/users/augustus1996/)
 * We’re taking a look at what might be the root cause. Can you please send us the
   PayPal plugin’s log file so we can review and compare to other log files that
   we have?
 * Kind Regards
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787256)
 *     ```wp-block-code
       2023-06-01T15:11:16+00:00 CRITICAL Uncaught Error: Call to a member function getId() on null in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php:54
       Stack trace:
       #0 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/Payments/Gateways/AbstractGateway.php(206): PaymentPlugins\WooCommerce\PPCP\PaymentResult->__construct()
       #1 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1050): PaymentPlugins\WooCommerce\PPCP\Payments\Gateways\AbstractGateway->process_payment()
       #2 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1279): WC_Checkout->process_order_payment()
       #3 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(485): WC_Checkout->process_checkout()
       #4 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-includes/class-wp-hook.php(308): WC_AJAX::checkout()
       #5  in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php on line 54
   
       2023-06-01T17:02:42+00:00 CRITICAL Uncaught Error: Call to a member function getId() on null in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php:54
       Stack trace:
       #0 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/Payments/Gateways/AbstractGateway.php(206): PaymentPlugins\WooCommerce\PPCP\PaymentResult->__construct()
       #1 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1050): PaymentPlugins\WooCommerce\PPCP\Payments\Gateways\AbstractGateway->process_payment()
       #2 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1279): WC_Checkout->process_order_payment()
       #3 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(485): WC_Checkout->process_checkout()
       #4 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-includes/class-wp-hook.php(308): WC_AJAX::checkout()
       #5  in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php on line 54
   
       2023-06-01T17:05:52+00:00 CRITICAL Uncaught Error: Call to a member function getId() on null in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php:54
       Stack trace:
       #0 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/Payments/Gateways/AbstractGateway.php(206): PaymentPlugins\WooCommerce\PPCP\PaymentResult->__construct()
       #1 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1050): PaymentPlugins\WooCommerce\PPCP\Payments\Gateways\AbstractGateway->process_payment()
       #2 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1279): WC_Checkout->process_order_payment()
       #3 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(485): WC_Checkout->process_checkout()
       #4 /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-includes/class-wp-hook.php(308): WC_AJAX::checkout()
       #5  in /var/www/thinkslimmer.wpfueledstaging.com/htdocs/wp-content/plugins/pymntpl-paypal-woocommerce/src/PaymentResult.php on line 54
       ```
   
 * This is what we have on the error log
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787276)
 * I think the issue was related to this
   Here’s the latest version of the plugin
   that you haveAs you can see here. this function have the paypal_order_id which
   causing an issue and critical error.
 *     ```wp-block-code
       	/**
       	 * PaymentResult constructor.
       	 *
       	 * @param \PaymentPlugins\PayPalSDK\Order|\WP_Error $paypal_order
       	 * @param \WC_Order                                 $order
       	 * @param AbstractGateway                           $payment_method
       	 * @param string                                    $error_message
       	 */
       	public function __construct( $paypal_order, \WC_Order $order, AbstractGateway $payment_method = null, $error_message = '' ) {
       		if ( is_wp_error( $paypal_order ) ) {
       			$this->success       = false;
       			$this->error_message = $paypal_order->get_error_message();
       			$this->error_code    = $paypal_order->get_error_code();
       		} elseif ( $paypal_order === false ) {
       			$this->success       = false;
       			$this->error_message = $error_message;
       		} else {
       			$this->success         = true;
       			$this->paypal_order    = $paypal_order;
       			$this->paypal_order_id = $paypal_order->getId();
       		}
       		$this->order          = $order;
       		$this->payment_method = $payment_method;
       	}
       ```
   
 * Compare to the version 1.29
 *     ```wp-block-code
       	/**
       	 * PaymentResult constructor.
       	 *
       	 * @param \PaymentPlugins\PayPalSDK\Order $paypal_order
       	 * @param \WC_Order                       $order
       	 * @param AbstractGateway                 $payment_method
       	 * @param string                          $error_message
       	 */
       	public function __construct( $paypal_order, \WC_Order $order, AbstractGateway $payment_method = null, $error_message = '' ) {
       		if ( is_wp_error( $paypal_order ) ) {
       			$this->success       = false;
       			$this->error_message = $paypal_order->get_error_message();
       		} elseif ( $paypal_order === false ) {
       			$this->success       = false;
       			$this->error_message = $error_message;
       		} else {
       			$this->success      = true;
       			$this->paypal_order = $paypal_order;
       		}
       		$this->order          = $order;
       		$this->payment_method = $payment_method;
       	}
   
       	public function success() {
       		return $this->success;
       	}
       ```
   
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787317)
 * Hi [@augustus1996](https://wordpress.org/support/users/augustus1996/)
 * Thank you for the login for and the feedback. We will review everything and respond
   to this thread shortly.
 * Kind regards
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787325)
 * FYI – I tried removing this line of code, from the **pymntpl-paypal-woocommerce/
   src/PaymentResult.php** and I was able to successfully checkout without the “
   Error processing checkout. Please try again” error. Can you review this. Thanks
   a lot.
 *     ```wp-block-code
       $this->paypal_order_id = $paypal_order->getId();
       ```
   
    -  This reply was modified 2 years, 12 months ago by [augustus1996](https://wordpress.org/support/users/augustus1996/).
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787418)
 * I did try to fix it using this method
 *     ```wp-block-code
       	/**
       	 * PaymentResult constructor.
       	 *
       	 * @param \PaymentPlugins\PayPalSDK\Order|\WP_Error $paypal_order
       	 * @param \WC_Order                                 $order
       	 * @param AbstractGateway                           $payment_method
       	 * @param string                                    $error_message
       	 */
       	public function __construct( $paypal_order, \WC_Order $order, AbstractGateway $payment_method = null, $error_message = '' ) {
       		if ( is_wp_error( $paypal_order ) ) {
       			$this->success       = false;
       			$this->error_message = $paypal_order->get_error_message();
       			$this->error_code    = $paypal_order->get_error_code();
       		} elseif ( $paypal_order === false ) {
       			$this->success       = false;
       			$this->error_message = $error_message;
       		} else {
       			$this->success         = true;
       			$this->paypal_order    = $paypal_order;
   
       			if(function_exists('getId')){
       				$this->paypal_order_id = $paypal_order->getId();
       			}
       		}
       		$this->order          = $order;
       		$this->payment_method = $payment_method;
       	}
       ```
   
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787522)
 * Hi [@augustus1996](https://wordpress.org/support/users/augustus1996/)
 * What’s odd is the PayPal Order object should not be null at that point since 
   you stated you were able to successfully checkout. Are you certain your transaction
   status is completed for the order you tested your code change one?
 * Kind Regards
    -  This reply was modified 2 years, 12 months ago by [Clayton R](https://wordpress.org/support/users/mrclayton/).
    -  This reply was modified 2 years, 12 months ago by [Clayton R](https://wordpress.org/support/users/mrclayton/).
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787806)
 * yes you are right the paypal object should not be null, the only thing that is
   null is the getId() function that is causing the critical error.
 * this may have happened because we are not using funnelkit and i think the patch
   you added is for the site who is using funnelkit if i’m not mistaken.
 * i do see my order on the backen order successfully.
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787809)
 * Hi [@augustus1996](https://wordpress.org/support/users/augustus1996/)
 * > yes you are right the paypal object should not be null, the only thing that
   > is null is the getId()
 * The error message `Call to a member function getId() on null` translates to “
   you tried to call a function on a null object” so that means the PayPal order
   object is null. I am not sure how that could be possible. Is this happening on
   a regular checkout page order?
 * > i do see my order on the backen order successfully.
 * What is the WooCommerce order’s status?
 * [Here is a link](https://drive.google.com/file/d/139SBzXdbSY1LEB1iFCJDrI_ZZnj9mJET/view?usp=drive_link)
   to the update which checks the null condition.
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787834)
 * The order status is active or completed, I’ve used the subscription for this 
   and the subscription status is active.
   I do think the getId function on the paypal
   SDK doesn’t work since that’s causing critical error.
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787840)
 * > I do think the getId function on the paypal SDK doesn’t work since that’s causing
   > critical error.
 * I agree, that didn’t work, but it’s not because there is something wrong with
   the function `getId()`. That function has been in the plugin since it was originally
   released a year ago.
 * That error message is specifically stating that you can’t call getId on a null
   object which means the PayPal order object is null. I am trying to understand
   how the PayPal order could be null in your scenario because I am not able to 
   replicate in our development environment.
 * We also don’t have any other reports of this specific error. The other support
   thread that you were commenting on was not related to the error you’re reporting.
 * Kind Regards
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787841)
 * It works now, thanks a lot.
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787847)
 * This situation likely arose when an individual utilized PayPal and designated
   their card as the primary payment option within their PayPal account.
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787853)
 * > It works now, thanks a lot.
 * Ok, will include that in the next release. I finally figured out why that was
   happening. Your subscription is a free trial subscription yes? If so that’s the
   cause and we will be releasing the update within the next hour.
 * The free trial doesn’t have a corresponding PayPal order the same way a one off
   payment or regular subscription does.
 * Thanks for reporting this issue and your help troubleshooting.
 * Kind Regards
 *  Thread Starter [augustus1996](https://wordpress.org/support/users/augustus1996/)
 * (@augustus1996)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/#post-16787858)
 * You are right, this is a free trial subscription.
   Thanks a lot. I think this 
   plugin is really helpful than the official paypal plugin that woocommerce have.
    -  This reply was modified 2 years, 12 months ago by [augustus1996](https://wordpress.org/support/users/augustus1996/).

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-processing-payment-8/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-processing-payment-8/page/2/?output_format=md)

The topic ‘Error processing payment’ is closed to new replies.

 * ![](https://ps.w.org/pymntpl-paypal-woocommerce/assets/icon-256x256.png?rev=2718338)
 * [Payment Plugins for PayPal WooCommerce](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * Last activity: [2 years, 12 months ago](https://wordpress.org/support/topic/error-processing-payment-8/page/2/#post-16788125)
 * Status: resolved