News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

payment plugin help. it stopped working in the store

Started by ArchiB, October 10, 2019, 20:22:43 PM

Previous topic - Next topic

ArchiB

Hi,

I just noticed that my credit card plugin stopped working.  I think it is from one of the updates but am not sure. it is alatak_creditcard plugin

The result is that I can see the payment option in VM (in the admin) but not in the product (in the store). 

The payment method works for all types of shopper groups and no change have been made to this.
The payment works for Canada, and no change has been made to this.
In the admin, I have selected the payment in shop ---> checkout.

VM: 3.6.2
Joomla: 3.9.12
php: 7.2.15
alatak plugin: 2.5.8

What steps should I take to get this fixed?

Any help appreciated!

Here is the debug message:
Quote from: ArchiB on October 10, 2019, 20:22:43 PM
Message
1 vmdebug Show All Errors, PHP-Version 7.2.15

2 vmdebug 2 Languages, default shoplanguage (VmConfig::$jDefLang): fr_fr fr-FR Selected VM language (VmConfig::$vmlang): fr_fr fr-FR SEF: fr $lfbs =

3 vmdebug vmTime: time to load config: 0.0167620182037354

4 vmdebug vmTime: time to import plugins vmuserfield: 5.50746917724609E-5

5 vmdebug SSL enabled

6 vmdebug my setupAddressFieldsForCart $countBT $this->byDefaultBT Var1:

30
Var2:
0
7 vmdebug Going to set pw fields unrequired

8 vmdebug Defining custom function convertfromcurrency

9 vmdebug Defining custom function converttocurrency

10 vmdebug Start used Ram 8M

11 vmdebug Common jQuery is disabled

12 vmdebug getVendorId normal shopper

13 vmdebug My Memory Limit in Bytes 268435456

14 vmdebug checkAutomaticSelectedPlug my $method_ids shipment Var1:

1
Var2:
Array
(
   
  • => 2
    )

    15 vmdebug FOUND automatic SELECTED shipment !! Var1:

    2
    16 vmdebug checkAutomaticSelectedPlug my $method_ids payment Var1:

    0
    Var2:
    Array
    (
    )

    17 vmdebug vmTime: Time consumed for shipment/payment plugins: 0.00331401824951172

    18 vmdebug Not filled by default email

    19 vmdebug Not filled by default first_name

    20 vmdebug Not filled by default last_name

    21 vmdebug Not filled by default address_1

    22 vmdebug Not filled by default zip

    23 vmdebug Not filled by default city

    24 vmdebug Not filled by default virtuemart_country_id

    25 vmdebug my setupAddressFieldsForCart $countBT $this->byDefaultBT Var1:

    30
    Var2:
    0
    26 vmdebug Common jQuery is disabled

    27 vmdebug Common jQuery is disabled

    28 vmdebug Common jQuery is disabled

    29 vmdebug Not filled by default email

    30 vmdebug Not filled by default first_name

    31 vmdebug Not filled by default last_name

    32 vmdebug Not filled by default address_1

    33 vmdebug Not filled by default zip

    34 vmdebug Not filled by default city

    35 vmdebug Not filled by default virtuemart_country_id

    36 vmdebug End used Ram 10M

    37 vmdebug Peak memory peak 10M

    38 vmdebug vmTime: "VirtuemartControllerCart" Finished task : 0.244856119155884

    39 vmdebug Common jQuery is disabled

    40 vmdebug Required output Var1:

    Array
    (
        [email] => 0
        [name] => 1
        [username] => 2
        [password] => 3
        [password2] => 4
        [tos] => 5
        [address_type_name] => 6
        [first_name] => 7
        [last_name] => 8
        [address_1] => 9
        [zip] => 10
        [city] => 11
        [virtuemart_country_id] => 12
    )

jjk

This probably happens because the 'Offline Credit Card Plugin' hasn't been updated to this yet:
https://docs.virtuemart.net/tutorials/development/236-update-payment-shipment-plugin-using-new-core-restrictions.html
A solution which allows old plugins to continue to work is currently being tested. Expect to see a new release within the next few days.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

GJC Web Design

try switching of any automatic selection of ship and payment plugins in the VM admin
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ArchiB

If I use an automatic selection of payment in the VM, it works.  So you are both right in saying it is the old plugin.

