1

We're implementing a new payment method. This payment method works differently than others in that when you select this method in Step4 (Payment Information), it displays a <form> which has its own submit button. This form is created via JavaScript (we include a that creates the form in our .phtml file) and has fields for Card #, Name, CVV, etc). This form's action="" points to the payment gateway. So when the form is submitted, it calls the payment gateway, which processes the payment, then calls our success action to inform us of the processing result.

As you may notice, this is problematic because all this happens inside Step4 of the Checkout, before even the "Place Order" button of Step5 (Order Review) is displayed.

So is there a way reverse the order of Step4 and Step5? Or maybe have this custom form appear in Step5 instead? Or, is it safe to just hide Step5 altogether since the payment is already handled in Step4?

We're very new to Magento so we'd really appreciate suggestions on how to go about this.

  • 2
    Perhaps instead of reversing the steps if you provided a subtotal/review breakdown on the side progress bar? If you're concerned about abandonment because you're asking for entry of a payment before they know the full total this would perhaps allay that fear... – philwinkle Aug 28 '13 at 17:21
2

I'm assuming you are working with a hosted payment gateway, there a few ways to do this.

A clever way of working with payment gateway like this would be to have a form that captures the CC information and temporarily saves it to order, then you could create an observer listening to the sales_order_place_before event.

Before you actually create the magento order you post the credit card form information using curl or whatever methods is available, based on the form result you can throw an exception and stop the checkout process or save the the transaction id and let the order go through.

This way you get the behavior you want (payment gets authorized before the order is placed) but without breaking the Magento order flow.

---- Another alternative

Would be to modify the review step and if your payment method is selected show the credit card form and disable the place order button until the payment information is provided.

| improve this answer | |
  • Yes we are using a hosted payment gateway. The procedure you describe in paragraph 2 and 3 seems very promising. My concern, though, is this: a form that captures the CC information and temporarily saves it to order, would that be okay given that we're not PCI-compliant? – Obay Sep 9 '13 at 7:17
  • Also, would temporarily saving it to order mean saving it into the database? Or is it possible not to have to save it to the database? – Obay Sep 9 '13 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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