Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    58
    Plugin Contributions
    0

    Default New install 1.5.8 Paypal Pro PHP Fatal error: 1062

    1.5.8 New install
    PHP Version: 8.1.10 (Zend: 4.1.10)
    MySQL 5.7.30

    Setup with a new install due to problems with PP Pro not working in my upgrade attempt previously. Setup PP Express and then when installing the Pro module I got a white page with this error message upon saving:
    Code:
    WARNING: An Error occurred, please let us know! If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you entered valid data.
    Hitting back or logging out and back in show both the express module and pro module gone in the list of payment modules.
    Log is
    Code:
    [30-Oct-2022 02:38:15 UTC] Request URI: /MyAdmin/index.php?cmd=modules&set=payment&action=install, IP address: **.***.***.***
    #0 [internal function]: zen_debug_error_handler()
    #1 /home/gtbullet/public_html/includes/classes/db/mysql/query_factory.php(667): trigger_error()
    #2 /home/gtbullet/public_html/includes/classes/db/mysql/query_factory.php(634): queryFactory->show_error()
    #3 /home/gtbullet/public_html/includes/classes/db/mysql/query_factory.php(275): queryFactory->set_error()
    #4 /home/gtbullet/public_html/includes/modules/payment/paypaldp.php(1218): queryFactory->Execute()
    #5 /home/gtbullet/public_html/MyAdmin/modules.php(109): paypaldp->install()
    #6 /home/gtbullet/public_html/MyAdmin/index.php(11): require('/home/gtbullet/...')
    --> PHP Fatal error: 1062:Duplicate entry 'MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY' for key 'unq_config_key_zen' :: INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Merchant Country', 'MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY', 'USA', 'Which country is your PayPal Account registered to? <br /><u>Choices:</u><br /><font color=green>You will need to supply <strong>API Settings</strong> in the Express Checkout module.</font><br /><strong>USA and Canada merchants</strong> need PayPal API credentials and a PayPal Payments Pro account.<br /><strong>UK merchants</strong> need to supply <strong>PAYFLOW settings</strong> (and have a Payflow account)<br><strong>Australia merchants</strong> choose Canada<br><em>(This setting is really about the internal PayPal API specification, and not so much about country: US=1.5, UK=2.0, Canada/Australia=3.0)</em>', '6', '25',  'zen_cfg_select_option(array(\'USA\', \'UK\', \'Canada\'), ', now()) ==> (as called by) /home/gtbullet/public_html/includes/modules/payment/paypaldp.php on line 1218 <== in /home/gtbullet/public_html/includes/classes/db/mysql/query_factory.php on line 667.

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: New install 1.5.8 Paypal Pro PHP Fatal error: 1062

    I had the same problem and believe this might be a bug. I fixed it by commenting a line in includes/modules/paypaldp.php:

    Code:
    function check() {
        global $db;
        if (!defined('MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY')) {
    //       $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Country', 'MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY', 'USA', 'Which country is your PayPal Account registered to? <br><u>Choices:</u><br><font color=green>You will need to supply <strong>API Settings</strong> in the Express Checkout module.</font><br><strong>USA and Canada merchants</strong> need PayPal API credentials and a PayPal Payments Pro account.<br><strong>UK merchants</strong> need to supply <strong>PAYFLOW settings</strong> (and have a Payflow account)<br><strong>Australia merchants</strong> choose Canada<br><em>(This setting is really about the internal PayPal API specification, and not so much about country: US=1.5, UK=2.0, Canada/Australia=3.0)</em>', '6', '25',  'zen_cfg_select_option(array(\'USA\', \'UK\', \'Canada\'), ', now())");
        }
    When installing PP Pro, the check() runs before install() and the constant isn't defined so it inserts it, and then when it gets to install(), it's already there and causes an error for a duplicate entry.

    Possibly not the correct solution, but it worked in my case.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: New install 1.5.8 Paypal Pro PHP Fatal error: 1062

    Thanks for reporting. Fixed: https://github.com/zencart/zencart/pull/5500
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. v151 PHP Fatal error: 1062:Duplicate entry
    By joyjoy in forum General Questions
    Replies: 6
    Last Post: 2 Jan 2014, 10:17 AM
  2. PHP Fatal error: 1062 I need help!!!
    By zch0071 in forum General Questions
    Replies: 1
    Last Post: 14 Nov 2013, 03:15 PM
  3. PHP Fatal error: 1062 Duplicate entry Error, cannot fix table
    By RoboPhung in forum General Questions
    Replies: 5
    Last Post: 10 Apr 2013, 09:03 PM
  4. v151 PHP Fatal error 1062: Duplicate entry '2147483647' for key 1
    By NoobGal in forum General Questions
    Replies: 5
    Last Post: 20 Jan 2013, 05:36 PM
  5. v151 PHP Fatal error:1062:Duplicate entry '1-1' for key 'PRIMARY'
    By Dopefish in forum General Questions
    Replies: 14
    Last Post: 19 Oct 2012, 02:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR