Sabai Posted March 1, 2004 Share Posted March 1, 2004 Hi, First of all I would like to tell you that I love your osCommerce script. Now I would like to know if it is possible to integrate a PayZip w2w gateway into osCommerce. Below is a short explanation of how the payment process should work: The Web2Web solution provides an easy and flexible way of connecting to the Payzip payment gateway over the Internet. The principle for the Web2Web solution is that the merchant transfer the cardholder to the Payzip payment gateway at the time of payment. The Payzip system is order-based compared to transaction-based. This means that the merchant has to create a payment order prior to transferring the cardholder to the Payzip payment gateway. All communications are made using XML over the HTTPS-protocol. If you have previous experience with payment gateways you will find that Payzip?s payment interface is slightly different from what you are used to. Most payment gateways works with a single interface (URL) that you redirect the cardholder to at the time of payment. A payment with Payzip is done in two steps. First your server has to POST an XML-string to what is called the Payment API. The Payment API collects data about the order you issue to the cardholder. Once the order has been created, you redirect the cardholder to another URL called the Payment Page. These two processes can be done in the same script; however, the order has to be submitted to the Payment API before the cardholder is redirected to the Payment Page. The payment flow with Payzip works like this: Merchant POST an order to Payment API using an XML-string. Merchant receives a response that the order was successfully inserted. If you did not submit your own OrderID, you have to extract the OrderID created by Payzip in this response. Merchant redirects the cardholder to the Payment Page and includes the AccID and OrderID in the URL like this: https://www.payzip.net/w2w/default.asp?AccID=973008&OrderID=123456 Cardholder enters his/her credit card details and approves payment. Once the payment is processed (approved or rejected), the cardholder is then redirected to either an ?approved? URL or ?declined? URL at merchant?s website. Merchant use GET_ORDER_STATUS to verify the payment and completes the order. Transaction complete. And here a PHP Code Sample from PayZip: <? $QSTRING = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; $QSTRING .= "<PAYZIP_XML>"; $QSTRING .= "<REQUEST>"; $QSTRING .= "<Pin>55555</Pin>"; $QSTRING .= "<AccID>973008</AccID>"; $QSTRING .= "<OrderID>11112</OrderID>"; $QSTRING .= "<Function>INSERT_ORDER</Function>"; $QSTRING .= "<PRODUCTS>"; $QSTRING .= "<MailNotify>0</MailNotify>"; $QSTRING .= "<EMailAddress>[email protected]</EMailAddress>"; $QSTRING .= "<Description>resort hotel for Alamanda Hotel</Description>"; $QSTRING .= "<Currency>USD</Currency>"; $QSTRING .= "<AmountTotal>10000</AmountTotal>"; $QSTRING .= "<VATRateTotal>0</VATRateTotal>"; $QSTRING .= "<ProductTotal>10000</ProductTotal>"; $QSTRING .= "</PRODUCTS>"; $QSTRING .= "<PRODUCT>"; $QSTRING .= "<Description>Almanda hotel for 2-4 May 2003</Description>"; $QSTRING .= "<Price>5000</Price>"; $QSTRING .= "<Quantity>2</Quantity>"; $QSTRING .= "<VATRate>0</VATRate>"; $QSTRING .= "<SubTotal>10000</SubTotal>"; $QSTRING .= "</PRODUCT>"; $QSTRING .= "<RECURRING>"; $QSTRING .= "<isRecurring>0</isRecurring>"; $QSTRING .= "<Period></Period>"; $QSTRING .= "<Description></Description>"; $QSTRING .= "<Amount></Amount>"; $QSTRING .= "<StartDate></StartDate>"; $QSTRING .= "<RecurringTime></RecurringTime>"; $QSTRING .= "<Automatic></Automatic>"; $QSTRING .= "</RECURRING>"; $QSTRING .= "</REQUEST>"; $QSTRING .= "</PAYZIP_XML>"; $ret = PostToHost("www.payzip.net","/testapi/api/apixml.asp",80, $QSTRING); echo "$ret"; // Remember to change the POST URL above to production interface when testing is complete function PostToHost($host, $path, $port, $data_to_send) { $ret = ""; $fp = fsockopen($host,$port,$errno,$errstr,30); if($fp) { fputs($fp, "POST $path HTTP/1.0\n"); fputs($fp, "Host: $host\n"); // write the hostname line of the header fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: " . strlen($data_to_send) . "\n"); // write the content-length of data to send fputs($fp, "Connection: close\n\n"); fputs($fp, $data_to_send); while(!feof($fp)) { $ret .= fgets($fp, 128); } fclose($fp); // close the "file" $q = stristr($ret,"RESULT"); if($q != false) $ret = $q; } else { $ret = "Bad Connection ".$errno." [".$errstr."]"; } return $ret; } ?> I would be really grateful if someone could make a gateway like this or point me in the right direction. Please let me know if you need any further info. Best Regards, Michael Link to comment Share on other sites More sharing options...
karpatel Posted June 4, 2004 Share Posted June 4, 2004 i am just starting to work on it and thought lets just see if someone has done that work earlier. no luck so far.. however if i dont get anything .. i will dig into the code .. and put post over here.. meanwhile, if you have a solution, would be great help if you can post it.. Thanks Link to comment Share on other sites More sharing options...
psxgunman Posted August 23, 2004 Share Posted August 23, 2004 That shouldnt be too hard to adapt the paypal / nochex / paysystems modules that exist. I have just applied for a merchants accoutn with them if they accept me I'll knock one together. Link to comment Share on other sites More sharing options...
996 Posted September 29, 2004 Share Posted September 29, 2004 That shouldnt be too hard to adapt the paypal / nochex / paysystems modules that exist. I have just applied for a merchants accoutn with them if they accept me I'll knock one together. <{POST_SNAPBACK}> psxgunman, did you ever get an account with them? I'm looking to setup an account with PayZip but dont want to unless someone has gotten it to work with OSC. Cheers, Rich Link to comment Share on other sites More sharing options...
Guest Posted November 27, 2004 Share Posted November 27, 2004 psxgunman, did you ever get an account with them? I'm looking to setup an account with PayZip but dont want to unless someone has gotten it to work with OSC. Cheers, Rich <{POST_SNAPBACK}> For your information, we have just finalized developing a plug-in for OsCommerce and Payzip's W2W implementation. Please email [email protected] for more information about this. B) Cheers, Payzip Team Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.