Integrate Paypal checkout laravel php - php

I'm currently developing a little shop system. Now I want to integrate a simple PayPal checkout. Just want to press checkout, log in to PayPal (as a customer), click pay and that's it, I get the money and he gets a confirmation.
Now, for Laravel I found 2 plugins, both relying on this. But somehow I don't come clear with those. Also, I found this, but its too old and different now, using Laravel 5.3. I also found this tutorial, but it also doesn't seem to be what I need (at least I guess so). I already created two sandbox accounts, a personal and a business acount, and I also have a user key and secret key.... But now, how can I use them?
What's the easiest way to just implement a quick way to checkout, entering some product data, the complete price and just be able (as a customer) to log in and click okay? I don't want more basically.

I'm using netshell/paypal for my current POS App. It's pretty good and not complex. Check their documentation from here.

If you are using 5.3 why not go with the new cool Cashier? https://laravel.com/docs/5.3/billing

Related

Paypal express checkout - buyer details

so I need to ask a question, I need to setup a simple paypal express checkout system, that one can allow users to change currencies, and two can then update the page with the updated currencies.
Then I need a way for me to get the order information. As I will be selling website templates so I need a way for me to get their email address, so I can then email them with the link to the template file download.
So my question is what data do I get if I set up an express checkout system. And what code do I need, Do i need to create a database to get the returned data back from paypal? Or do I just get an email or can i see that when i log into my paypal account and check orders and see their details that way, but the main important detail i need is their email address?
Can I also say that this is the first time I have looked into express shopping carts. So I am a complete novice in this field, So I will struggle with the coding aspect. But I think it is the route I need to go down.
Also I want to make it all in php as well. But also I don't want to use ready made systems. I just need the back-end code so that I can then just implement it into my current design. Not sure if paypal give you the code when you click the express shopping cart option in All tool section. I did notice though it redirects to a page that lists many partner sites. I couldn't find anywhere for any implementation advice or tips or code.
EDIT: Also I know I will also need to use either IPN or PDT but the documentation I read is highly confusing and just is making me unsure if I can even set a system up. I also read that you should implement both systems, but I also read that that had a risk of doing the payment twice. So yeah i am kinda a bit unsure how to even go about implementing a system I need.
Thanks in advance.

Laravel 5.4 Cashier - bridging the gap in documentation

I've been working my way through the documentation on Laravels website regarding Cashier. From the sounds of it, it seems like it is exactly what I need. A basic subscription configuration that integrates with Stripe. I am able to follow along fairly easily through the configuration section. Then it switches gears and talks about BrainTree integration for a bit. And then it hops right into creating subscriptions, citing the following code:
$user = User::find(1);
$user->newSubscription('main', 'monthly')->create($stripeToken);
So my first question is - where is "$stripeToken" coming from? I feel like there's a fairly large gap in explanations here. Even when I run the code, it errors out saying $stripeToken could not be found.
Where am I setting/getting the $stripeToken from?
I have attempted to follow other video tutorials on setting up Cashier with Laravel, but these all seem to be outdated, as many of the steps to set it up are no longer relevant in Laravel 5.4. For example:
In the one tutorial, it says that you can check to see if a user is already subscribed to a plan in Stripe via the following:
$user->subscribed('main')
And in the video series, it shows him changing a database field (stripe_active) from 0 to 1, to show a different message in the view. With the new process however, there is no "stripe_active" field even created anymore.
So - at the risk of this being an open-ended vague question, I pose 3 questions to kick things off.
a.) Can anybody tell me how/where I set $stripeToken for the code in the documentation to work?
b.) Can anybody tell me how I can check to see if a subscription exists within Stripe using Cashier 7.0 & Laravel 5.4?
c.) Does anybody know of any good tutorials/videos that walk through this process using the latest versions of each?
You're right-- there's a huge gap in the docs.
A) you need to create a form on the front end view, and generate the token yourself, which you capture via javascript and then submit via POST. It's easiest to do this with Stripe Checkout, but it's more customizable with Stripe Elements.
B) you can see if a User has a subscription in Laravel using the built in methods described here: https://laravel.com/docs/5.4/billing#checking-subscription-status. If you're asking about how to grab Stripe subscriptions by calling Stripe from Laravel, it appears you can do this using $plans = Plan::getStripePlans(); from the stripe/stripe-php library which is a dependency of Laravel Cashier.
C) I found this tutorial to be very helpful, and at the moment it's up to date, though that may change: http://www.qcode.in/subscription-with-coupon-using-laravel-cashier-stripe/

Updating Customer Credit Card with PHP & Stripe

I am trying to add this script to my Wordpress website that I found on Stripes documentation but I am a little confused as to how to enhance it more to know when the user already has a card on file it needs to update it rather than creating that customer again.
The code I was originally using can be seen here:
https://gist.github.com/bateller/154c6e5d1f6e0e53e527
This is that code with my edits to try and make it update:
http://pastebin.com/B3LXZpWq
I can't find any information anywhere that seems to make sense to me. Hopefully someone can break it down and help me understand before I loose my mind.
Take a look at Managed Accounts
Stripe - Managed Accounts - https://stripe.com/docs/connect/managed-accounts
You get a greater freedom when it comes to things like updating details and it is also a little stricter but worth it for the added API features.

Adding paypal and "add to cart" to my wamp server

I have added the ability to register on my site using wamp (phpMyAdmin). I would like to know if anyone could give me adice on how to link papal to the account and also have a cart that goes along with it. Are their any suggestions on how to do this? I have accounts set up but i am not sure how to make it so that someone can use their accounts to have a cart ad paypal.
Yes it is possible to implement a PayPal payment system in your website but we're not able to tell you how, because it is way to complex and would fill a book. Best solution is to check out by yourself and if you get problems, ask specific questions.
http://developer.paypal.com
You could also use magento - a commercial online shop software - as it is a very good shop system. It comes with a integrated PayPal checkout.
www.magento.com

Paypal integration confusion

I'm designing a database system, which sells courses to students. This is all done within PHP. I want to take Paypal payments on my website and having done some research I need IPN.
I've been reading docs/guides on how to achieve this from www.x.com but its quite confusing to find info I need as there seems to be more than one way of doing something. The IPN stuff looks pretty straight forward, paypal just needs the unique Invoice number, which the notify script uses to retrieve the record and post the appropriate response into a database and if all goes well, redirect page to a thank you.
The thing is which method do I initially send my values across to Paypal, I don't really want to pass on quantity and shipping data as all of these pieces of data are irrelevant I don't want my end user to see. Do I have to start looking at using the paypal api?
Thanks for the advice
Since your question seems to be "where should i start looking for a good paypal integration with php" i'll give you some general "advice". I had the same problem just a couple of months ago.
Yes you've to read paypal docs, and unfortunatly they don't have the gift of clarity.. very complete but i didn't find them very clear.
However this php class has been very helpful for my similar project: https://github.com/Quixotix/PHP-PayPal-IPN hope can help you too.
Also these articles/classes/docs has been helpful (but at the end i'm not using them) to clear my mind about PP integration:
http://drewjoh.com/wiki/code/classes/phppaypal
http://www.geekality.net/2011/05/28/php-tutorial-paypal-instant-payment-notification-ipn/
set up a sandbox account https://developer.paypal.com/
then go through some of the tutorials
you will also need to set up some test accounts, pay attention to the nav on the left (from the developers page). It has everything you need

Categories