laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.38k stars 679 forks source link

Create hooks for stripe events I see errors in the browser #806

Closed sergeynilov closed 5 years ago

sergeynilov commented 5 years ago

Hello, In my Laravel 5.8 app using Laravel Cashier "^10.3" I make subscription to Stripe Products and I want to create hooks for some events.

In dashboard of my stripe app I set callback link to my site In routes/web.php : Route::get('stripe_callback_event', 'PaymentController@stripe_callback_event')->name('stripe_callback_event'); and in control I try catch log events, like :


<?php

namespace App\Http\Controllers;

use Auth;
use Carbon\Carbon;
use Session;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
...
use Stripe\Stripe;
use Stripe\Customer;
use Stripe\Charge;

class PaymentController extends MyAppController
{
    use funcsTrait;
    private $stripe_payment_key = 'stripe_payment';
    private $session_id = '';

    public function __construct()
    {
        \Log::info( '<pre>PaymentController stripe_callback_event -1::'.print_r(-1,true).'</pre>' );
    }

    public function stripe_callback_event( $payload )   // https://www.votes.my-demo-apps.tk/stripe_callback_event
    {
        \Log::info( '<pre>-20 PaymentController stripe_callback_event $payload::'.print_r(-2,true).'</pre>' );
        \Log::info( '<pre>-21 $payload::'.print_r($payload,true).'</pre>' );

    } 

In log of laravel app I see messages from constructor, but not from stripe_callback_event and a lot of erros in the browser https://imgur.com/a/jN9gw4A

I checked firewall options:
# sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] Apache Full                ALLOW IN    Anywhere                  
[ 2] 443                        ALLOW IN    Anywhere                  
[ 3] 80                         ALLOW IN    Anywhere                  
[ 4] 22/tcp                     ALLOW IN    Anywhere                  
[ 5] Apache Full (v6)           ALLOW IN    Anywhere (v6)             
[ 6] 443 (v6)                   ALLOW IN    Anywhere (v6)             
[ 7] 80 (v6)                    ALLOW IN    Anywhere (v6)             
[ 8] 22/tcp (v6)                ALLOW IN    Anywhere (v6)    

Can firewall options be reason of these errors? How to fix it?

sergeynilov commented 5 years ago

Looks like adBlock / uBlock filters cause this error. I removed them form my browser(Google Chrome Version 77.0.3865.90 (Official Build) (64-bit)) and stripe payment works ok. But thta does not looks like decision, as many users use adBlock and uBlock on there browsers. Which decision can be ? and I am not sure it reason of error that I do not get stripe hooks ?

driesvints commented 5 years ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.