I have a website that offers a service where the price changes dynamically. For instance there are radio buttons and checkboxes that make the final price variate. At the final stage I have an hidden input that contains the final price.
How do I tell PayPal that that is the price to charge? I have tried to follow the documentations on PayPal website but I can't find an answer for this.
How could I dynamically change the values of these inputs but also make sure it's safe?
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="herschelgomez#xyzzyu.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Hot Sauce-12 oz. Bottle">
<input type="hidden" name="amount" value="5.95">
<input type="hidden" name="currency_code" value="USD">
<!-- Prompt buyers to enter their desired quantities. -->
<input type="hidden" name="undefined_quantity" value="1">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
Any help would be much appreciated, I'm really stuck on this.
Thanks,
Jeff
Related
In the past I was able to add a form so a user could add a donation amount on the website and it would send that amount to the PayPal checkout page. It seems that PayPal has changed how this works and I am having issues figuring out how to pass that amount. I am hoping someone here has gotten this to work. Here is my current code and dev site for testing purposes.
<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="VMUWQGHWEATL8" />
<input type="hidden" name="currency_code" value="USD">
<!-- Text Input Boxes -->
<div class="donate-wrapper">
<input type="text" id="amount" name="amount">
<p style="color: #fff">Monthly donation options on the next screen.</p>
<input type="submit" name="submit" value="continue" alt="PayPal - The safer, easier way to pay online!">
</div>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
Dev site: https://braindonordev.wpengine.com/support-us/
You can do it. Create a new button via http://www.paypal.com/buttons , and in Step 2 uncheck the option to save the button at PayPal. Then when you have generated your button code, click the option to remove the code protection.
Now you have "unhosted" HTML you can edit.
The unfortunate thing when passing a donation amount is there won't be an option to make the donation recurring, so you would need a separate relabeled "Subscribe" button for that. Relabled meaning, replace the image with one that says "Donate".
Alternatively, just keep the basic Donate button that you have to serve both use cases (recurring and non-recurring). It's intuitive enough, and has a nice big amount box on the next screen and checkbox to make it recurring:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="paypal#redcross.org">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="text" name="amount">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_donateCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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>
I am trying to use Paypal shopping cart in my web page:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="xxx">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="My Event Registration - Adult">
<input type="hidden" name="amount" value="30.00">
<input type="hidden" name="item_name_1" value="My Event Registration - Child">
<input type="hidden" name="amount_1" value="10.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_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>
This code is mostly generated using PayPal Payment Button helper on PayPal's website.
It seems PayPal's website generates code only for a single item. As I needed two items, I added another item using input fields item_name_1 and amount_1.
When I click on the submit button, I am properly taken to PayPal's shopping cart. However, I see only one item in the cart. I was expecting to see both, Registration-Adult and Registration-Child, in the shopping cart.
I am wondering what is it that I am missing. Regards.
It seems the hidden field "add" can only add one item. You could use "upload" instead. However, in that case PayPal's shopping cart page does not get displayed. For our case, the shopping cart has to be shown so that users can change the number of items. My solution was to actually have two forms instead of one in the same webpage. This works. The only drawback is the user has to click on two buttons instead of one.
I have a website and want to add a PayPal button so that people can buy staff.
I want to:
1) Add a PayPal button to my website but I want it also TO ACCEPT CREDIT CARDS
2) Change the label. e.g.https://developer.paypal.com/docs/classic/api/buttons/
I have browsed dozens of explanations pages but they are all not focused and don't really prompt what to do.
Can anyone help hpw to do these?
Thanks!
PayPal has default settings where the credit card acceptance would be relative to your account/the button type/and a risk assessment. This might be something better to call in and speak with an agent who would have your account details.
Here is some sample code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="youremail#youremail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Pay Now">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="weight_unit" value="lbs">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynowCC_LG.gif:NonHosted">
<table>
<tr><td><center>
<input type="text" name="amount"><br>
</center></tr></td>
<tr><td><center>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_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">
</center></tr></td>
</table>
</form>
You would want to change this line:
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"
This is the image URL. If you change the URL there to the URL of the image you are looking to use than it will reflect on the site.
I believe this is what you are looking for.
I'm looking to add a modifier to my PayPal Subscription button. I'd like to modify the subscription cost depending upon how many users the customer enters. Essentially, the subscribe button has a "base cost", with +$xx.xx added to the monthly subscription cost.
For example:
A user wants to create an account on my app with 6 users at $5 per user with a base subscription cost of $10/mo. The monthly cost of that subscription would be $40.
This can be achieved(may not be the most optimal solution)
Go to PayPal button designer
Moreover you are an advanced user in PayPal, you can customize checkout pages for your customers, streamline checkout, and more in this section.
I needed to build the markup as such. Then, using JavaScript I was able to assign the .val() of the item_number, item_name, and a3 fields. Works great!
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top" style="display: inline-block">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="...">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_number" monthly_item_name>
<input type="hidden" name="item_name" monthly_item_name>
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a3" id="monthly">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<!-- Send the user back here once they've completed payment. -->
<input type="hidden" name="custom" value="<?php echo $_SESSION[ID]; ?>">
<input type="hidden" name="return" value="...">
<input type="hidden" name="rm" value="2">
<input type="submit" name="submit" class="btn btn-inverse" value="Monthly" 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>
I've got a donate page on a website I'm building for a charity. On the page they want to have two options: 'Donate' and 'Donate monthly'. These buttons should take you straight to the donations page on PayPal, however the client wants the 'Donate monthly' button to make the 'make this recurring (monthly)' box on the paypal site itself, pre-ticked.
Is there a way to do this by passing a parameter? Either via Query string or hidden input. Here is the code as it stands at the moment:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="paypal#clientemail.org">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Client Name">
<input type="hidden" name="item_number" value="Donate">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="bn" value="PP-DonationsBF:donateBtnPaypal.png:NonHostedGuest">
<input class="btn shorter diavlo book" type="submit" value="Donate monthly (€)" 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>
What you could do is switch to the Express Checkout API. This would give you the ability to design those options into your own UI and pass it all over to PayPal however you want to.
If you're working with PHP my class library for PayPal will make it very easy on you. Specifically, you would be using:
SetExpressCheckout
GetExpressCheckoutDetails
DoExpressCheckoutPayment
CreateRecurringPaymentsProfile
No, its not possible to make it as default option "Make This Recurring (Monthly)"