Remove delivery address from Paypal checkout? - paypal

I have a Paypal form on my website, but for some reason when the user goes to the checkout Page on Paypal's website, it shows their 'delivery address'. Does anyone know how I can remove this? Thank you
<section style="background-color:white;border-radius:25px;"
id="three" class="wrapper style3 special">
<div class="container 50%">
<form id="Order" name="Order"
action="https://www.paypal.com/cgi-bin/webscr" method="post">
<h2 style="color:black;">Your Page:</h2> <input type="hidden"
name="on0" value="URL" />
<input style="border:1px solid grey;" name="os0" type="text"
class="formtext" />
<br />
<br />
<br />
<h2 style="color:black;">Your Email Address:</h2>
<input type="hidden" name="on1" value="EMAIL" />
<input style="border:1px solid grey;" name="os1" type="text"
class="formtext" />
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $paypalemail; ?>">
<input type="hidden" name="lc" value="U">
<input type="hidden" name="item_name" value="My Product Name">
<input type="hidden" name="amount" value="<?php echo $bronze_price; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the
seller">
<br />
<br />
<table width="50px" border="0" cellpadding="0" cellspacing="0">
<p style="color:black;">You have read and agreed to our <a style="text-
decoration:underline;" href="http://mywebsite.com/terms-of-service"
target="_blank">Terms of Service</a>
<tr onclick="document['Order'].submit()">
<td style="background-color:#3cadd4;width:5px;cursor: pointer;"><div><a
style="color:white;" href="#" onclick="document['Order'].submit()">PAY
NOW</a>
</div></td>
</tr>
</table>
<p style="color:black;">Price: $<?php echo $bronze_price; ?></p>
</form>
</div>
</section>

Please pass the parameter "no_shipping =1" in the PayPal button code and on the PayPal checkout page Delivery address will be removed.
no_shipping No
Do not prompt buyers for a shipping address.
Valid value is:
0 - Prompt for an address, but do not require one.
1 - Do not prompt for an address.
2 - Prompt for an address and require one.
Default is 0.
Refer the following link for more information about PayPal Button HTML variables: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/

Related

HTML Form Basics for PayPal Payments Standard custom fields

I'm trying to put a PayPal form on my website but I would also like to put custom fields on it.
I mean, I would like to receive the details that maybe are different from the PayPal details.
Maybe someone does a payment but wants to use a PayPal account with a different email, so I would like to know both the emails.
I would like to create a form with these fields:
First name
Last name
Personal email (not Paypal email)
and I want to be able to see these information when I receive the payment.
This is my form:
<div id="paynow" class="contact_form_invoice_payment">
<div class="invoice_payment_title">Pay your invoice here</div>
<form method="post" action="https://www.paypal.com/cgi-bin/webscr">
<input value="_xclick" name="cmd" type="hidden">
<input value="nessa#stressless.ie" name="business" type="hidden">
<input value="http://www.matrix-test.com/stressless/" name="return" type="hidden">
<input value="0" name="no_shipping" type="hidden">
<input value="1" name="no_note" type="hidden">
<input value="EUR" name="currency_code" type="hidden">
<input value="IE" name="lc" type="hidden">
<input value="PP-BuyNowBF" name="bn" type="hidden">
<input value="0" name="tax" type="hidden">
<input value="Online Payment" name="item_name" type="hidden">
<input value="OP" name="item_number" type="hidden">
<div class="first_name_invoice_payment">
First name (requiered) <br />
<input value="" name="first_name">
</div>
<div class="last_name_invoice_payment">
Last name (requiered)<br />
<input value="" name="last_name">
</div>
<div class="email_invoice_payment">
Email (requiered)<br />
<input value="" name="email">
</div>
<div class="first_name_invoice_payment">
Invoice Number (requiered)<br />
<input id="inv" value="" name="item_number">
</div>
<div class="last_name_invoice_payment">
Amount - Euro Only (requiered)<br />
<input id="amt" value="" name="amount">
</div>
<div class="job_title_invoice_payment">
<input alt="PayPal - The safer, easier way to pay online!" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" type="image" class="no-width image" style="width:auto !important; border:none; margin-top:20px;">
<img height="1" width="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" border="0" alt="">
</div>
</form>
</div>
I tried to put these fields:
name="first_name"
name="last_name"
name="email"
but I can't see them in the PayPal email and even in the PayPal backoffice.
Try using the variables below to gather the information you are looking for:
on0 = CustomerName
os0 = "Enter First and Last Name"
on1 = CustomerEmail
os1 = "Enter Email Address"
Developer: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
Your updated code would look similar to this:
<input value="CustomerName" name="on0" type="hidden">
<input value="CustomerEmail" name="on1" type="hidden">
<div class="first_name_invoice_payment">
First/Last name (requiered) <br />
<input value="" name="os0">
</div>
<div class="email_invoice_payment">
Email (requiered)<br />
<input value="" name="os1">
</div>

paypal options modify price

