Skip to content

Commit

Permalink
Merge pull request #16 from dystcz/fix/fix-finding-order
Browse files Browse the repository at this point in the history
Fix finding order
  • Loading branch information
repl6669 authored Nov 25, 2024
2 parents 303df54 + 5d2a514 commit c959e97
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
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

0 comments on commit c959e97

Please sign in to comment.