When I look at the link, I have a few questions:

I did the first part of what the link says to do.
But... after
QuoteWe need another line in the plugin constructor to add automatically the "varsToPush" to the method.
This is not clear to me.

QuoteThe first parameter is your $varsToPush variable, which is later used in $this->setConfigParameterable($this->_configTableFieldName, $varsToPush). The second parameter says if it is a payment or shipment. Usually it looks like this, then
Same here, not clear.  Does the quote replace the first quote?  Can I put these lines anywhere within the
Quotefunction __construct(& $subject, $config) {
?  Is that even the correct place to put the varsToPush?


I need to put those lines in here(?):
Quote
   function __construct(& $subject, $config) {

      parent::__construct($subject, $config);
       
        $varsToPush = $this->getVarsToPush();
$this->addVarsToPushCore($varsToPush, 1);
$this->setConfigParameterable($this->_configTableFieldName, $varsToPush);
      $this->_loggable = true;
      $this->_tablepkey = 'id';
      $this->_tableId = 'id';
      $this->tableFields = array_keys($this->getTableSQLFields());
      $varsToPush = $this->getVarsToPush();
      $this->setConfigParameterable($this->_configTableFieldName, $varsToPush);
   }


QuoteFinally we just need to update the "checkConditions" function. For example

- The payment "default" uses any restrictions provided by the core and has no extra restrictions, it is enough to remove the whole function

So I should delete this?

Quoteprotected function checkConditions($cart, $method, $cart_prices) {

      $address = (($cart->ST == 0) ? $cart->BT : $cart->ST);

      $amount = $cart_prices['salesPrice'];
      $amount_cond = ($amount >= $method->min_amount AND $amount <= $method->max_amount
         OR
         ($method->min_amount <= $amount AND ($method->max_amount == 0)));
      if (!$amount_cond) {
         vmdebug('Offline Credit Card checkConditions $amount_cond false');
         return false;
      }
      $countries = array();
      if (!empty($method->countries)) {
         if (!is_array($method->countries)) {
            $countries[0] = $method->countries;
         } else {
            $countries = $method->countries;
         }
      }

      // probably did not gave his BT:ST address
      if (!is_array($address)) {
         $address = array();
         $address['virtuemart_country_id'] = 0;
      }

      if (!isset($address['virtuemart_country_id'])) {
         $address['virtuemart_country_id'] = 0;
      }
      if (count($countries) == 0 || in_array($address['virtuemart_country_id'], $countries) || count($countries) == 0) {
         return true;
      }

      return false;
   }


GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jjk

Quote from: GJC Web Design on October 11, 2019, 19:28:16 PM
why not just get the latest version from alatak?
The latest Offline Credit Card plugin version currently available is 2.5.9 from 2017. It will most likely work again with VM build 10173 or higher, but that's not yet released.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

ArchiB

Quote from: GJC Web Design on October 11, 2019, 19:28:16 PM
why not just get the latest version from alatak?
I have no problem paying for an app (which was obliviously done), but paying for an update is insulting to me.

Can you provide some insight and clarifications on the questions I have for the link you have provided?

Thanks for the help

GJC Web Design

QuoteI have no problem paying for an app (which was obliviously done), but paying for an update is insulting to me.

Hmm .. how does that work? Developers can't expect to be paid for their time now? Interesting concept...

The standard agreement is you pay for an extension and any updates are included for "some" period .. normally 6 months to a year - think of it as a guarantee
after that you re-purchase your "subscription" or your on your own as far as maintenance etc is concerned.
Just like when your washing machine craps after 2 years etc ...  you expect the manufacturer to fix it after this time for free?

As you do not have the skills to update the plugin THAT is what your paying for if u get someone else to do it.. their investment in knowledge and subsequent skills...

But as I read it the next VM release is backwards compatible for old plugins?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ArchiB

I bought the plugin full price already, that is how it works.

Anyway, it took me 20 minutes to figure it out as it is now working.   Someone that knows what he is doing would have taken 2 mins.  You think it is fair to pay full price a second time for a 2 minute job? please...

I don't see it as fair to pay full price a second time for a 2 min job.  And to me this is the problem of fake "open source" mentality.  Can't read code? pay full price for a 2 minute job.

Thanks for your time and the link; I appreciate the help.

Have a nice day.