Skip to content
Snippets Groups Projects
Commit a489c330 authored by Nicolas Ricklin's avatar Nicolas Ricklin
Browse files

Issue #3028398 by wengerk, aerzas, czigor: Datatrans Interface (Redirect) is...

Issue #3028398 by wengerk, aerzas, czigor: Datatrans Interface (Redirect) is in the default language instead of Drupal current language
parent 7424fb32
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,16 @@ class DatatransForm extends PaymentOffsiteForm {
$payment = $this->entity;
/** @var \Drupal\commerce_datatrans\Plugin\Commerce\PaymentGateway\Datatrans $gateway */
$gateway = $payment->getPaymentGateway()->getPlugin();
/** @var \Drupal\Core\Language\LanguageInterface $language */
$language = \Drupal::languageManager()->getCurrentLanguage();
$response = $gateway->initializePayment($payment, [
'redirect' => [
'successUrl' => $form['#return_url'],
'cancelUrl' => $form['#cancel_url'],
'errorUrl' => $form['#return_url'],
]
],
'language' => $language->getId(),
]);
return $this->buildRedirectForm($form, $form_state, $response->getLocation(), []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment