Solved

PayPal payment intergation with php

Posted on 2016-09-02
3
51 Views
Last Modified: 2016-09-05
This questionis a follow on to this question.

https://www.experts-exchange.com/questions/28964796/Paypal-Simple-Interface.html

I forgot to mention; we want the customer to be able to pay either through paypal (with  paypal account) or via credit card. Does the awarded answer, based on http://www.evoluted.net/thinktank/web-development/paypal-php-integration cover that case as well? Also, in some cases there may be a buyer whose paypal email is not the same as that we have in our database for that client; I presume the payer email used must be that of the payers paypal account, assuming the buyer want's to use their paypal account.

Thanks
0
Comment
Question by:Richard Korts
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 250 total points
Comment Utility
PayPal can accept credit cards at the same rates as PayPal account payments.  PayPal is quite rigid about its requirements for client verification and email addresses.  So much so, that vendors can rely on shipping products to PayPal verified addresses.  Mismatched emails are simply unacceptable, so if you're using email #1 and PayPal is using email #2, you will have to have program logic to bridge the gap.

My instinct is that instead of going to "evoluted" for PayPal advice you should go straight to PayPal.  They have all kinds of helpful developer documentation.  And if you want to save time you can hire a PayPal developer - they have links for that, too.
https://developer.paypal.com/
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 125 total points
Comment Utility
It's too hard to follow the other question because the excepted answer was just a link to some possible test code and not what you may or may not actually be doing.

Payments are one of those things that seem simple in your mind but get more complex when you start adding on features.

In short, you have an invoice table in your database.  That invoice will contain the invoice id and contact id that is related to a contact table.  Then you will have a table of invoice transactions that will contain the invoice transaction id, invoice id, item id and selling price.

You will probably also have a table of payments that contains a contact id, invoice id and amount.

Your cart code adds up the total billed using the invoice transaction table, then subtracts any payments associated with the invoice.

A customer now pays online where you offer to pay by credit card or via paypal.  If the customer chooses pay by credit card or their paypal account, that is something you must account for in your code then send the info via the appropriate api call https://developer.paypal.com/docs/api/

Once the payment is accepted, you update your payment transaction table that shows $X amount went to invoice #123.  As mentioned, I put a contact id in the payment table because sometimes the person paying is not the person buying.  

That is an over simplified view.

There are different integration methods and the "easier" methods do make it more complex when you have more custom features.  Also, you can accept payment on your server which gives you more control, but then the pci compliance (essentially running a scan on your server and make sure your server passes) is your responsibility.   When you send the payer to the paypal site, you do not worry about pci compliance but then you also are sending the user to the paypal site and have to build in a listener page on your site to accept the paypal call back.
0
 
LVL 11

Assisted Solution

by:Andrew Angell
Andrew Angell earned 125 total points
Comment Utility
Your question is pretty broad.  There are lots of potential answers to it.

I would recommend you start with the Express Checkout APIs.  This will allow you to integrate PayPal in a way that you can force "guest checkout" as an option, which is what they call it when somebody pays with a credit card without signing in to a PayPal account.  The checkout still occurs on the PayPal hosted pages, but again, the user does not have to create/log-in to an account.

With EC integrated people who prefer to login and pay that way can do so, and people who do not have PayPal or prefer to enter card details directly will also be able to do so (in most cases.)

Guest checkout is simply not available for ALL transactions.  Depending on the seller and buyer countries and some other variables the buyer may not get the option to pay without logging in or creating an account.  If you're in the US and most of your buyers are US, though, you won't have any issues.

Beyond that, you could then choose to leave Express Checkout integrated but eliminate the guest checkout option.  This way people who choose to pay with PayPal would go through your EC integration and would simply login as they would expect to do.

Then for credit card payments you could use the REST API with "direct credit card" enabled in your REST application settings, or you could upgrade your account to PayPal Payments Pro.  

Pro gives you more functionality for handling direct credit card payments.  When approved for Pro you'll use either DoDirectPayment API or the PayFlow API to send credit card payment requests to PayPal depending on the version of Pro they put you in.

Yet another option would be to use Braintree, which is now owned by PayPal, and it has an entirely separate set of APIs / SDKs you can use to integrate payments.  In fact, the Braintree v.zero integration would allow you to include credit cards, PayPal, Apple Pay, Samsung Pay, and more, all within a single integration.

So again, you have all sorts of options here.  You'll need to study each and figure out what suits your business needs the best.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now