Skip to content

Commit

Permalink
Fix the issue with missing origin from state
Browse files Browse the repository at this point in the history
CS-5934
  • Loading branch information
Tamara committed Sep 30, 2024
1 parent cdc1167 commit 2766079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/Handlers/AbstractPaymentMethodHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,9 @@ protected function preparePaymentsRequest(
$paymentRequest->setLineItems($lineItems);
}

//Setting info from statedata additionalData if present
if (!empty($stateDataAdditionalData['origin'])) {
$origin = $stateDataAdditionalData['origin'];
} else {
$origin = $this->salesChannelRepository->getCurrentDomainUrl($salesChannelContext);
}
$origin = $stateDataAdditionalData['origin'] ??
$request['origin'] ??
$this->salesChannelRepository->getCurrentDomainUrl($salesChannelContext);

$paymentRequest->setOrigin($origin);
$paymentRequest->setAdditionaldata(['allow3DS2' => true]);
Expand Down
3 changes: 2 additions & 1 deletion src/Util/CheckoutStateDataValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class CheckoutStateDataValidator
'storePaymentMethod',
'conversionId',
'paymentData',
'details'
'details',
'origin'
);

/**
Expand Down

0 comments on commit 2766079

Please sign in to comment.