diff --git a/README.md b/README.md index 5fa51bc..ceecae2 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,14 @@ Commerce JCC Payments module is an integration module with the [JCC payment API] ### Module settings -- After activating the module, add new Payment gateways in the settings Drupal commerce +- After activating the module, add new Payment gateways in the settings + Drupal commerce - In the plugin block, select JccPay - The mode block allows you to choose a test or live mode - Enter your login and password -- **Return URL** - The relative reference address to which the user will be redirected if the payment is successful. For example an example (/buyer/payment_redirect) -- **Fail URL** - The relative to which the user is to be redirected in case of a failed payment. For example an example (/buyer/payment_redirect_fail) +- **Return URL** - The relative reference address to which the user will + be redirected if the payment is successful. + For example an example (/buyer/payment_redirect) +- **Fail URL** - The relative to which the user is to be redirected in case + of a failed payment. + For example an example (/buyer/payment_redirect_fail) diff --git a/commerce_jcc.module b/commerce_jcc.module index c5da268..4e5c401 100644 --- a/commerce_jcc.module +++ b/commerce_jcc.module @@ -23,6 +23,6 @@ function commerce_jcc_preprocess_page_title(&$variables) { $route_match = \Drupal::routeMatch(); if ($route_match->getRouteName() === 'commerce_checkout.form') { $order = $route_match->getParameter('commerce_order'); - $variables['title'] = t('Order #@order', ['@order' => $order->field_reference_id->value]); + $variables['title'] = t('Order #@order', ['@order' => $order->field_reference_id->value]); } } diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php index d8f6562..2966b7a 100644 --- a/src/Controller/RedirectController.php +++ b/src/Controller/RedirectController.php @@ -87,7 +87,6 @@ class RedirectController extends ControllerBase { $temp_store_factory = $container->get('tempstore.private'); $config_factory = $container->get('config.factory'); - return new static($logger, $entityStorage, $request_stack, $temp_store_factory, $config_factory); } @@ -102,7 +101,8 @@ class RedirectController extends ControllerBase { */ public function check(OrderInterface $commerce_order) { - $response = $this->requestStack->getCurrentRequest()->query->all();; + $response = $this->requestStack->getCurrentRequest()->query->all(); + ; $order_ids = $commerce_order->get('order_items')->getValue(); $order_items_ids = []; // Get order item. @@ -200,8 +200,10 @@ class RedirectController extends ControllerBase { * Payment error output. * * @param \Drupal\commerce_order\Entity\OrderInterface $commerce_order + * Commerce order. * * @return array + * Array. */ public function payError(OrderInterface $commerce_order) { @@ -241,4 +243,5 @@ class RedirectController extends ControllerBase { $title = $this->t('Order #@order', ['@order' => $ref_id]); return $title; } + } diff --git a/src/Plugin/Commerce/PaymentGateway/RedirectCheckout.php b/src/Plugin/Commerce/PaymentGateway/RedirectCheckout.php index 6f7cc0b..d4724da 100644 --- a/src/Plugin/Commerce/PaymentGateway/RedirectCheckout.php +++ b/src/Plugin/Commerce/PaymentGateway/RedirectCheckout.php @@ -107,7 +107,7 @@ class RedirectCheckout extends OffsitePaymentGatewayBase { foreach ($required_fields as $key) { if (empty($values[$key])) { - $message = t('Service is not configured for use. Please contact + $message = $this->t('Service is not configured for use. Please contact an administrator to resolve this issue.'); $this->messenger()->addError($message); return FALSE; diff --git a/templates/commerce-jcc-pay-template.html.twig b/templates/commerce-jcc-pay-template.html.twig index 6d0134c..7ecc8f9 100644 --- a/templates/commerce-jcc-pay-template.html.twig +++ b/templates/commerce-jcc-pay-template.html.twig @@ -23,4 +23,3 @@ {% endif %} {% endif %} {% endif %} -