Post by straightlight » Mon Oct 23, 2017 4:41 am

In catalog/controller/extension/payment/sagepay_server.php file,

find:

Code: Select all

public function success() {
add above:

Code: Select all

public function failure() {
		$this->load->language('extension/payment/g2apay');

		$this->session->data['error'] = $this->language->get('text_generic_error');

		$this->response->redirect($this->url->link('checkout/checkout', '', true));
	}
Then, in catalog/language/en-gb/extension/payment/g2apay.php file,

find:

Code: Select all

$_['text_title']
add right below:

Code: Select all

$_['text_generic_error']		= 'There was an error processing your request.';
This should resolved the problem.

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 straightlight » Mon Oct 23, 2017 5:25 am

In addition on the same controller file, find:

Code: Select all

if ($response_data === false) {
			$this->response->redirect($this->url->link('extension/payment/failure', '', true));
		}

		if (strtolower($response_data->status) != 'ok') {
			$this->response->redirect($this->url->link('extension/payment/failure', '', true));
		}
		
replace with:

Code: Select all

if ($response_data === false) {
			$this->response->redirect($this->url->link('checkout/failure', '', true));
		}

		if (strtolower($response_data->status) != 'ok') {
			$this->response->redirect($this->url->link('checkout/failure', '', true));
		}
		

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 straightlight » Mon Oct 23, 2017 5:56 am

For further diagnostics when receiving the response data from G2APay API;

In catalog/model/extension/payment/g2apay.php file,

find:

Code: Select all

curl_close($curl);
add right below:

Code: Select all

if ($this->config->get('payment_g2apay_debug') == 1) {
			$log = new Log('g2apay.log');
			
			$log->write('Response data: ' . print_r(json_decode($response, true)));
		}
Once tested a transaction, see the log entries that begins with: Response data: . The provided response will be from the actual transaction being replied by G2APay. However, if these issues needs to be troubleshooted on the forum, do NOT include the confidential information along.

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 straightlight » Mon Oct 23, 2017 7:06 am

In admin/controller/extension/payment/g2apay.php file,

find:

Code: Select all

$this->session->data['complete'] = $this->language->get('text_complete');
replace with:

Code: Select all

$this->session->data['success'] = $this->language->get('text_success');

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 straightlight » Mon Oct 23, 2017 7:35 am

The status and token fields are missing from the API response. The Opencart G2APay controller first refers to the status field which, obviously, will enforce the payment to fail at this time. This issue has now been addressed on Github.

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 straightlight » Sat Mar 21, 2020 12:07 am

Other solutions have been found which seem to be continuing on OC v3.0.3.2 release: https://github.com/opencart/opencart/co ... d5c35a7e55

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 straightlight » Sat Mar 21, 2020 12:15 am

Commit issue 6125 on Opencart Github also informs by Daniel that the issue has already been fixed on the Master Branch.

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
Who is online

Users browsing this forum: canvasbay and 316 guests