I am trying to use Laravel cashier for both Braintree and Stripe. I have to use both payment gateways at a time. Can i achieve this with cashier?
For subscription i'm using.
Braintree
$user->newSubscription('paypalPlaneName', $paypal_plan_id)->create($nonce);
And same as with Stripe
$user->newSubscription('stripePlaneName', $Stripe_plan_id)->create($stripeToken)
And both payment gateways are using same 'users' and 'subscriptions' tables with their fields.
But how can cashier recognize request is for which payment gateway? Is cashier handle this?
Can anyone help me with some ideas please?
Related
I have created a subscription for any of product using laravel cashier and the subscription is for one month then in id of subscription user wants to sowngrade or upgrade his subscription then how can we calculate unused time on cost on existing subscription in laravel cashier.
I am not using stripe/stripe-php i am using laravel cashier
How we can preview prorations?or
What is the logic of calculationg prorations?
Laravel Cashier uses stripe/stripe-php package so you could use \Stripe\Invoice::upcoming() method.
From Cashier v13 Cashier offers a wrapper for previewing:
$invoice = $user->subscription('default')->previewInvoice('price_yearly');
You can read more about this: https://laravel.com/docs/8.x/billing#previewing-subscription-invoices.
While Stripe's API has an upcoming invoice endpoint that supports previewing changes to subscriptions (change prices, quantity, etc), it does not look like Cashier offers this functionality. Or at least nothing that sounds like an implementation of this feature is included in their documentation. You could contact them to ask about current/future support for this feature.
You can read all about Stripe's proration logic here in the docs.
Not too long ago Payment gateways allowed you to create customer profile accounts and store their credit card info with the gateway and use the returned customer id to make future purchases with ease.
I am trying to do this with Laravel cashier and Braintree. I followed the docs here https://laravel.com/docs/5.5/billing#braintree-configuration and it set up fine. I am able to do one time charges and subscriptions.
Is there a way to store the customers credit card info on Braintree ( Vault? ) and retrieve it using their customer id everytime they want to buy something?
I can retrieve the Payment Nonce but that seems to be for a one time use.
Since the Laravel Cashier API wrapper provides the ability to create subscriptions within Braintree, it is certainly creating customers with saved payment methods prior to creating the subscriptions, since that is a Braintree requirement.
The Laravel Cashier docs don't show a standalone customer create call, so you may need to use the Braintree Customer Create API Call.
I want to integrate Stripe into my Laravel app, and I'm wondering what is better solution for it: https://github.com/cartalyst/stripe-laravel or https://laravel.com/docs/5.3/billing?
If you're only performing "one-off" charges use the Stripe SDK directly or stripe-laravel by Cartalyst. https://cartalyst.com/manual/stripe-laravel/
If you're offering subscriptions, you should use Laravel Cashier instead. https://laravel.com/docs/5.4/billing
Do we have any package for Credit Card Payment in Paypal in Laravel 5.2.37?
I am already following this to link my app with Paypal : http://learninglaravel.net/integrate-paypal-sdk-into-laravel-4-laravel-5 and now want to check any package for Credit Card(Master Card/Visa)
PayPal
These packages are for PayPal only and can be used to process credit cards.
PayPal PHP SDK
PayPal Developer REST API Samples
PHPBuilder - Working with the PayPal API
17 Educations - Paypal integration in laravel
laravel-paypalpayment
laravel-paypal
Multiple Services
These packages are for more than one payment processor and include PayPal. They can be used to process credit cards.
Omnipay for Laravel 5 & Lumen
Omnipay Simple Example
Payum
Laravel Cashier (official Laravel package; supports PayPal via Braintree; meant for subscriptions / recurring billing plans)
EnvatoTuts - Process Payments With Stripe and Laravel Cashier
ItSolutionStuff - Laravel 5 Stripe example using Laravel Cashier from Scratch
I suggest you to use Omnipay
https://github.com/thephpleague/omnipay
It supports paypal and tens of other major payment providers, with a simple unique interface for all of them
Install & use instructions are on the github project page, package are available for composer
I am developing application e-commerce application and using Laravel Cashier to charge the user. In some cases I have to refund partial amount. Is there is there any method to refund partial amount using Laravel Cashier.
Thanks,