- Posts: 173
- Thank you received: 8
PayPal Checkout - problems with cancel return and purchase
3 years 3 months ago - 3 years 3 months ago #353158
by ianspeed
-- HikaShop version -- : 4.7.4
-- Joomla version -- : Latest
-- PHP version -- : 7.4.33
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : No Error, just problems
Hi,
I'm having an issue with the new PayPal checkout, if I cancel from PayPal, the status stays at created, and I'm not redirected back to the checkout, I'm just dropped back to the PayPal button. Similarly if I complete an order it doesn't update the status to confirmed just stays at created?
Any ideas,
Thanks
Ian
-- Joomla version -- : Latest
-- PHP version -- : 7.4.33
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : No Error, just problems
Hi,
I'm having an issue with the new PayPal checkout, if I cancel from PayPal, the status stays at created, and I'm not redirected back to the checkout, I'm just dropped back to the PayPal button. Similarly if I complete an order it doesn't update the status to confirmed just stays at created?
Any ideas,
Thanks
Ian
Last edit: 3 years 3 months ago by ianspeed.
Please Log in or Create an account to join the conversation.
3 years 3 months ago #353160
by nicolas
Replied by nicolas on topic PayPal Checkout - problems with cancel return and purchase
Hi,
That's an interesting point. Normally, the plugin will display many payment methods on the end screen.
And so, when you cancel, you can select another payment method from there. So we didn't thought about returning to the checkout.
I think we'll add the code:
before the line:
in the file plugins/hikashoppayment/paypalcheckout/paypalcheckout_end.php
That way, if you provide the URL of your checkout in the "cancel URL" of your PayPal Checkout payment method, you'll be redirected back to it when canceling the payment from PayPal.
Regarding the confirmation of the order, what is the URL you end up after the payment ?
Also, check the "payment log file" setting of the HikaShop configuration. It should contain interesting information about the issue at the end. And if you have the "debug" setting of the payment method on for a test payment, you should even even more information in the payment log.
That's an interesting point. Normally, the plugin will display many payment methods on the end screen.
And so, when you cancel, you can select another payment method from there. So we didn't thought about returning to the checkout.
I think we'll add the code:
Code:
<?php
if(!empty($this->payment_params->cancel_url)) {
?>
onCancel: function (data) {
// redirect to cancel URL
window.location.href = "<?php echo $this->cancel_url; ?>";
},
<?php
}
?>
Code:
createOrder: function(data, actions) {
That way, if you provide the URL of your checkout in the "cancel URL" of your PayPal Checkout payment method, you'll be redirected back to it when canceling the payment from PayPal.
Regarding the confirmation of the order, what is the URL you end up after the payment ?
Also, check the "payment log file" setting of the HikaShop configuration. It should contain interesting information about the issue at the end. And if you have the "debug" setting of the payment method on for a test payment, you should even even more information in the payment log.
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353328
by ianspeed
Replied by ianspeed on topic PayPal Checkout - problems with cancel return and purchase
Hi Nicolas,
Sorry, again I don't seem to be getting notifications of replies? I don't have a spam filter either?
Thank you, the code worked.
I checked the logs, full of previous stuff, so I cleared the log, nothing is being written to the log?
So currently:
Cancel from PayPal: Working, returns to checkout, but still does not change status to cancelled.
Complete Purchase, Status = Confirmed and return goes to home page as requested. (Working)
Thanks
Ian
Sorry, again I don't seem to be getting notifications of replies? I don't have a spam filter either?
Thank you, the code worked.
I checked the logs, full of previous stuff, so I cleared the log, nothing is being written to the log?
So currently:
Cancel from PayPal: Working, returns to checkout, but still does not change status to cancelled.
Complete Purchase, Status = Confirmed and return goes to home page as requested. (Working)
Thanks
Ian
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353330
by nicolas
Replied by nicolas on topic PayPal Checkout - problems with cancel return and purchase
Hi,
The emails are sent by the forum system. If you don't receive them, then it means they are filtered on your end, or you provided an invalid email address when you registered. The email address you provided is one specific for our website. Maybe you forgot to create the redirection on your end for it ?
Are you receiving our newsletters and other emails like orders ?
The order should be cancelled. Are you able to reproduce the problem ?
I tried to reproduce the issue on your website but I wasn't able to use the PayPal Checkout payment plugin. Could you provide precise instructions to be able to do so ?
The emails are sent by the forum system. If you don't receive them, then it means they are filtered on your end, or you provided an invalid email address when you registered. The email address you provided is one specific for our website. Maybe you forgot to create the redirection on your end for it ?
Are you receiving our newsletters and other emails like orders ?
The order should be cancelled. Are you able to reproduce the problem ?
I tried to reproduce the issue on your website but I wasn't able to use the PayPal Checkout payment plugin. Could you provide precise instructions to be able to do so ?
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353332
by ianspeed
Replied by ianspeed on topic PayPal Checkout - problems with cancel return and purchase
Hi Nicolas,
No filters on my email system, all emails come to me as a catch all. I got this reply email... Very strange.
I did see you had done a test on the live site.
I'm currently live/testing in the Joomla4 subfolder... I'll PM you with the link again.
Thanks
Ian
No filters on my email system, all emails come to me as a catch all. I got this reply email... Very strange.
I did see you had done a test on the live site.
I'm currently live/testing in the Joomla4 subfolder... I'll PM you with the link again.
Thanks
Ian
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353336
by nicolas
Replied by nicolas on topic PayPal Checkout - problems with cancel return and purchase
Hi,
Everything looks fine on the frontend side of things. I can see that the user is first redirected to the standard HikaShop cancel order URL, which should first cancel the order and then redirects to the URL you specified in the payment method.
So if the order is not being cancelled, It's not a problem with the plugin, but an order status configuration issue I think.
Could you provide a screenshot of what you have in the System>Order statuses menu ?
Everything looks fine on the frontend side of things. I can see that the user is first redirected to the standard HikaShop cancel order URL, which should first cancel the order and then redirects to the URL you specified in the payment method.
So if the order is not being cancelled, It's not a problem with the plugin, but an order status configuration issue I think.
Could you provide a screenshot of what you have in the System>Order statuses menu ?
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353339
by ianspeed
Replied by ianspeed on topic PayPal Checkout - problems with cancel return and purchase
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353340
by nicolas
Replied by nicolas on topic PayPal Checkout - problems with cancel return and purchase
Hi,
That's the issue. The "created" status needs to be enabled either in the "unpaid" column or in the "cancellable" column (or both).
Since it is disabled in both, the status is not changed to cancelled by HikaShop and it just redirects to the checkout.
Note that by default "created" is enabled under the "unpaid" column.
That's the issue. The "created" status needs to be enabled either in the "unpaid" column or in the "cancellable" column (or both).
Since it is disabled in both, the status is not changed to cancelled by HikaShop and it just redirects to the checkout.
Note that by default "created" is enabled under the "unpaid" column.
The following user(s) said Thank You: ianspeed
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353343
by ianspeed
Replied by ianspeed on topic PayPal Checkout - problems with cancel return and purchase
Thanks Nicolas,
Not sure how that ever got changed as it wasn't something I ever did anything with? That's why it isn't working in live either, it just stopped one day.
I think the owner of the website was probably fiddling with stuff!!
Thanks again,
Ian
Not sure how that ever got changed as it wasn't something I ever did anything with? That's why it isn't working in live either, it just stopped one day.
I think the owner of the website was probably fiddling with stuff!!
Thanks again,
Ian
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.278 seconds