Was wondering if there's a way to have an drop-down option field modify a base price of an item? Something like this...
<input type="hidden" name="amount" value="$90" />
<input type="hidden" name="shipping" value="$10" />
<input type="text" name="quantity" value="1" style="width:15px;" />
<input type="hidden" name="on0" value="Options1" />
<select name="os0">
<option value="21 inches $5" >21 inches $5</option>
<option value="22 inches $5" >22 inches $5</option>
<option value="24 inches $10" >24 inches $10</option>
</select>
I'm guessing I'll have to make the amount field be a drop-down?
You can check the updated demo:
I have made a custom code to achieve base price + optional price scenario.
you will need to customise your own logic to build the amount value and pass to the amount variable and send it to paypal
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="S4X5XW328WAYY">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="test">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="currency_code" value="USD">
Base Price:<div id="base_price" value="100.00">100.00</div>
<input id="final_amount" name="amount" type="hidden" value="100">
<input type="hidden" name="weight_unit" value="lbs">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"><br>
Optional Prices
<table>
<tr><td>
<select name="os0">
<option class="optionVal" value="10.00">Option $10.00 USD</option>
<option class="optionVal" value="20.00">Option $20.00 USD</option>
<option class="optionVal" value="30.00">Option $30.00 USD</option>
</select>
</td></tr>
</table>
<input type="image" src="https://www.sandbox.paypal.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.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
JavaScript:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script>
$(document).ready(function(){
var base_price = $('#base_price').text();
$('select').change(function(){
var amt = $(this).val();
final_amt = parseInt(amt)+parseInt(base_price);
$('#final_amount').val(final_amt);
});
});
</script>

Submit a form in or out a foreach

I have a servlet webapplication with jsp related to some servlets, among them, I have this form:
<form action="MeetingDetails" method="post">
<input type="hidden" name="mtgid" value="${selectMeeting.id}"/>
<c:forEach items="${comments}" var="comment" varStatus="i">
<p><input type="hidden" name="cmtid" value="${comment.getKey()}"/>
<c:out value="${comment.getKey()}"/> - <c:out value="${comment.getValue()}"/>
<input id="minus" type="submit" name="action" value="DeleteComment"/></p>
</c:forEach>
<p>New Comment: <input type="text" name="cmt" value=""> <input id="plus" type="submit" name="action" value="AddComment"/></p>
</form>
And when I send the action:Delete to the servlet, it recieves a wrong "cmtid" value, and if I put the form within the foreach, the parameter "mtgid" value is null...
Is there anyway to do this?
Thank you.
Sorry for the inconvenient, I figured it out by:
<c:forEach items="${comments}" var="comment" varStatus="i">
<form action="MeetingDetails" method="post">
<input type="hidden" name="mtgid" value="${selectMeeting.id}"/>
<p><input type="hidden" name="cmtid" value="${comment.getKey()}"/>
<c:out value="${comment.getKey()}"/> - <c:out value="${comment.getValue()}"/>
<input id="minus" type="submit" name="action" value="DeleteComment"/></p>
</form>
</c:forEach>
<form action="MeetingDetails" method="post">
<input type="hidden" name="mtgid" value="${selectMeeting.id}"/>
<p>New Comment: <input type="text" name="cmt" value=""> <input id="plus" type="submit" name="action" value="AddComment"/></p>
</form>
I was a little obfuscated and didn't see it

Need to pass user input from 1 form to another on the same page

