Page 1 of 1

[v3.0.3.1 - cardconnect extension payment]

Posted: Sun Mar 03, 2019 3:59 am
by straightlight
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.

Re: [v3.0.3.1 - cardconnect extension payment]

Posted: Wed Mar 27, 2019 1:08 pm
by HAO
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!

Re: [v3.0.3.1 - cardconnect extension payment]

Posted: Wed Mar 27, 2019 2:35 pm
by xxvirusxx
is wrong, should be post.

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


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

Re: [v3.0.3.1 - cardconnect extension payment]

Posted: Wed Mar 27, 2019 5:34 pm
by straightlight
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.

Re: [v3.0.3.1 - cardconnect extension payment]

Posted: Wed Mar 27, 2019 5:50 pm
by xxvirusxx
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');
		}

Re: [v3.0.3.1 - cardconnect extension payment]

Posted: Wed Mar 27, 2019 10:58 pm
by HAO
Thank you for your fixed!

I have updated the file!