Skip to content

Commit

Permalink
Merge branch '0.7' into feature/stripe-webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
theimerj authored Feb 6, 2024
2 parents 6b41567 + 3091797 commit 08871a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Actions/AuthorizeStripePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
namespace Dystcz\LunarApiStripeAdapter\Actions;

use Dystcz\LunarApi\Domain\Orders\Events\OrderPaid;
use Dystcz\LunarApi\Domain\Orders\Models\Order;
use Dystcz\LunarApi\Domain\Payments\PaymentAdapters\PaymentIntent;
use Illuminate\Support\Facades\Log;
use Lunar\Base\DataTransferObjects\PaymentAuthorize;
use Lunar\Facades\Payments;
use Lunar\Models\Cart;
use Lunar\Models\Order;

class AuthorizeStripePayment
{
public function __invoke(Order $order, PaymentIntent $intent): void
public function __invoke(Order $order, Cart $cart, PaymentIntent $intent): void
{
Log::info('Payment intent succeeded: '.$intent->id);

/** @var PaymentAuthorize $payment */
$payment = Payments::driver('stripe')
->order($order)
->cart($order->cart)
->cart($cart)
->withData([
'payment_intent_client_secret' => $intent->client_secret,
'payment_intent' => $intent->id,
Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/Lunar/TestTaxDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestTaxDriver implements TaxDriver
/**
* {@inheritDoc}
*/
public function setShippingAddress(Addressable $address = null): self
public function setShippingAddress(?Addressable $address = null): self
{
$this->shippingAddress = $address;

Expand All @@ -58,7 +58,7 @@ public function setCurrency(Currency $currency): self
/**
* {@inheritDoc}
*/
public function setBillingAddress(Addressable $address = null): self
public function setBillingAddress(?Addressable $address = null): self
{
$this->billingAddress = $address;

Expand Down

0 comments on commit 08871a0

Please sign in to comment.