I have rolled out my own shopping cart website in PHP, and I want to add a "Pay Now" button which:
Sends the user to Paypal with a total amount payable
Allows the user to pay with or without a paypal account of their own
Prevent user from hacking around with the final amount (e.g. plain text attributes in HTML)
and I want a solution where I do not pay any monthly Paypal fees. But I'm finding the Paypal documentation seriously confusing, as well as other SO questions:
Paypal: Paypal Button Manager overview
SO: Paypal Pay Now Button
SO: php basic pay now button for paypal
SO: PayPal: express checkout pay without account
The Paypal documentation suggests that if I want a "Pay Now" button, the only option I have is to use "Hosted Sole Solution only". What exactly does this mean?
It also says "You cannot use hosted buttons with Hosted Sole Solution; you should use token buttons instead." Please forgive the stupid question, but this means if I want a Paypal "Pay Now" button, I have to use the "Hosted Sole Solution", which always uses "Tokens"? How exactly does the "Token" scheme work? Other questions suggest data is sent in plain text so can be hacked around with, yet the concept of tokens seems to suggest otherwise?
And last but not least, are there any examples of PHP code for the "Pay Now" button? I'm mystified why it all has to be so confusing!! (I'm comfortable with PHP, but to really understand how the Paypal "Pay Now" system works, examples would be ideal)
In case it matters, I will also want to use Paypal IPN, but I have done this before, so will regard it as a separate task, unless it has to be considered for the "Pay Now" button.
The big factor here is going to be the fact that you do not want to pay a monthly fee. This will limit you to using PayPal Payments Standard / Express Checkout, both of which have no monthly cost.
PayPal Standard are your "Pay now" buttons. They are nothing more than an HTML post form and can be created within your PayPal account's button factory, or you can create your own forms.
PayPal Express Checkout is an API based solution which in the absence of a shopping cart platform will perform nearly identically to PayPal Standard. Express Checkout does not allow the customer to checkout as a guest by default, additional variables (solutiontype=sole) need to be passed with the initial API call.
It sounds to me like PayPal Standard is going to be the product you are after. Here is a link to the base "developer" guide for PayPal Standard:
https://developer.paypal.com/webapps/developer/docs/integration/web/
If you prefer to create the buttons through the PayPal system, login to your PayPal account, click 'Profile' in the top right, then select "My Selling Tools". Select "Update" next to "PayPal Buttons" and then click on Create New Button on the right side. The button builder is really a simple tool and will provide you with a complete HTML form to paste into your site's source.
It turns out that what I wanted is the Express Checkout:
Getting Started with Express Checkout
Related
I want my PHP web application to have the ability to save the user's PayPal details in their user account.
When they go to purchase items, rather than going through the standard PayPal form, it will automatically grab the user's PayPal details from their user account, and make the payment directly from my website. There is definitely a way to do this, as I have seen this feature on sites such as Freelancer.com
Thanks for the help! :)
No, you don't need Payments Pro for that. That would only be if you want to do it with direct credit cards. What you're after in general is called Reference Transactions, and when done with PayPal Express Checkout it uses Billing Agreements.
You'll use Express Checkout and/or Payments Pro (optional) to process an original authorization or sale transaction. Then, you can send that ID you get back in that original transaction along with a new amount in the DoReferenceTransaction API and that new amount will be instantly processed without any redirection or further authorization required.
I'm new to Paypal integration. I need to dynamically change the HTML variable to the Buy Now button since I need to calculate discount_rate and shipping.
At first I use the hosted button, but then realized that I can't add new variables.
So I found this alternative way which is creating our own button. But then the customer can simply "Inspect Element" and change the value of the input.
Is there better and more secure way to implement dynamic pricing for Paypal?
Can I submit the payment through backend script like PHP?
Thanks
You can use the PayPal express checkout API to create a purchase in the background then send the user to PayPal with a token linked to this purchase.
if you do go down this route, I recommend using this class as it is very simple, yet powerful;
https://github.com/thenbrent/paypal-digital-goods/
On the other hand you can continue what you are doing with the non-hosted buttons and simply check the gross amount paid by the user against what they should have paid in your notify script.
I have been hunting around developer.paypal.com for a couple of days now and have the gist of what I need. But I am still looking on the best way to accomplish my task.
What I need is a way for people to pay a fee for an event from my website. I would prefer to allow Guest Checkout as not all attendees will likely have a paypal account yet. But what I would really like is for the paypal website to handle all of checkout. In ebay, you see the total, a small summary and you pay for it right there. I have looked at express checkout, and it wants to return the user to my website to finalize everything.
So in short:
Allow guest checkout
Show payment total on Paypal webpage
Allow payment to be finalized and 'Captured' from PayPal's website, only coming back to my page to say Thanks.
And if possible, not require an address of the attendee
Can this be done?
I have long used StackOverflow for answers, but I am having a hard time finding this answer (mainly because I don't know exactly what I am looking for).
Thanks in advance
You are describing "standard", and the HTML button integration will be much easier than Express Checkout.
Express Checkout is the most robust API to use. The "return" to your site is a good thing, to give the customer the ability to click a final "Place Order" button. But you can also have this triggered automatically on return -- just run DoExpressCheckout without user interaction and display a thank you / confirmation message. If you are going to run DoEC w/o interaction, your initial redirect to PayPal.com should have &useraction=commit appended to the URL. Then, the final button at PayPal.com will say "Pay Now" instead of the default "Continue"
To allow guest checkout with EC, pass SOLUTIONTYPE=Sole in the initial SetEC call. Note that when customers load a PayPal.com checkout page, it checks their browser cookies to see if they have a PayPal email address stored. If they have one stored in the browser, the top "Log in to PayPal" section will be expanded. If they do not have an address stored -- generally meaning this is a brand new computer or they've never used a PayPal account to check out on this one before -- then the bottom guest checkout section will be expanded.
To not require an address, pass NOSHIPPING=1.
Background
I'm building a website where I need to use some sort of recurring billing payment method. My client does not have Paypal's Website Payments Pro so he decided to use a simple Subscribe button.
Problem
This is all nice and easy to use but how would I get a notification from Paypal when such a payment has been made? I had some experience with Paypal before and there was a field return_url that would be accessed by Paypal to notify the website but checking the variables on their site this field does not exist anymore or perhaps not available with this type of button.
when you create subscribe button that time you will find that option(in step 3) , so according your need you can set url and get ipn variable
Step 3: Customize advanced features (optional)
Take customers to this URL when they cancel their checkout
http://yourwebsite/complete_registration.php?action=cancel&sts=0
Take customers to this URL when they finish checkout
http://yourwebsite/complete_registration.php
Advanced variables
notify_url=http://yourwebsite/complete_registration.php
i hope it help you
I have a scenario where a user can input the amount he wants to be billed. I use buynow buttons that are created using code. Now in this case what what i had in mind was to:
Set minimum billing amount to 10$
If he enters below that, give error.
Set the amount of buynow button 10$ when form loads.
Once User inputs a number greater than 10 do an ajax request to controller
Check if their is a button saved in DB against that amount that was created earier on PayPal.
If button does not exist, create a new one on PayPal, save button in the DB.
Return the HTML of the newly created button
Replace the existing button with the returned HTML
Problem with this approach is that it might be too heavy. I also do not want to spread form over 2 pages. Are there any alternate and better options? Can i do some tweaks to make this option more robust?
A better option in this case would be to use the API and do the payments via either Express or Payments Pro. Essentially, you're trying to over-complicate this by making the buttons to the job of the API; getting the worst of both worlds in the process.
You could still utilize a "pay now" button graphic, but just submit your own request to the paypal express gateway (exactly what the button does for you) with a couple curl commands.
There are many tutorials available, but PayPal provides PHP code and a complete walkthrough on their site, so best, in my opinion, to go right to the source.
Log into PayPal -> Merchant Services -> Express Checkout
Under "Setting it up", you'll find all the implementation details.