Its several days that i'm trying to solve a payment method problem, and I really need support to solve it.
I have to create a new payment method, i studied the existing ones, i tried to simulate the paypall express, but it is still hard for me to understand the flow beetween purchase and purchase_return method.
This is the problem: I have to create a new payment method that redirect the user in a bank page. Here, the user will insert his bank datas (like paypall) and later, the system redirect the user back to my site. Here i have to do some operations with some informations that the bank give back to me in a GET way.
1 - complete checkout DONE 2 - create a new payment method DONE 3 - connect to a bank DONE (using the "purchase" function) -> the user is redirected to the bank page. The customer insert his datas, and after the bank redirect my to a url of my site that i told it before in a request. It is like:
so, the hash_code and some parameters that the bank append to my return_url, because i need thosevdatas in order to make more operations later.
4 - Redirection from the bank to my site at the url above DONE
now, if I'm correct, i expect the code inside the function "purchase_return" will be automatically executed (if i understand right). But it doesn't. I force the call of this function from the template of the checkout/complete page, importing the merchant library and my custom payment method code. Now the code that i put inside the "purchase_return" function will run. I return new Merchant_response(Merchant_response::COMPLETE, NULL, $order_id);
RESULTS: The order is still pending. It's not paid and it isn't complete. So: my cart is not empty, too!
Somebody can help me, please??? thanks on advance!!