PHP - Cc-avenue Payment Gateway Response Page Return 404 Error?
Here is my code : https://paiza.io/projects/SUiG5qp_wttfcrQn-0Mwew?language=php FYI -> [index.htm -> LineNo : 781 & 782] After successfully received payment response page return 404 error The form & CC-Avenue Payment Gateway Request page working good, after customer paid the response page return 404 error. How can i solve the error? Edited May 22, 2019 by aveevaSimilar TutorialsI am using Magento (Ver 1.9.x) If i try with my localhost success url like, http://192.168.1.65/magento/index.php/checkout/onepage/success/ and return success message with order id. if i try with live, success url like, https://abc.in/payubiz/redirect/success/ success page like blank page. How to solve the issue? Code : https://github.com/ZusZus/Payubiz Edited February 4, 2020 by aveevaI am using Payeezy Payment Gateway, how to integrate with my PHP page, actually the payment gateway for my customer form, i done with form using PHP, how can i integrate Payeezy Payment Gateway with my PHP form. Hi guys, I'm not really experienced with PHP to a high degree, very very basic knowledge. I took a website for a client which was an e-commerce website in need of a re-host? Sounds Simple enough. However when uploading the site i found it went to a secure server outside of the one I was hosting it on when it came to submitting the payment. I then had to get access to these files and get them working on locally on my server. This where I'm having trouble... It's easier to show you the problems rather than try and explain them. This is the original working version of the payment page: https://secure.wilkesdesign.com/egowear/pay.php And this is my version: http://www.egowear.co.uk/payment/pay.php Which is essentially a duplicate, all I have changed is the details for it accessing the database on the the server which is included in "inc_db.php" As well as updating the link in protx.php to the correct TermUrl. The rest is the same as the original If you go to the first page and enter no details and just click "Make Payment" at the bottom of the page, you should get several validation errors appear in red at the top of the page. Do exactly the same on my version, the second link. And nothing seems to happen, no errors nothing. I'll admit i'm quite out of my depth here now, and I'm betting it's just me missing something obvious. So if anyone has any ideas I'd really appreciate it . Best Regards Chris Source code for pay.php: Code: [Select] <?php ini_set('display_errors','1'); ini_set('display_startup_errors','1'); error_reporting(E_ALL ^ E_NOTICE); $homeURL = "http://www.egowear.co.uk/"; //$homeURL = "http://intranet.wilkesdb.com/ego/"; // include at the start of the script being called. //error_reporting(E_ALL); ini_set('display_errors', '1'); $asId = 1; include "includes/inc_db.php"; $db = new DB; $db1 = new DB; $vatRate = $db->getval("SELECT glValue FROM globals WHERE glId=1","glValue")+0; $xorCountry = 2; $orDelCountry="UK"; $orPayNote='Unconfirmed'; $orPaid=0.00; $header = "MIME-Versin: 1.0\r\n" . "Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n" . "From: Egowear <sales@egowear.co.uk>\r\n"; $header .= "Reply-To: Egowear <sales@egowear.co.uk>\r\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\r\n"; if($basketURL) { $basketArray = double_explode(":","|",$basketURL); //print_r($basketArray); $subTotal=$discount=$orDelCharge=0; $items = $subTotal = $totalWeight = 0; foreach ($basketArray as $key => $val) { $extraCost = 0; $prId = $val[0]; $qty = $val[1]; $prSize=$val[2]; $prColour=$val[3]; $extraCost = $val[5]; $db->query("SELECT prtName, prtPrice, prtImage, prColour, prPrtId, prVatable, IF(prWeight>0,prWeight,prtWeight) weight FROM products, prtypes WHERE prId='$prId' AND prtId=prPrtId"); $db->next_record(); list($prtName, $prPrice, $prtImage, $prColour, $prPrtId, $prVatable, $weight) = $db->Record; $prPrice = $prPrice + $extraCost; if($prVatable) $prPrice = calcVat($prPrice); $totalWeight += $qty*$weight; $items += $qty; $lineTotal = $qty*$prPrice; $subTotal += $lineTotal; } // calulate delivery (use function!!!!) $orDelChargeArray = getDelCharge($totalWeight, $xorCountry); //var_dump($orDelChargeArray); $deliveryTypesCount = count($orDelChargeArray); //echo "count: $deliveryTypesCount"; if (!$deliveryTypesCount) $orDelCharge = -1; elseif ($deliveryTypesCount==1) { list($crType) = array_keys($orDelChargeArray); $orDelCharge = $orDelChargeArray[$crType]; } if ($delOverride) $orDelCharge = $delOverride; $orVcId=0; if($xcnId) { $voucherCode = $db->getval("SELECT cnCurrentVoucherCode FROM contacts WHERE cnId='$xcnId'","cnCurrentVoucherCode"); if($voucherCode) { list($valid, $offerDescription, $vcDiscountPercent, $vcDiscountValue, $vcFreePostage, $vcMinValue, $orVcId) = validateVoucherCode($voucherCode, $xcnId); if($valid) { if($vcFreePostage) $orDelCharge=0; if($vcDiscountPercent>0) { if(!($vcMinValue>0) || ($subTotal>=$vcMinValue)) $discount = $subTotal*($vcDiscountPercent/100); } if($vcDiscountValue>0) { if(!($vcMinValue>0) || ($subTotal>=$vcMinValue)) $discount = $vcDiscountValue; } } } } $orTotal = round($subTotal+$orDelCharge-$discount,2); //$orTotal = round($subTotal*1.175,2); //echo formatnumber($subTotal).",".formatnumber($orDelCharge).",".formatnumber($discount); //$orTotal=0.01; } //echo "$subTotal<br />$orDelCharge<br />"; //echo "$orTotal<br />"; if ($sbmt) { // not used but leave in just in case!! if ($paypalOK) $ignorePayment = 1; // go with payment processing // first validate // validate fields if ($action!="callback") { if (strlen($cardHolder) < 2) $error = " • Enter the name as it appears on your card <br>"; if (!ereg("^[0-9]{10,20}", $cardNumber)) $error .= " • Please enter a valid card number <br>"; if ($startDate AND !ereg("^[0-9]{2}[0-9]{2}", $startDate)) $error .= " • Your start date is invalid <br>"; if (!ereg("^[0-9]{2}[0-9]{2}", $expiryDate)) $error .= " • Your expiry date is invalid <br>"; $billingAddress = $ccAddress1."\n\r".$ccAddress2."\n\r".$ccAddress3."\n\r".$ccTown; //if (strlen($billingAddress) < 10) $error .= " • Enter a valid billing address <br>"; $ccPostcode = strtoupper($ccPostcode); if($orDelCountry == "UK") { //if (!ereg("^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1}[[:space:]][0-9]{1}[A-Z]{2}", $ccPostcode)) $error .= " • Enter a valid billing postcode. (Ensure that you have included the space!) <br>"; } if (!ereg("^[0-9]{3,4}", $CV2)) $error .= " • You have missed out your CV2 number<br>"; $orDelPostcode = strtoupper($orDelPostcode); //if ($orDelCountry == "UK") if (!ereg("^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1}[[:space:]][0-9]{1}[A-Z]{2}", $orDelPostcode)) $error .= " • Your delivery postcode is invalid. (Ensure that you have included the space!) <br>"; // check if UK and BT (i.e. NI postcode) - should do this as part of the delivery package. //if ($orDelCountry == "UK" && substr($orDelPostcode, 0, 2) == "BT") $error .= " • You have selected UK postage. 'BT' postcodes are Northern Ireland and have different rates from mainland UK. Please click 'Cancel' and sellect the correct postal type."; if (strlen($orName) < 2) $error .= " • Please enter a customer name<br>"; if (strlen($orTel) < 5) $error .= " • Please tell us your telephone number<br>"; //if (strlen($orDelAddress1) < 2 || strlen($orDelTown) < 2) $error .= " • Please enter a valid customer address<br />"; if ($cnUsername) { $chkCnId = $db->getval("SELECT cnId FROM contacts WHERE cnUsername = '$cnUsername'", "cnId"); if ($cnUsername AND $chkCnId AND $chkCnId != $cnId) $error .= " • Your username is already in use by someone else. Please try another<br />"; } } //end if not callback // if(!eregi('^([a-z0-9\._-])+@([^\.]+\.[^\.]+)', $cnEmail, $matched)) $error .= " • Enter a valid email address<br>"; // second go with payment if (!$error) { /////////////////////////////////////// Payment not started yet so create order /////////////////////////////////// if(!isset($_GET['action']) && !($orId)) { //Add order if($xcnId>0) { // update contact $db->query("UPDATE contacts SET cnName='$cardHolder', cnEmail='$orEmail', cnAddress1='$ccAddress1', cnAddress2='$ccAddress2', cnAddress3='$ccAddress3', cnTown='$ccTown', cnPostcode='$ccPostcode' WHERE cnId='$xcnId'"); } else { $db->query("INSERT INTO contacts SET cnName='$cardHolder', cnUsername='$cnUsername', cnPassword='$cnPassword', cnEmail='$orEmail', cnAddress1='$ccAddress1', cnAddress2='$ccAddress2', cnAddress3='$ccAddress3', cnTown='$ccTown', cnPostcode='$ccPostcode', cnGroups='$cnGroups', cnPrefs='$cnPrefs'"); $xcnId = mysql_insert_id(); } if ($paypalOK) $orStatus = "Check Paypal Payment"; else $orStatus = "Payment Pending"; $db->query("INSERT INTO orders SET orCnId='$xcnId', orName='$orName', orDelAddress1='$orDelAddress1', orDelAddress2='$orDelAddress2', orDelAddress3='$orDelAddress3', orDelTown='$orDelTown', orDelCounty='$orDelCounty', orDelPostcode='$orDelPostcode', orDelCountry='$orDelCountry', orEmail='$orEmail', orDate=NOW(), orDelCharge='$orDelCharge', orDelType='$orDelType', orStatus='$orStatus', orVcId='$orVcId', orPayNote='$orPayNote', orPaid='$orPaid', orTotal='$orTotal', orDiscount='$discount', orTel='$orTel', orVatRate='$vatRate'"); $orId = mysql_insert_id(); $orVat=$orNet=0; foreach ($basketArray as $key => $val) { $flexString=""; $prId = $val[0]; $qty = $val[1]; $prSize=$val[2]; $flexString=$val[3]; $oiVat=$oiNet=0; $db->query("SELECT prtName, prtPrice, prtImage, prColour, prPrtId, prVatable, IF(prWeight>0,prWeight,prtWeight) weight FROM products, prtypes WHERE prId='$prId' AND prtId=prPrtId"); $db->next_record(); list($prtName, $prPrice, $prtImage, $prColour, $prPrtId, $prVatable, $weight) = $db->Record; $oiNet=$prPrice; if($prVatable) { $prPrice = calcVat($prPrice); $oiVat=$prPrice-$oiNet; $orVat+=$oiVat; } else $oiVat=0; if($qty) { $db->query("INSERT INTO orderitems SET oiOrId='$orId', oiPrId='$prId', oiQty='$qty',oiSize='$prSize',oiColour='$prColour', oiWidth='$prWidth',oiVat='$oiVat',oiNet='$oiNet',oiPriceEach='$prPrice', oiName='$prtName', oiFlexString='$flexString'"); $lineTotal = $qty*$prPrice; } } } $db->query("UPDATE orders SET orVat='$orVat', orNet='$orNet' WHERE orId='$orId'"); $vendorTxCode = "Order_".$orId; $billingAddress = substr($ccAddress1."\n\r".$ccAddress2."\n\r".$ccAddress3."\n\r".$ccTown,0,199); include("includes/protx.php"); $data = array ( 'VPSProtocol' => '2.22', 'TxType' => 'PAYMENT', 'Vendor' => 'egowear', 'VendorTxCode' => substr(substr($vendorTxCode,0,40-strlen(time())).'_'.time(),0,40), 'Amount' => number_format($orTotal,2), 'Currency' => "GBP", 'Description' => substr("Egowear Website Order: (".trim($typeDescrip).")",0,99), 'CardHolder' => substr($cardHolder,0,50), 'CardNumber' => substr($cardNumber,0,20), 'StartDate' => substr($startDate,0,4), 'ExpiryDate' => substr($expiryDate,0,4), 'IssueNumber' => substr($issueNumber,0,2), 'CV2' => substr($CV2,0,4), 'CardType' => substr($cardType,0,15), 'BillingAddress' => substr($billingAddress,0,199), 'BillingPostCode' => substr($ccPostcode,0,10), 'CustomerName' => substr($orName,0,99), 'CustomerEMail' => substr($orEmail,0,254), 'ContactNumber' => substr("",0,20), 'ClientIPAddress'=>$_SERVER['REMOTE_ADDR'] ); //echo $vendorTxCode; if($data) $optRequest = formatData($data); /////////////////////////////////////// Protx.php /////////////////////////////////// if(!isset($_GET['action'])) { $p = null; $response1 = _CompletePayment($p,$Vars,$optRequest,$orId); if(substr($response1,0,6)=="iframe") $iframecode=substr($response1,6); else if($response1) $error.=$response1; else $iframecode=0; } else if($_GET['action'] == 'callback') { $error .= __VerifyCallback($_POST, $Vars,null,$orId); } else if($_GET['action'] == 'callbacktest') { $optRequest = '... .. '; __VerifyCallback($p = null, $Vars, $optRequest); } else { $error.=('Invalid action'); } } // no error } else { // end submit if($xcnId && !$error && !$cardHolder) { $db->query("SELECT cnName, cnAddress1, cnAddress2, cnAddress3, cnTown, cnPostcode FROM contacts WHERE cnId='$xcnId'"); $db->next_record(); list($cardHolder, $ccAddress1, $ccAddress2, $ccAddress3, $ccTown, $ccPostcode) = $db->Record; /*$orName = $cardHolder; $orDelAddress1 = $ccAddress1; $orDelAddress2 = $ccAddress2; $orDelAddress3 = $ccAddress3; $orDelTown = $ccTown; $orDelPostcode = $ccPostcode;*/ } } // end no submit if($iframecode) echo $iframecode; else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Egowear</title> <link rel="stylesheet" type="text/css" href="includes/default.css"> <script language="javascript"> function goCopy() { document.getElementById('cardHolder').value = document.getElementById('orName').value; document.getElementById('ccAddress1').value = document.getElementById('orDelAddress1').value; document.getElementById('ccAddress2').value = document.getElementById('orDelAddress2').value; document.getElementById('ccAddress3').value = document.getElementById('orDelAddress3').value; document.getElementById('ccTown').value = document.getElementById('orDelTown').value; document.getElementById('ccPostcode').value =document.getElementById('orDelPostcode').value; } </script> <!--[if lt IE 7]><script defer type="text/javascript" src="pngfix.js"></script><![endif]--> </head> <body> <div align="center"> <? include "includes/nav.php"; ?> <div id="wrapper2" style="position:relative;z-index:1;top:25px"> <div align="left" id="<?= $theme ?>"> <div style="text-align:left;padding:18px 0px 0px 18px;overflow:hidden;"> <div style="float:right;padding:20px 160px 0px 0px;border:0px solid #000;width:535px;text-align:center;height:25px"> <h1><?= $wcTitle ?></h1> </div> <div><img src="images/logo.jpg" /></div> </div> <div align="left" class="pageMiddle"> <div style="position:relative;z-index:1;padding:2px 30px 10px 32px;" > <h1>Card Payment</h1> <form name="form1" method="post" action=""> <table id="tableSubCategories" style="width:100%;text-align:left;"> <tr id="trColumnTitles" > <td colspan="2" style=""><div style="background:#FF0000; color:#FFFFFF; font-weight:bold"><? echo $error ?></div></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Delivery Address:</strong></td> </tr> <tr > <td style="width:45%"><div align="right">Name*:</div></td> <td><input name="orName" type="text" id="orName" value="<? echo $orName ?>" size="40" maxlength="100"> </td> </tr> <tr> <td><div align="right">Delivery Address: *: </div></td> <td><input name="orDelAddress1" type="text" id="orDelAddress1" value="<? if($orDelAddress1) echo $orDelAddress1; else echo $orDelAddress1; ?>" size="50" maxlength="50"></td> </tr> <tr> <td> </td> <td><input name="orDelAddress2" type="text" id="orDelAddress2" value="<? if($orDelAddress2) echo $orDelAddress2; else echo $orDelAddress2; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right"> </div></td> <td><input name="orDelAddress3" type="text" id="orDelAddress3" value="<? if($orDelAddress3) echo $orDelAddress3; else echo $orDelAddress3; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Town:</div></td> <td><input name="orDelTown" type="text" id="orDelTown" value="<? if($orDelTown) echo $orDelTown; else echo $orDelTown; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Post Code<? if($orDelCountry == "UK") echo "*" ?>: </div></td> <td><input name="orDelPostcode" type="text" id="orDelPostcode" value="<? if($orDelPostcode) echo $orDelPostcode; else echo $orDelPostcode; ?>" size="10" maxlength="10"></td> </tr> <tr> <td><div align="right">County:</div></td> <td><input name="orDelCounty" type="text" id="orDelCounty" value="<? echo $orDelCounty ?>" size="40" maxlength="100"> </td> </tr> <tr> <td><div align="right">Email*:</div></td> <td><input name="orEmail" type="text" id="orEmail" value="<? echo $orEmail ?>" size="40" maxlength="100"></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Billing Address:</strong></td> </tr> <tr> <td><div align="right"> Credit Card Billing Address: *: </div></td> <td><input name="ccAddress1" type="text" id="ccAddress1" value="<? if($ccAddress1) echo $ccAddress1; else echo $orDelAddress1; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">[<a href="Javascript:goCopy();">click here to copy from delivery address </a>] </div></td> <td><input name="ccAddress2" type="text" id="ccAddress2" value="<? if($ccAddress2) echo $ccAddress2; else echo $orDelAddress2; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right"> </div></td> <td><input name="ccAddress3" type="text" id="ccAddress3" value="<? if($ccAddress3) echo $ccAddress3; else echo $orDelAddress3; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Town:</div></td> <td><input name="ccTown" type="text" id="ccTown" value="<? if($ccTown) echo $ccTown; else echo $orDelTown; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Post Code<? if($orDelCountry == "UK") echo "*" ?>: </div></td> <td><input name="ccPostcode" type="text" id="ccPostcode" value="<? if($ccPostcode) echo $ccPostcode; else echo $orDelPostcode; ?>" size="10" maxlength="10"></td> </tr> <tr> <td><div align="right">Telephone No *: </div></td> <td><input name="orTel" type="text" id="orTel" value="<?= $orTel; ?>" size="14" maxlength="20"></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Card details:</strong></td> </tr> <tr> <td><div align="right">Payment amount: £</div></td> <td><input name="orTotal" type="text" id="orTotal" value="<? echo number_format($orTotal,2, ".", ""); ?>" size="20" maxlength="20" readonly=""></td> </tr> <tr> <td><div align="right">Card holder's name as it appears on your card*:</div></td> <td><input name="cardHolder" type="text" id="cardHolder" value="<? if($cardHolder) echo $cardHolder; else echo $orName ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Card Type*:</div></td> <td> <select name="cardType" id="cardType"> <option value="VISA" <? if($cardType=="VISA") echo "selected"; ?>>Visa</option> <option value="DELTA" <? if($cardType=="DELTA") echo "selected"; ?>>Visa Delta/Debit </option> <option value="MC" <? if($cardType=="MC") echo "selected"; ?>>Mastercard</option> <option value="SWITCH" <? if($cardType=="SWITCH") echo "selected"; ?>>Maestro</option> <option value="SOLO" <? if($cardType=="SOLO") echo "selected"; ?>>SOLO</option> <option value="UKE" <? if($cardType=="UKE") echo "selected"; ?>>Visa Electron</option> </select> </td> </tr> <tr> <td><div align="right">Card Number*:</div></td> <td><input name="cardNumber" type="text" id="cardNumber" value="<? echo $cardNumber ?>" size="20" maxlength="20"> (no spaces please)</td> </tr> <tr> <td><div align="right">Start Date:</div></td> <td><input name="startDate" type="text" id="startDate" value="<? echo $startDate ?>" size="4" maxlength="4"> (MMYY) Switch and Solo cards only </td> </tr> <tr> <td><div align="right">Expiry Date*:</div></td> <td><input name="expiryDate" type="text" id="expiryDate" value="<? echo $expiryDate ?>" size="4" maxlength="4"> (MMYY)</td> </tr> <tr> <td><div align="right">Issue Number:</div></td> <td><input name="issueNumber" type="text" id="issueNumber" value="<? echo $issueNumber ?>" size="2" maxlength="2"> Exactly as it appears on the card</td> </tr> <tr> <td><div align="right">CV2*: </div></td> <td><input name="CV2" type="text" id="CV2" value="<? echo $CV2 ?>" size="4" maxlength="4"> Last three digits on signature strip</td> </tr> <? if(!$xcnId) {?> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Confirm order:</strong></td> </tr> <tr> <td colspan="2"> If you would like us to save your details for future orders create a username and password below: </td> </tr> <tr> <td colspan="2"><div style="float:left; width:10%">Username: </div><div style="float:left;"> <input name="cnUsername" type="text" id="cnUsername" value="<? echo $cnUsername ?>" size="40" maxlength="100"></div></td> </tr> <tr> <td colspan="2"><div style="float:left; width:10%">Password: </div><div style="float:left"> <input name="cnPassword" type="password" id="cnPassword" value="<? echo $cnPassword ?>" size="40" maxlength="100"></div></td> </tr> <? } ?> <tr > <td colspan="2"><input name="sbmt" type="hidden" id="sbmt" value="1"> <input type="submit" name="Submit" value="Make payment"> <? echo back($back); ?> <input name="paypalOK" type="hidden" id="paypalOK" value="0"></td> </tr> </table> <input type="hidden" name="basketURL" value="<?= double_implode(":","|",$basketArray); ?>" /> <input type="hidden" name="xcnId" value="<?= $xcnId ?>" /> <input type="hidden" name="orId" value="<?= $orId ?>" /> <input type="hidden" name="prSize" value="<?= $prSize?>" /> </form> </div> </div> <div style="position:absolute;"> <div style="position:relative;z-index:2;margin-top:5px;margin-left:35px" > <a style="text-decoration:none;background:none" href="http://www.egowear.co.uk/designer.php"><img src="images/spacer.gif" border="0" width="200" height="205" /></a> </div> </div> <img src="images/bot1.jpg" /> </div> </div> </div> </body> </html> <? } ?> Hi guys, I just want to know if any one has worked with streamline payment gateway before, we are building a cart for a customer, a in house built sulition, and just wanted some help / advice on how to process payments. The customer has picked streamline as their merchant Thank you Hi, Is there any one has integrated securenet payment gateway in php? Is yes, can any one provide me HTML code and php code for it? Looking foward hey guys. I am using Liberty reserve to sell my digital items online, when the user buys the item LR posts back item_id so I can grab the id out of the database to display to the buyer and lr_amnt to check the amount against the one inside the database before displaying the result to the user. TOP: <?php include 'includes/config.inc.php'; if(isset($_POST['item_id']) && isset($_POST['lr_amnt'])) { $itemID = $_POST['item_id']; $lrAmt = $_POST['lr_amnt']; $result = mysql_query("SELECT * FROM items WHERE item_id='$itemID'"); while($row = mysql_fetch_array($result)) { $login = $row['item_login']; $pass = $row['item_pass']; $itemName = $row['item_account']; $itemDel = $row['item_del']; $price = $row['item_price']; } } ?> -------------------------------- Header: <?php if($lrAmt != $price) : ?> <h2>Fatal error in transaction: the price does not match that in the database</h2> <?php else: ?> <h2>Thank you for you're purchase of <?php echo $itemName; ?>. Please keep these details safe as they have been deleted from our database.</h2> <?php echo '<br />'; echo 'Your new Username: ' . $login; echo '<br />'; echo 'Your password: ' . $pass; ?> <?php endif; ?> but if the user views the source code and grabs the ID they could easily get it for free by making a simple html script that takes in item_id and lr_amnt and put in the values and post it to the success page. example: Code: [Select] <fieldset> <!-- <legend>Forgot password</legend> --> <form method="post" action="http://angrypossum.org/carl/mySaleTwo/success.php"> <p> <label for="itemid">Item ID: </label> <input type="text" name="item_id" id="itemid" class="input" /> </p> <p> <label for="itemprice">Item price: </label> <input type="text" name="lr_amnt" id="itemprice" class="input" /> </p> <p> <input type="submit" name="login" value="Steal" class="button" /> </p> </form> </fieldset> how could I stop that? thanks I need to store the Login ID and Key for my Payment Gateway, and figured it was best to do this outside my web root ("httpdocs") on my VPS. Unfortunately, my PHP Include is breaking, and it looks like this is a *major* thing to get working, since requires me to tinker with Plesk's default settings in Linux. (This link seems to discuss the same issues I'm having: http://stackoverflow.com/questions/2370053/how-to-include-file-outside-document-root ) Anyways... Since I'm no Linux guru and afraid of breaking my VPS, how bad would it be to store my Authorize.net API ID and Key in a PHP file in my web root and include that file in my "checkout.php" file?? If anyone knows a reasonably easy way to fix the issue described in the link above, I'm all for it, but I am thinking I may have to just settle on leaving things in my web root... Thanks, Debbie This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=276607.0 We are trying to capture customer details & redirecting the customer to payment gateway page and, after succesful transaction from payment gateway we are facing a problem for different browsers. Ideally after successful transaction the page should redirect to order confirmation page but it is redirecting to our cart page.In IE7 it is working fine but in mozilla firefox it is redireting to cart page.On analyzing we found that session is not persisting in firefox. Please help we have stuck here Suggest something if you have faced similar issue with different browsers. I have a form, details getting from customer and calculate the grand total, here how can i pass my grand total value to ccavenue payment gateway page and getting payment form customer? code : https://www.pastiebin.com/5cdbae859bb64
Hello. I activate the Payment Gateway Platform (by Redsys in Spain), and it works fine asking you for card number and it goes through correctly and says PAYMENT OK, but the notification.PHP FILE does not work. Could my server (SSL) configuration be the problem? or is it the CODE? Any help about this, please, would be highly appreciated. Thank you. Part of the Nofication.php code is: __________________________________________________________________________________
<?php $handle = fopen("_redsys.log", "a");
require_once("include/dbcommon.php"); $miObj = new RedsysAPI;
$version = postvalue("Ds_SignatureVersion");
// $version = "HMAC_SHA256_V1";
$claveModuloAdmin = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7';
if ($signatureCalculada === $signatureRecibida && $res["Ds_AuthorisationCode"]!="++++++" && !isset($res["Ds_ErrorCode"]) {
$sql = "SELECT Espacio FROM Espacios WHERE Id_Espacio=" . $values["Id_Espacio"];
// echo '<img src="data:image/jpeg;base64,'.$imageData.'">';
_______________________________________________________________________________________________ Hi i buy new domain www.ipogtech.com Server is IIS 7 I have installed SMF Forum which is fully developed by PHP and add the database also but when i opened the site it is showing Bad Gateway Web server received an invalid response while acting as a gateway or proxy server. Web Server at ipogtech.com pls help me to recover form this error. Hi, when I browse my php website I recieve sometimes error 504. when it happens I try to refresh and get this error: Gateway Time-out The gateway did not receive a timely response from the upstream server or application. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. This website is in a shared hosting. Where can I find logs that will help me correct the issue? Thank you. I am using the Stripe API. Been at it for a day and still no luck. I keep getting this error. POST http://localhost/pay 404 (Not Found) Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position // this error is because of this line .then(handleServerResponse); It has specifically to do with this function. function handlePaymentMethodResult(result) { if (result.error) { // An error happened when collecting card details, show it in the payment form resultContainer.textContent = result.error.message; } else { // Otherwise send paymentMethod.id to your server (see Step 3) fetch('/pay', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ payment_method_id: result.paymentMethod.id }) }).then(function(result) { return result.json(); }).then(handleServerResponse); } } What is "/pay" suppose to be exactly? I assumed it was a page where i run my server process code. But it keeps giving me that error no matter what I try it.
Here is my full mode. INDEX.php <?php require_once 'library/stripe/init.php'; ?> <!DOCTYPE HTML> <head> <meta charset="UTF-8"> <title>Title</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content="---"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="shortcut icon" href="/images/favicon.png" /> <link href="css/screen.css?v=1.1" media="screen, projection" rel="stylesheet" /> <script src="javascripts/jquery-3.2.0.min.js"></script> <script src="https://js.stripe.com/v3/"></script> <script src="javascripts/client.js" defer></script> </head> <body> <?php $total_amount = 20; ?> <div id="payment-box"> <div id="p-box-heading"> Total Amount: <span>$<?php if(empty($total_amount)){echo '0.00';}else{echo $total_amount;} ?> CAD</span> </div> <div id="p-box-body"> <form id="payment-form"> <div id="card-element"><!-- placeholder for Elements --></div> <button id="card-button">Submit Payment</button> <p id="payment-result"><!-- we'll pass the response from the server here --></p> </form> </div> </div> </body>
CLIENT.js var stripe = Stripe("pk_test_ROlyXpDaTbqIvSpndWp7IdxW"); var elements = stripe.elements(); var cardElement = elements.create('card'); cardElement.mount('#card-element'); var form = document.getElementById('payment-form'); var resultContainer = document.getElementById('payment-result'); cardElement.on('change', function(event) { if (event.error) { resultContainer.textContent = event.error.message; } else { resultContainer.textContent = ''; } }); form.addEventListener('submit', function(event) { event.preventDefault(); resultContainer.textContent = ""; stripe.createPaymentMethod({ type: 'card', card: cardElement, }).then(handlePaymentMethodResult); }); function handlePaymentMethodResult(result) { if (result.error) { // An error happened when collecting card details, show it in the payment form resultContainer.textContent = result.error.message; } else { // Otherwise send paymentMethod.id to your server (see Step 3) fetch('/pay', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ payment_method_id: result.paymentMethod.id }) }).then(function(result) { return result.json(); }).then(handleServerResponse); } } function handleServerResponse(responseJson) { if (responseJson.error) { // An error happened when charging the card, show it in the payment form resultContainer.textContent = responseJson.error; } else { // Show a success message resultContainer.textContent = 'Success!'; } }
SERVER.php \Stripe\Stripe::setApiKey('sk_test_GPxllXVIfWnuczEjLAGh7BaX'); header('Content-Type: application/json'); # retrieve JSON from POST body $json_str = file_get_contents('php://input'); $json_obj = json_decode($json_str); try { // Create the PaymentIntent $intent = \Stripe\PaymentIntent::create([ 'amount' => 1099, 'currency' => 'usd', 'payment_method' => $json_obj->payment_method_id, # A PaymentIntent can be confirmed some time after creation, # but here we want to confirm (collect payment) immediately. 'confirm' => true, # If the payment requires any follow-up actions from the # customer, like two-factor authentication, Stripe will error # and you will need to prompt them for a new payment method. 'error_on_requires_action' => true, ]); generateResponse($intent); } catch (\Stripe\Exception\ApiErrorException $e) { // Display error on client echo json_encode(['error' => $e->getMessage()]); } function generateResponse($intent) { if ($intent->status == 'succeeded') { // Handle post-payment fulfillment echo json_encode(['success' => true]); } else { // Any other status would be unexpected, so error echo json_encode(['error' => 'Invalid PaymentIntent status']); } }
This is the code im using to try to connect Empire Avenue API but i must be missing somthing here still trying to figure out all this Oauth stuff.
<?php ?> <html> <head>Empire Traider2</head> <body> <form method="post" action="https://www.empireavenue.com/profile/developer/authorize?client_id=app_543abbac2ad99&response_type=code&state=request_access_token"> <input type="submit" value="Login" /> </form> </body> </html>Oauth.php <?php require('client.php'); require('GrantType/IGrantType.php'); require('GrantType/AuthorizationCode.php'); const CLIENT_ID = 'app_543abbac2ad99'; const CLIENT_SECRET = '1ee4b7f5d702d2c7e64523daf4d107b3dd82a0a787f117986d84f'; const REDIRECT_URI = 'https://yousearch.mobi/OAuth2/oauth.php'; const AUTHORIZATION_ENDPOINT = 'http://www.empireavenue.com/profile/developer/authorize'; const TOKEN_ENDPOINT = 'https://api.empireavenue.com/oauth/token'; $client = new OAuth2\Client(CLIENT_ID, CLIENT_SECRET); if (!isset($_GET['code'])) { $auth_url = $client->getAuthenticationUrl(AUTHORIZATION_ENDPOINT, REDIRECT_URI); header('Location: ' . $auth_url); die('Redirect'); } else { $params = array('code' => $_GET['code'], 'redirect_uri' => REDIRECT_URI); $response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params); parse_str($response['result'], $info); $client->setAccessToken($info['access_token']); $response = $client->fetch('https://api.empireavenue.com/profile/info'); echo $response; echo 'test'; } ?>Here are the docs http://www.empireave...elopers/apidocs Why am I getting that error on Google reCAPTCHA V2 response? Hello, it's my first time posting here and I'm not good with such stuff as the one I'm posting right now I have been trying to solve this issue for 2 days by now so I could use some help lol This error "Please solve the captcha." is showing even if the captcha is verified so it's showing in the both cases (verified/unverified). Thanks in advance.
<?php require_once 'db/setting.php'; require_once 'db/odbc.php'; session_start(); error_reporting(0); if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $protocol = 'https://'; } else { $protocol = 'http://'; } $currentDomain = $protocol.$_SERVER[HTTP_HOST]; $API["secret_key"] = "xx"; $API["api_key"] = "xx"; $API["callback"] = $currentDomain."/vote-reward-tok.php?return={RETURNEDCODE}"; $API["API_Domain"] = "http://api.top-kal.com"; $secretKey = 'xxx'; $captcha = $_POST['g-recaptcha-response']; $ip = $_SERVER['REMOTE_ADDR']; $responseData=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&responseData=".$captcha."&remoteip=".$ip); $responseKeys = json_decode($responseData,true); $config["db_username"] = "sa"; $config["db_password"] = "********"; $config["db_database_account"] = "kal_auth"; $config["db_database_player"] = "kal_db"; $config["db_server"] = "NAME\SQLEXPRESS"; $config["db_driver"] = "SQL Server"; $config["Reward_Name"] = "Vote Coin"; $config["MinLvl_Require"] = 30; $config["Reward_Index"] = 447; $config["Reward_Amount"] = 10; $config["Reward_Bound"] = false;
function insertRewards($account_unique_id){ global $config; $connect = odbc_connect('Driver={'.$config["db_driver"].'};Server='.$config["db_server"].';Database='.$config["db_database_player"].';', $config['db_username'] ,$config['db_password']); if(!$connect) return false; $query = odbc_exec($connect,"SELECT Top 1 [IID] FROM [Item] Where [IID] < 1 order by IID Desc"); if(!$query) return false; $data = odbc_fetch_array($query); if($data && !empty($data) && isset($data["IID"])) odbc_exec($connect,"INSERT INTO [Item] ([PID],[IID],[Index],[Prefix],[Info],[Num])VALUES ($account_unique_id,".($data["IID"]+1).",".$config["Reward_Index"].",0,".(16+($config["Reward_Bound"] ? 128 : 0)).",".$config["Reward_Amount"].")"); } function checkCharacters($accountUID){ global $config; $connect = odbc_connect('Driver={'.$config["db_driver"].'};Server='.$config["db_server"].';Database='.$config["db_database_player"].';', $config['db_username'] ,$config['db_password']); if(!$connect) return array("error" => "failed to connect to database players."); $query = odbc_exec($connect,"SELECT [Level] FROM [Player] WHERE [UID] = $accountUID ORDER BY [Level] DESC"); if(!$query) return array("error" => "failed to find characters in this account id."); while($r = odbc_fetch_array($query)){ if($r["Level"] >= $config["MinLvl_Require"]) return array("success" => $accountUID); } return array("error" => "You should have one character at least higher than level : ".$config["MinLvl_Require"]." to vote."); } function checkAccount($accountID){ global $config; $connect = odbc_connect('Driver={'.$config["db_driver"].'};Server='.$config["db_server"].';Database='.$config["db_database_account"].';', $config['db_username'] ,$config['db_password']); if(!$connect) return array("error" => "failed to connect to database accounts."); $query = odbc_exec($connect,"SELECT TOP 1 [UID] FROM [Login] WHERE [ID] = '$accountID'"); if(!$query) return array("error" => "this account id not exists."); $data = odbc_fetch_array($query); if(!$data || empty($data) || !isset($data["UID"])) return array("error" => "this account id not exists."); if($config["MinLvl_Require"] > 0) return checkCharacters($data["UID"]); return array("success" => $data["UID"]); } >> Submitting Function $response = array("error" => false , "success" => false , 'redirect' => false); function post_content($query){ $query_array = array();foreach( $query as $key => $key_value )$query_array[] = urlencode( $key ) . '=' . urlencode( $key_value );return implode( '&', $query_array ); } global $API; $opts = array('http' => array('method' => 'POST',"header" => "Content-type: application/x-www-form-urlencoded\r\nAuthorization:".base64_encode($API["api_key"].":".$API["secret_key"])."\r\n", "content" => post_content($content)));return stream_context_create($opts); } function submit(){ global $API; if(empty($captcha) || $captcha == '' || !isset($captcha)) return array( "error" => "Please solve the captcha."); if (empty($_POST['account']) || !ctype_alnum($_POST['account'])) return array( "error" => "Invalid account id."); $checkAccount = checkAccount($_POST['account']); if (isset($checkAccount["error"])) return array("error" => $checkAccount["error"]); if (isset($checkAccount["success"])){ $account_unique_id = (isset($_SESSION['kal_id'])) ? $_SESSION['kal_id'] : $checkAccount["success"]; $result = json_decode(file_get_contents($API["API_Domain"] . '/api/generate/vote-rewards-token', false, postParams(array('callback' => $API["callback"],'account_unique_id' => $account_unique_id ))) , true); { echo '<br><center><h3>Please wait...</h3></center>'; } if (!empty($result)){ if (isset($result["response"])){ if (isset($result["response"]["error"])) return array("error" => $result["response"]["error"]); elseif (isset($result["response"]["success"])) return array("redirect" => '<script type="text/javascript">setTimeout(function () { window.location.href = "'.$result["response"]["success"].'";}, 500)</script>'); } } } } if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['account'])){ $response = submit(); if (isset($response['redirect']) && $response['redirect']){ echo $response['redirect']; die; } }elseif (isset($_GET['return'])){ $result = json_decode(file_get_contents($API["API_Domain"] . '/api/verify/vote-rewards-token', false, postParams(array('returned_code' => $_GET['return']))) , true); if (!empty($result)){ if (isset($result["response"])){ if (isset($result["response"]["error"])) $response['error'] = $result["response"]["error"]; elseif (isset($result["response"]["success"])){ insertRewards($result["response"]["account_unique_id"]); $response['success'] = '<b>Thank you, Your vote has been recorded and the server rank will be updated soon.<b><br />You will receive your rewards in storage of your account.<p>Your next vote in : <b>' . $result["response"]["NextVote"] . '</b></p>'; } } } } ?>
<head> <title>Vote Rewards - <?php echo $config['serverName']; ?></title> <link rel="shortcut icon" href=images/favicon.png"> <link rel="stylesheet" href="css/vote.css"> <link rel="stylesheet" href="css/fontawesome.css"> <link rel="stylesheet" href="css/fontawesomeall.css"> <script src='https://www.google.com/recaptcha/api.js'></script> </head> <body> <form class="vote-form" method="post"> <noscript><div class="isa_error">Javascript is not enabled in your browser! Please enable it or change your browser.</div></noscript> <?php if(isset($response['error']) && $response['error']){ ?><div class="isa_error"> <?php echo $response['error'] ;?> </div> <?php } ?> <?php if(isset($response['success']) && $response['success']){ ?><div class="isa_success"> <?php echo $response['success'] ;?> </div> <?php }else{ ?> <label> <span>Account ID :</span> <input type="text" name="account" maxlength="20" <?php echo (isset($_SESSION['kal_username'])) ? 'readonly value="'.$_SESSION['kal_username'].'"' : ""; ?>" /> </label> <div class="g-recaptcha" style="margin:0 auto;" data-sitekey="xxx" data-theme="dark"></div> <label class="label_btn"> <input type="submit" class="button" value="Vote" /> </label> <?php } ?> </form> <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> </body> </html> Edited October 13, 2019 by requinix we don't do markdown. please use the Code <> button for code I'm trying to debug a sporadic 500 error which users occasionally get when filling out form sections on my site. Whenever it happens, I try to recreate their environment and fill out the form exactly as they have done, but can never recreate the issue. I have checked my application logs for the framework I am using, but they report nothing related to the error. I'm hoping someone here might be able to help me catch this. This is where the 500 error is sometimes happening and this triggers the error which users report: Code: [Select] //In jquery AJAX function, which submits data to PHP form for processing error: function(data,transport){ $.validationEngine.debug("error in ajax response: "+data.status+" "+transport) } Is there a way for me to try and catch what the exact error is here? The problem is I can't recreate the error, either using an AJAX call or not to call the PHP script. I need to catch the error response from the PHP script being called, but I never get an error when trying to recreate the user issue, i.e same OS/browser/form answers. The Apache error logs for the site have very little - unless I'm looking in the wrong place. I'm on CentOS, ran locate error_log and got an error_log.txt file in my vhosts directory for my site, but this just contained a 302 message log, nothing else. I also tried locate error | grep mysite. Hi I am trying to retrieve soap response as xml string. I have tried to parse the soap response xml string using simplexml. I am getting the error XML Parsing Error: junk after document element Here is my response. I have a problem in this response as you can see <br /> tag get added to the last of this xml string. I haver tried to remove using str_replace but with no luck. Code: [Select] <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><GetListItemsResult><listitems xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'> <rs:data ItemCount="4"> <z:row ows_Attachments='0' ows_LinkTitle='test' ows_Name='test' ows_Email='jaiganesh@gmail.com' ows_MetaInfo='1;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='test' ows_ID='1' ows_owshiddenversion='2' ows_UniqueId='1;#{B6AEA147-BD2F-4157-8F46-57B86277EAA5}' ows_FSObjType='1;#0' ows_Created_x0020_Date='1;#2012-05-15 12:09:57' ows_Created='2012-05-15 12:09:57' ows_FileLeafRef='1;#1_.000' ows_FileRef='1;#Lists/CustomerInfo/1_.000' /> <z:row ows_Attachments='0' ows_LinkTitle='Test2' ows_Name='test' ows_MetaInfo='2;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='Test2' ows_ID='2' ows_owshiddenversion='1' ows_UniqueId='2;#{4EC49195-F4D6-483F-B762-0F1DEEDBF2E5}' ows_FSObjType='2;#0' ows_Created_x0020_Date='2;#2012-05-15 12:11:00' ows_Created='2012-05-15 12:11:00' ows_FileLeafRef='2;#2_.000' ows_FileRef='2;#Lists/CustomerInfo/2_.000' /> <z:row ows_Attachments='0' ows_LinkTitle='My Title' ows_MetaInfo='3;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='My Title' ows_ID='3' ows_owshiddenversion='1' ows_UniqueId='3;#{E4E5854A-2263-45D0-85D1-02AD65B6006E}' ows_FSObjType='3;#0' ows_Created_x0020_Date='3;#2012-05-15 15:49:58' ows_Created='2012-05-15 15:49:58' ows_FileLeafRef='3;#3_.000' ows_FileRef='3;#Lists/CustomerInfo/3_.000' /> <z:row ows_Attachments='0' ows_LinkTitle='My Title' ows_MetaInfo='4;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='My Title' ows_ID='4' ows_owshiddenversion='1' ows_UniqueId='4;#{59C287EA-F92E-4F57-80A7-30E453124DD8}' ows_FSObjType='4;#0' ows_Created_x0020_Date='4;#2012-05-15 15:50:50' ows_Created='2012-05-15 15:50:50' ows_FileLeafRef='4;#4_.000' ows_FileRef='4;#Lists/CustomerInfo/4_.000' /> </rs:data> </listitems></GetListItemsResult></GetListItemsResponse></soap:Body></soap:Envelope><br /> First of all, I apologize for my "newbieness" in advance. I've got a form processing script that is working fine except for one section of code, snippets of which is shown below:
//default values $formResponse = "How are you really doing? Use this to find out!"; $imgSource = "blue.png"; If ($country == "United States") { //US zip code query $sql = "SELECT location, revParData FROM zipData WHERE zipCode = '$zipCode' LIMIT 1"; mysql_select_db('db'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { $formResponse = "It looks like you entered an invalid zip code. Please try again!"; $imgSource = "yellow.png"; } else { $sql = "SELECT location, revParData FROM zipData WHERE zipCode = '$zipCode' LIMIT 1"; mysql_select_db('db'); $retval = mysql_query( $sql, $conn ); while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { $location = $row['location']; $revParData = $row['revParData']; } }What I thought would happen is this: If the zip code entered by the end user does not exist in the table, the $formResponse and $imgSource values would be the "... invalid zip code" and "yellow.png" values. If a valid zip code is entered, it completes the second query. In fact, it works fine if a zip code that exists in the table is entered, but shows the default values for $formResponse and $imgSource if a zip code that doesn't exist in the database is entered. I can't figure out why it is doing this... if anyone can point out my coding error, it would be appreciated. Cheers! Mike Hi, Help would be very appreciative I am doing some preliminary testing for future projects. A company we are working with supplied us with a wsdl file to communicate with their system. I want to use PHP to run functions in the wsdl file but I got stuck after calling a function and I get no response back. Below is my test snippet PHP code. Below the PHP code is the wsdl file (also attached change the extension from .txt to .wsdl before using it). When I run the php code from command line (linux server) I get a "Segmentation fault" back. I am assuming that the error is coming from the wsdl file. I am not high fly on wsdl code and I would not really know what I'm doing if I started chopping and dicing the wsdl file. <?php $client = new SoapClient("http://172.21.1.24:7070/comactivity/axis2services/OrderEntryWebService?wsdl/"); //if the wsdl exist locally use //$client = new SoapClient("file.wsdl"); //echo var_export($client->__getFunctions(),true); $arr_head=array( "cuno" =>"1234", "ortp" =>"ORD", "faci" =>"M00", "rldt" =>"20110811" ); try { $arr = $client->__soapCall("addBatchHead", $arr_head); } catch (SoapFault $exception){ echo $exception; } ?> =========== WSDL file within these tags ============= <?xml version="1.0" encoding="utf-16"?> <wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns="http://services.web" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://services.web" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:documentation>Order Entry Web Service</wsdl:documentation> <wsdl:types> <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://services.web"> <xs:element name="addBatchHead"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="cuno" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="ortp" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="faci" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="rldt" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="addBatchHeadResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="addBatchHeadReturn" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="addBatchLine"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="tempOrno" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="itno" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="orqt" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="whlo" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="dlsp" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="addBatchLineResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="addBatchLineReturn" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="confirm"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="tempOrno" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="confirmResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="confirmReturn" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </wsdl:types> <wsdl:message name="addBatchLineRequest"> <wsdl:part name="parameters" element="ns:addBatchLine" /> </wsdl:message> <wsdl:message name="confirmRequest"> <wsdl:part name="parameters" element="ns:confirm" /> </wsdl:message> <wsdl:message name="confirmResponse"> <wsdl:part name="parameters" element="ns:confirmResponse" /> </wsdl:message> <wsdl:message name="addBatchHeadResponse"> <wsdl:part name="parameters" element="ns:addBatchHeadResponse" /> </wsdl:message> <wsdl:message name="addBatchLineResponse"> <wsdl:part name="parameters" element="ns:addBatchLineResponse" /> </wsdl:message> <wsdl:message name="addBatchHeadRequest"> <wsdl:part name="parameters" element="ns:addBatchHead" /> </wsdl:message> <wsdl:portType name="OrderEntryWebServicePortType"> <wsdl:operation name="addBatchLine"> <wsdl:input wsaw:Action="urn:addBatchLine" message="ns:addBatchLineRequest" /> <wsdl:output wsaw:Action="urn:addBatchLineResponse" message="ns:addBatchLineResponse" /> </wsdl:operation> <wsdl:operation name="addBatchHead"> <wsdl:input wsaw:Action="urn:addBatchHead" message="ns:addBatchHeadRequest" /> <wsdl:output wsaw:Action="urn:addBatchHeadResponse" message="ns:addBatchHeadResponse" /> </wsdl:operation> <wsdl:operation name="confirm"> <wsdl:input wsaw:Action="urn:confirm" message="ns:confirmRequest" /> <wsdl:output wsaw:Action="urn:confirmResponse" message="ns:confirmResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="OrderEntryWebServiceHttpBinding" type="ns:OrderEntryWebServicePortType"> <http:binding verb="POST" /> <wsdl:operation name="addBatchLine"> <http:operation location="OrderEntryWebService/addBatchLine" /> <wsdl:input> <mime:content part="addBatchLine" type="text/xml" /> </wsdl:input> <wsdl:output> <mime:content part="addBatchLine" type="text/xml" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="addBatchHead"> <http:operation location="OrderEntryWebService/addBatchHead" /> <wsdl:input> <mime:content part="addBatchHead" type="text/xml" /> </wsdl:input> <wsdl:output> <mime:content part="addBatchHead" type="text/xml" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="confirm"> <http:operation location="OrderEntryWebService/confirm" /> <wsdl:input> <mime:content part="confirm" type="text/xml" /> </wsdl:input> <wsdl:output> <mime:content part="confirm" type="text/xml" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="OrderEntryWebServiceSoap11Binding" type="ns:OrderEntryWebServicePortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="addBatchLine"> <soap:operation soapAction="urn:addBatchLine" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="addBatchHead"> <soap:operation soapAction="urn:addBatchHead" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="confirm"> <soap:operation soapAction="urn:confirm" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="OrderEntryWebServiceSoap12Binding" type="ns:OrderEntryWebServicePortType"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="addBatchLine"> <soap12:operation soapAction="urn:addBatchLine" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="addBatchHead"> <soap12:operation soapAction="urn:addBatchHead" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="confirm"> <soap12:operation soapAction="urn:confirm" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="OrderEntryWebService"> <wsdl:port name="OrderEntryWebServiceHttpEndpoint" binding="ns:OrderEntryWebServiceHttpBinding"> <http:address location="http://172.21.1.24:7070/comactivity/axis2services/OrderEntryWebService/" /> </wsdl:port> <wsdl:port name="OrderEntryWebServiceHttpSoap12Endpoint" binding="ns:OrderEntryWebServiceSoap12Binding"> <soap12:address location="http://172.21.1.24:7070/comactivity/axis2services/OrderEntryWebService/" /> </wsdl:port> <wsdl:port name="OrderEntryWebService" binding="ns:OrderEntryWebServiceSoap11Binding"> <soap:address location="http://172.21.1.24:7070/comactivity/axis2services/OrderEntryWebService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> ============== End WSDL file =================== Thank you /Martin [attachment deleted by admin] |