Page 1 of 1

Opencart 3.0.4 PHP 8.2 Paypal Checkout Integration Issues - no buttons

Posted: Mon Mar 03, 2025 5:19 am
by Andrey558
I'm using OpenCart 3.0.4 PHP 8.2.
I have installed the PayPal Checkout Integration module VERSION 3.1.14
The PayPal and Card buttons are not being displayed in the checkout page.
In console i got error

Code: Select all

a3a3ad0……s?20250302153350:64 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'includes')
    at loadPayPalSDK (a3a3ad0……250302153350:64:375)
    at Object.init (a3a3ad0……50302153350:106:171)

Code: Select all

var loadPayPalSDK = function() {
        var html = '';
        if (paypal_data['components'].includes('buttons')) {
            if (!$('#paypal_button').length) {
                if ($(paypal_data['button_insert_tag']).length) {
                    html = '<div id="paypal_button" class="paypal-button clearfix"><div id="paypal_button_container" class="paypal-button-container paypal-spinner"></div></div>';
                    eval("$('" + paypal_data['button_insert_tag'] + "')." + paypal_data['button_insert_type'] + "(html)");

Code: Select all

    };
    var init = async function(callback='') {
        await updatePayPalData();
        paypal_callback = callback;
        loadPayPalSDK();
    };
    return {
        init: init
    };

Any thoughts?

Re: Opencart 3.0.4 PHP 8.2 Paypal Checkout Integration Issues - no buttons

Posted: Mon Mar 03, 2025 6:40 pm
by ADD Creative
The error is saying that paypal_data['components'] in undefined. Have you check both the OpenCart and PHP error logs? Have you contacted support for that extension?

Re: Opencart 3.0.4 PHP 8.2 Paypal Checkout Integration Issues - no buttons

Posted: Tue Mar 04, 2025 10:10 pm
by Andrey558
ADD Creative wrote:
Mon Mar 03, 2025 6:40 pm
Have you contacted support for that extension?
Yes. I haven't received a possible solution yet.
The error is saying that paypal_data['components'] in undefined. Have you check both the OpenCart and PHP error logs?
2025-03-03 17:04:38 - PHP Unknown: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /homepages/00/999999999/htdocs/000/admin/model/extension/payment/paypal.php on line 375

Code: Select all

	public function update() {
		if (version_compare($this->config->get('paypal_version'), '3.1.14', '<')) {
			$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "paypal_checkout_integration_customer_token`");
			$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "paypal_checkout_integration_order`");
			$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "paypal_checkout_integration_order_recurring`");
		
			$this->db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "paypal_checkout_integration_customer_token` (`customer_id` INT(11) NOT NULL, `payment_method` VARCHAR(20) NOT NULL, `vault_id` VARCHAR(50) NOT NULL, `vault_customer_id` VARCHAR(50) NOT NULL, `card_type` VARCHAR(40) NOT NULL, `card_nice_type` VARCHAR(40) NOT NULL, `card_last_digits` VARCHAR(4) NOT NULL, `card_expiry` VARCHAR(20) NOT NULL, `main_token_status` TINYINT(1) NOT NULL, PRIMARY KEY (`customer_id`, `payment_method`, `vault_id`), KEY `vault_customer_id` (`vault_customer_id`), KEY `main_token_status` (`main_token_status`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
			$this->db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "paypal_checkout_integration_order` (`order_id` INT(11) NOT NULL, `paypal_order_id` VARCHAR(20) NOT NULL, `transaction_id` VARCHAR(20) NOT NULL, `transaction_status` VARCHAR(20) NOT NULL, `payment_method` VARCHAR(20) NOT NULL, `vault_id` VARCHAR(50) NOT NULL, `vault_customer_id` VARCHAR(50) NOT NULL, `card_type` VARCHAR(40) NOT NULL, `card_nice_type` VARCHAR(40) NOT NULL, `card_last_digits` VARCHAR(4) NOT NULL, `card_expiry` VARCHAR(20) NOT NULL, `total` DECIMAL(15,2) NOT NULL, `currency_code` VARCHAR(3) NOT NULL, `environment` VARCHAR(20) NOT NULL, `tracking_number` VARCHAR(64) NOT NULL, `carrier_name` VARCHAR(64) NOT NULL, PRIMARY KEY (`order_id`), KEY `paypal_order_id` (`paypal_order_id`), KEY `transaction_id` (`transaction_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
			$this->db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "paypal_checkout_integration_order_recurring` (`paypal_order_recurring_id` INT(11) NOT NULL AUTO_INCREMENT, `order_id` INT(11) NOT NULL, `order_recurring_id` INT(11) NOT NULL, `date_added` DATETIME NOT NULL, `date_modified` DATETIME NOT NULL, `next_payment` DATETIME NOT NULL, `trial_end` DATETIME DEFAULT NULL, `subscription_end` DATETIME DEFAULT NULL, `currency_code` CHAR(3) NOT NULL, `total` DECIMAL(10, 2) NOT NULL, PRIMARY KEY (`paypal_order_recurring_id`), KEY (`order_id`), KEY (`order_recurring_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
		}
	}
}
}
2025-03-03 17:04:38 - PHP Unknown: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /homepages/00/999999999/htdocs/000/admin/controller/extension/payment/paypal.php on line 2087

Code: Select all

	if (version_compare($this->config->get('paypal_version'), '3.1.14', '<')) {			
			$this->load->model('setting/setting');
			
			$setting = $this->model_setting_setting->getSetting('payment_paypal');
		
			$setting['payment_paypal_setting']['general']['order_history_token'] = sha1(uniqid(mt_rand(), 1));
						
			$this->model_setting_setting->editSetting('payment_paypal', $setting);
		}
		
		$_config = new Config();
		$_config->load('paypal');
			
		$config_setting = $_config->get('paypal_setting');
				
		$setting['paypal_version'] = $config_setting['version'];
		
		$this->load->model('setting/setting');
		
		$this->model_setting_setting->editSetting('paypal_version', $setting);
	}

Re: Opencart 3.0.4 PHP 8.2 Paypal Checkout Integration Issues - no buttons

Posted: Tue Mar 04, 2025 11:00 pm
by ADD Creative
Could be an issue with the settings. Have you tried uninstalling and reinstalling?

Re: Opencart 3.0.4 PHP 8.2 Paypal Checkout Integration Issues - no buttons

Posted: Wed Mar 05, 2025 12:10 am
by JNeuhoff
Have you asked the author for support, see https://github.com/Dreamvention/paypal ?

This issue doesn't exist in OpenCart's built-in PayPal Checkout Integration V. 3.0.2 .