We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday 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
*/
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;
}
......
......@@ -1571,8 +1571,8 @@ class Data extends AbstractHelper
*/
public function getOriginKeyForBaseUrl()
{
$origin = $this->getOrigin();
$storeId = $this->storeManager->getStore()->getId();
$origin = $this->getOrigin($storeId);
$cacheKey = 'Adyen_origin_key_for_' . $origin . '_' . $storeId;
if (!$originKey = $this->cache->load($cacheKey)) {
......
......@@ -345,11 +345,11 @@ class Requests extends AbstractHelper
* @param array $request
* @return array
*/
public function buildRedirectData($request = [])
public function buildRedirectData($storeId, $request = [])
{
$request['redirectFromIssuerMethod'] = 'GET';
$request['redirectToIssuerMethod'] = 'POST';
$request['returnUrl'] = $this->adyenHelper->getOrigin() . '/adyen/process/redirect';
$request['returnUrl'] = $this->adyenHelper->getOrigin($storeId) . '/adyen/process/redirect';
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