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

Illuminate\Database\Eloquent\ModelNotFoundException #9

Closed
imadrn0202 opened this issue Sep 19, 2019 · 1 comment
Closed

Illuminate\Database\Eloquent\ModelNotFoundException #9

imadrn0202 opened this issue Sep 19, 2019 · 1 comment
Labels
invalid This doesn't seem right

Comments

@imadrn0202
Copy link

imadrn0202 commented Sep 19, 2019

Required Information

  • Operating system:
  • PHP version: 7.2
  • Laravel version: 6.0
  • Laravel Coinbase Commerce wrapper version: v0.7.6

Expected behaviour

job handler will work

Actual behaviour

sometimes exception appears, sometimes it works

dispatch(new HandleCreatedCharge(CoinbaseWebhookCall::findOrFail($test)));

Steps to reproduce

post method to charge:create

Extra details

public function test()
{
    $charge = Coinbase::createCharge([
        'name' => 'jajaja',
        'description' => 'jeje',
        'local_price' => [
            'amount' => 100,
            'currency' => 'USD',
        ],
        'pricing_type' => 'fixed_price',
    ]);

    $test = $charge['data']['id'];


    // error here ->>
    dispatch(new HandleCreatedCharge(CoinbaseWebhookCall::findOrFail($test)));
}
$e: Illuminate\Database\Eloquent\ModelNotFoundException
$e->model "Shakurov\Coinbase\Models\CoinbaseWebhookCall"
$e->message "No query results for model [Shakurov\Coinbase\Models\CoinbaseWebhookCall] 289c9315-0ff8-4fef-be8f-7e13aae6090f"
@antimech
Copy link
Collaborator

antimech commented Jul 8, 2023

It seems like you use it incorrectly. You don't have to dispatch events, the package does that for you. Please refer to the documentation, there are two ways this package enables you to handle webhook requests: you can opt to queue a job or listen to the events the package will fire. This package takes care of most things for your convenience.

@antimech antimech added the bug Something isn't working label Jul 11, 2023
@antimech antimech added invalid This doesn't seem right and removed bug Something isn't working labels Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants