• Resolved jakemorrow

    (@jakemorrow)


    Hello!
    I set up new copy of WordPress with WooCommerce and installed Nomiddleman Bitcoin and Crypto Payments for WooCommerce.
    There are no other plugins installed. None.
    In Nomiddleman Bitcoin and Crypto Payments for WooCommerce setup I choose BTC with Classic mode first. Entered one BTC address anx tried to make a purchase. I’ve got “The site is experiencing technical difficulties.” after hit Place Order button on checkout page.
    Then I tried to add my Master Private Key to Privacy Mode settings in BTC and getting “Bitcoin has an invalid HD MPK. Disabling Bitcoin.”

    What am I doing wrong?
    Thank you

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Nomiddleman Crypto

    (@nomiddleman)

    Please try using these three addresses at the top of https://en.bitcoin.it/wiki/Address.

    If none of those works you will need to enable debugging, trigger the error, and send the logs to nomiddleman@nomiddlemancrypto.io.

    As for the MPK, we only support legacy addresses for MPKs so if your MPK starts with ypub or zpub it will not work. If your MPK starts with xpub please verify it is 111 characters long and it starts with xpub6. If you have verified this you might need to send it via email so I can debug it.

    @nomiddleman I’ve got a typo in my previous post. I meant not Master Private Key, but Master Public Key of course.

    First I generated MPK myself via bx tool as described here: https://bitcoin.stackexchange.com/questions/84116/get-master-private-key-from-bip39-seed

    After your plugin throw an error that MPK is invalid, I checked your code and realized that the prefix supposed to start either with xpub6, ypub6 or zpub6. So apparently you require what is called extended public key. So I picked it up
    from a program Bitcoin.com wallet and tried again. The plugin accepted it (so it is starting with xpub6 and has a length of 111 characters), but address generation failed.

    For exapmle let’s pick up extended public key from here:

    https://bitcoin.stackexchange.com/a/80454/93412

    xpub661MyMwAqRbcFJwcugErEvzSgeKwGgHeLyzWKKK4C3edVRDbCU8o2pueJ5S26cXgPQQVRxQXyuoKrScnNKzohc4YNefs4zXg8tAhSLfnFo7

    I am inserting it into “Privacy Mode MPK” field, pressing “Save Changes”. No error thrown. But then I see “Address creation failed, please check your mpk.” in the fields where the addresses supposed to be.

    https://ibb.co/B4wpjpz

    Any idea how to debug it?

    • This reply was modified 11 months, 1 week ago by jakemorrow.
    • This reply was modified 11 months, 1 week ago by jakemorrow.
    Plugin Author Nomiddleman Crypto

    (@nomiddleman)

    I’m not getting the error on my setup with this MPK.

    Please add to wp-config.php and try again:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );

    Then navigate to WordPressDirectory/wp-content/debug.log and see if there are any errors.

    I cannot see any log files whatsoever.
    I thought that the problem is because of permissions, but the owner of the wp-content directory is apache user (and it has write permissions) and my php-fpm is configured to run as apache user.

    So that’s why I did this additionally:

    define( 'WP_DEBUG_DISPLAY', true );
    @ini_set( 'display_errors', 1 );

    But I can’t see any errors still. Tried to delete MPK, save it, insert it again and save it. Still the same thing – the MPK is accepted but it can’t generate any addresses.

    What PHP version are you using and what modules are required BTW?

    Plugin Author Nomiddleman Crypto

    (@nomiddleman)

    It is possible if you don’t have the php extension ‘gmp’ installed then you are timing out when generating the addresses.

    Try uncommenting the line
    ;extension=gmp
    in your php.ini.

    Yes, that’s was the case. Thank you!

    Dear author, apparently you forgot to add a field “hd_mode” into the table with addresses derived from MPK (*_nmmpro_hd_addresses). At least in my case the addresses were not displaying on the purchase form without that field – the records couldn’t get inserted or selected without it.

    Next issue with Bitcoin setup.

    Plugin is set for Privacy Mode MPK. Addressed being served. All good.
    Privacy Mode Required Confirmations set to 0 (zero)

    Test purchase has been made to given address. Blockchain shows that transfer alright. But order status in Woocommerce is still ‘On Hold’.
    Note inside the order:
    ‘Privacy Mode (HD wallet) address BITCOIN-ADDRESS is awaiting payment of 0.0005 BTC. Order status changed from Pending payment to On hold.’

    Transfer has no confirmations yet, but 30 minutes has elapsed since it’s visible in blockchain.

    What seems to be a problem here?

    jakemorrow

    (@jakemorrow)

    Logs:

    69 2019-10-18T22:10:04+00:00 CRITICAL Uncaught Error: Call to a member function get_id() on null in /var/holland/gui/wordpress/wp-content/plugins/nomiddleman-crypto-payments-for-woocommerce/src/NMM_Gateway.php:167
    70 Stack trace:
    71 #0 /var/holland/gui/wordpress/wp-includes/class-wp-hook.php(286): NMM_Gateway->thank_you_page(53)
    72 #1 /var/holland/gui/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    73 #2 /var/holland/gui/wordpress/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    74 #3 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/templates/checkout/thankyou.php(77): do_action(‘wooco mmerce_tha…’, 53)
    75 #4 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/wc-core-functions.php(249): include(‘/var/holland/gu…’)
    76 #5 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(2 48): wc_get_template(‘checkout/thanky…’, Array)
    77 #6 /var/holland/gui/wordpress/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.p in /var/holland/gui/wordpress/wp-content/plugins/nomiddleman-crypto-payments-for-woocommerce/src/NMM_Gateway.php on l ine 167
    78

    jakemorrow

    (@jakemorrow)

    The log above might be unrelated to the issue.

    I just don’t quite understand how K can debug it. There suppose to be some task scheduler for wordpress. In Linux these kind of things supposed to be handled by programs like cron. But apparently in WordPress that kind of scheduler is not used and instead, apparently, the scheduler is triggered by php – i.e. by client. If that is so, then – is it triggered by login to the admin panel of WP? Or by the user browsing a page with order? So, how I can trigger the plugin to check the balance of the order? And how I can catch debug logs from it?

    jakemorrow

    (@jakemorrow)

    Uncommented the log function from the NMM_Util.php module. Can’t see any nmm.log file yet.

    Installed plugin WP-Control to monitor what is going on with job scheduler of WP. It seems that scheduler wasn’t working.

    There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
    Unexpected HTTP response code: 401

    So the scheduler requires an access to specific webserver url in order to work?

    … started job manually:

    Successfully executed the cron event NMM_cron_hook

    Again, can’t see any logs.

    • This reply was modified 11 months ago by jakemorrow.
    • This reply was modified 11 months ago by jakemorrow.
    jakemorrow

    (@jakemorrow)

    Hmm… adding wp-cron.php into the exception from Basic Authorization seems to be working.

    <FilesMatch “(wp-cron.php)$”>
    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none
    </FilesMatch>

    Yet it is unclear why the event didn’t produce any logs when I called it manually.

    And it is also unclear how the wp cron scheduler actually working – why it cannot work under basic authorization.

    jakemorrow

    (@jakemorrow)

    Anyways, there is a bug for sure.

    The missing field in the database.
    The “hd_mode” field.

    Thanks!

    jakemorrow

    (@jakemorrow)

    I am looking into nnm.log right now and see that blockexplorer.com was down at least one time (it was using cloudflare ddos protection). So it is kinda scary to use this in production. Is there any other data providers available in the plugin in case if blockexplorer.com is down?

    • This reply was modified 11 months ago by jakemorrow.
Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Bitcoin Setup Problem’ is closed to new replies.