2

I'm working on a website that has Paypal Express Checkout integration. We've disable the ability to checkout from product pages, or the basket page, so it's essentially just another payment option at checkout.

Currently, when a customer selects Paypal, they are immediately redirected to PayPal. Whilst this has the ability to have an order review step (after the customer enters their details), we would like to change this so that the checkout order review step (6) displays, and the customer would hit "pay now" and then be directed to PayPal from there instead. Is this possible?

1 Answer 1

0

The behaviour described by you is controlled by two functions on the payment method model, that get called by Mage_Checkout_OnepageController::savePaymentAction/Mage_Checkout_Model_Type_Onepage::saveOrder.

Mage_Checkout_OnepageController::savePaymentAction will call the payment method instances getCheckoutRedirectUrl and redirect to the given url after saving the payment informations from the checkout (e.g. Mage_Paypal_Model_Express::getCheckoutRedirectUrl).

Mage_Checkout_Model_Type_Onepage::saveOrder is executed on order placement and after saving the order it will redirect to the url given by the payment method instances getOrderPlaceRedirectUrl (e.g. Mage_Paypal_Model_Standard::getOrderPlaceRedirectUrl).

So your solution would be to override the Paypal Express payment model, ensure that getCheckoutRedirectUrl returns nothing and return the url in getOrderPlaceRedirectUrl.

A word of warning though: I'm not that sure how exactly Paypal handles the whole authorisation and capturing of the order, so you might run into problems: Mage_Checkout_Model_Type_Onepage::saveOrder will place the order and authorize/capture the orders payment depending on the payment methods configuration. I would assume, that the initial redirect to Paypal authorizes the order on Paypal side and will capture it on order placement. So the payment might fail, because the authorization is missing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.