Stripe take payment using saved card laravel php - php

How can i use saved card in stripe for next payment in future using stripe in Laravel framework?
I have tried to find out in Stripe official documentation but i could not find the best solution.

You may want to ask the Laravel/Cashier community for more advice, but it looks like you can retrieve a customer's payment methods like this (docs):
$paymentMethods = $user->paymentMethods();
If you're referring to use with future invoices (eg for subscriptions) you may want to set a default (docs):
$user->updateDefaultPaymentMethod($paymentMethod);

I have found the solution with the help of stripe document.
Here is the reference link https://stripe.com/docs/payments/save-and-reuse?platform=web
With the use of demo i got success. And its working properly.
Thanks for another answers.

One way to do it is using Stripe's future payments. On that documentation one can find PHP examples that can be translated into Laravel.
Depending on the use case, Laravel Cashier might also be of relevance.
A Stripe account will be required (here's the Sign Up page).
Here one can find how to get up and running with a Stripe integration in PHP.
Even though related with Django, my answer here on a similar issue might be of relevance.

Related

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/

Integrate Paypal checkout laravel 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

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.

Billdesk payment integrations in php

I am trying to find ways to integrate bill desk payment in php , but i am not able to find
any code snippet in php , However there are no any clues for sandbox environment in billdesk
Can any one please give me right steps to integrate billdesk with php?
The bank itself would be expected to provide such tutorials.
If you can't find any on their site, then it's unlikely that you'll find them elsewhere unless it's a bank that's already very widely used for online transaction processing. Call them and ask them what help they can provide. Banks I've worked with have always been very happy to help.
Rather than just integrating into your website, it can be helpful to use an existing, popular shopping cart system e.g. Ubercart, which will have a lot of the code you need already in place and will have examples of where similar plugins has been done with other banks, e.g. here.

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