Skip to content

Commit

Permalink
Update checkout configuration fetching
Browse files Browse the repository at this point in the history
ISSUE: ADCRSET1G-23
  • Loading branch information
Tamara committed Apr 17, 2024
1 parent 18c2616 commit bb08ffa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 12 additions & 1 deletion Components/CheckoutConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ private function buildConfigRequest(?Amount $forceAmount = null): PaymentCheckou
$shop = Shopware()->Shop();
$userId = (int)$this->session->offsetGet('sUserId');
$shopperReference = ($userId !== 0) ? $shop->getHost() . '_' . Shop::getShopId() . '_' . $userId : null;
$shopperEmail = null;

if (
($sAdmin = Shopware()->Modules()->Admin()) &&
($userData = $sAdmin->sGetUserData()) &&
isset($userData['additional']['user']['email'])
) {
$shopperEmail = $userData['additional']['user']['email'];
}

return new PaymentCheckoutConfigRequest(
$this->getAmount($forceAmount),
$country,
Shopware()->Shop()->getLocale()->getLocale(),
$shopperReference
$shopperReference,
$shopperEmail
);
}

Expand Down Expand Up @@ -243,6 +253,7 @@ private function disableCardsSingleClickPayment(PaymentCheckoutConfigResponse $r
$method->setAdditionalData(new CardConfig(
$additionalData->isShowLogos(),
false,
$additionalData->isClickToPay(),
$additionalData->isInstallments(),
$additionalData->isInstallmentAmounts(),
$additionalData->isSendBasket(),
Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb08ffa

Please sign in to comment.