I am using Salesforce's Web-to-lead feature. It basically creates a form that inputs the data in a new lead for every submission. I'm wondering how to dynamically populate the hidden fields in the code below (Refer Url, Landing Page URL, GA source / medium / campaign)
I tried the code suggested on this blog post, unsuccessfully.
This is what the html for the form loks like:
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="XXXXXXXXXXXXXXX">
<input type=hidden name="retURL" value="/thankyou.html">
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="phone">Phone</label><input id="phone" maxlength="40" name="phone" size="20" type="text" /><br>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>
<label for="title">Title</label><input id="title" maxlength="40" name="title" size="20" type="text" /><br>
<div style="display:none;">
<label for="lead_source">Lead Source</label><select id="lead_source" name="lead_source">
<option value="Quotefx Web Inquiry" selected>Web Inquiry</option>
</select><br>
Refer URL:<input id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
Landing Pg URL:<input id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
GA Medium:<input id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
GA Source:<input id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
GA Campaign:<input id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
</div>
<input type="submit" name="submit">
</form>`
Related
i have implemented paypal recurring payment through form api using sandbox
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="codetestml003-facilitator#gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_GB/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="5.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
the code was working properly. But now after login to paypal with buyer account the page is redirecting to my account page instead of payment procedure. Can anyone help?
I have the below form sent to Paypal's sandbox from my production Server
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypalFOrm">
<input type="hidden" value="_xclick-subscriptions" name="cmd">
<input type="hidden" value="a.user#gmail.com" name="business">
<input type="hidden" value="A Subscription" name="item_name">
<input type="hidden" value="10" name="item_number">
<input type="hidden" value="USD" name="currency_code">
<input type="hidden" value="1" name="no_note">
<input type="hidden" value="10" name="a3">
<input type="hidden" value="1" name="p3">
<input type="hidden" value="M" name="t3">
<input type="hidden" value="http://a.com/ThankYou.aspx?from=pc" name="return">
<input type="hidden" value="http://a.com/IPN.aspx" name="notify_url">
<input type="hidden" value="1" name="src">
<input type="image" alt="" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_SM.gif" name="submit">
<img border="0" width="1" height="1" alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
When I test the IPN using IPN simulator, it works fine however when I make test payments, no IPN is fired. Please advise if I am doing something wrong here.
Subscriptions won't work from notify_url. You'll have to setup IPN in the PayPal account profile to trigger subscription based IPNs.
Dear Please tell me the Purpose of all fields here,
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="platnosci">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="arest#arest.pl">
<input type="hidden" name="notify_url" value="http://www.google.pl/paypal.php">
<input type="hidden" name="item_name_1" value="Item description">
<input type="hidden" name="amount_1" value="34.00">
<input type="hidden" name="currency_code" value="PLN">
<input type="hidden" name="shopping_url" value="http://www.arest.pl">
<input type="hidden" name="email" value="tester">
<input type="submit">
All these fields are necessary and what is the purpose of each field,
thanks
You can refer this paypal developer page
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
I'd like the user to be able to type the amount they wish to pay into a text box, then click "Buy Now", and that amount will be charged through PayPal. How do I go about creating a PayPal button like this?
Success! For anyone else having this problem, here is the code I used:
<form name="input" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR BUSINESS NAME">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="item_number" value="ITEM ID NUMBER">
Other amount: $<input type="text" maxlength="200" style="width:50px;" name="amount" value="5.00"> CAD<br />
<input type="hidden" name="currency_code" value="CAD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!">
</form>
I have implemented a Paypal structure
through my page button it direct to a paypal sandbox,
payment being performed.
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="abhish_1347270213_biz#gmail.com" />
<input type="hidden" name="item_name" value="Red Jacket" />
<input type="hidden" name="item_number" value="7601" />
<input type="hidden" name="amount" value="125.00" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
height="1" />
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
<div></div>
</form>
Now when i am trying to redirect to a localhost, its showing an error.
I need to ask is it possible to redirect to a localhost from a paypal, and if it is possible then how shall i implement this. thanks for any assistance.
try http:// in front of the localhost
In place of
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
place
<input type="hidden" name="return" value="http://localhost:53237/WebSite17/Default.aspx" />
and for IPN notification
place
<input type="hidden" name="notify_url" value="http://localhost:53237/WebSite17/Default.aspx" />
It will redirect to the site with the return Value Varifiedfor the transaction.