From c9fa525d3d03a198d403da354306951d63deae63 Mon Sep 17 00:00:00 2001
From: Joaquin Bravo Contreras <jackbravo@gmail.com>
Date: Sun, 3 Sep 2017 13:17:21 -0500
Subject: [PATCH] 2906457: Send order information to buildPaymentInstructions
 method in the HasPaymentInstructionsInterface

---
 modules/payment/commerce_payment.module                             | 2 +-
 .../Commerce/PaymentGateway/HasPaymentInstructionsInterface.php     | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/payment/commerce_payment.module b/modules/payment/commerce_payment.module
index 3efb41ecb..563f8f451 100755
--- a/modules/payment/commerce_payment.module
+++ b/modules/payment/commerce_payment.module
@@ -127,7 +127,7 @@ function commerce_payment_preprocess_commerce_checkout_completion_message(&$vari
   /** @var \Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\HasPaymentInstructionsInterface $payment_gateway_plugin */
   $payment_gateway_plugin = $payment_gateway->getPlugin();
   if ($payment_gateway_plugin instanceof HasPaymentInstructionsInterface) {
-    $variables['payment_instructions'] = $payment_gateway_plugin->buildPaymentInstructions();
+    $variables['payment_instructions'] = $payment_gateway_plugin->buildPaymentInstructions($order);
   }
 }
 
diff --git a/modules/payment/src/Plugin/Commerce/PaymentGateway/HasPaymentInstructionsInterface.php b/modules/payment/src/Plugin/Commerce/PaymentGateway/HasPaymentInstructionsInterface.php
index 79dbdc9c9..15521eb18 100644
--- a/modules/payment/src/Plugin/Commerce/PaymentGateway/HasPaymentInstructionsInterface.php
+++ b/modules/payment/src/Plugin/Commerce/PaymentGateway/HasPaymentInstructionsInterface.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\commerce_payment\Plugin\Commerce\PaymentGateway;
 
+use Drupal\commerce_order\Entity\OrderInterface;
+
 /**
  * Defines the interface for gateways which show payment instructions.
  *
@@ -12,9 +14,11 @@
   /**
    * Builds the payment instructions.
    *
+   * @param \Drupal\commerce_order\Entity\OrderInterface $order
+   *
    * @return array
    *   A render array containing the payment instructions.
    */
-  public function buildPaymentInstructions();
+  public function buildPaymentInstructions(OrderInterface $order);
 
 }
