Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github files - PP Express Checkout #7272

Open
straightlight opened this issue Mar 16, 2019 · 15 comments

Comments

Projects
None yet
4 participants
@straightlight
Copy link

commented Mar 16, 2019

admin/view/template/extension/payment/pp_express.twig

replace all instances of:

{% endfor %}>

with:

{% endfor %}

@straightlight

This comment has been minimized.

Copy link
Author

commented Mar 18, 2019

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

find:

if (isset($this->error['sandbox_signature'])) {

add above:

if (isset($this->session->data['error_api'])) {
$data['error_api'] = $this->session->data['error_api'];

		unset ($this->session->data['error_api']);
	} else {
		$data['error_api'] = '';
	}
	
	if (isset($this->session->data['error_merchant_id'])) {
		$data['error_merchant_id'] = $this->session->data['error_merchant_id'];
		
		unset ($this->session->data['error_merchant_id']);
	} else {
		$data['error_merchant_id'] = '';
	}

Then, find:

$response['error_msg'] = 'Enter a start date';

replace with:

$response['error_msg'] = $this->language->get('error_start_date');`

In admin/view/template/extension/payment/pp_express.twig file,

find:

{% if error_warning %}

add above:

{% if error_api %}

{{ error_api }}
×

{% endif %}
{% if error_merchant_id %}
{{ error_merchant_id }}
×

{% endif %}

@straightlight

This comment has been minimized.

Copy link
Author

commented Mar 18, 2019

In admin/language/en-gb/extension/payment/pp_express.php file, add at the bottom:

$_['error_merchant_id'] = 'The merchant ID could not be found!';
$_['error_start_date'] = 'Enter a start date';

@melvin16

This comment has been minimized.

Copy link

commented Mar 24, 2019

Hi straightlight,
In admin/controller/extension/payment/pp_express.php you wrote :

Then, find:

$json['error_msg'] = 'Enter a start date';

I can't find it....do you have suggestions? Thank you in advance.

@straightlight

This comment has been minimized.

Copy link
Author

commented Mar 24, 2019

My bad. Thanks for mentioning this. Instructions updated on the 2nd post. Changed from $json to $response

@straightlight

This comment has been minimized.

Copy link
Author

commented Mar 30, 2019

Patch released for v3.x releases: #7170

@straightlight

This comment has been minimized.

Copy link
Author

commented Apr 2, 2019

Github file and all OC v3.x releases (maybe v2.x release as well): catalog/controller/extension/payment/pp_express.php file - long time reported issue:

replace:

'recurring_name' => (isset($product['recurring']['recurring_name']) ? $product['recurring']['recurring_name'] : ''),

with:

'recurring_name' => (isset($product['recurring']['name']) ? $product['recurring']['name'] : ''),

This should resolved the recurring name issue but also needs to be added into the catalog/view/theme/default/template/extension/payment/pp_express_confirm.twig file.

@aj1322001

This comment has been minimized.

Copy link

commented Apr 5, 2019

upon confirming order,

Notice: Undefined index: affiliate_id in /home4/mywebsite.com/catalog/controller/extension/payment/pp_express.php on line 1214Warning: Cannot modify header information - headers already sent by (output started at /home4/mywebsite.com/catalog/controller/startup/error.php:34) in /home4/storage/modification/system/library/response.php on line 36

@straightlight

This comment has been minimized.

Copy link
Author

commented Apr 5, 2019

I question the ways of the array validations on this platform as only validating the variable itself seems to be insufficient to avoid an error in this case.

See if the following makes a difference. In catalog/controller/extension/payment/pp_express.php, find:

if ($affiliate_info) {

replace with:

if (!empty($affiliate_info['affiliate_id']) && !empty($affiliate_info['commission'])) {

Then, retry a new order with an affiliate tracking number.

@straightlight

This comment has been minimized.

Copy link
Author

commented Apr 7, 2019

File attachment replaced on topic. Also fixed the marketing_info validation.

@amshehzad

This comment has been minimized.

Copy link

commented May 5, 2019

@straightlight I have applied the patch you provided and clear the cache before reinstalling but still getting the same error :
"Error: There was an error fetching the PayPal token at eval (eval at globalEval "
image
can you please tell me what's wrong here ?

@straightlight

This comment has been minimized.

Copy link
Author

commented May 5, 2019

As much and the same usual response from the OC forum users trying this fix, you are using Journal3. See from a fresh installation of OC (v3.0.3.2) by, then, installing the PP Express Fix package if it will work. Also take note that the IPN / Callback URL may need to be changed via your test environment location rather than your live server.

I would also suggest to set your live store under maintenance, especially if the screenshot above originates from the live store until you complete these steps with PP Express Checkout.

@amshehzad

This comment has been minimized.

Copy link

commented May 5, 2019

Thank you so much for your suggestion, I have just enabled the errors for testing, I have installed the fix packages you provided but still the same error, I would really very glad if you can help on this as I'm trying to fix it from last two days

@straightlight

This comment has been minimized.

Copy link
Author

commented May 5, 2019

If it indicates the exact same error as your above screenshot, it means you are still using Journal which is not supported which this fix solution. The main idea was to propose this fix for the core by using a fresh installation due to geographic restrictions that could not be identified out-of-the-box. Most of the users wants to remain with Journal and that is under their responsibility to use a 3rd party extension to sell their products and services with OC.

With that being said, once a fresh installation will be done, see the results. In addition, this section is not for troubleshooting, it is for reporting technical issues 'from the core' and NOT from 3rd party extensions. To report 3rd party extension issues, please report them on the official topic on the Opencart forum.

@straightlight

This comment has been minimized.

Copy link
Author

commented May 5, 2019

@straightlight

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

Issue resolved on my Github namespace for: catalog/controller/extension/payment/pp_express.php file in the checkout() method. pp_express.twig file uses application/json-token while the checkout() method in the controller was also handling a failed redirection with $this->response->redirect since the setOutput was set to JSON encoding.

Balanced both IF statements for non-JSON and JSON conditions to handle successful redirection with $this->session->data and JSON encoding. Tested with a user on a custom job having a PayPal Business Account, mentions she no longer since the PayPal token error message as it continues to the next steps accordingly.

https://github.com/straightlight/opencart_contributions/blob/master/upload/catalog/controller/extension/payment/pp_express.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.