JIRA-17952 - adding currency into the AJAX request.
authorKarinG <karin@semper-it.com>
Tue, 2 Feb 2016 23:14:06 +0000 (16:14 -0700)
committerKarinG <karin@semper-it.com>
Wed, 3 Feb 2016 01:29:20 +0000 (18:29 -0700)
CRM/Core/Payment/ProcessorForm.php
CRM/Financial/Form/Payment.php
templates/CRM/common/paymentBlock.tpl

index adcd41cf5aa9dc8a3c4b7fcccd83c2522dcafa4b..463c6abeecff5a959ef467486653c2db81f3c7b7 100755 (executable)
@@ -66,6 +66,8 @@ class CRM_Core_Payment_ProcessorForm {
 
     $form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
 
+    $form->assign('currency', $form->_values['currency']);
+
     // also set cancel subscription url
     if (!empty($form->_paymentProcessor['is_recur']) && !empty($form->_values['is_recur'])) {
       $form->_values['cancelSubscriptionUrl'] = $form->_paymentObject->subscriptionURL(NULL, NULL, 'cancel');
index b3fca54abfe6cd3f2ea80233a12439e483b63d13..33958a4c86a7f127e97d00acc880bc8a11793c55 100644 (file)
@@ -36,6 +36,7 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
    * @var int
    */
   protected $_paymentProcessorID;
+  protected $currency;
 
   /**
    * @var array
@@ -48,6 +49,8 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
     parent::preProcess();
     $this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject,
       TRUE);
+    $this->currency = CRM_Utils_Request::retrieve('currency', 'String', CRM_Core_DAO::$_nullObject,
+      TRUE);
 
     $this->assignBillingType();
 
@@ -58,11 +61,19 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
     self::addCreditCardJs();
 
     $this->assign('paymentProcessorID', $this->_paymentProcessorID);
+    $this->assign('currency', $this->currency);
 
     $this->assign('suppressForm', TRUE);
     $this->controller->_generateQFKey = FALSE;
   }
 
+  /**
+   * @return string
+   */
+  public function getCurrency() {
+    return $this->currency;
+  }
+
   /**
    * Build quickForm.
    */
index 75d15050777878b4a121fdbd3908606e1e6e3b66..8710e439b6a6220cb25adef728ca1874dc43efc2 100644 (file)
         {capture assign='profilePathVar'}{/capture}
       {/if}
 
-      var dataUrl = "{crmURL p='civicrm/payment/form' h=0 q="`$urlPathVar``$profilePathVar``$contributionPageID`processor_id="}" + type;
+      var dataUrl = "{crmURL p='civicrm/payment/form' h=0 q="currency=`$currency`&`$urlPathVar``$profilePathVar``$contributionPageID`processor_id="}" + type;
       {literal}
       if (typeof(CRM.vars) != "undefined") {
         if (typeof(CRM.vars.coreForm) != "undefined") {