Stripe Subscription problems with Laravel 4.2 - laravel-4

I have been using cashier to create subscriptions for a couple sites but when I tried to implement it again in an new app it's not working. I am getting Stripe Notice: Undefined property of Laravel\\Cashier\\Customer instance: default_card. Is there an update to Cashier or a property/code I need to change to make it work again?
I have the BillableTrait attached to the School Model and am trying to subscribe to a subscriptions (in Stripe) using $school->subscribe($input['school_plan'])->create($input['stripeToken']);

The solution is to add 'version' => '2014-06-17' to the services.php page for the Stripe info array. It requests the older API and successfully works.

Related

Laravel Cashier - WebhookReceived vs WebhookHandled

On this documentation, it said that both can be used, but what's the difference between the two? Their code seems to be identical as well.
I found the answer, it seems that WebhookReceived is triggered BEFORE Laravel Cashier do any logic with the webhook event, while WebhookHandled is triggered AFTER Laravel Cashier did their logic.
So if you received a customer.subscription.created event.
WebhookReceived will trigger before there are any data on the database with that event while WebhookHandled will trigger with the new subscription available in the database.

Canceling Stripe subscription throws scheduling error

I recently increased the prices of my Stripe subscription plans on my Laravel SASS application. Now, when a user cancels their subscription, it throws the following error:
"The subscription is managed by the subscription schedule sub_sched_XXXXXXXXXX, and updating any cancelation behavior directly is not allowed. Please update the schedule instead."
I'm using Laravel 5.6 and have this in my composer.json file:
"laravel/cashier": "~7.0",
Basically, I get the subscription object and just call cancel(). E.g.:
$subscription->cancel();
This worked for years until I recently changed my prices. Is this a programming error on my part, or do I need to move my subscription plans off of schedules somehow? I'm really stumped here, because Googling has not turned up any useful results on this error.
Found the issue. The recent price change moved the subscriptions onto a schedule. I had to release the subscription schedule using the API here:
https://stripe.com/docs/api/subscription_schedules/release?lang=php

PayPal REST API not returning recurring payment information in laraval

I am working on Paypal webhook (subscription) section to insert recurring payment information into the database. I have done coding based on the link "https://jslim.net/blog/2018/01/22/PayPal-Rest-API-with-Laravel-5-and-Angular/" but Paypal webhook always return “payment_status: Pending” on sandbox image and its not inserting recurring payment information into the database (insert option added in PayPalController - function webhooksPaymentSaleCompleted ).
I think the problems related with routes/api.php file but I can't figure out what exactly is going wrong.
Another URL that I have referred and tried was "https://github.com/supermavster/PayPal-PHP-SDK"
Laravel version 5.8
paypal/rest-api-sdk-php: "^1.14"
Please suggest a feasible solution to this problem.
Thanks in advance.
Verify that the sandbox account's email is confirmed, by logging into the sandbox business account receiving the payment and navigating to: https://www.sandbox.paypal.com/businessprofile/settings/email
Resend the confirmation message. Open the message via https://developer.paypal.com/developer/notifications/ , and confirm the sandbox email.
The v1 PayPal-PHP-SDK is deprecated and there is no reason to be using it for a new integration. Use the v2 Checkout-PHP-SDK for payments.
You'll need two routes on your server, one for 'Set Up Transaction' and one for 'Capture Transaction', documented here; https://developer.paypal.com/docs/checkout/reference/server-integration/
The best approval flow to pair it with is https://developer.paypal.com/demo/checkout/#/pattern/server

Laravel - Checking for a new messages with websocket

I built my first app in Laravel and I am wondering what is the best way to check for a new messages while you are in conversation with someone? This is how conversation looks now: http://prntscr.com/t976tx .
I want to check for a new message without reloading a page and constantly listening that event.
I was reading about Socket.io and I have no idea how to start with that..i am using Laravel 5.7

Duplicate customer in Stripe laravel

I started today Stripe in Laravel 6. I used below code and ran it two times.
$stripeCustomer = $this->User->createOrGetStripeCustomer();
As per the instructions here same user can't be created two times but after running the code 2 times, it created the duplicate customer.
Please check the screenshot below.
Can I delete the customer from stripe? I saw the Laravel library. But seems like there is no delete stripe customer function in cashier
Am I missing anything? Why did it create the duplicate customer?

Resources