Why am I getting an error when sending invoices to XERO?

I have a WordPress website running WooCommerce and I am using a plugin called XERO to do my invoicing, whenever I try and send an invoice to XERO via WordPress back end the website throws an error:

Fatal error: Class ‘WC_XR_OAuthSimple’ not found in /home/vipcomau/public_html/wp-content/plugins/woocommerce-xero/classes/requests/class-wc-xr-request.php on line 213

Read More

So here is the the snippet of code where this error refers to:

    private function get_signed_url() {
    if ( null === $this->signed_url ) {

        // Setup OAuth object
        $oauthObject = new WC_XR_OAuthSimple();

        // Reset, start clean
        $oauthObject->reset();

        // Settings object
        $settings = new WC_XR_Settings();

        // Do the OAuth sign request
        $oauth_result = $oauthObject->sign( array(
            'path'       => self::API_URL . $this->get_endpoint() . '/',
            'action'     => 'PUT',
            'parameters' => array(
                'oauth_signature_method' => 'RSA-SHA1'
            ),
            'signatures' => array(
                'consumer_key'    => $settings->get_option( 'consumer_key' ),
                'shared_secret'   => $settings->get_option( 'consumer_secret' ),
                'rsa_private_key' => $settings->get_option( 'private_key' ),
                'rsa_public_key'  => $settings->get_option( 'public_key' ),
                'oauth_secret'    => $settings->get_option( 'consumer_secret' ),
                'oauth_token'     => $settings->get_option( 'consumer_key' )
            )
        ) );

        // Set the signed URL
        $this->signed_url = $oauth_result['signed_url'];

    }

    return $this->signed_url;
}

I am really struggling with this as I am not a PHP developer but setting the website up for a client.

Related posts

Leave a Reply