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

Paypal Checkout logic is wrong when it is the only available payment method #803

Closed
nick4501 opened this issue Aug 29, 2023 · 8 comments
Closed
Assignees
Milestone

Comments

@nick4501
Copy link

Describe the bug
When the only available payment method is Paypal Checkout, the whole payment process does not work, as the Select Payment Method checkout step is automatically skipped, preventing the user from being able to click on the dedicated Paypal button. NOTE: the Paypal button DOES appear when there are multiple payment methods available and the user selects Paypal.

To Reproduce
Steps to reproduce the behavior:

  1. Remove all payment methods except for Paypal Checkout.
  2. Add a product to the cart and then continue to the checkout page.
  3. After entering shipping/billing address, the payment selection page is skipped, so there is no way to be redirected to Paypal to authorise the payment. If the user continues all the way to the end of the standard checkout process and clicks Confirm, instead of being redirected to the Paypal website, the following error is displayed: PayPal Error (PayPalCheckoutState.PaypalOrderId)

Expected behavior
We should either force the Payment Method step to be displayed (which will allow the user to click on the Paypal button next to the payment method), or correctly handle this scenario at the end of the checkout process.

Desktop (please complete the following information):

  • OS: (All)
  • Browser: (All)
@Michael-Herzog
Copy link
Contributor

Hi,
There is already a hidden setting which prevent this behaviour. Please go to Admin / Configuration / Settings / All setting
Search for the setting name bypasspaymentmethodselectionifonlyone and set it to False.
Regards,
Michael

@nick4501
Copy link
Author

Hi @Michael-Herzog, @muratcakir. Sorry to re-open this ticket. I've changed the setting and the payment method step is now displayed so I'm able to click on the Paypal button, but after logging into Paypal and confirming the payment, I get redirected back to the store website with an error saying "Error: data is not defined". Everything looks to be correctly configured in the Paypal plugin, so I'm wondering why this is now happening. Is it a known bug?

@nick4501
Copy link
Author

I believe this may be because we're not passing a "custom_id" field on the Paypal request (see screenshot from Paypal dashboard). Am I right in thinking that we use this custom_id on the return to our site, to retrieve the session/cart?

Paypal_missing_custom_id

@Michael-Herzog
Copy link
Contributor

Hi,
currently in branch 5.0.5 there are no know bugs and the plugin is working fine in multiple shops.
Are you working in another branch or did you adapt the code?
Regards,
Michael

@nick4501
Copy link
Author

Hi Michael. I'm running v5.0.4.0, but haven't made any changes to the Paypal code. What are your thoughts on the missing custom_id field?

Thanks,
Nick

@Michael-Herzog
Copy link
Contributor

Hi Nick,
custom_id should be filled. But I can't tell if this is causing the error. We also fixed lots of othe stuff in version 5.0.5 so please perform an update.
Regards,
Michael

@nick4501
Copy link
Author

Thanks Michael - I've just had a look at a long list of bug fixes in 5.0.5 and it certainly sounds like it's worth upgrading! I'll do this today and report back.

Also: if you take a look at PayPalHttpClient.cs, you can see that the orderGuid parameter is optional (see attached screenshot). It's this parameter that is used to populate custom_id...

Paypal_optional_orderID

@nick4501
Copy link
Author

@Michael-Herzog, Thanks very much - upgrading to v5.0.5 fixed this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants