• Resolved Render Cursos Sistemas

    (@sistemasrender)


    When trying to create a new user using the woocommerce api (php7 and wc/v3), it gives this error in the plugin.

    [22-Jul-2022 03:20:55 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get() on null in /home/www/www.render.com.br/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-vaulting/src/VaultingModule.php:111
    Stack trace:
    #0 /home/www/www.render.com.br/html/wp-includes/class-wp-hook.php(289): WooCommerce\PayPalCommerce\Vaulting\VaultingModule->WooCommerce\PayPalCommerce\Vaulting\{closure}(252496)
    #1 /home/www/www.render.com.br/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #2 /home/www/www.render.com.br/html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/www/www.render.com.br/html/wp-content/plugins/woocommerce/includes/wc-user-functions.php(105): do_action('woocommerce_cre...', 252496, Array, false)
    #4 /home/www/www.render.com.br/html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store.php(108): wc_create_new_customer('alisson@render....', 'alisson@render....', 'd5c432')
    #5 /home/www/www.render.com.br/html/wp-content/plugins/woocommerce/includes/class-wc-d in /home/www/www.render.com.br/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-vaulting/src/VaultingModule.php on line 111
    

    This error is causing error500 and crashing POST request “create customer woocomerce”

    To fix the problem provisionally, I commented out lines 107 to 115 of the VaultingModule.php file

    $subscription_helper = $container->get( 'subscription.helper' );
    		/*add_action(
    			'woocommerce_created_customer',
    			function( int $customer_id ) use ( $subscription_helper ) {
    				$guest_customer_id = WC()->session->get( 'ppcp_guest_customer_id' );
    				if ( $guest_customer_id && $subscription_helper->cart_contains_subscription() ) {
    					update_user_meta( $customer_id, 'ppcp_guest_customer_id', $guest_customer_id );
    				}
    			}
    		);*/
    

    I’m waiting for the plugin update and help to solve the problem.
    Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Error php – create user via api woocomerce’ is closed to new replies.