Active
Project:
e-Commerce
Version:
5.x-3.4
Component:
cart
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Jun 2008 at 08:08 UTC
Updated:
25 Jan 2009 at 23:43 UTC
It sounds get method is used to pass data to payment processor. What is the way to change this get method to post.
Comments
Comment #1
Dublin Drupaller commentedbumping this.
You're right. GET is the default.
the workaround involves another step (another page) on the checkout review form. Have a look at the ec_caixa_penedes payment gateway module which uses the POST method for an example.
I'm working on another option i.e. overriding the checkout_review_form using template.php at the moment...will, erm..post back up here if I have any success.
dub
(changing component to CART because that's where the checkout_review_form is )
Comment #2
Dublin Drupaller commentedupdate
Overriding the checkout_review_forms isn't simple, so I had a look at CURL, which may offer an elegant way of doing it, but, not all servers have libcurl enabled by default. I also glanced at fsockopen, which looked very involved...so I ended up with the following as a balance between simplicity and results.
You can use this snippet to automatically submit the form:
<script language="javascript">document.checkout_confirmation.submit()</script>Notes: Where
checkout_confirmationis the form name..e.g.<Form action="www.example.com/payment" method="post" name="checkout_confirmation">The snippet automatically submits the form, but, should a customer have javascript completely disabled, the text above the form and "proceed" button, can be something like "Thank you for your order. We are now redirecting you to [payment gateway] so you can make your credit/debit card payment. If javascript is disabled in your browser, click on the button below to proceed."
hope that makes sense
Dub
Comment #3
gordon commentedI have looked at this a number of times, and to do a POST vs a GET you need to redirect to a page which has a bunch of hidden fields and then use some js to submit the form.
I have never liked this as a solution and in v4 I have added functionality to support paypal express (it is broken ATM because of the formapi), which does this much nicer. I also think doing this breaks up the flow of the checkout.