I am do not know .php at all but have a problem on one of my websites.
1. There are 2 forms for payment processing on a single page.
2. Each form has a separate submit button.
The problem.
I need to pass some of the user input from form one on to form two.
Note. this is on the same page.
Form 1
<input type="hidden" name="payfast_url" id="payfast_url" value="https://www."/>
<input type="hidden" name="merchant_id" id="merchant_id" value="xxxxx"/>
<input type="hidden" name="merchant_key" id="merchant_key" value="xxxxx"/>
<input type="hidden" name="return_url" id="return_url" value="payment_finished.html"/>
<input type="hidden" name="cancel_url" id="cancel_url" value="payment_cancelled.html"/>
<input type="hidden" name="notify_url" id="notify_url" value="/payment_notify.html"/>
<input type="hidden" name="item_name" id="item_name" value="Product name"/>
<input type="hidden" name="item_description" id="item_description"value="description"/>
<input type="hidden" name="email_confirmation" id="email_confirmation" value="1"/>
<input type="hidden" name="confirmation_address" id="confirmation_address" value=""/>
<input type="hidden" name="amount" id="amount" value="price" />
<input type="hidden" name="payment_id" id="payment_id" value="website_sales" />
<span class="formlable">Name</span><input name="name_first" id="name_first"type="text" value="" class="forminput"/>
<span class="formlable">Surname</span> <input name="name_last" id="name_last" type="text" value="" class="forminput"/>
<span class="formlable">E-Mail</span> <input type="text" name="email_address" id="email_address" value="" class="forminput"/>
<span class="formlable">Post Address</span> <input name="custom_str1" id="custom_str1" type="text" value="" class="forminput"/>
<span class="formlable">City</span><input name="custom_str2" id="custom_str2" type="text" value="" class="forminput"/>
<span class="formlable">Postal Code</span><input name="custom_str3" id="custom_str3" type="text" value="" class="forminput"/>
<input type="button" value="EFT Payment" onclick="quickPostPaymentToPayFast(document.getElementById('payfast_url').value);" id="button" method="post"/>
Form 2
<form name="CreditCards" action="https://www.mygate.co.za/.cfm" method="post"/>
<input type="hidden" name="Mode" id="Mode" value="0"/>
<input type="hidden" name="txtMerchantID" id="txtMerchant" value="xxxxxxx"/>
<input type="hidden" name="txtApplicationID" id="txtApplicationID" value="xxxxxxxx"/>
<input type="hidden" name="txtMerchantReference" id="txtMerchantReference" value="1234"/>
<input type="hidden" name="txtPrice" id="txtPrice" value="1234"/>
<input type="hidden" name="txtCurrencyCode" id="txtCurrencyCode" value="ZAR"/>
<input name="txtRedirectSuccessfulURL" value="success_failure.php" readonly="true" type="hidden"/>
<input name="txtRedirectFailedURL" value="success_failure.php" readonly="true" type="hidden"/ >
<input type="hidden" name="txtQty" id="txtQty" value="1"/>
<input type="hidden" name="txtItemDescr" id="txtItemDescr" value="descr"/>
<input type="hidden" name="txtItemAmount" id="txtItemAmount" value="449.00"/>
<input type="hidden" name="txtRecipient" value="<?php $_POST["name_first"]; ?>"/>
<input type="hidden" name="txtShippingAddress1" value="<?php $_POST["name_last"]; ?>"/>
<input type="hidden" name="txtShippingAddress2" value="<?php $_POST["email_address"]; ?>"/>
<input type="hidden" name="txtShippingAddress3" value="<?php $_POST["custom_str1"]; ?>"/>
<input type="hidden" name="txtShippingAddress4" value="<?php $_POST["custom_str2"]; ?>"/>
<input type="hidden" name="txtShippingAddress5" value="<?php $_POST["custom_str3"] ?>"/>
<input type="submit" id="button4" value="Credit card" />
</form>
name_first
name_last
email_address
custom_str1
custom_str2
Custom-str3
from the first form must be transfered into the second form as well
thanks
You should think of using some client-side JavaScript. I'd recommend using jQuery.
Not sure whether you have any experience in JS but that won't be very complex.
Basically, all you have to do is:
1) Read the value of the first input
email = $('#email_address').val()
2) Assign it to the other field (not sure what fields you want to assign)
$('#txtShippingAddress2').val(email)
Then just bind this code to your submit button or anywhere you need it.
You can find out more about jQuery at http://jquery.com/

How to send multiple items to PayPal

I want to send multiple item names and item prices to PayPal but I am unable to post my item name and price with below code can you please help me?
<form method="post" name="cart" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="navive_1295939206_biz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="notify_url" value="http://newzonemedia.com/henry/ipn.php" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="return" value="http://www.example.com/thank_you_kindly.html" />
<?php
//select items for table
$srowcart_dtl = mysql_num_rows($srscart_dtl);
if($srowcart_dtl > 0) {
$cnt=1;
while($srscart_dtl1 = mysql_fetch_assoc($srscart_dtl)) {
?>
<input type="hidden" name="item_name[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iname']; ?>">
<input type="hidden" name="amount[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iprc']; ?>">
<?php
$cnt++;
}
}
?>
<input type="image" src="https://www.paypal.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.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Create your code like this:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart"> <!-- change _xclick to _cart -->
<input type="hidden" name="upload" value="1"> <!-- add this line in your code -->
<input type="hidden" name="business" value="your_seller_account">
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item Name 2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form>
In addition to the changes suggested by devilprince, the underscores are missing from the line item input tags' name attributes, and also the tags are not proper self-closing tags because the closing / is missing. Correct like so:
<form method="post" name="cart" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="navive_1295939206_biz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="notify_url" value="http://newzonemedia.com/henry/ipn.php" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="return" value="http://www.mysite.org/thank_you_kindly.html" />
<?php
// select items for table
$srowcart_dtl = mysql_num_rows($srscart_dtl);
if($srowcart_dtl > 0)
{
$cnt=1;
while($srscart_dtl1 = mysql_fetch_assoc($srscart_dtl))
{
?>
<input type="hidden" name="item_name_[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iname']; ?>"/>
<input type="hidden" name="amount_[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iprc']; ?>"/>
<?php
$cnt++;
}
}
?>
<input type="image" src="https://www.paypal.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.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
(You may also want to escape special characters in the value attribute, at least for the " character in case it shows up in your item name data.)
Just had to figure this out today for a client. Besides item_name_N and amount_N I also used quantity_N, tax_N, and shipping_N (where N is the line item number, starting with 1).
This page has a list of all parameters: PayPal HTML Form Variables, but the question & answers given here are a better real-world example than the trivial examples on the PayPal site.