Advertisement:

Author Topic: payments plugin: Plugin couldn't be installed because of: Error importSQL::Model  (Read 4465 times)

spmedia

  • Newbie
  • *
  • Posts: 2
Hi, when I click the Install link for Payments plugin I get this error:

Plugin couldn't be installed because of: Error importSQL::ModelPayment
payment/struct.sql

Can you tell me how I can enable this plugin?

Duane

lucky_strike

  • Guest
Do u have paypal..or paypal plus installed before?... ccheck the atruct.sql.. see what table has.. see if u have any of thouse tables in the database

sigivr

  • Sr. Member
  • ****
  • Posts: 471
Did you solved it?

thunderbird

  • Newbie
  • *
  • Posts: 15
I have same issue, any help please

Salvat0re

  • Newbie
  • *
  • Posts: 40
Edit struct.sql and change "InnoDB" to "MyISAM" and test

thunderbird

  • Newbie
  • *
  • Posts: 15
Ok i made the changes but same issue

Code: [Select]
CREATE TABLE  /*TABLE_PREFIX*/t_payments_log (
    pk_i_id INT NOT NULL AUTO_INCREMENT ,
    s_concept VARCHAR( 200 ) NOT NULL ,
    dt_date DATETIME NOT NULL ,
    s_code VARCHAR( 255 ) NOT NULL ,
    f_amount FLOAT NOT NULL ,
    i_amount BIGINT(20) NULL,
    s_currency_code VARCHAR( 3 ) NULL ,
    s_email VARCHAR( 200 ) NULL ,
    fk_i_user_id INT NULL ,
    fk_i_item_id INT NULL ,
    s_source VARCHAR( 10 ) NOT NULL,
    i_product_type VARCHAR( 15 ) NOT NULL,

    PRIMARY KEY(pk_i_id)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_payments_wallet (
    fk_i_user_id INT UNSIGNED NOT NULL,
    i_amount BIGINT(20) NULL,

        PRIMARY KEY (fk_i_user_id),
        FOREIGN KEY (fk_i_user_id) REFERENCES /*TABLE_PREFIX*/t_user (pk_i_id)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_payments_premium (
    fk_i_item_id INT UNSIGNED NOT NULL,
    dt_date DATETIME NOT NULL ,
    s_keyword VARCHAR(250) NULL ,
    fk_i_payment_id INT NOT NULL,

        PRIMARY KEY (fk_i_item_id),
        FOREIGN KEY (fk_i_item_id) REFERENCES /*TABLE_PREFIX*/t_item (pk_i_id),
        FOREIGN KEY (fk_i_payment_id) REFERENCES /*TABLE_PREFIX*/t_payments_log (pk_i_id)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_payments_publish (
    fk_i_item_id INT UNSIGNED NOT NULL,
    dt_date DATETIME NOT NULL ,
    b_paid BOOLEAN NOT NULL DEFAULT FALSE,
    s_keyword VARCHAR(250) NULL ,
    fk_i_payment_id INT NULL,

        PRIMARY KEY (fk_i_item_id),
        FOREIGN KEY (fk_i_item_id) REFERENCES /*TABLE_PREFIX*/t_item (pk_i_id)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_payments_prices (
    fk_i_category_id INT UNSIGNED NOT NULL,
    f_publish_cost FLOAT NULL ,
    f_premium_cost FLOAT NULL ,

        PRIMARY KEY (fk_i_category_id),
        FOREIGN KEY (fk_i_category_id) REFERENCES /*TABLE_PREFIX*/t_category (pk_i_id)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

Salvat0re

  • Newbie
  • *
  • Posts: 40
Try execute sentece SQL from phpmyadmin and post error

thunderbird

  • Newbie
  • *
  • Posts: 15
how ? i have phpmyadmin open

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Edit struct.sql and change "InnoDB" to "MyISAM" and test
dont do this...osclass runs on InnoDB...you will break your site....


pardon the interruption:
« Last Edit: August 01, 2014, 08:37:47 pm by design »

slinkyaroo

  • Newbie
  • *
  • Posts: 11
I have install issues also however I think your error is because the table already exists from previous install attempts.

perotin

  • Newbie
  • *
  • Posts: 46
I have delete the four tables in myphpadmin database but now when i install the payment plugin i get the message:

The plugin generated 254 characters of unexpected output during the installation. Output: "
Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in C:\Program Files\Ampps\www\osclass\oc-content\plugins\payment2\ModelPayment.php on line 97"

and if i want to pay an ad I get:

Fatal error: Call to a member function row() on a non-object in C:\Program Files\Ampps\www\osclass\oc-content\plugins\payment2\ModelPayment.php on line 376

teseo

  • Hero Member
  • *****
  • Posts: 6169
Hi,

You need to keep the original name of the plugin folder ("payment", not "payment2"). The error you are seeing is provoked by this line:

Code: [Select]
$this->import('payment/struct.sql');
Regards