After some debugging (see comments and original post below) I've found that Paypal Checkout strongly depends on the "Review" checkout pane being active and placed on the "Review" step.
In other words, unlike other configurations (i.e, Express Checkout), the "Review" step/pane cannot be skipped.
The lack of documentation / logged information makes it more difficult to find out this configuration dependency.
My proposed solution is to either document this need (via docs or logging messages) or get rid of this need (feature request).
Hello;
I've been trying to make Paypal Checkout work to no avail.
I tested both on my localhost and full-fledged servers, with https enabled.
I tested both live and sandbox modes.
I tested alpha and dev versions of the module.
I create a Paypal Gateway and introduce my api key and secret. It connexts succesfully.
When trying to pay an order, I get an error and the following logs:
(commerce_paypal) Client error: `PATCH https://api.paypal.com/v2/checkout/orders/` resulted in a `404 Not Found` response
(commerce_payment) Could not retrieve the order from PayPal with the following remote_id: .
Comment | File | Size | Author |
---|---|---|---|
#5 | Captura de pantalla 2019-04-08 a las 11.50.05.png | 33.65 KB | idiaz.roncero |
Comments
Comment #2
jsacksick CreditAttribution: jsacksick at Centarro for PayPal, Inc commentedIt looks like the remote_Id we get from PayPal wasn't stored in the payment method remote_id field... Maybe something wrong happened when creating/approving the order?
Could you try to debug CheckoutController::onCreate or CheckoutController::onApprove? See if it enters there... And also check if you have other info in the logs?
Comment #3
idiaz.ronceroHello,
Found out the following:
- There are no other info on the logs.
- I had this patch for direct checkout (no cart). Disabled it, it is still not working.
- The product i'm adding to the order uses commerce_license to sell a role, and sets a different type of checkout flow, line item and order. Tried to add a "default" product (with a default line item, and a default order type, and a default checkout flow), andit works.
So, this is something related to commerce_license module. Good to know.
I'll continue debugging this but in the meantime i'll update the title. It might help people with the same problem.
Comment #4
idiaz.ronceroComment #5
idiaz.ronceroOk, I finally found the issue:
My "commerce_license" product checkout flow wasn't featuring the "Review" pane - I choose not to show it to shorten the process.
This configuration worked when using Paypal Express Checkout, but it fails on Paypal Checkout.
To add confusion, it was failing silently (maybe because this checkout flow was defined before the new "Paypal Checkout" gateway was added to the module). So, this module configuration requirement wasn't either explicited nor threw any error / log / message.
Proposed improvements:
- Document the need to have a review checkout pane.
- Log a message on the watchdog / error on screen when review pane is not available and Paypal Checkout is active.
- Or... make PayPal Checkout usable without the review pane.
Comment #6
idiaz.ronceroChanged category, title and priority of issue.
Comment #7
idiaz.ronceroComment #8
idiaz.ronceroComment #9
jsacksick CreditAttribution: jsacksick at Centarro for PayPal, Inc commentedThe proposed improvements sound good, feel free to send patches / edit the documentation page (I'd be more than happy to review).
The reason why the Smart payment buttons are shown on the review page is that it's hard to show them directly from the PaymentInformation pane for various reasons:
It is usable... It just needs some custom code, if you need to adapt it to your custom flow.
The only thing you'd have to do is something like the following:
Comment #10
jsacksick CreditAttribution: jsacksick at Centarro for PayPal, Inc commentedFYI we have a documentation page that needs to be updated to describe the 2 different flows (i.e the "shortcut" flow where you initiate the payment from the cart page, and the "mark" flow, when PayPal is being used just like another regular payment gateway).
See https://www.drupal.org/node/3042053.
Comment #11
jsacksick CreditAttribution: jsacksick at Centarro for PayPal, Inc commentedComment #12
bojanz CreditAttribution: bojanz at Centarro commentedIf we define the buttons in an offsite-form as well, then anyone without a Review step would still get the PayPal buttons on the separate Payment step. It's bad UX, and I don't know why anyone would do it (VS just having a Review step), but it's better than nothing.
Comment #13
joelseguinAs per #10, I can't seem to get the "Mark flow" working. No issues with the "Shortcut flow" though.
Maybe someone can elaborate a bit more on what is needed for the "Mark flow" to work properly. I've made sure to make use of the Review step.
I'm also thinking that the "Shortcut flow" is an interesting idea. It seems to work well, but I'm finding it a little confusing that the user has two options. I wonder if we could just offer the user with one option: the "Shortcut flow" if desired by a site builder?
Comment #14
jsacksick CreditAttribution: jsacksick at Centarro for PayPal, Inc commentedAs suggested by Bojan in #12, we actually already provide an offsite form in the event no "review" step is present, so I believe this issue is now outdated.
Comment #15
brooke_heaton CreditAttribution: brooke_heaton commentedI'm having the same issue with a checkout process that involves only 'order_information' and 'payment' steps, but no review step. The information in #12 does not appear to be correct. I simply see an error and no offsite form. The error is a `commerce_payment` error of:
Cannot create the payment without the PayPal order ID.
Comment #16
brooke_heaton CreditAttribution: brooke_heaton commentedTo clarify #9 as a solution is not entirely accurate and may simply be out of date. I'm using this in a form_alter successfully.
Comment #17
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedI don't think this is outdated. PayPal Checkout does not seems to work without review step in the default configuration.
Cannot create the payment without the PayPal order ID.
@brooke_heaton Can you please elaborate, which form you are altering in the mentioned form_alter? Thanks!Edit: Just to be sure, I mean the "mark" flow, not the payment buttons (shortcut). It is a bit unfortunate, that this is not working, because Express checkout is deprecated and therefore there is no working offsite option in 8.x version of this modules without the review step. But I will understand if this is "won't fix".