Post by straightlight » Sun Mar 03, 2019 3:59 am

The following steps are for Opencart v3.0.3.1 release. If your site is running in production, put your site under maintenance. Issue already fixed on GitHub.

1 - Take a screenshot of your admin cardconnect payment module configurations.
2 - Uninstall the cardconnect payment module.
3 - In admin/controller/extension/payment/cardconnect.php file,

find all instances of:

Code: Select all

->post['cardconnect_
replace all with:

Code: Select all

->post['payment_cardconnect_
Then, find all instances of:

Code: Select all

->get('cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
In your admin/model/extension/payment/cardconnect.php file, find all instances of:

Code: Select all

->get('cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
In admin/view/template/extension/payment/cardconnect.twig file,

find all instances of:

Code: Select all

cardconnect_
replace all manually (not automatically!):

Code: Select all

payment_cardconnect_
In admin/view/template/extension/payment/cardconnect_order.twig file,

find all instances of:

Code: Select all

cardconnect_
replace all with (except the CSS portion):

Code: Select all

payment_cardconnect_
In catalog/controller/extension/payment/cardconnect.php file,

find all instances of:

Code: Select all

->get('cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
In catalog/model/extension/payment/cardconnect.php file,

find all instances of:

Code: Select all

->get('cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
4 - Reinstall the cardconnect payment module.
5 - Reconfigure the cardconnect payment module.
6 - Test a transaction during checkout.
7 - When successful, disable the site maintenance (if running in production).

This should overall resolve the status issues along with other variables.
Last edited by straightlight on Wed Mar 27, 2019 5:33 pm, edited 1 time in total.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by HAO » Wed Mar 27, 2019 1:08 pm

Hello!

Please confirm the following code, is it correct?

find all instances of:

Code: Select all

->post['cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
Because of other code, it seems to be reserved: ->post[

Excuse me, Can you confirm?

Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by xxvirusxx » Wed Mar 27, 2019 2:35 pm

is wrong, should be post.

->post['cardconnect_ to ->post['payment_cardconnect_


And you can check..
https://github.com/opencart/opencart/bl ... onnect.php

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by straightlight » Wed Mar 27, 2019 5:34 pm

HAO wrote:
Wed Mar 27, 2019 1:08 pm
Hello!

Please confirm the following code, is it correct?

find all instances of:

Code: Select all

->post['cardconnect_
replace all with:

Code: Select all

->get('payment_cardconnect_
Because of other code, it seems to be reserved: ->post[

Excuse me, Can you confirm?

Thank you!
Thanks for addressing this. That first portion has now been edited.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by xxvirusxx » Wed Mar 27, 2019 5:50 pm

I think also these need to be changed

from

Code: Select all

		if (isset($this->error['cardconnect_api_username'])) {
			$data['error_cardconnect_api_username'] = $this->error['cardconnect_api_username'];
		} else {
			$data['error_cardconnect_api_username'] = '';
		}
in to

Code: Select all

		if (isset($this->error['payment_cardconnect_api_username'])) {
			$data['error_cardconnect_api_username'] = $this->error['cardconnect_api_username'];
		} else {
			$data['error_cardconnect_api_username'] = '';
		}
Because when replace all manually cardconnect_ in to payment_cardconnect_ in cardonnect.twig some lines will be like this

Code: Select all

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-cardconnect-api-username"><span data-toggle="tooltip" title="{{ help_api_username }}">{{ entry_api_username }}</span></label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_api_username" value="{{ payment_cardconnect_api_username }}" placeholder="{{ entry_api_username }}" id="input-cardconnect-api-username" class="form-control" />
                  {% if error_payment_cardconnect_api_username %}
                  <div class="text-danger">{{ error_payment_cardconnect_api_username }}</div>
                  {% endif %} </div>
              </div>
And I think correct code will be only

Code: Select all

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-cardconnect-api-username"><span data-toggle="tooltip" title="{{ help_api_username }}">{{ entry_api_username }}</span></label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_api_username" value="{{ payment_cardconnect_api_username }}" placeholder="{{ entry_api_username }}" id="input-cardconnect-api-username" class="form-control" />
                  {% if error_cardconnect_api_username %}
                  <div class="text-danger">{{ error_cardconnect_api_username }}</div>
                  {% endif %} </div>
              </div>
Another situation when you fallow the posted rules

Code: Select all

		if (isset($this->request->post['payment_cardconnect_transaction'])) {
			$data['cardconnect_transaction'] = $this->request->post['payment_cardconnect_transaction'];
		} else {
			$data['cardconnect_transaction'] = $this->config->get('payment_cardconnect_transaction');
		}
I think correct is this

Code: Select all

		if (isset($this->request->post['payment_cardconnect_transaction'])) {
			$data['payment_cardconnect_transaction'] = $this->request->post['payment_cardconnect_transaction'];
		} else {
			$data['payment_cardconnect_transaction'] = $this->config->get('payment_cardconnect_transaction');
		}

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by HAO » Wed Mar 27, 2019 10:58 pm

Thank you for your fixed!

I have updated the file!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 31 guests