WoofHosting Posted April 28, 2009 Share Posted April 28, 2009 im building a Intuit Payment gateway add on and when i click on pay now it ask for the card info and then goto /creditcard.php and the screen is empty. but it work on the admin portal any ideals? function intuit_link($params) { $code='<form method="post" action="https://client.woofhosting.com/creditcard.php" name="paymentfrm"> <input type="hidden" name="invoiceid" value="9"> <input type="submit" value="Pay Now"> </form>'; return $code; } function intuit_capture($params) { # Card Details $cardtype = $params['cardtype']; $cardnumber = $params['cardnum']; $cardexpiry = $params['cardexp']; # Format: MMYY $month=substr($cardexpiry, 0, 2); $year="20".substr($cardexpiry, 2, 2); $cardstart = $params['cardstart']; # Format: MMYY $cardissuenum = $params['cardissuenum']; //$cardnumber="4111111111111111"; # PERFORM TRANSACTION HERE $qbmsurl = 'https://merchantaccount.ptc.quickbooks.com/j/AppGateway'; $timestamp=time(); $xml = '<?xml version="1.0"?> <?qbmsxml version="2.0"?> <QBMSXML> <SignonMsgsRq> <SignonDesktopRq> <ClientDateTime>'.date('Y',$timestamp).'-'.date('m',$timestamp).'-'.date('d',$timestamp).'T'.date('H',$timestamp).':'.date('i',$timestamp).':'.date('s',$timestamp).'</ClientDateTime> <ApplicationLogin>whmcs.client.woofhosting.com</ApplicationLogin> <ConnectionTicket>'.$gatewayusername.'</ConnectionTicket> <Language>English</Language> <AppID>107758279</AppID> <AppVer>1.0</AppVer> </SignonDesktopRq> </SignonMsgsRq> <QBMSXMLMsgsRq> <CustomerCreditCardAuthRq> <TransRequestID>ef_'.$invoiceid.'_'.time().'</TransRequestID> <CreditCardNumber>'.$cardnumber.'</CreditCardNumber> <ExpirationMonth>'.$month.'</ExpirationMonth> <ExpirationYear>'.$year.'</ExpirationYear> <IsCardPresent>false</IsCardPresent> <Amount>'.$amount.'</Amount> <NameOnCard>'.$firstname.' '.$lastname.'</NameOnCard> <CreditCardAddress>'.$address1.'</CreditCardAddress> <CreditCardPostalCode>'.$postcode.'</CreditCardPostalCode> <SalesTaxAmount>0.0</SalesTaxAmount> </CustomerCreditCardAuthRq> </QBMSXMLMsgsRq> </QBMSXML>'; //$xml = getTransRequestID($xml); $mystring = date('Y-m-d'); $searchtext = "<TransRequestID>"; $replacetext = "<TransRequestID>" . $mystring; $xml = str_replace ($searchtext, $replacetext, $xml); $header[] = "Content-type: application/x-qbmsxml"; $header[] = "Content-length: ".strlen($xml); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $qbmsurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 500); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); $data = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); } else { curl_close($ch); $xml = simplexml_load_string($data); $gettransid=$xml->QBMSXMLMsgsRs->CustomerCreditCardAuthRs->CreditCardTransID; } # PUT TRANSACTION ID INTO $transid $transid = $gettransid; # PUT DEBUG DATE into $desc $debugdata = "Response Code => 1\nResult => Successful\nAVS Result => 0"; # Check Result foreach($xml->QBMSXMLMsgsRs->CustomerCreditCardAuthRs->attributes() as $a => $b) { if ( $a == "statusMessage" ) $statusMessage = $b; } if($statusMessage=="Status OK") { addInvoicePayment($invoiceid,$transid,$amount,$fees,"intuit","on"); logTransaction("intuit",$debugdata,"Successful"); sendMessage("Credit Card Payment Confirmation",$invoiceid); $result="success"; } else { logTransaction("intuit",$debugdata,"Declined"); sendMessage("Credit Card Payment Failed",$invoiceid); $result="declined"; } return $result; } 0 Quote Link to comment Share on other sites More sharing options...
abcsol Posted March 7, 2013 Share Posted March 7, 2013 Did you get this working? 0 Quote Link to comment Share on other sites More sharing options...
UWH - David Posted April 28, 2014 Share Posted April 28, 2014 Any progress on this? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.