Jump to content

Search the Community

Showing results for tags 'paypal'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. This is more of a Paypal question, but I'm using php on the listener and hopefully someone has run into this problem. I'm having trouble finding the correct POST name to use to get the OPTION SELECT for the item on my listener page. I tried: $option = $_POST['os0']; But, I'm not getting anything using that. I've also tried os0_x, on0, and on0_x. This is what I'm posting to Paypal: <input type="hidden" name="on0" value="Term"> <select name="os0"> <option value="1 Year">1 Year</option> <option value="3 Years">3 Years</option> <option value="5 Years">5 Years</option> </select>
  2. Using Joomla 2.5 and Virtuemart 3. I've had a client tell us that they're getting e-mails (admin order confirmation email) that are different orders from the same person at the same time. After some test orders I've seen that what happens is when PayPal is used, and the customer is being redirected or has been, they then press the back button in the browser, amend the order and send it again. This sends 2 e-mails to the shop and causes confusion. Is there a way to stop this? (Other than a big bold message warning not to do it)
  3. I have a website which shows lots of products by PHP/mysql database. Currently only cash payments are available. I want to add PayPal in, which I've never done before. Having looked at the integration guides, I found the PayPal payments standard bit but with this you need PayPal's buttons. If you have the add to cart buttons, apparently you need to write out each product into PayPal which shouldn't happen as the products are generated by a while loop so I should only paste the code once, but it looks like this needs to be posted individually for each product. Ideally I'd have the PayPal code only happen if the user chooses PayPal at the cart, and then send them to PayPal. The cart products, prices, options and option prices are all in session arrays. Is this possible? Is there a better way?
  4. hello, so i've been developing this website ( http://www.ultimate-dimension.co.uk/NewRAL/store1.php ) for a while now, and the owner wanted a shopping cart implemented. However another coder began the coding of this shopping cart. The cart works perfectly besides that fact that after the Paypal payment as been made I cannot make the system redirect the user to a page where they can download the files that they have ordered. Here is the shopping cart code... <?php session_start(); $page = 'store1.php'; if (isset($_GET['add'])) { $quantity = mysql_query('SELECT id, quantity FROM filesTable WHERE id='.mysql_real_escape_string((int)$_GET['add'])); while ($quantity_row = mysql_fetch_assoc($quantity)) { if ($quantity_row['quantity']!=$_SESSION['cart_'.(int)$_GET['add']]) { $_SESSION['cart_'.(int)$_GET['add']]+='1'; } } header('location:'.$page); } if (isset($_GET['remove'])) { $_SESSION['cart_'.(int)$_GET['remove']]--; header('location:'.$page); } if (isset($_GET['delete'])) { $_SESSION['cart_'.(int)$_GET['delete']]='0'; header('location:'.$page); } function products() { $get = mysql_query('SELECT id, name, description, price, shipping FROM filesTable WHERE quantity > 0 ORDER BY id DESC'); if (mysql_num_rows($get)==0) { echo "There are no products to display :/"; } else { while ($get_row = mysql_fetch_assoc($get)) { echo '<p>'.$get_row['name'].'<br />'.$get_row['description'].'<br /> &pound'.number_format($get_row['price'], 2).' <br /> <a href="cart.php?add='.$get_row['id'].'">ADD</a></p> <br /><hr><br />'; } } } function paypal_items() { $num==0; foreach ($_SESSION as $name => $value) { if ($value!=0) { if (substr($name, 0, 5)=='cart_') { $id = substr($name, 5, strlen($name)-5); $get = mysql_query('SELECT id, name, price, shipping FROM filesTable WHERE id='.mysql_real_escape_string((int)$id)); while ($get_row = mysql_fetch_assoc($get)) { $num++; echo '<input type="hidden" name="item_number_'.$num.'" value="'.$id.'">'; echo '<input type="hidden" name="item_name_'.$num.'" value="'.$get_row['name'].'">'; echo '<input type="hidden" name="amount_'.$num.'" value="'.$get_row['price'].'">'; echo '<input type="hidden" name="shipping_'.$num.'" value="'.$get_row['shipping'].'">'; echo '<input type="hidden" name="shipping2_'.$num.'" value="'.$get_row['shipping'].'">'; echo '<input type="hidden" name="quantity_'.$num.'" value="'.$value.'">'; } } } } } function cart() { foreach ($_SESSION as $name => $value) { if ($value>0) { if (substr($name, 0, 5)=='cart_') { $id = substr($name, 5, (strlen($name)-5)); $get = mysql_query('SELECT id, name, description, price, shipping FROM filesTable WHERE id='.mysql_real_escape_string((int)$id)); while ($get_row = mysql_fetch_assoc($get)) { $sub = $get_row['price']*$value; echo $get_row['name'].' x '.$value.' @ &pound'.number_format($get_row['price'], 2).' = &pound'.number_format($sub, 2).' <a href="cart.php?remove='.$id.'">[ - ]</a> <a href="cart.php?add='.$id.'">[ + ]</a> <a href="cart.php?delete='.$id.'">[ DELETE ]</a> <br><br>'; } } $total += $sub; } } if ($total==0) { echo "Your cart is empty :/"; } else { echo '<br><p class="rightAlignCart">Total: £'.number_format($total, 2).'</p>'; ?> <p> <form class="rightAlignCart" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="joshlittlewood@ultimate-dimension.co.uk"> <?php paypal_items(); ?> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="amount" value="<?php echo $total; ?>"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but06.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> </p> <?php } } ?> By the way the store is running in sandbox mode, for anyone who wants to try it. I believe that Paypal's IPN is the way to do it, but I just can't get it to work with the current shopping cart system. Any help on how do do this would be greatly appreciated!
  5. Hello all, I need some help with my database. So far I have made a program that collects information from a mysql database and I can edit the information and all. Anyways, I use that program to keep track of my job orders but as it stands now I have to enter it all myself. Is there a way that I can have paypal or a php enter the clients name, email, order ID (dont even know how to do this in paypal), and what product he bought in a table on my database? Ill provide screenshots of my program and also database table. Dont know if it will help but it might a bit. By the way, I dont have a clue about php.
  6. Hi guys I am now current trying to implement Paypal sandbox in my website for testing. I used the form generated by Paypal and it worked. However, I wish to make it more secure by verifying the POST details against my database first before posting to Paypal. I have read on the internet for a few days and download a few sample codes to try out, however I still dun understand how it works. The thing I read on is IPN (Instant Payment Notification) for Paypal. Am I reading the right thing? If I am can anyone help me out cause I do not really understand part of it.
  7. Hello Codingforums, yet again I desire some help to my coding, this time regarding a paypal button. I'm working on a local project of mine in which I wish to let my costumers type the amount of quantities for a product they wish into a text box and then want it to automatically edit the amount of quantities on the paypal page. This works when I have the input inside the form, but due to my template I wish to have my quantity text box outside the "form" code of the paypal button but still want it to connect so that it changes. Let me explain with some code This is the working code for which i can enter the amount of quantities into a text box and it will automatically change it on the paypal page as well. <div id="payment" style="margin-top:10px;"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="TEXT" name="quantity" value="1"> <input type="hidden" name="hosted_button_id" value="C5P9LBML2FSC6"> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/da_DK/i/scr/pixel.gif" width="1" height="1"> </form> </div> This is what I want it to do, I want to be able to put the input of the quantities text box onto another div and still be able to change the amount of quantities on paypal. (Doesn't change the amount of quantities when clicked on button) <div id="anotherdiv"> <input type="TEXT" name="quantity" value="1"> </div> <div id="payment" style="margin-top:10px;"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="C5P9LBML2FSC6"> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/da_DK/i/scr/pixel.gif" width="1" height="1"> </form> </div> Thx in advance - rec0il
  8. so I have a custom store built off of PHP, JS and CSS and it sells virtual coins for a game and the coins are sent automatically by the script however I want to start offering discounts to customers via discounts codes and I currently came across this script that I have put together: Javascript <!-- var discnt = 0; // no default percent discount var coupons = new Array ( // place to put coupon codes "MavrkHD", "TheFUTBucks", "TOTW", "Mega", "LL" ); var coupdc = new Array ( // place to put discounts for coupon vals "10", "15", "7", "10", "20" ); var coupval = "(blanket)"; // what user entered as coupon code function ChkCoup () { // check user coupon entry var i; discnt = 0; // assume the worst for (i=0; i<coupons.length; i++) { if (coupval == coupons[i]) { discnt = coupdc[i]; // remember the discount amt alert ("This is a valid promo code! \n\n" + discnt + "%" + " discount now in effect."); return; } } alert ("'" + coupval + "' is not a valid promo code!"); } function Sterling (val) { // force to valid dollar amount var str,pos,rnd=0; if (val < .995) rnd = 1; // for old Netscape browsers str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape pos = str.indexOf ("."); if (pos > 0) str = str.substring (rnd, pos + 3); return str; } function ReadForm (obj1) { // apply the discount var amt,des; amt = obj1.amount.value*1.0; // base amount des = obj1.basedes.value; // base description if (discnt > 0) { // only if discount is active amt = Sterling (amt - (amt * discnt/100.0)); des = des + " - " + discnt + "% off - COUP = " + coupval; } obj1.baseamt.value = Sterling (amt); obj1.item_name.value = des; } //--> </script> PayPal Form Details <form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target = 'paypal'; return ReadForm (this);"> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="add" value="1" /> <input type="hidden" name="business" value="<?=$functions->getPayPal();?>" /> <input type="hidden" name="item_name" value="Online Coin Currency" /> <input type="hidden" name="amount" id="amount" value="0.00" /> <input type="hidden" name="currency_code" value="GBP" /> <input type="hidden" name="baseamt" id="amount" value="0.00" /> <input type="hidden" name="basedes" value="Online Coin Currency (FUT)" /> <input type="hidden" name="custom" id="custom" value=""> <input type="hidden" name="return" value="RETURN LINK HERE";?> <input type="hidden" name="notify_url" value="<?=HOST.'files/payments/paypal.php';?>"> <input type="hidden" name="cancel_return" value="<?=HOST.'cancelled';?>"> Enter Coupon code <input type = "text" size = "10" name = "coupcode"; /> <input type="button" value="Apply code" onclick="coupval =this.form.coupcode.value; ChkCoup();" /><br/><br/> <input type="image" id="xx" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" onclick="CalculateOrder(this.form)" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_US/i/scr/pixel.gif" width="1" height="1"> </form> So, it all works like sending information to PayPal I have one issue about PayPal displaying the calculated prices. For example: if I take out the id of amount and baseamt and just leave value and put a value of 12.99 and then go on my store and go through the process of buying the virtual coins and then get to the discount code area and proceed to paypal I will get a discount price to pay at paypal but when I use the id="amount" which is a variable for depending on how many coins the customer to buy it'll send that price to paypal, it doesn't discount the price and I have been trying endlessly to fix this! help? Thanks.
  9. require_once ("paypalfunctions.php"); $PaymentOption = "PayPal"; if ( $PaymentOption == "PayPal") { // ================================== // PayPal Express Checkout Module // ================================== //'------------------------------------ //' The paymentAmount is the total value of //' the purchase. //' //' TODO: Enter the total Payment Amount within the quotes. //' example : $paymentAmount = "15.00"; //'------------------------------------ $paymentAmount = "99"; //'------------------------------------ //' The currencyCodeType //' is set to the selections made on the Integration Assistant //'------------------------------------ $currencyCodeType = "USD"; $paymentType = "Sale"; //'------------------------------------ //' The returnURL is the location where buyers return to when a //' payment has been succesfully authorized. //' //' This is set to the value entered on the Integration Assistant //'------------------------------------ $returnURL = "http://127.0.0.1/digitalgoodsexample/orderconfirm.php"; //'------------------------------------ //' The cancelURL is the location buyers are sent to when they hit the //' cancel button during authorization of payment during the PayPal flow //' //' This is set to the value entered on the Integration Assistant //'------------------------------------ $cancelURL = "http://127.0.0.1/digitalgoodsexample/cancel.php"; //'------------------------------------ //' Calls the SetExpressCheckout API call //' //' The CallSetExpressCheckout function is defined in the file PayPalFunctions.php, //' it is included at the top of this file. //'------------------------------------------------- $items = array(); $items[] = array('name' => 'PayPal Digital Goods Integration Guide', 'amt' => $paymentAmount, 'qty' => 1); //::ITEMS:: // to add anothe item, uncomment the lines below and comment the line above // $items[] = array('name' => 'Item Name1', 'amt' => $itemAmount1, 'qty' => 1); // $items[] = array('name' => 'Item Name2', 'amt' => $itemAmount2, 'qty' => 1); // $paymentAmount = $itemAmount1 + $itemAmount2; // assign corresponding item amounts to "$itemAmount1" and "$itemAmount2" // NOTE : sum of all the item amounts should be equal to payment amount $resArray = SetExpressCheckoutDG( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $items ); $ack = strtoupper($resArray["ACK"]); if($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { $token = urldecode($resArray["TOKEN"]); RedirectToPayPalDG( $token ); } else { //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); echo "SetExpressCheckout API call failed. "; echo "Detailed Error Message: " . $ErrorLongMsg; echo "Short Error Message: " . $ErrorShortMsg; echo "Error Code: " . $ErrorCode; echo "Error Severity Code: " . $ErrorSeverityCode; } }<code>I am using the above paypal function to send users to paypal for payment. However, I would like to automatically insert the product price on the line:</code>$paymentAmount = "99"<code>instead of numeric value using a meta value that is:</code>echo get_post_meta($post->ID, 'download_info_price', true I am have been perfectly able to make the paypal functions work, but only with numeric value by using it as a template page for my checkout page. I believe that I need something that help me echo meta value outside of the loop and using:`global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'Your-Custom-Field', true);`did not get me anywhere. with the above, I tried calling /wp-load.php in the paypal functions, but no result. The price/amount I want to automate is require by my paypal checkout file that is called on the header of above codesrequire_once ("paypalfunctions.php")the paypal checkout is:`/******************************************** PayPal API Module Defines all the global variables and the wrapper functions ********************************************/ $PROXY_HOST = '127.0.0.1'; $PROXY_PORT = '808'; $SandboxFlag = true; //' TODO: //'------------------------------------ //' PayPal API Credentials //' Replace <API_USERNAME> with your API Username //' Replace <API_PASSWORD> with your API Password //' Replace <API_SIGNATURE> with your Signature //'------------------------------------ $API_UserName=//this is hidden; $API_Password=//this is hidden; $API_Signature=//this is hidden; // BN Code is only applicable for partners $sBNCode = "PP-ECWizard"; /* ' Define the PayPal Redirect URLs. ' This is the URL that the buyer is first sent to do authorize payment with their paypal account ' change the URL depending if you are testing on the sandbox or the live PayPal site ' ' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token= ' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token= */ if ($SandboxFlag == true) { $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $PAYPAL_URL = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; $PAYPAL_DG_URL = "https://www.sandbox.paypal.com/incontext?token="; } else { $API_Endpoint = "https://api-3t.paypal.com/nvp"; $PAYPAL_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; $PAYPAL_DG_URL = "https://www.paypal.com/incontext?token="; } $USE_PROXY = false; $version = "84"; /* An express checkout transaction starts with a token, that identifies to PayPal your transaction In this example, when the script sees a token, the script knows that the buyer has already authorized payment through paypal. If no token was found, the action is to send the buyer to PayPal to first authorize payment */ /* '------------------------------------------------------------------------------------------------------------------------------------------- ' Purpose: Prepares the parameters for the SetExpressCheckout API Call for a Digital Goods payment. ' Inputs: ' paymentAmount: Total value of the shopping cart ' currencyCodeType: Currency code value the PayPal API ' paymentType: paymentType has to be one of the following values: Sale or Order or Authorization ' returnURL: the page where buyers return to after they are done with the payment review on PayPal ' cancelURL: the page where buyers return to when they cancel the payment review on PayPal '-------------------------------------------------------------------------------------------------------------------------------------------- */ function SetExpressCheckoutDG( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $items) { //------------------------------------------------------------------------------------------------------------------------------------ // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation $nvpstr = "&PAYMENTREQUEST_0_AMT=". $paymentAmount; $nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType; $nvpstr .= "&RETURNURL=" . $returnURL; $nvpstr .= "&CANCELURL=" . $cancelURL; $nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType; $nvpstr .= "&REQCONFIRMSHIPPING=0"; $nvpstr .= "&NOSHIPPING=1"; foreach($items as $index => $item) { $nvpstr .= "&L_PAYMENTREQUEST_0_NAME" . $index . "=" . urlencode($item["name"]); $nvpstr .= "&L_PAYMENTREQUEST_0_AMT" . $index . "=" . urlencode($item["amt"]); $nvpstr .= "&L_PAYMENTREQUEST_0_QTY" . $index . "=" . urlencode($item["qty"]); $nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital"; } //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal //' If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment. //' If an error occured, show the resulting errors //'--------------------------------------------------------------------------------------------------------------- $resArray = hash_call("SetExpressCheckout", $nvpstr); $ack = strtoupper($resArray["ACK"]); if($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { $token = urldecode($resArray["TOKEN"]); $_SESSION['TOKEN'] = $token; } return $resArray; } /* '------------------------------------------------------------------------------------------- ' Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call. ' ' Inputs: ' None ' Returns: ' The NVP Collection object of the GetExpressCheckoutDetails Call Response. '------------------------------------------------------------------------------------------- */ function GetExpressCheckoutDetails( $token ) { //'-------------------------------------------------------------- //' At this point, the buyer has completed authorizing the payment //' at PayPal. The function will call PayPal to obtain the details //' of the authorization, incuding any shipping information of the //' buyer. Remember, the authorization is not a completed transaction //' at this state - the buyer still needs an additional step to finalize //' the transaction //'-------------------------------------------------------------- //'--------------------------------------------------------------------------- //' Build a second API request to PayPal, using the token as the //' ID to get the details on the payment authorization //'--------------------------------------------------------------------------- $nvpstr="&TOKEN=" . $token; //'--------------------------------------------------------------------------- //' Make the API call and store the results in an array. //' If the call was a success, show the authorization details, and provide //' an action to complete the payment. //' If failed, show the error //'--------------------------------------------------------------------------- $resArray=hash_call("GetExpressCheckoutDetails",$nvpstr); $ack = strtoupper($resArray["ACK"]); if($ack == "SUCCESS" || $ack=="SUCCESSWITHWARNING") { return $resArray; } else return false; } /* '------------------------------------------------------------------------------------------------------------------------------------------- ' Purpose: Prepares the parameters for the GetExpressCheckoutDetails API Call. ' ' Inputs: ' sBNCode: The BN code used by PayPal to track the transactions from a given shopping cart. ' Returns: ' The NVP Collection object of the GetExpressCheckoutDetails Call Response. '-------------------------------------------------------------------------------------------------------------------------------------------- */ function ConfirmPayment( $token, $paymentType, $currencyCodeType, $payerID, $FinalPaymentAmt, $items ) { /* Gather the information to make the final call to finalize the PayPal payment. The variable nvpstr holds the name value pairs */ $token = urlencode($token); $paymentType = urlencode($paymentType); $currencyCodeType = urlencode($currencyCodeType); $payerID = urlencode($payerID); $serverName = urlencode($_SERVER['SERVER_NAME']); $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt; $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName; foreach($items as $index => $item) { $nvpstr .= "&L_PAYMENTREQUEST_0_NAME" . $index . "=" . urlencode($item["name"]); $nvpstr .= "&L_PAYMENTREQUEST_0_AMT" . $index . "=" . urlencode($item["amt"]); $nvpstr .= "&L_PAYMENTREQUEST_0_QTY" . $index . "=" . urlencode($item["qty"]); $nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital"; } /* Make the call to PayPal to finalize payment If an error occured, show the resulting errors */ $resArray=hash_call("DoExpressCheckoutPayment",$nvpstr); /* Display the API response back to the browser. If the response from PayPal was a success, display the response parameters' If the response was an error, display the errors received using APIError.php. */ $ack = strtoupper($resArray["ACK"]); return $resArray; } /** '------------------------------------------------------------------------------------------------------------------------------------------- * hash_call: Function to perform the API call to PayPal using API signature * @methodName is name of API method. * @nvpStr is nvp string. * returns an associtive array containing the response from the server. '------------------------------------------------------------------------------------------------------------------------------------------- */ function hash_call($methodName,$nvpStr) { //declaring of global variables global $API_Endpoint, $version, $API_UserName, $API_Password, $API_Signature; global $USE_PROXY, $PROXY_HOST, $PROXY_PORT; global $gv_ApiErrorURL; global $sBNCode; //setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php if($USE_PROXY) curl_setopt ($ch, CURLOPT_PROXY, $PROXY_HOST. ":" . $PROXY_PORT); //NVPRequest for submitting to server $nvpreq="METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode); //setting the nvpreq as POST FIELD to curl curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); //getting response from server $response = curl_exec($ch); //convrting NVPResponse to an Associative Array $nvpResArray=deformatNVP($response); $nvpReqArray=deformatNVP($nvpreq); $_SESSION['nvpReqArray']=$nvpReqArray; if (curl_errno($ch)) { // moving to display page to display curl errors $_SESSION['curl_error_no']=curl_errno($ch) ; $_SESSION['curl_error_msg']=curl_error($ch); //Execute the Error handling module to display errors. } else { //closing the curl curl_close($ch); } return $nvpResArray; } /*'---------------------------------------------------------------------------------- Purpose: Redirects to PayPal.com site. Inputs: NVP string. Returns: ---------------------------------------------------------------------------------- */ function RedirectToPayPal ( $token ) { global $PAYPAL_URL; // Redirect to paypal.com here $payPalURL = $PAYPAL_URL . $token; header("Location: ".$payPalURL); exit; } function RedirectToPayPalDG ( $token ) { global $PAYPAL_DG_URL; // Redirect to paypal.com here $payPalURL = $PAYPAL_DG_URL . $token; header("Location: ".$payPalURL); exit; } /*'---------------------------------------------------------------------------------- * This function will take NVPString and convert it to an Associative Array and it will decode the response. * It is usefull to search for a particular key and displaying arrays. * @nvpstr is NVPString. * @nvpArray is Associative Array. ---------------------------------------------------------------------------------- */ function deformatNVP($nvpstr) { $intial=0; $nvpArray = array(); while(strlen($nvpstr)) { //postion of Key $keypos= strpos($nvpstr,'='); //position of value $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr); /*getting the Key and Value values and storing in a Associative Array*/ $keyval=substr($nvpstr,$intial,$keypos); $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1); //decoding the respose $nvpArray[urldecode($keyval)] =urldecode( $valval); $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr)); } return $nvpArray; }
  10. I've been trying to get help with a PayPal button on a few different coding message boards and the only responses I get are regarding format and violating unwritten rules (apparently offering $20 thank-yous for solving my problem is a no-no). My coding skills (as I learned) are mostly limited to formatting so I'm at the end of my skill set. So rather than asking for coding help, is there a resource you all use to solve specialized coding problems like this one that would probably be very amateur for someone proficient in the area? Any help is appreciated. For context, my other post is linked below. http://forums.phpfreaks.com/topic/285418-pay-now-button-with-registration-form-on-paypal/
  11. I'm trying to set up what I thought would be an easy form with button. I want to get the registration information out of the form when someone fills it out and pays. Instead, clicking the button leads to a mess of bad information at the top of the PayPal page. I think I'm missing something that pulls the data out of the form when someone registers. Looking at some examples online, someone who has done this before could probably fix my code in a few minutes. I thought the HTML skills learned I learned in the mid/late 90s were adequate for this. Sorry for the wall of code, but I provided it below. I've spent hours to get to this point and made a bunch of changes from some other forums and it still drops and error. http://www.lifeatpathway.com/what-s-happening/mukti-5k-registration <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="mukti5k" id="5k" onsubmit="this.target='paypal'; return UpdateForm(this);" > <table> <tbody> <tr> <td>First name:</td> </tr> <tr> <td><input type="hidden" name="on0" value="First Name" /> <input type="text" name="os0" size="30" /></td> </tr> <tr> <td>Last name:</td> </tr> <tr> <td><input type="hidden" name="on1" value="Last Name" /> <input type="text" name="os1" size="30" /></td> </tr> <tr> <td>Address:</td> </tr> <tr> <td><input type="hidden" name="on2" value="Address" /> <input type="text" name="os2" size="30" /></td> </tr> <tr> <td>City:</td> </tr> <tr> <td><input type="hidden" name="on3" value="City" /> <input type="text" name="os3" size="20" /></td> </tr> <tr> <td>State:</td> </tr> <tr> <td><input type="hidden" name="on3" value="State" /> <input type="text" name="os3" size="2" /></td> </tr> <tr> <td>Zip:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Zip" /> <input type="text" name="os3" size="10" /></td> </tr> <tr> <td>Phone:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Phone" /> <input type="text" name="os3" size="14" /></td> </tr> <tr> <td>Email:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Email" /> <input type="text" name="os3" size="30" /></td> </tr> <tr> <td>Age:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Age" /> <input type="text" name="os3" size="2" /></td> </tr> <tr> <td>Gender:</td> </tr> <tr> <td><input type="radio" name="gender" value="male" /> Male <input type="radio" name="gender" value="female" /> Female</td> </tr> <tr> <td>Race:</td> </tr> <tr> <td><input type="radio" name="race" value="5k" /> Mukti 5K <input type="radio" name="race" value="1m" /> Mukti 1 Mile Fun Walk</td> </tr> <tr> <td><input type="hidden" name="on1" value="Shirt Size" />Shirt Size: </td> </tr> <tr> <td><input type="radio" name="shirt" value="ys" /> Youth Small <input type="radio" name="shirt" value="ym" /> Youth Medium <input type="radio" name="shirt" value="yl" /> Youth Large <br /><input type="radio" name="shirt" value="as" /> Adult Small <input type="radio" name="shirt" value="am" /> Adult Medium <input type="radio" name="shirt" value="al" /> Adult Large <input type="radio" name="shirt" value="axl" /> Adult XL <input type="radio" name="shirt" value="axxl" /> Adult XXL</td> </tr> <tr> <td colspan="2" align="center"> <div> </div> <div><input type="checkbox" name="agree" value="agree_terms" /> By checking this box, I, intending to be legally bound for myself, my heirs, my executors and administrators, waive, release and discharge any and all rights and claims which I may have or which hereafter may arise from all claims of damage, actions, injury or death received in any manner before, during or after participation in the 2014 Pathway Church Mukti 5K and 1 Mile Run/Walk on Saturday, May 10, 2014. I shall abide by all decisions of race officials as final. I also release the sponsoring organizations and individuals from all legal responsibility or liability for the use of any photographs involving me for the purpose of advertising or reporting.</div> </td> </tr> </tbody> </table> <input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" alt="Register Now" align="middle" /> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="business" value="mikejohnston5@gmail.com" /> <input type="hidden" name="return" value="http://www.lifeatpathway.com" /> <input type="hidden" name="currency_code" value="USD" /> <input type="hidden" name="bn" value="PP-ShopCartBF" /></form>
  12. Hello, I've been struggling with an issue for a few days now and I was hoping someone could help. I bought a php script that allows me to create paypal adaptive payments. It works great, it's all set up. My only issue is that I can't find the proper place to set my code so that it will make an update call to my php database. The problem with that is I'm not sure how to set up paypal url forwarding to forward them to a webpage where the php code could run, so I either have to give them what they paid for BEFORE they pay and cancel the sale if they choose not to continue on with the transaction(which is my current problem) -OR- Call the code to update my database after I receive the transaction complete from POST data (which is what I would like to do.) I have 3 scripts. Buy.php which handles the actual transaction Paypal_API script which has the method definitions within it, and an IPN script which has the IPN listener within. Which three of these scripts should I place the code to update my database? I've tried placing it inside all three at various places, it doesn't seem to work in the IPN script at all, and the other two scripts give me the first problem I mentioned. Any help would be greatly appreciated and you might just win the "internets".
  13. Basically what I can see is that I am failing to create the apiContext object. Can anyone see where the error is? Please tell me how I can improve the question. Here is the error: Fatal error: Uncaught exception 'PayPal\Exception\PPConnectionException' with message 'Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment.' in /vendor/paypal/sdk-core-php/lib/PayPal/Core/PPHttpConnection.php:104 Stack trace: #0 /vendor/paypal/sdk-core-php/lib/PayPal/Transport/PPRestCall.php(44): PayPal\Core\PPHttpConnection->execute('{"intent":"sale...') #1 /vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Payment.php(246): PayPal\Transport\PPRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...') #2 /pymt.php(38): PayPal\Api\Payment->create(Object(PayPal\Rest\ApiContext)) #3 {main} thrown in /vendor/paypal/sdk-core-php/lib/PayPal/Core/PPHttpConnection.php on line 104 This is the PHP sample I'm using. I am trying to run it off my server. If a customer clicks the pay with paypal button, it runs the following sample script: <?php require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Address; use PayPal\Api\Amount; use PayPal\Api\Payer; use PayPal\Api\Payment; use PayPal\Api\FundingInstrument; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; session_start(); $payer = new Payer(); $payer->setPayment_method('paypal'); $amount = new Amount(); $amount->setCurrency('USD'); $amount->setTotal('1.00'); $transaction = new Transaction(); $transaction->setAmount($amount); $transaction->setDescription('This is the payment description.'); $baseUrl = getBaseUrl(); $redirectUrls = new RedirectUrls(); $redirectUrls->setReturn_url('baseUrl/sale.php'); $redirectUrls->setCancel_url('baseUrl/saleFail.php'); $payment = new Payment(); $payment->setIntent('sale'); $payment->setPayer($payer); $payment->setRedirect_urls($redirectUrls); $payment->setTransactions(array($transaction)); try { $payment->create($apiContext); } catch (\PPConnectionException $ex) { echo 'Exception: ' . $ex->getMessage() . PHP_EOL; var_dump($ex->getData()); exit(1); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirectUrl = $link->getHref(); } } $_SESSION['paymentId'] = $payment->getId(); if(isset($redirectUrl)) { header('Location: $redirectUrl'); exit; } ?> Here's the redacted bootstrap.php: <?php /* * Sample bootstrap file. */ // Include the composer autoloader if(!file_exists(__DIR__ .'/vendor/autoload.php')) { echo "The 'vendor' folder is missing. You must run 'composer update --no-dev' to resolve application dependencies.\nPlease see the README for more information.\n"; exit(1); } require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/common.php'; use PayPal\Rest\ApiContext; use PayPal\Auth\OAuthTokenCredential; $apiContext = getApiContext(); /** Helper method for getting an APIContext for all calls * * @return PayPal\Rest\ApiContext */ function getApiContext() { // ### Api context // Use an ApiContext object to authenticate // API calls. The clientId and clientSecret for the // OAuthTokenCredential class can be retrieved from // developer.paypal.com $apiContext = new ApiContext( new OAuthTokenCredential( 'MY CLIENT ID', 'MY SECRET' ) ); // Register the sdk_config.ini file in current directory // as the configuration source. if(!defined("PP_CONFIG_PATH")) { define("PP_CONFIG_PATH", __DIR__); } return $apiContext; } ?> Can anyone help? Let me know if you need more info. Thanks up front.
  14. I have been working on this website for a client. One of the features this client requires is the ability to pay for services via PayPal. They have created a Buy Now button and submitted to me the code from said button. The client would also like for some additional information not needed by PayPal to be emailed to them. Currently my form code looks like this: <form action="service.php" method="post" name="register" onSubmit="document.location='thankyou.htm';"> <?php $fName = $_POST['fName']; $lName = $_POST['lName']; $email = $_POST['email']; $cEmail = $_POST['cEmail']; $phone = $_POST['tele']; $pickUp = $_POST['pickUp']; $dropOff = $_POST['dropOff']; $date = $_POST['date']; $service = $_POST['service']; $instruct = $_POST['instruct']; $human = $_POST['human']; $thankyou = 'thankyou.htm'; $from = 'From: Joyful Xpressions'; $to = 'feliciaharried@yahoo.com'; $subject = 'Service Request'; $body = "From: $fName $lName\n E-Mail: $email\n Phone: $phone\n \n Pick Up Location: $pickUp\n Drop Off Location: $dropOff\n Pick Up Date: $date\n \n Service Requested: $service\n \n Special Instructions: $instruct"; ?> <h2>Register</h2> <p>Give us a try! Use this form to sign up for your first FREE pick up. Enter your information below and submit. You will get a Paypal button which allows you to select the service you want and proceed to Paypal's secure payment page to process your payment. You may be asked to enter some information again.</p> <hr/> <fieldset> <legend>Personal Information</legend> <label for="fName">First Name: </label> <input autocomplete="on" autofocus name="fName" placeholder="First Name" required type="text" /> <br/> <label for="lName">Last Name: </label> <input autocomplete="on" name="lName" placeholder="Last Name" required type="text" /> <br/> <label for="email">Email: </label> <input autocomplete="on" name="email" placeholder="john.doe@example.com" required type="email" /> <br/> <label for="cEmail">Confirm Email: </label> <input autocomplete="off" name="cEmail" placeholder="john.doe@example.com" required type="email" /> <br/> <label for="tele">Phone: </label> <input autocomplete="on" name="tele" placeholder="555-555-5555" required type="tel" /> </fieldset> <br/> <br/> <fieldset> <legend>Service Request</legend> <label for="pickUp">Complete Address for Pickup: </label> <textarea cols="20" name="pickUp" placeholder="Please enter your desired pickup location." required rows="3"></textarea> <br/> <label for="dropOff">Complete Address for Delivery: </label> <textarea cols="20" name="dropOff" placeholder="Please enter your desired drop off location." required rows="3"></textarea> <br/> <label for="date">Pickup Date: </label> <input autocomplete="off" min="2013-01-01" name="date" required type="date" /> <br/> <label for="service">Chore: </label> <select name="service"> <option value="1 Bag">1 Bag $35.00 USD</option> <option value="2 Bags">2 Bags $65.00 USD</option> <option value="Express Service">Express Service $15.00 USD</option> <option value="King Comforter">King Comforter $20.00 USD</option> <option value="Queen Comforter">Queen Comforter $15.00 USD</option> </select> <br/> </fieldset> <br/> <br/> <fieldset> <legend>Special Intructions</legend> <textarea cols="70" name="instruct" placeholder="Please enter any special instructions you may have regarding your service request here." rows="10"></textarea> <br/> </fieldset> <br/> <br/> <fieldset> <label>*What is 2+2? (Anti-spam)</label> <input name="human" placeholder="Type Here"> <br/> <br/> <input type="hidden" name="return" value="http://expressyourchores.com/thankyou.htm" /> <input id="submit" type="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" /> </fieldset> <br/> <? if ($_POST['submit'] && $human == '4') { if (mail ($to, $subject, $body, $from)) { echo '<p>Test Failed</p>'; } else { echo '<p>Something went wrong, go back and try again!</p>'; } } else if ($_POST['submit'] && $human != '4') { echo '<p>You answered the anti-spam question incorrectly!</p>'; } ?> </form> I have tried several different methods of submitting the email the redirecting to a Thank You page which contains the PayPal Buy Now button form. and none of my redirects have worked. I have also scoured the internet looking for ways to complete both tasks through one form and have come up with nothing. The PayPal button form looks like this: <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick" /> <input type="hidden" name="hosted_button_id" value="VPK6MXG9XGY6L" /> <table> <tr> <td><input type="hidden" name="on0" value="Chores" /> Chores</td> </tr> <tr> <td><select name="os0"> <option value="1 Bag">1 Bag $35.00 USD</option> <option value="2 Bags">2 Bags $65.00 USD</option> <option value="Express Service">Express Service $15.00 USD</option> <option value="King Comforter">King Comforter $20.00 USD</option> <option value="Queen Comforter">Queen Comforter $15.00 USD</option> </select></td> </tr> </table> <input type="hidden" name="currency_code" value="USD" /> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" /> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" /> </form> Is there any way to combine the two and accomplish both tasks through one form? If not, how could I rewrite the first form's code to redirect to the Thank You page that has the PayPal button? This project has done nothing but make me more and more frustrated. Please note that the variables and email format php code in the first form was moved into the form to place on here. Originally, that code was placed before the doctype of the page. I hope that someone can actually assist me in making this form work as it's the only thing preventing me from turning the project over to the client.
  15. Hi there. I'm a beginner so hopefully someone can help me. Say I have a paypal button on my site, that after using it to pay, takes you to a page with a download link on it that allows you to download a file on my sites server. How can I make it so that people can't just bypass the payment process by typing in the url of the download link page? I've looked into PayPal IPN but I find it hard to understand the underlying code, and wonder if there's another way. Any actual coding examples would be gratefully appreciated.
  16. <?php // Database variables $host = "localhost"; //database location $user = ""; //database username $pass = ""; //database password $db_name = ""; //database name // PayPal settings $paypal_email = 'paypal@example.com'; $return_url = 'http://example.com/payment-successful.htm'; $cancel_url = 'http://example.com/payment-cancelled.htm'; $notify_url = 'http://example.com/paypal/payments.php'; $item_name = 'Test Item'; //<----- this is my problem These are static variables set in the code I want to pass them from whatever the user selects in their shopping cart. $item_amount = 5.00; //<----- this is my problem // Include Functions include("functions.php"); //Database Connection $link = mysql_connect($host, $user, $pass); mysql_select_db($db_name); // Check if paypal request or response if (!isset($_POST["txn_id"]) && !isset($_POST["txn_type"])){ // Firstly Append paypal account to querystring $querystring .= "?business=".urlencode($paypal_email)."&"; // Append amount& currency (£) to quersytring so it cannot be edited in html //The item name and amount can be brought in dynamically by querying the $_POST['item_number'] variable. $querystring .= "item_name=".urlencode($item_name)."&"; $querystring .= "amount=".urlencode($item_amount)."&"; //loop for posted values and append to querystring foreach($_POST as $key => $value){ $value = urlencode(stripslashes($value)); $querystring .= "$key=$value&"; } // Append paypal return addresses $querystring .= "return=".urlencode(stripslashes($return_url))."&"; $querystring .= "cancel_return=".urlencode(stripslashes($cancel_url))."&"; $querystring .= "notify_url=".urlencode($notify_url); // Append querystring with custom field //$querystring .= "&custom=".USERID; // Redirect to paypal IPN header('location:https://www.sandbox.paypal.com/cgi-bin/webscr'.$querystring); exit(); }else{ // Response from Paypal // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i','${1}%0D%0A${3}',$value);// IPN fix $req .= "&$key=$value"; } // assign posted variables to local variables $data['item_name'] = $_POST['item_name']; $data['item_number'] = $_POST['item_number']; $data['payment_status'] = $_POST['payment_status']; $data['payment_amount'] = $_POST['mc_gross']; $data['payment_currency'] = $_POST['mc_currency']; $data['txn_id'] = $_POST['txn_id']; $data['receiver_email'] = $_POST['receiver_email']; $data['payer_email'] = $_POST['payer_email']; $data['custom'] = $_POST['custom']; // post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp($res, "VERIFIED") == 0) { // Used for debugging //@mail("you@youremail.com", "PAYPAL DEBUGGING", "Verified Response<br />data = <pre>".print_r($post, true)."</pre>"); // Validate payment (Check unique txnid & correct price) $valid_txnid = check_txnid($data['txn_id']); $valid_price = check_price($data['payment_amount'], $data['item_number']); // PAYMENT VALIDATED & VERIFIED! if($valid_txnid && $valid_price){ $orderid = updatePayments($data); if($orderid){ // Payment has been made & successfully inserted into the Database }else{ // Error inserting into DB // E-mail admin or alert user } }else{ // Payment made but data has been changed // E-mail admin or alert user } }else if (strcmp ($res, "INVALID") == 0) { // PAYMENT INVALID & INVESTIGATE MANUALY! // E-mail admin or alert user // Used for debugging //@mail("you@youremail.com", "PAYPAL DEBUGGING", "Invalid Response<br />data = <pre>".print_r($post, true)."</pre>"); } } fclose ($fp); } } ?>
  17. using paypal.class.php i can edit the amount using firebug. how to resolve it. i have attached the files. please check with the attached screen shot. after changing the amount to zero using firebug paypal-1.3.0.zip
  18. i have used paypal class file which somebody says its not safe to use this class file in payment sites. please advise on this. i have doubts regarding the paypal ipn and i have 2 files 1) paypal.class.php 2) paypal.php i am using it in localserver should i add return url in my developer paypal account. i didnt add the return url but its working fine with the below url ex: https://localhost/paypal.php?success i am getting all the response here i have attached files please check it paypal-1.3.0.zip
  19. When I use this for my payments $txt = "<form name=\"makepay\" action=\"https://www.paypal.com/uk/cgi-bin/webscr\" method=\"post\">"; No email is returned
  20. Hi Guys Anyone knows how to include paypal payment in my code? here is my code, i already created sandbox acccount my problem is how can i add that paypal integration such as API, and other stuffs thanks! in Advance!
  21. I'd like to create an application where a user can fund an account. When a user does a certain task, they will get a certain amount of their money back. If they complete all their tasks, over time, they will get all of their money back. Any suggestions as to which payment gateway to use for this? I am nervous about getting hit with a ton of transaction fees. I am thinking I could use PayPal Payments Pro so that the user can fund their account with a credit card. Whenever they complete a task, I could issue a partial refund, which would go back against their credit card. Can I even issue multiple partial refunds on the same transaction ID, though? I'm not sure. And I also don't want a bunch of transaction fees on those refunds. Maybe there is a gateway out there which would only charge a transaction fee on the original transaction? I'm thinking about changing the design. A user funds their account with their credit card, and then once they complete ALL tasks, I can issue a single refund. This would avoid the many transaction fees associated with issuing a refund per task. But in order for this to be a successful app, I think the user should get a % of their money back right away after completing each task. Any advice on which Payment Gateway to use for this? Advice, or design considerations?
  22. I successfully implemented paypal ipn on my website, I tested it on the paypal sandbox and everything worked. Then I changed the url from https://www.sandbox..../cgi-bin/webscr to https://www.paypal.com/cgi-bin/webscr. This should be standard procedure and everything should work fine. Once again, when using the sandbox provided by paypal, there are no problems. Now a few of my customers tried to buy things and nobody got there items. In my database I log everything and I logged this error: http error=Unknown SSL protocol error in connection to www.paypal.com:443 I use paypal ipn for the payment, underneath will be the ipn.php (ipn call back script that paypal will post variables to when a payment has been done) //Original source: https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt //Modified sample code by Codex-m: http://www.php-developer.org //WORKING DEMO HERE: http://www.php-developer.org/paypal_ipn_demo/ //Use your Paypal Sandbox buyer account to test. $req = 'cmd=' . urlencode('_notify-validate'); foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } //NEW CODE: using Curl instead of fsockopen $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.sandbox.paypal.com')); $res = curl_exec($ch); //assign posted variables to PHP variables $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $account=$_POST['custom']; $productname=$_POST['item_name']; $txn_type=$_POST['txn_type']; $trans_id=$_POST['transaction[0].id']; $trans_id_2=$_POST['transaction[0].id_for_sender']; //Check if any error occured if(curl_errno($ch)) { //HTTP ERROR occurred //Log error to database for troubleshooting $log='http error='.curl_error($ch); //Here the error message gets build db_write($log); //Here it gets written to the database } else { //NO HTTP ERROR OCCURRED, CLEAN //CHECK IF VERIFIED if (strcmp ($res, "VERIFIED") == 0) { I hope somebody knows what the problem is. Additional information about my webserver: ###### ApacheFriends XAMPP version 1.7.1 ###### + Apache 2.2.11 + MySQL 5.1.33 (Community Server) + PHP 5.2.9 + PEAR (Support for PHP 4 has been discontinued) + XAMPP Control Version 2.5 from www.nat32.com + XAMPP CLI Bundle 1.3 from Carsten Wiedmann + XAMPP Security 1.0 + SQLite 2.8.15 + OpenSSL 0.9.8i + phpMyAdmin 3.1.3.1 + ADOdb 5.06a + Mercury Mail Transport System v4.62 + FileZilla FTP Server 0.9.31 + Webalizer 2.01-10 + Zend Optimizer 3.3.0 + eAccelerator 0.9.5.3 for PHP 5.2.9 (but not activated in the php.ini)
  23. Tally The Total Error When I tally the total with an quantity of 2 my php calculate turn short up in php...But when I press the checkout button to paypal everything adds up correctly..... Shipment Trouble When I can add 2 or more items to my cart and checkout with paypal my shipment increase to another 10.00 dollars How would I fix that to remain 10.00? Tax calculate error the more items I add to my database my shipment changes from 0.08% to 0.02% How Would I fix these errors without any bugs ? $shipTotal="10.00"; $taxRate ="0.08"; $pricetotal = $price * $each_item['quantity']; $getTax = $price * $taxRate; $cartTotal = $pricetotal + $getTax + $shipTotal + $cartTotal ; setlocale(LC_MONETARY, "en_US"); $pricetotal = money_format("%10.2n", $pricetotal); // Dynamic Checkout Btn Assembly $x = $i + 1; $pp_checkout_btn .= '<input type="hidden" name="item_name_' . $x . '" value="' . $product_name . '"> <input type="hidden" name="amount_' . $x . '" value="' . $price . '"> <input type="hidden" name="quantity_' . $x . '" value="' . $each_item['quantity'] . '"> <input type="hidden" name="shipping_'. $x . '"value="'. $shipTotal .'"> <input type="hidden" name="tax_'. $x . '"value="'. $taxRate * $price .'"> '; // Create the product array variable $product_id_array .= "$item_id-".$each_item['quantity'].",";
  24. taking many days to figure this out: heres the code <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Booking</title> <style type="text/css"> body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: rgba(255,255,255,1); } body { background-color: #E1E8FF; background-repeat: no-repeat; background-position: center top; height: 848px; text-align: left; background-image: url(bgbooking.jpg); font-family: Arial, Helvetica, sans-serif; color: #FFF; } a:link { text-decoration: none; color: rgba(252,217,37,1); } a:visited { text-decoration: none; color: rgba(102,0,0,1); } a:hover { text-decoration: none; color: rgba(153,153,153,1); } a:active { text-decoration: none; } #apDiv1 { position:absolute; left:10px; top:48px; width:760px; height:848px; z-index:1; visibility: inherit; } #apDiv2 { position:absolute; left:29px; top:61px; width:258px; height:120px; z-index:2; } #apDiv3 { position:absolute; left:329px; top:26px; width:283px; height:87px; z-index:1; } #apDiv4 { position:absolute; left:325px; top:114px; width:702px; height:22px; z-index:2; text-align: right; background-color: #333399; border-radius: 9px 9px 0px 0px; } #apDiv5 { position:absolute; left:308px; top:186px; width:429px; height:46px; z-index:3; } #apDiv6 { position:absolute; left:751px; top:217px; width:266px; z-index:4; color: rgba(255,255,255,1); padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; height: 288px; background-color: rgba(0,0,0,0.5); text-align: center; border-radius: 15px 15px 0px 0px; } #apDiv7 { position:absolute; left:329px; top:217px; width:398px; height:298px; z-index:5; text-align: center; } #apDiv8 { position:absolute; left:303px; top:594px; width:270px; height:74px; z-index:6; text-align: center; } </style> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css"> <style type="text/css"> #apDiv9 { position:absolute; left:325px; top:137px; width:703px; height:3px; z-index:7; background-color: #CB00CB; } #apDiv10 { position:absolute; left:324px; top:164px; width:412px; height:44px; z-index:8; } #apDiv11 { position:absolute; left:317px; top:602px; width:700px; height:134px; z-index:9; } #apDiv12 { position:absolute; left:2px; top:596px; width:693px; height:119px; z-index:9; background-color: rgba(0,0,0,.4); text-align: center; color: #FFF; border-radius: 15px 15px; } #apDiv13 { position:absolute; left:325px; top:141px; width:703px; height:2000px; z-index:1;font-size: 27px; background-color: rgba(0,0,0,.5); color: #FFF; } #apDiv14 { position:absolute; left:385px; top:883px; width:564px; height:24px; z-index:10; color: #003; text-align: center; } .f { font-weight: bold; } .f { font-weight: bold; } #apDiv14 p { font-weight: bold; } #apDiv15 { position:absolute; left:328px; top:169px; width:384px; height:32px; z-index:11; color: #FFF; font-family: Arial, Helvetica, sans-serif; font-size: 27px; text-shadow: 3px 3px 3px rgba(0,0,0,1); font-style: oblique; } #apDiv13 p { color: #FFFFFF; padding-left: 5px; text-indent: 10px; font-weight: bold; } #apDiv16 { position:absolute; width:191px; height:871px; z-index:12; left: 423px; top: 17px; overflow: auto; } </style> <link rel="stylesheet" type="text/css" href="../config/jamstyle.css" /> <style type="text/css"> .style1 { border-width: 0px; } #apDiv17 { position:absolute; left:40px; top:159px; width:317px; height:49px; z-index:8; font-size: 24px; font-style: italic; } head { font-size: 24px;font-weight: normal; } .headin { font-size: 27px; text-shadow: 2px 2px 2px rgba(0,0,0,1); left: 4px; font-style: italic; font-family:tahoma; font-weight: normal; color: rgba(255,153,0,1); text-align: left; } .reservation tbody tr td .headin { font-style: italic; font-weight: normal; } .reservation tr td h4 { font-style: italic; color: rgba(255,153,0,1); font-size: 16px; text-align: center; } #apDiv18 { position:absolute; width:238px; height:115px; z-index:8; left: 769px; top: 161px; } </style> <script type="text/javascript"> function check_email(z) { var x = document.getElementById(z); var y = document.getElementById('email'); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if(y.value == x.value && filter.test(y.value)){ document.getElementById('emailvalidation').innerHTML = ''; x.style.backgroundColor = '#77DE6B'; y.style.backgroundColor = '#77DE6B'; }else{ document.getElementById('emailvalidation').innerHTML = 'Invalid email'; x.style.backgroundColor = '#F44D00'; y.style.backgroundColor = '#F44D00'; } } function show_fields(x) { var ob = document.getElementById(x); if(ob.style.display == "none"){ ob.style.display = "block"; }else{ ob.style.display = "none"; arrChildren = ob.childNodes; for(i = 0; i < arrChildren.length; i++) { objChild = arrChildren; objChild.value = "0"; } add_total(); } add_total(); } function add_total() { var ttotal = 0.00; var tour = document.getElementsByName("tour[]");  if(tour.item(0).checked) { ttotal += parseInt(document.getElementById("tour0a").value) * parseInt(35.00); ttotal += parseInt(document.getElementById("tour0c").value) * parseInt(35.00); document.getElementById("tour0b").value = 1; } else { document.getElementById("tour0a").value = 0; document.getElementById("tour0b").value = 0; document.getElementById("tour0c").value = 0; } if(tour.item(1).checked) { ttotal += parseInt(document.getElementById("tour1a").value) * parseInt(65.00); ttotal += parseInt(document.getElementById("tour1c").value) * parseInt(65.00); document.getElementById("tour1b").value = 1; } else { document.getElementById("tour1a").value = 0; document.getElementById("tour1b").value = 0; document.getElementById("tour1c").value = 0; } if(tour.item(2).checked) { ttotal += parseInt(document.getElementById("tour2a").value) * parseInt(60.00); ttotal += parseInt(document.getElementById("tour2c").value) * parseInt(60.00); } else { document.getElementById("tour2a").value = 0; document.getElementById("tour2c").value = 0; } if(tour.item(3).checked) { ttotal += parseInt(document.getElementById("tour3a").value) * parseInt(50.00); ttotal += parseInt(document.getElementById("tour3c").value) * parseInt(50.00); } else { document.getElementById("tour3a").value = 0; document.getElementById("tour3c").value = 0; } if(tour.item(4).checked) { ttotal += parseInt(document.getElementById("tour4a").value) * parseInt(45.00); ttotal += parseInt(document.getElementById("tour4c").value) * parseInt(45.00); } else { document.getElementById("tour4a").value = 0; document.getElementById("tour4c").value = 0; } if(tour.item(5).checked) { ttotal += parseInt(document.getElementById("tour5a").value) * parseInt(45.00); ttotal += parseInt(document.getElementById("tour5c").value) * parseInt(45.00); } else { document.getElementById("tour5a").value = 0; document.getElementById("tour5c").value = 0; } if(tour.item(6).checked) { ttotal += parseInt(document.getElementById("tour6a").value) * parseInt(72.00); ttotal += parseInt(document.getElementById("tour6c").value) * parseInt(50.00); } else { document.getElementById("tour6a").value = 0; document.getElementById("tour6c").value = 0; } if(tour.item(7).checked) { ttotal += parseInt(document.getElementById("tour7a").value) * parseInt(45.00); ttotal += parseInt(document.getElementById("tour7c").value) * parseInt(30.00); } else { document.getElementById("tour7a").value = 0; document.getElementById("tour7c").value = 0; } if(tour.item( .checked) { ttotal += parseInt(document.getElementById("tour8a").value) * parseInt(30.00); ttotal += parseInt(document.getElementById("tour8c").value) * parseInt(20.00); } else { document.getElementById("tour8a").value = 0; document.getElementById("tour8c").value = 0; } if(tour.item(9).checked) { ttotal += parseInt(document.getElementById("tour9a").value) * parseInt(340.00); ttotal += parseInt(document.getElementById("tour9c").value) * parseInt(0.00); } else { document.getElementById("tour9a").value = 0; document.getElementById("tour9c").value = 0; } if(tour.item(10).checked) { ttotal += parseInt(document.getElementById("tour10a").value) * parseInt(59.00); ttotal += parseInt(document.getElementById("tour10c").value) * parseInt(59.00); } else { document.getElementById("tour10a").value = 0; document.getElementById("tour10c").value = 0; } if(tour.item(11).checked) { ttotal += parseInt(document.getElementById("tour11a").value) * parseInt(143.00); ttotal += parseInt(document.getElementById("tour11c").value) * parseInt(125.00); } else { document.getElementById("tour11a").value = 0; document.getElementById("tour11c").value = 0; } if(tour.item(12).checked) { ttotal += parseInt(document.getElementById("tour12a").value) * parseInt(204.00); ttotal += parseInt(document.getElementById("tour12c").value) * parseInt(186.00); } else { document.getElementById("tour12a").value = 0; document.getElementById("tour12c").value = 0; } if(tour.item(13).checked) { ttotal += parseInt(document.getElementById("tour13a").value) * parseInt(84.00); ttotal += parseInt(document.getElementById("tour13c").value) * parseInt(73.00); } else { document.getElementById("tour13a").value = 0; document.getElementById("tour13c").value = 0; } if(tour.item(14).checked) { ttotal += parseInt(document.getElementById("tour14a").value) * parseInt(35.00); ttotal += parseInt(document.getElementById("tour14c").value) * parseInt(24.00); } else { document.getElementById("tour14a").value = 0; document.getElementById("tour14c").value = 0; } if(tour.item(15).checked) { ttotal += parseInt(document.getElementById("tour15a").value) * parseInt(52.00); ttotal += parseInt(document.getElementById("tour15c").value) * parseInt(37.00); } else { document.getElementById("tour15a").value = 0; document.getElementById("tour15c").value = 0; } if(tour.item(16).checked) { ttotal += parseInt(document.getElementById("tour16a").value) * parseInt(49.00); ttotal += parseInt(document.getElementById("tour16c").value) * parseInt(32.00); } else { document.getElementById("tour16a").value = 0; document.getElementById("tour16c").value = 0; } if(tour.item(17).checked) { ttotal += parseInt(document.getElementById("tour17a").value) * parseInt(51.00); ttotal += parseInt(document.getElementById("tour17c").value) * parseInt(42.00); } else { document.getElementById("tour17a").value = 0; document.getElementById("tour17c").value = 0; } if(tour.item(18).checked) { ttotal += parseInt(document.getElementById("tour18a").value) * parseInt(69.00); ttotal += parseInt(document.getElementById("tour18c").value) * parseInt(58.00); } else { document.getElementById("tour18a").value = 0; document.getElementById("tour18c").value = 0; } if(tour.item(19).checked) { ttotal += parseInt(document.getElementById("tour19a").value) * parseInt(77.00); ttotal += parseInt(document.getElementById("tour19c").value) * parseInt(64.00); } else { document.getElementById("tour19a").value = 0; document.getElementById("tour19c").value = 0; } if(tour.item(20).checked) { ttotal += parseInt(document.getElementById("tour20a").value) * parseInt(67.00); ttotal += parseInt(document.getElementById("tour20c").value) * parseInt(55.00); } else { document.getElementById("tour20a").value = 0; document.getElementById("tour20c").value = 0; } if(tour.item(21).checked) { ttotal += parseInt(document.getElementById("tour21a").value) * parseInt(52.00); ttotal += parseInt(document.getElementById("tour21c").value) * parseInt(37.00); } else { document.getElementById("tour21a").value = 0; document.getElementById("tour21c").value = 0; } if(tour.item(22).checked) { ttotal += parseInt(document.getElementById("tour22a").value) * parseInt(74.00); ttotal += parseInt(document.getElementById("tour22c").value) * parseInt(62.00); } else { document.getElementById("tour22a").value = 0; document.getElementById("tour22c").value = 0; } if(tour.item(23).checked) { ttotal += parseInt(document.getElementById("tour23a").value) * parseInt(0.00); ttotal += parseInt(document.getElementById("tour23c").value) * parseInt(0.00); } else { document.getElementById("tour23a").value = 0; document.getElementById("tour23c").value = 0; } if(tour.item(24).checked) { ttotal += parseInt(document.getElementById("tour24a").value) * parseInt(45.00); ttotal += parseInt(document.getElementById("tour24c").value) * parseInt(30.00); } else { document.getElementById("tour24a").value = 0; document.getElementById("tour24c").value = 0; } if(tour.item(25).checked) { ttotal += parseInt(document.getElementById("tour25a").value) * parseInt(70.00); ttotal += parseInt(document.getElementById("tour25c").value) * parseInt(50.00); } else { document.getElementById("tour25a").value = 0; document.getElementById("tour25c").value = 0; } if(tour.item(26).checked) { ttotal += parseInt(document.getElementById("tour26a").value) * parseInt(50.00); ttotal += parseInt(document.getElementById("tour26c").value) * parseInt(35.00); } else { document.getElementById("tour26a").value = 0; document.getElementById("tour26c").value = 0; } if(tour.item(27).checked) { ttotal += parseInt(document.getElementById("tour27a").value) * parseInt(65.00); ttotal += parseInt(document.getElementById("tour27c").value) * parseInt(50.00); } else { document.getElementById("tour27a").value = 0; document.getElementById("tour27c").value = 0; } if(tour.item(28).checked) { ttotal += parseInt(document.getElementById("tour28a").value) * parseInt(98.00); ttotal += parseInt(document.getElementById("tour28c").value) * parseInt(98.00); } else { document.getElementById("tour28a").value = 0; document.getElementById("tour28c").value = 0; } if(tour.item(29).checked) { ttotal += parseInt(document.getElementById("tour29a").value) * parseInt(125.00); ttotal += parseInt(document.getElementById("tour29c").value) * parseInt(125.00); } else { document.getElementById("tour29a").value = 0; document.getElementById("tour29c").value = 0; } if(tour.item(30).checked) { ttotal += 80.00; ttotal += parseInt(document.getElementById("tour30a").value) * parseInt(20.00); ttotal += parseInt(document.getElementById("tour30c").value) * parseInt(20.00); document.getElementById("tour30b").value = 1; } else { document.getElementById("tour30a").value = 0; document.getElementById("tour30b").value = 0; document.getElementById("tour30c").value = 0; } if(tour.item(31).checked) { ttotal += 200.00; ttotal += parseInt(document.getElementById("tour31a").value) * parseInt(35.00); ttotal += parseInt(document.getElementById("tour31c").value) * parseInt(20.00); document.getElementById("tour31b").value = 1; } else { document.getElementById("tour31a").value = 0; document.getElementById("tour31b").value = 0; document.getElementById("tour31c").value = 0; } if(tour.item(32).checked) { ttotal += parseInt(document.getElementById("tour32a").value) * parseInt(25.00); ttotal += parseInt(document.getElementById("tour32c").value) * parseInt(15.00); } else { document.getElementById("tour32a").value = 0; document.getElementById("tour32c").value = 0; } if(tour.item(33).checked) { ttotal += parseInt(document.getElementById("tour33a").value) * parseInt(8.00); ttotal += parseInt(document.getElementById("tour33c").value) * parseInt(0.00); } else { document.getElementById("tour33a").value = 0; document.getElementById("tour33c").value = 0; } if(tour.item(34).checked) { ttotal += parseInt(document.getElementById("tour34a").value) * parseInt(0.00); ttotal += parseInt(document.getElementById("tour34c").value) * parseInt(0.00); } else { document.getElementById("tour34a").value = 0; document.getElementById("tour34c").value = 0; } if(tour.item(35).checked) { ttotal += parseInt(document.getElementById("tour35a").value) * parseInt(22.00); ttotal += parseInt(document.getElementById("tour35c").value) * parseInt(22.00); } else { document.getElementById("tour35a").value = 0; document.getElementById("tour35c").value = 0; } if(tour.item(36).checked) { ttotal += parseInt(document.getElementById("tour36a").value) * parseInt(38.00); ttotal += parseInt(document.getElementById("tour36c").value) * parseInt(38.00); } else { document.getElementById("tour36a").value = 0; document.getElementById("tour36c").value = 0; } if(tour.item(37).checked) { ttotal += parseInt(document.getElementById("tour37a").value) * parseInt(98.00); ttotal += parseInt(document.getElementById("tour37c").value) * parseInt(98.00); } else { document.getElementById("tour37a").value = 0; document.getElementById("tour37c").value = 0; } if(tour.item(38).checked) { ttotal += parseInt(document.getElementById("tour38a").value) * parseInt(125.00); ttotal += parseInt(document.getElementById("tour38c").value) * parseInt(125.00); } else { document.getElementById("tour38a").value = 0; document.getElementById("tour38c").value = 0; } if(tour.item(39).checked) { ttotal += parseInt(document.getElementById("tour39a").value) * parseInt(50.00); ttotal += parseInt(document.getElementById("tour39c").value) * parseInt(50.00); } else { document.getElementById("tour39a").value = 0; document.getElementById("tour39c").value = 0; } if(tour.item(40).checked) { ttotal += parseInt(document.getElementById("tour40a").value) * parseInt(65.00); ttotal += parseInt(document.getElementById("tour40c").value) * parseInt(50.00); } else { document.getElementById("tour40a").value = 0; document.getElementById("tour40c").value = 0; } if(tour.item(41).checked) { ttotal += parseInt(document.getElementById("tour41a").value) * parseInt(40.00); ttotal += parseInt(document.getElementById("tour41c").value) * parseInt(40.00); } else { document.getElementById("tour41a").value = 0; document.getElementById("tour41c").value = 0; } if(tour.item(42).checked) { ttotal += parseInt(document.getElementById("tour42a").value) * parseInt(51.00); ttotal += parseInt(document.getElementById("tour42c").value) * parseInt(51.00); } else { document.getElementById("tour42a").value = 0; document.getElementById("tour42c").value = 0; } if(tour.item(43).checked) { ttotal += parseInt(document.getElementById("tour43a").value) * parseInt(30.00); ttotal += parseInt(document.getElementById("tour43c").value) * parseInt(15.00); } else { document.getElementById("tour43a").value = 0; document.getElementById("tour43c").value = 0; } if(tour.item(44).checked) { ttotal += parseInt(document.getElementById("tour44a").value) * parseInt(55.00); ttotal += parseInt(document.getElementById("tour44c").value) * parseInt(35.00); } else { document.getElementById("tour44a").value = 0; document.getElementById("tour44c").value = 0; } if(tour.item(45).checked) { ttotal += parseInt(document.getElementById("tour45a").value) * parseInt(35.00); ttotal += parseInt(document.getElementById("tour45c").value) * parseInt(17.00); } else { document.getElementById("tour45a").value = 0; document.getElementById("tour45c").value = 0; } if(tour.item(46).checked) { ttotal += parseInt(document.getElementById("tour46a").value) * parseInt(30.00); ttotal += parseInt(document.getElementById("tour46c").value) * parseInt(20.00); } else { document.getElementById("tour46a").value = 0; document.getElementById("tour46c").value = 0; } if(tour.item(47).checked) { ttotal += parseInt(document.getElementById("tour47a").value) * parseInt(45.00); ttotal += parseInt(document.getElementById("tour47c").value) * parseInt(45.00); } else { document.getElementById("tour47a").value = 0; document.getElementById("tour47c").value = 0; } if(tour.item(48).checked) { ttotal += parseInt(document.getElementById("tour48a").value) * parseInt(59.00); ttotal += parseInt(document.getElementById("tour48c").value) * parseInt(40.00); } else { document.getElementById("tour48a").value = 0; document.getElementById("tour48c").value = 0; } if(tour.item(49).checked) { ttotal += parseInt(document.getElementById("tour49a").value) * parseInt(72.00); ttotal += parseInt(document.getElementById("tour49c").value) * parseInt(72.00); } else { document.getElementById("tour49a").value = 0; document.getElementById("tour49c").value = 0; } if(tour.item(50).checked) { ttotal += parseInt(document.getElementById("tour50a").value) * parseInt(98.00); ttotal += parseInt(document.getElementById("tour50c").value) * parseInt(98.00); } else { document.getElementById("tour50a").value = 0; document.getElementById("tour50c").value = 0; } if(tour.item(51).checked) { ttotal += parseInt(document.getElementById("tour51a").value) * parseInt(125.00); ttotal += parseInt(document.getElementById("tour51c").value) * parseInt(125.00); } else { document.getElementById("tour51a").value = 0; document.getElementById("tour51c").value = 0; } if(tour.item(52).checked) { ttotal += parseInt(document.getElementById("tour52a").value) * parseInt(70.00); ttotal += parseInt(document.getElementById("tour52c").value) * parseInt(55.00); } else { document.getElementById("tour52a").value = 0; document.getElementById("tour52c").value = 0; } if(tour.item(53).checked) { ttotal += parseInt(document.getElementById("tour53a").value) * parseInt(95.00); ttotal += parseInt(document.getElementById("tour53c").value) * parseInt(67.00); } else { document.getElementById("tour53a").value = 0; document.getElementById("tour53c").value = 0; } if(tour.item(54).checked) { ttotal += parseInt(document.getElementById("tour54a").value) * parseInt(40.00); ttotal += parseInt(document.getElementById("tour54c").value) * parseInt(30.00); } else { document.getElementById("tour54a").value = 0; document.getElementById("tour54c").value = 0; } document.getElementById("total").innerHTML = ttotal.toFixed(2); document.getElementById("deposit").innerHTML = (ttotal/5).toFixed(2); } function clear_all() { var tour = document.getElementsByName("tour[]"); for(var i = 0; i < tour.length;i++){ tour.item(i).checked = false; document.getElementById("div"+i).style.display = "none"; document.getElementById("tour"+i+"a").value = 0; document.getElementById("tour"+i+"c").value = 0; } document.getElementById("total").innerHTML = 0.00; document.getElementById("deposit").innerHTML = 0.00; } function init(){ var tour = document.getElementsByName("tour[]"); var none = 0.0; for(var i = 0; i < tour.length;i++){ var a = document.getElementById("tour"+i+"a") var c = document.getElementById("tour"+i+"c") if(parseInt(a.value) > 0 || parseInt(c.value) > 0){ tour.item(i).checked = true; document.getElementById("div"+i).style.display = "block"; } } document.getElementById("total").innerHTML = none; document.getElementById("deposit").innerHTML = none; } </script> </head> <body bgcolor="#CCCCCC" leftmargin="29px" topmargin="61px" marginwidth="258px" marginheight="120px"> <div id="apDiv18"> <div align="right"></div> <div align="right"><img src="funcation_vansm.png" alt="funcation" width="200" height="136"> </div> <div align="right"></div> </div> <div id="apDiv3"><img src="funcation2.png" width="267" height="71" alt="jamaica funcation"></div> <div id="apDiv4"> <ul id="MenuBar1" class="MenuBarHorizontal"> <li><a href="http://www.-.com/fun...ion">home</a> </li> <li><a href="http://www.-.com/fun...events</a></li> <li><a href="http://www.-.com/tou...rs</a> </li> <li><a href="http://www.-.com/faq...">faqs</a></li> <li><a href="http://www.-.com/boo...ooking</a></li> <li><a href="http://www.-.com/con...ontact</a></li> </ul> </div> <div id="apDiv9"></div> <div id="apDiv13"> <form action="https://www.paypal.c...cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="cueb.jb@gmail.com"> <table width="100%" class="reservation"> <tbody> <tr> <td colspan="2" align="center"> <p align="left"> <span class="headin"><font color="ffffff"> TOUR BOOKING </span></p></font><BR> <p align="left">Thank you for choosing Funcation Island Tours & Events. <br>We are committed to ensuring superb customer service, safety and FUN! <br> Please fill out the following or <a href="http://www.-.com/tou...tours"><B><font color="orange">CUSTOMIZE YOUR VACATION</font></B></a> <br> <br> </p> </td> </tr> <tr> <td colspan="2"> <label>Name: <input type="text" name="name" id="name" class="input" value="" size="30" /></label> </td> </tr> <tr> <td> <div id="emailvalidation"> </div> <label>Email:: <input type="text" name="email" id="email" class="input" value="" size="30" /></label> <br> </td> <td valign="bottom"><label>How did you hear about Funcation?: </label> </td> </tr> <tr> <td> <label>Contact #: <input type="text" name="contact" id="contact" class="input" value="" size="30" /></label> </td> <td> <label> <input type="text" name="referral" id="referral" class="input" value="" size="45" /></label></td> </tr> </td> <td> <label>Date of Tour: <input type="text" name="dateoftour" id="dateoftour" class="input" value="" size="30" /></label> </td> <td> <label>Alt Contact #: <input type="text" name="contact2" id="contact2" class="input" value="" size="30" /></label></td> </tr> <tr> <tr> <td colspan="2"> <label><br> Additional cost (Optional:) Transportation service from airport to your villa / hotel. If needed, please include the following: <br> Arrival date, Time and pickup location<br> <input type="text" name="transportationdetails_airport" id="travelers" class="input" value="" size="100" /></label> </td> <tr> <td colspan="2"> <h2 align="left"><br> Choose your tour/s below </h2> <span class="headin">OCHO RIOS</span><BR> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="62" value= "tour" onclick="show_fields('div0')" /> Dunns River Falls - - Round trip transportation from hotel - - $35 per person </label> <div id="div0" class="prices" style="display:none"> number of <input type="text" value="0" class="input" name="tour0a" id="tour0a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour0c" id="tour0c" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour0b" id="tour0b" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="63" value= "tour" onclick="show_fields('div1')" /> Dunns River Falls and River Rafting - - Round trip transportation from hotel - - $65 per person </label> <div id="div1" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour1a" id="tour1a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour1c" id="tour1c" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour1b" id="tour1b" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="15" value= "tour" onclick="show_fields('div2')" /> Dunns River Falls and River Tubing - - Round trip transportation from hotel - - $60 per person </label> <div id="div2" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour2a" id="tour2a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour2c" id="tour2c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="16" value= "tour" onclick="show_fields('div3')" /> Dunns River Falls and Ocho Rios Sightseeing - - Round trip transportation from hotel - - $45 per person </label> <div id="div3" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour3a" id="tour3a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour3c" id="tour3c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="18" value= "tour" onclick="show_fields('div4')" /> Dunns River Falls and Reggae Beach - - Round trip transportation from hotel - - $45 per person </label> <div id="div4" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour4a" id="tour4a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour4c" id="tour4c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="17" value= "tour" onclick="show_fields('div5')" /><strong><a href="http://www.-.com/tou...om/tours"><font color="#ffffff">**</font><font color="#FFFF00">DUNNS RIVER TOUR PACKAGE</FONT><font color="#ffffff">**</font></a></strong></font> - - $75 per person </label> <div id="div5" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour5a" id="tour5a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour5c" id="tour5c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="20" value= "tour" onclick="show_fields('div6')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div6" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour6a" id="tour6a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour6c" id="tour6c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="19" value= "tour" onclick="show_fields('div7')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div7" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour7a" id="tour7a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour7c" id="tour7c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="21" value= "tour" onclick="show_fields('div8')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div8" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour8a" id="tour8a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour8c" id="tour8c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="31" value= "tour" onclick="show_fields('div9')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div9" class="prices" style="display:none">Number of boat (1-4 people) required: <input type="text" value="0" class="input" name="tour9a" id="tour9a" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour9c" id="tour9c" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="24" value= "tour" onclick="show_fields('div10')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div10" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour10a" id="tour10a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour10c" id="tour10c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="27" value= "tour" onclick="show_fields('div11')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div11" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour11a" id="tour11a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour11c" id="tour11c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="26" value= "tour" onclick="show_fields('div12')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div12" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour12a" id="tour12a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour12c" id="tour12c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="25" value= "tour" onclick="show_fields('div13')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div13" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour13a" id="tour13a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour13c" id="tour13c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="33" value= "tour" onclick="show_fields('div14')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div14" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour14a" id="tour14a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour14c" id="tour14c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="34" value= "tour" onclick="show_fields('div15')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div15" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour15a" id="tour15a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour15c" id="tour15c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="30" value= "tour" onclick="show_fields('div16')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div16" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour16a" id="tour16a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour16c" id="tour16c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="28" value= "tour" onclick="show_fields('div17')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div17" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour17a" id="tour17a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour17c" id="tour17c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="29" value= "tour" onclick="show_fields('div18')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div18" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour18a" id="tour18a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour18c" id="tour18c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="32" value= "tour" onclick="show_fields('div19')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div19" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour19a" id="tour19a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour19c" id="tour19c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label><br><span class="headin">NEGRIL</span><br> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="36" value= "tour" onclick="show_fields('div20')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div20" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour20a" id="tour20a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour20c" id="tour20c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="35" value= "tour" onclick="show_fields('div21')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div21" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour21a" id="tour21a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour21c" id="tour21c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="37" value= "tour" onclick="show_fields('div22')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div22" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour22a" id="tour22a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour22c" id="tour22c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="38" value= "tour" onclick="show_fields('div23')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div23" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour23a" id="tour23a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour23c" id="tour23c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="39" value= "tour" onclick="show_fields('div24')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div24" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour24a" id="tour24a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour24c" id="tour24c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="40" value= "tour" onclick="show_fields('div25')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div25" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour25a" id="tour25a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour25c" id="tour25c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="41" value= "tour" onclick="show_fields('div26')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div26" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour26a" id="tour26a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour26c" id="tour26c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="42" value= "tour" onclick="show_fields('div27')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div27" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour27a" id="tour27a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour27c" id="tour27c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="69" value= "tour" onclick="show_fields('div28')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div28" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour28a" id="tour28a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour28c" id="tour28c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="72" value= "tour" onclick="show_fields('div29')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div29" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour29a" id="tour29a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour29c" id="tour29c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="53" value= "tour" onclick="show_fields('div30')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div30" class="prices" style="display:none">Additional (<b>ontop</b> of the included 1-4 People) Adults: <input type="text" value="0" class="input" name="tour30a" id="tour30a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour30c" id="tour30c" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour30b" id="tour30b" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="43" value= "tour" onclick="show_fields('div31')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div31" class="prices" style="display:none">Additional (<b>ontop</b> of the included 1-4 People) Adults: <input type="text" value="0" class="input" name="tour31a" id="tour31a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour31c" id="tour31c" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour31b" id="tour31b" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="46" value= "tour" onclick="show_fields('div32')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div32" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour32a" id="tour32a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour32c" id="tour32c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="44" value= "tour" onclick="show_fields('div33')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div33" class="prices" style="display:none">Number of person10yrs old & up required: <input type="text" value="0" class="input" name="tour33a" id="tour33a" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour33c" id="tour33c" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="80" value= "tour" onclick="show_fields('div34')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div34" class="prices" style="display:none">Number of person under 10 required: <input type="text" value="0" class="input" name="tour34a" id="tour34a" size="2" onchange="add_total()" /> <input type="hidden" value="0" class="input" name="tour34c" id="tour34c" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="48" value= "tour" onclick="show_fields('div35')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div35" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour35a" id="tour35a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour35c" id="tour35c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="49" value= "tour" onclick="show_fields('div36')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div36" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour36a" id="tour36a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour36c" id="tour36c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="67" value= "tour" onclick="show_fields('div37')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div37" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour37a" id="tour37a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour37c" id="tour37c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="70" value= "tour" onclick="show_fields('div38')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div38" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour38a" id="tour38a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour38c" id="tour38c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="11" value= "tour" onclick="show_fields('div39')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div39" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour39a" id="tour39a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour39c" id="tour39c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="50" value= "tour" onclick="show_fields('div40')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div40" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour40a" id="tour40a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour40c" id="tour40c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="51" value= "tour" onclick="show_fields('div41')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div41" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour41a" id="tour41a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour41c" id="tour41c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="52" value= "tour" onclick="show_fields('div42')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div42" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour42a" id="tour42a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour42c" id="tour42c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="54" value= "tour" onclick="show_fields('div43')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div43" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour43a" id="tour43a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour43c" id="tour43c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="55" value= "tour" onclick="show_fields('div44')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div44" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour44a" id="tour44a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour44c" id="tour44c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="60" value= "tour" onclick="show_fields('div45')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div45" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour45a" id="tour45a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour45c" id="tour45c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="56" value= "tour" onclick="show_fields('div46')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div46" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour46a" id="tour46a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour46c" id="tour46c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="45" value= "tour" onclick="show_fields('div47')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div47" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour47a" id="tour47a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour47c" id="tour47c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="79" value= "tour" onclick="show_fields('div48')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div48" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour48a" id="tour48a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour48c" id="tour48c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="14" value= "tour" onclick="show_fields('div49')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div49" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour49a" id="tour49a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour49c" id="tour49c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="68" value= "tour" onclick="show_fields('div50')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div50" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour50a" id="tour50a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour50c" id="tour50c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="71" value= "tour" onclick="show_fields('div51')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div51" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour51a" id="tour51a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour51c" id="tour51c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="57" value= "tour" onclick="show_fields('div52')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div52" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour52a" id="tour52a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour52c" id="tour52c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="58" value= "tour" onclick="show_fields('div53')" />Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div53" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour53a" id="tour53a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour53c" id="tour53c" size="2" onchange="add_total()" /></div> </div> <div class="divtours"><label> <input type="checkbox" value="unchecked" class="input" name="tour[]" id="61" value= "tour" onclick="show_fields('div54')" /> Round trip transportation from Waikiki - - Adult: $85.00 Child 2-11 yrs: $75.45 </label> <div id="div54" class="prices" style="display:none">Adults: <input type="text" value="0" class="input" name="tour54a" id="tour54a" size="2" onchange="add_total()" /> Children: <input type="text" value="0" class="input" name="tour54c" id="tour54c" size="2" onchange="add_total()" /></div> </div> <p> </p> </td> </tr> <tr> <td style="height: 92px"> <p>(Optional) Additional Information <textarea id="addinfo" name="addinfo" rows="5" cols="40"></textarea> <table border="0" cellpadding="10" cellspacing="0" align="right"> <tr><td align="right"><label>Total: USD$</label></td><td id="total" name="total"></td></tr> <tr><td align="right"><label>Deposit: USD$ </label></td><td id="deposit" name="deposit"></td></tr> <tr><td align="right"> <p class="submit" align="right"> <input type="submit" name="submit" id="submit" value="Book Now"> </p></td></tr> <tr><td align="center"> </td></tr></table></p> <img src="paypal-logo.png" width="129" style="float: left" height="108"border="0" ></a></td> <td style="height: 92px"> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody> </table> </form> <script type="text/javascript"> </script> </body> </html>
  25. Hello everyone, I'm having a real issue here with getting a paypal IPN to update the database. When I sandbox tested the IPN it connected successfully but when I used the sandbox to fake a real world transaction the database doesn't get updated. Here's the code for the form that I send to paypal. <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="private@yahoo.com"> <input type="hidden" name="item_name" value="private.com Lifetime Membership"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="amount" value="7.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="hidden" name="return" value="http://private.com/login.php"> <input type="hidden" name="cancel_return" value="http://private.com"> <input type="hidden" name="rm" value="2"> <input type="hidden" name="notify_url" value="http://private.com/ipn.php" /> <input type="hidden" name="custom" value="<?php echo $_SESSION['username']; ?>"> <input type="submit" value="Activate Lifetime Membership"> </form> Here is the IPN code. <?php // Connect to database require 'config.php'; // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $username = $_POST['custom']; // Identify User if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { if ($payment_status=='Completed'){ $txn_id_check = mysql_query("SELECT 'txn_id' FROM 'log' WHERE 'txn_id'='".$txn_id."'"); if (mysql_num_rows($txn_id_check) !=1){ if ($receiver_email=='private@email.com'){ if ($payment_amount=='7.00' && $payment_currency=='USD'){ // add txn_id to database $log_query = mysql_query("INSERT INTO 'log' VALUES ('','".$txn_id."','".$payer_email."')"); // update premium to 1 $update_premium = mysql_query("UPDATE 'members' SET premium='1' WHERE 'username'='".$username."'"); } } } } } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } } fclose ($fp); } ?> No matter what I have tried via scouring various search engines and forums I can not seem to find an answer to why this set up is not updating the databases. If anyone could please help I would appreciate it, this little snag is the only thing holding me back from launching the site. I should note that I am a rather novice coder so please do provide examples. Thank you much, Nightasy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.