bitpay / magento2-plugin

Magento2.x payment plugin for Bitpay.com
MIT License
13 stars 24 forks source link

Invalid scope type 'base_zen' #19

Closed ZenDevMaster closed 6 years ago

ZenDevMaster commented 7 years ago

I'm getting an error during pairing for the first time on a Magento 2.1.6 system. The following entries are logged to payment_bitpay.txt output:

[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In Bitpay_Core_Model_Config_PairingCode::save(): attempting to pair with BitPay with pairing code XXXX [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::sendPairingRequest(): function called with the pairingCode parameter: XXXX [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::registerAutoloader(): autoloader file was found and has been registered. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::generateAndSaveKeys(): attempting to generate new keypair and save to database. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getKeyManager(): successfully created new BitPay KeyManager object. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::generateAndSaveKeys(): key manager called to persist keypair to database. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getSinKey(): attempting to get the SIN parameter. [] []

[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getPublicKey(): found an existing public key, returning that. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::sendPairingRequest(): attempting to pair with the SIN parameter: YYYYYYY [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::sendPairingRequest(): using the label "Magento English". [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getBitpayClient(): successfully created new BitPay Client object. [] []
[2017-07-26 08:43:12] Bitpay.DEBUG: [ERROR] Exception thrown while calling the sendPairingRequest() function. The specific error message is: "Invalid scope type 'base_zen'" [] []

The error Invalid scope type 'base_zen' is logged in the admin interface and shown below:

bitpay_error

I've tried a full uninstall, cleared the configuration from core_config_data and setup_module, and reinstalled per the setup guide.

The error appears to be thrown when this codeblock is called inside /app/code/Bitpay/Core/Model/Config/Backend/PairingCode.php

 try {
            $this->helper->sendPairingRequest($pairingCode);
        } catch (\Exception $e) {
            $this->helper->debugData(sprintf('[ERROR] Exception thrown while calling the sendPairingRequest() function. The specific error message is: "%s"', $e->getMessage())$
            $this->messageManager->addError('There was an error while trying to pair with BitPay using the pairing code '.$pairingCode.'. Please try again or enable debug mode$

            return;
        }

Any suggestions on how to debug this further?

ZenDevMaster commented 6 years ago

@linden2015 can confirm this is true and the fix referenced in your comment resolves the bug

pieterpoorthuis commented 6 years ago

Fixed in latest release (v1.06): https://github.com/bitpay/magento2-plugin/releases

Please check, feedback is appreciated.

linden2015 commented 6 years ago

@pieterpoorthuis Do you mean 1.0.7? 1.0.6 was released in April of this year.

pieterpoorthuis commented 6 years ago

I need to sync up the source code tags, will do that with the next changes.

With respect to downloading the plugin: it's much easier to download the release (instead of the github source): https://github.com/bitpay/magento2-plugin/releases/download/v1.0.6/Bitpay_Core-1.0.6.zip

A release contains all files (including other libs) & the correct Magento file structure.