Change button name and amount
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 6 Sep 2016 05:45:00 +0000 (11:15 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 6 Sep 2016 12:00:20 +0000 (17:30 +0530)
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/Main.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php

index 39af77a1cabcfbbee48becba0b7ba0d914e0ec46..35470008fa484469d5ccc7359e6f5734c916e3e3 100644 (file)
@@ -496,6 +496,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       $contribButton = ts('Continue');
       $this->assign('button', ts('Continue'));
     }
+    elseif (!empty($this->_ccid)) {
+      $contribButton = ts('Make Payment');
+      $this->assign('button', ts('Make Payment'));
+    }
     else {
       $contribButton = ts('Make Contribution');
       $this->assign('button', ts('Make Contribution'));
index f36f4398d58f4ec57ceae38396b9500585fd6228..76cdb228808b45c905182a9dca6e63201be494e2 100644 (file)
@@ -157,7 +157,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $this->_defaults = array_merge($this->_defaults, $billingDefaults);
     }
     if (!empty($this->_ccid) && !empty($this->_pendingAmount)) {
-      $this->_defaults['total_amount'] = $this->_pendingAmount;
+      $this->_defaults['total_amount'] = CRM_Utils_Money::format($this->_pendingAmount, NULL, '%a');
     }
 
     /*
@@ -544,6 +544,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       if (empty($this->_values['is_confirm_enabled'])) {
         $submitButton['js'] = array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');");
       }
+      //change button name for updating contribution
+      if (!empty($this->_ccid)) {
+        $submitButton['name'] = ts('Confirm Payment');
+      }
       $this->addButtons(array($submitButton));
     }
 
index 8c2f80e92948d4a45581f19d48949ae10f10a949..fcd510d771ca8c5fff7fb666e679d63395ea984d 100644 (file)
@@ -619,7 +619,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
 
     if (empty($priceSet)) {
       $this->waitForElementPresent("total_amount");
-      $this->assertTrue($this->isElementPresent("xpath=//input[@id='total_amount'][@readonly=1][@value=100]"));
+      $this->assertTrue($this->isElementPresent("xpath=//input[@id='total_amount'][@readonly=1][@value='100.00']"));
     }
     else {
       $this->assertElementContainsText("xpath=//div[@class='header-dark']", "Contribution Information");