Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I don't know where else to turn...
I have a client who insists on using PayPal as their credit card merchant. We will be taking cards directly on the site, so I suppose "Website Payments Pro" is the right avenue?
All of these different PayPal types, API's, accounts, etc. are all very confusing to me- I'm used to working with Stripe which is, in my opinion, the best, cleanest solution I have ever found.
Anyway, I have been looking everywhere for some sort of a PHP class to help me interact with the PayPal API as I have all but given up on figuring out how to interact with this thing from scratch. All of the classes I've found are several years old and no longer seem to function properly.
Does anyone have any suggestions? Any help would be extremely appreciated!
This PayPal PHP Class Library will make all of the PayPal Classic API calls very simple for you, including Payments Pro. It has fully functional samples included with it, and then "templates" that are empty and ready for you to simply fill in your param values. It handles the rest.
You can see a sample of the output for DoDirectPayment here, which is the API that is used for Website Payments Pro 3.0 that you mentioned. Note that it's working in the sandbox, and PayPal's sandbox is a little slow processing credit cards, so that sample might take a few moments to load, but the live servers don't do that.
You do need to make sure "Website Payments Pro" is what your client has enabled on their PayPal account if you're going to use DoDirectPayment, though. PayPal has a new version where they dropped the "website" and they just call it "PayPal Payments Pro 2.0". Yes, 2.0 is newer than 3.0. There's a reason for that, and if you're curious you can read about the history of PayPal Pro here.
If the client has the newer PayPal Payments Pro 2.0 enabled then you'll need to use the PayFlow API instead of DoDirectPayment. The class library includes that as well, and you can see a sample of its result here.
Using the library you could get credit card processing up-and-running within minutes.
I suggest the Omnipay Package; it's well maintained and it has a lot of gateways for different payment services. I've started using it 8 months ago: it's simple and it works very well.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to paypal integration,
Requirement (paypal USA):
Admin should be able to generate paypal invoice from website admin panel. As this is service invoice and charges will be different depending on client requirement.
And User, from website client area can receive paypal invoice and pay it online.
I ve read few documents of paypal api but couldn't decide which flow/API to use.
Please suggest best way with least coding to integrate paypal with my website.
You can use the Invoicing API for that. My PHP class library for PayPal will make this very simple for you. It comes with fully functional samples and ready-made templates so you can get calls working very quickly and easily.
For example, take a look at the CreateAndSendInvoice sample. All you would need to do is replace the static values with your own static or dynamic values and it would create the invoice in the PayPal system as well as send the user an email to pay the invoice.
It also comes with all the other calls like CreateInvoice, SendInvoice, DeleteInvoice, CancelInvoice, etc, so you can easily make any call you need for a complete PayPal invoicing system.
There are two API endpoints that could serve your purpose.
Invoicing using Classic APIs, which uses SOAP, NVP and at times REST to make calls
Invoicing using New REST APIs which is the new API set that PayPal is actively developing.
The REST APIs are getting actively developed and supported, and we encourage external developers to start using REST APIs over Classic APIs, to ensure long term support from PayPal with any issues, and features. However, as these APIs, are getting developed, few specific features are still getting developed, and should be available soon. However, Invoicing APIs is developed with most features as Classic APIs.
REST APIs also comes with these APIs:
Create an invoice
Send an invoice
Update an invoice
Retrieve an invoice
Get invoices of a merchant
Search for invoices
Send an invoice reminder
Cancel an invoice
Delete an invoice
Retrieve a QR code
Record a payment
Record a refund
We are currently supporting PayPal-PHP-SDK, an SDK for making calls to PayPal REST APIs. There is a lot of documentation around the SDK from installing it, to running samples, etc.
I would definitely recommend you to download this SDK, and run the samples locally in your machine, (which generally takes few seconds to setup), and try out Invoicing Samples. You could modify the samples, to verify the specific use case that you are trying to accomplish. You could view the sample source code online here.
Please let me know if you run into any issues, and we would be more than happy to help.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a shareware site where the user pays $25 for an annual membership. The shareware is free, the membership entitles users to support and an enhanced version of the shareware.
I would like to create a page on my site where the user can make a Paypal payment without leaving the site. Then, I want the user to land on a specific thank you page.
I'm not able to find documentation on how to do this, other than this intimidating, 256 page guide: Gateway Developer Guide and Reference.
My needs are humble. I'm hoping there is a quick-start guide I missed.
Please advise.
PS: I do have the Paypal Advanced ($5/month).
If you absolutely do not want to leave the page you will need to use PayPal Payments Advanced Or PayPal Payments Pro
Advanced comes with a $5 monthly fee and you will see PayPal branding, (I believe this is almost like an iFrame), however I have never used this service so cannot comment on what is required.
Pro is $30/month however you will not see PayPal branding and user will have no idea PayPal is being used in the backend
This uses an API that you are going to have to do progamming for since it is all done in the backend, and you are also most likely going to want an SSL Certificate.
There is PayPal Payments standard, but that puts a button on your page which redirects you to PayPal. Your customers will not need a PayPal account to pay. This option is free (aside from regular PayPal fees)
There is also PayPal Express Checkout, I am not 100% sure what the difference between this and Payments Standard is.. perhaps a PayPal account is required?
PayPal have prohibited the page from being included in an iframe, by setting the X-FRAME-OPTIONS header.
There is no way around this security measure.
You could provide a link to go back to your site if you want payment running through PayPal.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm somewhat familiar with the classic Paypal API but I'm trying to figure out a few things for the REST API. I browsed around the documentation but I couldn't find anything
With the REST API, Can I set a username, password and signature of the person to transfer the funds to just like I can with the classic API, or is it based entirely on the client_id and secret?
The software I'm working with is sort of like a marketplace where there are buyers and sellers. If I cannot use the username, password and signature for the individual sellers, is there some other way to handle the payments between buyers and sellers so that the sellers don't have to sign up for developer accounts to get their own client_id and secret?
Considering that credit cards are a form of payment, I assume this means I don't have to re-direct to Paypal's site to handle this, unlike the classic API. Correct?
I saw this code sames for PHP on paypal's site, but I'm wondering if there are more in depth examples. Does anyone know of a good tutorial for the paypal REST API?
For those of you downvoting, can you please point out anywhere in the documentation that it explicity answers my questions?
The PayPal REST API uses only OAuth 2.0 for authentication, so yes you need to provide a client id and secret, and call the OAuth end point to retrieve an access token to use in subsequent calls.
Currently there is no way to do that through the REST API.
Correct, the REST API does not require a redirect for the credit card use case.
With respect to samples, there are SDKs for several different languages, that include sample applications. Is there something in particular that you are looking for?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to learn how I can add PayPal Subscription to my existing PHP app using IPN and looking for a good article that explains the ins-and-outs.
In my app, users can register for a free account and then they can select a membership type and rate (daily, weekly, monthly and yearly). When they have made their selection, the configured PayPal button is displayed. They can click the Subscribe button which takes them to PayPal.
I need to know how to identify the user: what custom information to send to PayPal that is then sent back? I would also like to know what information PayPal sends back to the IPN page.
It seems that the button can be configured for the notify url. Does that mean I still have to turn on IPN?
I just have too many questions to list here... The PayPal site does not have any teaching material that explains Subscriptions and how to integrate it into a site.
Any good and recent articles you know of?
anon445699, I completely agree with you about the subscribe information it mostly shows you how to generate a button with no parameters.
Maybe this will help some people in the future, it oulines all the possible parameters for subscriptions. I know it helped me
https://www.paypalobjects.com/en_US/ebook/subscriptions/html.html
There are plenty of articles out there, just google it. The date doesn't matter as much, most of the main functionality is basically the same, they don't change it much because a ton of people rely on it being the same. What you really need to do though, is look at the documentation at paypal, its quite thorough, and even has code samples. Including for subscriptions, how do you think the people who wrote articles, and everyone who has implemented it did it? Did they just guess and hope for the best?
Next get yourself an account on the paypal sandbox. Want to know what the IPN sends back? Setup a script to catch an IPN post, and save all the $_POST data to a file, and see for yourself using the sandbox to complete a fake order. Thats what I did when implementing paypal. Of course, the return values are also noted in the documents as well.
Edit
I believe the field they will send back is called custom. You could hijack a field you are not using, like productnumber. Or maybe use the payer_id field. Or identify them with their email. There is not just one way to do it. The best way to find out though, is to try it on the sandbox rather than waiting for someone to do it for you or write an article. You could have saved yourself 3 days of reading if you would just try it.
Links
Found these in about 2 minutes, there is more than enough info in these to get the job done.
Various IPN and subscription tutorials:
http://net.tutsplus.com/tutorials/php/using-paypals-instant-payment-notification-with-php/
http://www.web-development-blog.com/archives/easy-payments-using-paypal-ipn/
http://www.paymentsplus.com.au/joomla/faq/paypal-buy-now-guide.html
Sandbox:
https://developer.paypal.com/devscr?cmd=_signup-run
Paypal Documentation:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_subscribe_buttons (this is the one you really want)
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to process credit cards and integrate with backend payment services to credit them. The majority of solutions on the internet require an intermediary, eg. 2CO, GCO, Auth.net.
Do you have any experience with implementing a credit-card payment gateway in PHP? Any help in appreciated.
Thanks for your time.
Stripe has a PHP library to accept credit cards without needing a merchant account: https://github.com/stripe/stripe-php
Check out the documentation and FAQ, and feel free to drop by our chatroom if you have more questions.
If you need something quick and dirty, you can just use PayPal's "Buy" buttons and drop them on your pages. These will take people off-site to PayPal where they can pay with a PayPal account or a credit card. This is free and super easy to implement.
If you want something a bit nicer where people pay on-site with their credit card, then you would want to look into one of those 3rd part payment providers. None of them (that I'm aware of) are completely free. All will have a per-transaction fee, and most will have a monthly fee as well.
Personally I've worked with Authorize.NET and PayPal Website Payments Pro. Both have great APIs and sample code that you can hook into via PHP easily enough.
There are more than a few gateways out there, but I am not aware of a reliable gateway that is free. Most gateways like PayPal will provide you APIs that will allow you to process credit cards, as well as do things like void, charge, or refund.
The other thing you need to worry about is the coming of PCI compliance which basically says if you are not compliant, you (or the company you work for) will be liable by your Merchant Bank and/or Card Vendor for not being compliant by July of 2010. This will impose large fines on you and possibly revoke the ability for you to process credit cards.
All that being said companies like PayPal have a PHP SDK:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks
Authorize.Net:
http://developer.authorize.net/samplecode/
Those are two of the more popular ones for the United States.
For PCI Info see:
https://www.pcisecuritystandards.org/
Braintree also has an open source PHP library that makes PHP integration pretty easy.
The best solution we found was to team up with one of those intermediaries. Otherwise you will have to deal with a bunch of other requirements like PCI compliance. We use Verifone's IPCharge and it works quite well.