Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No return with test webhook #41

Closed
beuzathor opened this issue Mar 13, 2019 · 1 comment
Closed

No return with test webhook #41

beuzathor opened this issue Mar 13, 2019 · 1 comment

Comments

@beuzathor
Copy link

beuzathor commented Mar 13, 2019

Hello,
I installed this good package but i have a problem with catching test webhook.
I tried to test catching webhook with an event and with a job but when i do a test on stripe i have a good answer (200) but no return.
I'm on laravel 5.7 with laravel stripe webhooks 1.1.1

I have this job in use

<?php

namespace App\Jobs\StripeWebhooks;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Spatie\StripeWebhooks\StripeWebhookCall;
use Illuminate\Http\Request;
use Stripe\Stripe;
use Stripe\Charge;
use App\Models\Centre;

class HandleCustomerSubscriptionCreated implements ShouldQueue
{
    use InteractsWithQueue, Queueable, SerializesModels;

    /** @var \Spatie\StripeWebhooks\StripeWebhookCall */
    public $webhookCall;


    public function __construct(StripeWebhookCall $webhookCall)
    {
        $this->webhookCall = $webhookCall;

    }

    public function handle()
    {

        return "plop";
    }


}

And i tried with this event

<?php

namespace App\Listeners;


use Spatie\StripeWebhooks\StripeWebhookCall;

class HandleCustomerSubscriptionCreated
{
    public function handle(StripeWebhookCall $webhookCall)
    {
        return 'plop99';
    }
}

Event is in eventprovider

protected $listen = [
       'stripe-webhooks::customer.subscription.created' => [\App\Listeners\HandleCustomerSubscriptionCreated::class,],
'stripe-webhooks::source.chargeable' => [ \App\Listeners\ChargeSource::class,],
   ];

And job in stripe-webhooks.php

'jobs' => [
       /// 'source_chargeable' => \App\Jobs\HandleChargeableSource::class,
     'customer_subscription_created' => \App\Jobs\StripeWebhooks\HandleCustomerSubscriptionCreated::class,
    ],

This error is the same to this issue #36 but i don't have CASHIER_ENV=testing in my .env.
I have cleared cache.

If i try to do same thing with redirect route directly to a simple controller i have the correct return but when i use Jobs or event i can't do it.
I think i forget something somewhere but i don't found what. An idea ?

@spatie-bot
Copy link

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants