Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Handle SAAS apps

Dave Earleyb4ed24c84394
diff --git a/backend/app/Services/Domain/Payment/Stripe/StripePaymentIntentCreationService.php b/backend/app/Services/Domain/Payment/Stripe/StripePaymentIntentCreationService.php
index b88c16043..be408ef99 100644
--- a/backend/app/Services/Domain/Payment/Stripe/StripePaymentIntentCreationService.php
+++ b/backend/app/Services/Domain/Payment/Stripe/StripePaymentIntentCreationService.php
@@ -143,7 +143,7 @@ class StripePaymentIntentCreationService
}
/**
- * @throws ApiErrorException
+ * @throws ApiErrorException|CreatePaymentIntentFailedException
*/
private function upsertStripeCustomer(CreatePaymentIntentRequestDTO $paymentIntentDTO): StripeCustomerDomainObject
{
@@ -152,10 +152,13 @@ class StripePaymentIntentCreationService
]);
if ($customer === null) {
- $stripeCustomer = $this->stripeClient->customers->create([
- 'email' => $paymentIntentDTO->order->getEmail(),
- 'name' => $paymentIntentDTO->order->getFullName(),
- ]);
+ $stripeCustomer = $this->stripeClient->customers->create(
+ params: [
+ 'email' => $paymentIntentDTO->order->getEmail(),
+ 'name' => $paymentIntentDTO->order->getFullName(),
+ ],
+ opts: $this->getStripeAccountData($paymentIntentDTO)
+ );
return $this->stripeCustomerRepository->create([
'name' => $stripeCustomer->name,
@@ -169,8 +172,9 @@ class StripePaymentIntentCreationService
}
$stripeCustomer = $this->stripeClient->customers->update(
- $customer->getStripeCustomerId(),
- ['name' => $paymentIntentDTO->order->getFullName()]
+ id: $customer->getStripeCustomerId(),
+ params: ['name' => $paymentIntentDTO->order->getFullName()],
+ opts: $this->getStripeAccountData($paymentIntentDTO),
);
$this->stripeCustomerRepository->updateFromArray($customer->getId(), [