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

Fix finding order #16

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .env.testing.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ APP_URL=http://localhost
DB_CONNECTION="sqlite"
DB_DATABASE=":memory:"

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=
QUEUE_CONNECTION=sync
CACHE_DRIVER=array

REDIS_CLIENT=phpredis
REDIS_HOST=localhost
REDIS_PASSWORD=null
REDIS_PORT=6379

PAYMENTS_TYPE=stripe
PAYMENT_DRIVER=stripe

STRIPE_PUBLIC_KEY=pk_test_
STRIPE_SECRET_KEY=sk_test_
Expand Down
4 changes: 2 additions & 2 deletions src/Actions/AuthorizeStripePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Dystcz\LunarApi\Domain\Payments\Contracts\PaymentIntent;
use Lunar\Base\DataTransferObjects\PaymentAuthorize;
use Lunar\Facades\Payments;
use Lunar\Models\Cart;
use Lunar\Models\Order;
use Lunar\Models\Contracts\Cart;
use Lunar\Models\Contracts\Order;

class AuthorizeStripePayment
{
Expand Down
8 changes: 4 additions & 4 deletions src/Jobs/Webhooks/WebhookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Lunar\Models\Order;
use Lunar\Models\Contracts\Order;
use Spatie\WebhookClient\Models\WebhookCall;
use Stripe\Event;
use Throwable;
Expand Down Expand Up @@ -82,23 +82,23 @@ protected function findOrder(PaymentIntentContract $paymentIntent): Order

return $order;
} catch (Throwable $e) {
$this->fail($e);
// $this->fail($e);
}

try {
$order = App::make(FindOrderByTransaction::class)($paymentIntent);

return $order;
} catch (Throwable $e) {
$this->fail($e);
// $this->fail($e);
}

try {
$order = App::make(FindOrderByCartIntent::class)($paymentIntent);

return $order;
} catch (Throwable $e) {
$this->fail($e);
// $this->fail($e);
}

$this->fail(new ModelNotFoundException('Order not found.'));
Expand Down
Loading