I'm trying to develop new payment method and I'm having some issues.
First for some reason the postsale.php script is not creating the PaymentMethod object, I'm talking about this part of code inside postsale.php:
Now I could be wrong but this part is supposed to create an object based on the data sent by the payment gateway, so if the gateway being used is paypal the script is supposed to create:Code:try { $objModule = new $strClass($objModule->row()); return $objModule->processPostSale(); } catch (Exception $e) { $this->log('Exception in post-sale request: '.$e->getMessage(), __METHOD__, TL_ERROR); }
and then returnCode:$objModule = new PaymentPaypal($objModule->row());
Now I've put inside the processPostSale() this line of code:Code:PaymentPaypal->processPostSale()
but nothing is loged, when I put the same line of code in postsale.php before the part that tries to create an object I can see the log entry with the post data.Code:$this->log('Received post data: ' . print_r($_POST, true), __METHOD__, TL_GENERAL);
Now can someone please explain what is going on, and what am I doing wrong.
Also I've seen that if I set the processPayment() as follows:
My payment is working and I get an order placed in Isotope orders. Of course public function processPayment() shoudn't return true by default, there should be some kind of security check. But only postsale.php can receive post data from outside Contao, thus only processPostSale can handle it. So could someone please explain how do processPayment() and processPostsale() work, what do I need them for, and what do they handle in Contao?Code:public function processPayment() { return true; }


Reply With Quote
Bookmarks