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)"
Related
I'm building a website for a client that has to take donations. I want to have the donation value passed through and automatically filled when they land on PayPal. I have two different sets of code with two different errors.
I do not have access to my clients PayPal account so please let me know if it's not solvable on my end. I do have their merchant ID, which has been redacted in the below code with "merchantidgoeshere".
Code 1: Goes To Merchant Donation Form But Doesn't Pass The Value
<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="merchantidnumberhere" />
<input type="hidden" name="item_name" value="Donation Description">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="amount" value="15.00">
<br /><input name="submit" type="image" alt="PayPal - The safer, easier way to pay online!" src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png" /><span class="lazy_container" style="width: 1px;"><span class="lazy_preloader" style="padding-top: 100%;"></span><img width="1" height="1" alt="" src="plugins/system/tmlazyload/blank.gif" class="lazy" data-src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" border="0" /></span>
</form>
Code 2: Doesn't Go To Page And Redirects To Error Page With The Message:
We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller. Please contact the seller to resolve the problem. If this payment is for an eBay listing, you can contact the seller via the "Ask Seller a Question" link on the listing page. When you have the correct email address, payment can be made at www.paypal.com.
<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="merchantidnumberhere" />
<input type="hidden" name="item_name" value="Donation Description">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="amount" value="15.00">
<br /><input name="submit" type="image" alt="PayPal - The safer, easier way to pay online!" src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png" /><span class="lazy_container" style="width: 1px;"><span class="lazy_preloader" style="padding-top: 100%;"></span><img width="1" height="1" alt="" src="plugins/system/tmlazyload/blank.gif" class="lazy" data-src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" border="0" /></span>
</form>
The first button is a hosted button, so the amount details would have to be set at in the button wizard within the PayPal account. You won't be able to pass your own dynamic value using a hosted button.
The second one is working fine for me when I replace "merchantidnumberhere" with a valid account email address. Did you make sure to update the business parameter with a valid email address or account ID?
Just as a note, to force English as the language the code shouldn't be:
<input type="hidden" name="lc" value="US">
It should be:
<input type="hidden" name="lc" value="en_US">
Cheers from Spain!
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 need to integrate paypal in my site but without using API beacause it needs to put API key APY sescret and and Username. In my case there are different vendors in my site and they are not supposed to share there API credientials to my site. so I need to accept payment using emailid only.
If you do not want to use Rest API, Adaptive Payments, or Express Checkout, which all use API Credentials, you can use PayPal Standard buttons.
Below is a basic PayPal Add to Cart button example:
<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="youremail#youremail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Sample Add to Cart Button">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<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>
You can create a basic add to cart button in your PayPal account or you can use the PayPal Button Factory
Here are the basics of PayPal Payments Standard:
Basic PayPal Standard Integration Guide
PayPal Standard HTML Variable Guide
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 have created a rather simple photo gallery that I wish to apply PayPal Checkout buttons. The basics are simple enough, but what I want to do is to at least pre-populate the named fields as part of the button or pass variables contained in each individual page through to the cart.
Each page contains a picture ID, date, and title. I would like to be able to pass this data along so that when someone clicks "Add to Cart", the data is already there. Right now the only way I can see the buttons working is creating custom fields and having the customer copy and paste the data themselves, kind of a pain.
If I could figure this one thing out PayPal checkout might be worth while. Has anyone here ever done this?
You need something like this? I got it out of the PayPal docs awhile back. I'm using it in a production app now. Please test before using though :)
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin:4px 0px 0px 4px;">
<input type="image" src="<ADD_TO_CART_BUTTON>.jpg" border="0" name="submit" alt="Add this item to your shopping cart">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="<YOUR_PAYPAL_EMAIL>">
<input type="hidden" name="item_name" value="<THE_ITEM_NAME>">
<input type="hidden" name="item_number" value="<THE_ITEM_NUMBER_SKU_OR_WHATEVER>">
<input type="hidden" name="amount" value="<HOW_MUCH_IT_COSTS>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="cn" value="<CUSTOM_TEXT_FOR_THE_BUYER_TO_LEAVE_YOU_SPECIAL_INSTRUCTIONS>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
<input type="hidden" name="address_override" value="1">
<input type="hidden" name="business_cs_email" value="<YOUR_PAYPAL_EMAIL>">
<input type="hidden" name="return" value="<WHERE_TO_TAKE_THE_USER_AFTER_PURCHASE_LIKE_thankyou.html>">
<input type="hidden" name="notify_url" value="<IF_YOU_PROCESS_ORDERS_THROUGH_YOUR_SITE_THE_CALLBACK_URL_GOES_HERE>">
</form>
You'll need one of these for each item you're selling.
Signup at http://sandbox.paypal.com and start working in their sandbox to try this out.
Also check out http://www.x.com and http://www.paypal-labs.com. They've been doing some cool stuff with checkouts.
Also check out using the "custom" PayPal variable, which you can use to pass any information you want to PayPal and get it back when the transaction completes.