Payment: sample.php or doc anyone??

mathiasp <[email protected]>
Newsgroups gmane.comp.web.oscommerce.devel
Message-ID <ba23aaa1bf4b6c613e5582bb8dc7ab84@osCommerce-Forums>
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=168413#168413
----------------------------------------------------------------

I try to port a tep payment module for a german payment service http://www.directpos.de/ to the milestone.

The old version had a sample.php payment module which served as something of a documentation stand-in. The Milestone has nothing. How does the payment module work?

Any hints, pointers, documentations, how-to's would be weldome!

My payment service needs me to call a url and gives back a page containing form-data. I used to use curl in my module for tep, in the before_process() funtion, and if the payment transation failed, I deleted the order directly in before_process, using

--- code snippet from modules/payment/directpos_ls.php, in before_process() --------

      if ($posResult['posherr'] != '0') {
	tep_db_query("delete from " . TABLE_ORDERS . " where orderS_id=" . $insert_id . ";");
	 tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT,
				    'error_message=' . urlencode(MODULE_PAYMENT_DIRECTPOS_LS_TEXT_ERROR . " Error code: " . $posResult['posherr'] . " / " . $posResult['rc'] . ": " . $my_url . "?" . $my_postfields),
				    'SSL', true, false));
      }

------- end of code snippet -------------------

This was not elegantly solved, but did work (actually still does, see http://cbt.virtual-earth.de/ (german only))

Now, after some fiddling, I get it to register. That was easy :) But now  (at least) the "delete from order where orderS=id=$insert_id;" part fails, it seems $insert_id is no longer available.

_Any_ ideas, hints, tipps? (Thanks _a_lot_ if you have!! :-)


BTW _very_ nice work! thanks to developers.... Only documentation is sorely missed!


Cheers, Mathias
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.