We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit f0fea89a authored by Ángel Campos's avatar Ángel Campos Committed by GitHub

Adding storeId param to getOrigin() calls (#806)

Co-authored-by: default avatarAttila Kiss <42297201+cyattilakiss@users.noreply.github.com>
parent 847b8821
...@@ -58,7 +58,11 @@ class RedirectDataBuilder implements BuilderInterface ...@@ -58,7 +58,11 @@ class RedirectDataBuilder implements BuilderInterface
*/ */
public function build(array $buildSubject) public function build(array $buildSubject)
{ {
$request['body'] = $this->adyenRequestsHelper->buildRedirectData([]); /** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
$payment = $paymentDataObject->getPayment();
$storeId = $payment->getOrder()->getStoreId();
$request['body'] = $this->adyenRequestsHelper->buildRedirectData($storeId, []);
return $request; return $request;
} }
......
...@@ -1571,8 +1571,8 @@ class Data extends AbstractHelper ...@@ -1571,8 +1571,8 @@ class Data extends AbstractHelper
*/ */
public function getOriginKeyForBaseUrl() public function getOriginKeyForBaseUrl()
{ {
$origin = $this->getOrigin();
$storeId = $this->storeManager->getStore()->getId(); $storeId = $this->storeManager->getStore()->getId();
$origin = $this->getOrigin($storeId);
$cacheKey = 'Adyen_origin_key_for_' . $origin . '_' . $storeId; $cacheKey = 'Adyen_origin_key_for_' . $origin . '_' . $storeId;
if (!$originKey = $this->cache->load($cacheKey)) { if (!$originKey = $this->cache->load($cacheKey)) {
......
...@@ -345,11 +345,11 @@ class Requests extends AbstractHelper ...@@ -345,11 +345,11 @@ class Requests extends AbstractHelper
* @param array $request * @param array $request
* @return array * @return array
*/ */
public function buildRedirectData($request = []) public function buildRedirectData($storeId, $request = [])
{ {
$request['redirectFromIssuerMethod'] = 'GET'; $request['redirectFromIssuerMethod'] = 'GET';
$request['redirectToIssuerMethod'] = 'POST'; $request['redirectToIssuerMethod'] = 'POST';
$request['returnUrl'] = $this->adyenHelper->getOrigin() . '/adyen/process/redirect'; $request['returnUrl'] = $this->adyenHelper->getOrigin($storeId) . '/adyen/process/redirect';
return $request; return $request;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment