+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
parent::setUp();
}
+ public function testPayNowLink() {
+ $this->webtestLogin();
+
+ //Offline Pay Later Contribution
+ $contact = $this->_testOfflineContribution();
+ $this->openCiviPage("contact/view", "reset=1&cid={$contact['id']}", "css=li#tab_contribute a");
+ $this->click("css=li#tab_contribute a");
+ $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody//tr/td[8]/span/a");
+
+ $this->clickPopupLink("xpath=//table[@class='selector row-highlight']/tbody//tr/td[8]/span/a[@title='Edit Contribution']");
+ $this->waitForElementPresent('financial_type_id');
+
+ $this->clickPopupLink("xpath=//a[contains(text(), 'Pay with Credit Card')]");
+ $this->assertElementContainsText("xpath=//span[@class='ui-dialog-title']", "Pay with Credit Card");
+ $this->assertElementNotPresent("xpath=//select[@id='currency']");
+ $this->assertNotEditable('total_amount');
+ $this->assertElementNotPresent("xpath=//select[@id='contribution_status_id']");
+
+ $this->webtestAddCreditCardDetails();
+ $this->webtestAddBillingDetails();
+
+ //return to the edit contrib form
+ $this->clickAjaxLink('_qf_Contribution_upload-bottom');
+ $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+
+ //save the edit form
+ $this->clickAjaxLink('_qf_Contribution_upload-bottom');
+ $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+
+ $this->clickPopupLink("xpath=//table[@class='selector row-highlight']/tbody//tr/td[8]/span/a[@title='View Contribution']");
+
+ // View Contribution Record and test for expected values
+ $expected = array(
+ 'From' => $contact['display_name'],
+ 'Financial Type' => 'Donation',
+ 'Total Amount' => '$ 100.00',
+ 'Payment Method' => 'Credit Card (Test Processor)',
+ 'Contribution Status' => 'Completed',
+ 'Received Into' => 'Payment Processor Account',
+ 'Net Amount' => '$ 98.50',
+ 'Fee Amount' => '$ 1.50',
+ );
+ $this->webtestVerifyTabularData($expected);
+ }
+
public function testUpdatePendingContribution() {
$this->webtestLogin();
$this->type("note", "This is a test note.");
$this->type("non_deductible_amount", "10");
- $this->type("fee_amount", "0");
- $this->type("net_amount", "0");
$this->type("invoice_id", time());
$this->webtestFillDate('thankyou_date');
// View Contribution Record and test for expected values
$expected = array(
'Financial Type' => 'Donation',
- 'Total Amount' => '100.00',
+ 'Total Amount' => '$ 100.00',
'Contribution Status' => 'Pending',
'Payment Method' => 'Check',
'Check Number' => 'check #1041',
// verify soft credit details
$expected = array(
4 => 'Donation',
- 2 => '100.00',
+ 2 => '$ 100.00',
6 => 'Pending',
1 => $contact['display_name'],
);