Jump to content

[Solved]Where i run the payment gateway


mexicanox

Recommended Posts

I'm developing a payment module that works in a very simple way.

I send a purchase data via POST to a url and have a XML return.

 

My doubt is where to put the code that is sending the XML.

 

In the file "payment_execution.php"? Before or after the "validateOrder ()"?

 

And the hook "PaymentReturn" to what exactly should be using and when it runs?

 

Everything else is ready but i dont understand this part, very confusing to me.

 

 

 

 

Thanks.

Edited by mexicanox (see edit history)
Link to comment
Share on other sites

Hi Mexicanox,

 

Now I am also confused with your question :)

 

If the xml returned tells if payment is ok or ko it is before validateOrder.

 

Your are mixing :

- customer on his webbrowser that make a payment

- server (your xml return) that tells your prestashop that payment ok or ko

 

Diplay : Customer will have displayed hmtl pages to know what is happening.

No display :Hidden Server to server will check if payment is ok

 

But I am not sure what your POST and xml is.

 

Cheers

Edited by math_php (see edit history)
Link to comment
Share on other sites

I send an XML via POST (using cURL) with information about the order.

This request returns an XML informing me that the process was ok or not.

 

 

As I understand it goes after validateOrder, right?

 

 

Later, when the customer make the payment I receive another POST with an XML informing the new status of order.

 

 

I'm confused on where goes each part, mainly the hook PaymentReturn, I could not find exactly what it is for, or whe its is called.

 

 

Thanks

Link to comment
Share on other sites

Mexicanox, :huh:

 

PaymentReturn is for the display for the customer, he went to bank secure website and after payment he go back to your prestashop and you display 'Thanks for your order and payment my dear'

 

You must not use this to validate neither order nor payment.

 

And no, it is not after ValidateOrder, you do not register order if you do not have the payment. :ph34r:

 

Are you ok with No payment = no order ?

 

You send xml with curl and wait xml response to know is payment ok or ko ?

 

Regards

Edited by math_php (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...