Пример #1
0
 protected function btnSave_Click()
 {
     $strText = file_get_contents($this->flcUpload->FilePath);
     try {
         $intEntriesModified = 0;
         $intEntriesAdded = 0;
         $intRows = PaypalBatch::ProcessReport($strText, $intEntriesModified, $intEntriesAdded);
         if (!$intEntriesAdded && !$intEntriesModified) {
             QApplication::DisplayAlert('No new or modified entries found.  No changes were made.');
         } else {
             if ($intEntriesAdded) {
                 QApplication::DisplayAlert(sprintf('PayPal import successful.  %s payment entries were updated.  WARNING: %s unlinked credit card payment entries had to be created.', $intEntriesModified, $intEntriesAdded));
             } else {
                 QApplication::DisplayAlert(sprintf('PayPal import successful.  %s payment entries were updated.', $intEntriesModified));
             }
         }
         QApplication::ExecuteJavaScript('document.location = "/stewardship/paypal/";');
     } catch (QCallerException $objExc) {
         QApplication::DisplayAlert('There were problems processing the report file: "' . $objExc->getMessage() . '"');
         return;
     }
 }
Пример #2
0
 protected function Transactions_Refresh()
 {
     // Cache the Payment Array for actual trackable payments
     $this->objPaymentArray = CreditCardPayment::LoadArrayByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, false, QQ::OrderBy(QQN::CreditCardPayment()->DateCaptured));
     if ($this->objBatch->ReconciledFlag) {
         $this->lblInstructionHtml->Text = sprintf('This PayPal Batch was posted to NOAH on <strong>%s</strong>.<br/><strong>No more changes can be made to this PayPal Batch.</strong><br/><br/>' . 'Click the following to view the linked <strong><a href="/stewardship/batch.php/%s#1">Stewardship Batch</a></strong>.<br/>' . 'Click on any <strong>Date Captured</strong> below on a credit card transaction with a donation record to view its linked Stewardship Entry.', $this->objBatch->DateReconciled->ToString('MMMM D YYYY at h:mm z'), $this->objBatch->StewardshipBatchId);
         $this->btnPost->Visible = false;
         $this->btnSplit->Visible = false;
         $this->dtxDateCredited->Visible = false;
     } else {
         if ($this->objBatch->IsUncategorizedPaymentsExist()) {
             $this->lblInstructionHtml->Text = 'There are currently unspecified funding accounts for one more more credit card payment line item.  Please ensure all items are accounted for before posting to NOAH.';
             $this->btnPost->Visible = false;
             $this->btnSplit->Visible = false;
             $this->dtxDateCredited->Visible = false;
             if (CreditCardPayment::CountByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, true)) {
                 $this->lblInstructionHtml->Text .= '<br/><br/><strong>WARNING!</strong>  There are unaccountable Credit Card Payment records in this batch!';
             }
         } else {
             $this->lblInstructionHtml->Text = 'This PayPal Batch has not yet been posted to NOAH.  Click on <strong>Post to NOAH</strong> when you are sure that there are no more changes or additions left for this batch.';
             $this->btnPost->Visible = true;
             $this->btnSplit->Visible = true;
             $this->dtxDateCredited->Visible = true;
             $this->btnPost->RemoveAllActions(QClickEvent::EventName);
             if (CreditCardPayment::CountByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, true)) {
                 $this->lblInstructionHtml->Text .= '<br/><br/><strong>WARNING!</strong>  There are unaccountable Credit Card Payment records in this batch!';
                 $this->btnPost->AddAction(new QClickEvent(), new QConfirmAction('NOTE!  There are unaccountable Credit Card Payment records in this batch!  You are about to PERMANENTLY post this batch to NOAH.  No changes can be made after this point.  Are you SURE you want to proceed?'));
                 $this->btnPost->AddAction(new QClickEvent(), new QAjaxAction('btnPost_Click'));
             } else {
                 $this->btnPost->AddAction(new QClickEvent(), new QConfirmAction('You are about to PERMANENTLY post this batch to NOAH.  No changes can be made after this point.  Are you SURE you want to proceed?'));
                 $this->btnPost->AddAction(new QClickEvent(), new QAjaxAction('btnPost_Click'));
             }
         }
     }
     $this->dtgTransactions->Refresh();
     $this->dtgFunding->Refresh();
 }
Пример #3
0
 public function RenderCount(PaypalBatch $objBatch)
 {
     return $objBatch->CountCreditCardPayments();
 }
Пример #4
0
 /**
  * This will process a report text file as taken from PayPal.  This will create any applicable PaypalBatch entries
  * and correlate with existing CreditCardPayment records.  This will *only* process "Delayed Capture" transactions,
  * since that's all we actually care about.  This will create "as unlinked" any CreditCardPayment records that had
  * to be created because it didn't exist (which means that this is a bad thing -- we should not have any of those).
  * 
  * If there are any issues with importing, this will throw an error
  * 
  * @param string $strReportText the text of the report itself from paypal
  * @param integer $intEntriesModified return value of the number of entries that were modified
  * @param integer $intEntriesAdded return value of the number of entries that were created (hopefully shouuld be zero)
  * @throws QCallerException
  */
 public static function ProcessReport($strReportText, &$intEntriesModified, &$intEntriesAdded)
 {
     $intEntriesModified = 0;
     $intEntriesAdded = 0;
     // Cleanup Linebreaks
     $strReportText = str_replace("\r", "\n", $strReportText);
     while (strpos($strReportText, "\n\n") !== false) {
         $strReportText = str_replace("\n\n", "\n", $strReportText);
     }
     $strReportText = trim($strReportText);
     // Pull out the First Line (column headers) from the rest of the report
     $intPosition = strpos($strReportText, "\n");
     $strFirstLine = substr($strReportText, 0, $intPosition);
     $strReportText = substr($strReportText, $intPosition + 1);
     // Calculate the tokens
     $strTokenArray = array();
     $intColumnIndex = 0;
     foreach (explode("\t", $strFirstLine) as $strToken) {
         if (array_key_exists($strToken, $strTokenArray)) {
             throw new QCallerException('Report has a duplicate column: ' . $strToken);
         }
         $strTokenArray[$strToken] = $intColumnIndex;
         $intColumnIndex++;
     }
     // Ensure that the required fields exist
     foreach (self::$RequiredFields as $strRequiredToken) {
         if (!array_key_exists($strRequiredToken, $strTokenArray)) {
             throw new QCallerException('Report is missing required column: ' . $strRequiredToken);
         }
     }
     // Go through each line of the report
     foreach (explode("\n", $strReportText) as $strLine) {
         // Break out all cells, and then create a specific Values array that contain only the cells we care about, indexed by name
         $strCellArray = explode("\t", $strLine);
         $strValuesArray = array();
         foreach (self::$RequiredFields as $strRequiredToken) {
             $strValuesArray[$strRequiredToken] = $strCellArray[$strTokenArray[$strRequiredToken]];
         }
         // Only process "Delayed Capture"
         if ($strValuesArray['Type'] == 'Delayed Capture') {
             if (strlen(trim($strValuesArray[self::PayPalOriginalTransactionId])) == 0) {
                 throw new QCallerException('Transaction ' . $strValuesArray[self::PayPalTransactionId] . ' does not have an Original Transaction Id');
             }
             // Can we find the linked CCPayment Record?
             $objCreditCardPayment = CreditCardPayment::LoadByTransactionCode($strValuesArray[self::PayPalOriginalTransactionId]);
             if (!$objCreditCardPayment) {
                 // No -- let's create this as an UNLINKED one
                 $intEntriesAdded++;
                 $objCreditCardPayment = new CreditCardPayment();
                 $objCreditCardPayment->TransactionCode = $strValuesArray[self::PayPalOriginalTransactionId];
                 $objCreditCardPayment->CreditCardStatusTypeId = CreditCardStatusType::Captured;
                 $objCreditCardPayment->CreditCardLastFour = substr($strValuesArray[self::PayPalAccountNumber], strlen($strValuesArray[self::PayPalAccountNumber]) - 4);
                 foreach (CreditCardType::$NameArray as $intId => $strName) {
                     if (strtolower($strName) == strtolower($strValuesArray[self::PayPalTenderType])) {
                         $objCreditCardPayment->CreditCardTypeId = $intId;
                     }
                 }
                 if (!$objCreditCardPayment->CreditCardTypeId) {
                     throw new QCallerException('Unlinked transaction contains an unknown credit card type: ' . $strValuesArray[self::PayPalTenderType]);
                 }
                 $objCreditCardPayment->UnlinkedFlag = true;
                 // Setup Fields
                 $objCreditCardPayment->AuthorizationCode = $strValuesArray[self::PayPalAuthCode];
                 $objCreditCardPayment->AmountCharged = $strValuesArray[self::PayPalAmount];
             }
             // Link in the Pay Pal Batch Info (if applicable)
             //					if (SERVER_INSTANCE == 'dev') $strValuesArray[self::PayPalBatchId] = 789;
             if ($intBatchNumber = trim($strValuesArray[self::PayPalBatchId])) {
                 $objPayPalBatch = PaypalBatch::LoadByNumber($intBatchNumber);
                 if (!$objPayPalBatch) {
                     $objPayPalBatch = new PaypalBatch();
                     $objPayPalBatch->Number = $intBatchNumber;
                     $objPayPalBatch->DateReceived = new QDateTime($strValuesArray[self::PayPalSettledDate]);
                     $objPayPalBatch->ReconciledFlag = false;
                     $objPayPalBatch->Save();
                 }
                 if ($objCreditCardPayment->PaypalBatchId != $objPayPalBatch->Id) {
                     $objCreditCardPayment->PaypalBatch = $objPayPalBatch;
                     if ($objCreditCardPayment->Id) {
                         $intEntriesModified++;
                     }
                 }
             } else {
                 if (!is_null($objCreditCardPayment->PaypalBatchId)) {
                     $objCreditCardPayment->PaypalBatch = null;
                     if ($objCreditCardPayment->Id) {
                         $intEntriesModified++;
                     }
                 }
             }
             // TODO: How do we account fo a "reconciled" PayPal batch that unexpectatly received another transaction not previously accounted for?
             // Check Fields to ensure match
             if ($objCreditCardPayment->AuthorizationCode != $strValuesArray[self::PayPalAuthCode]) {
                 throw new QCallerException(sprintf('Mismatch AuthCode for Transaction %s: %s vs. %s', $strValuesArray[self::PayPalOriginalTransactionId], $strValuesArray[self::PayPalAuthCode], $objCreditCardPayment->AuthorizationCode));
             }
             if ($objCreditCardPayment->AmountCharged != str_replace(',', '', $strValuesArray[self::PayPalAmount])) {
                 throw new QCallerException(sprintf('Mismatch Amount for Transaction %s: %s vs. %s', $strValuesArray[self::PayPalOriginalTransactionId], $strValuesArray[self::PayPalAmount], $objCreditCardPayment->AmountCharged));
             }
             // Update Fields
             $objCreditCardPayment->DateCaptured = new QDateTime($strValuesArray[self::PayPalTime]);
             $objCreditCardPayment->Save();
         }
     }
 }
Пример #5
0
 /**
  * Main utility method to aid with data binding.  It is used by the default BindAllRows() databinder but
  * could and should be used by any custom databind methods that would be used for instances of this
  * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. 
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  *
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query		 
  * @return void
  */
 public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     // Setup input parameters to default values if none passed in
     if (!$objCondition) {
         $objCondition = QQ::All();
     }
     $objClauses = $objOptionalClauses ? $objOptionalClauses : array();
     // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = PaypalBatch::QueryCount($objCondition, $objClauses);
     }
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from PaypalBatch, given the clauses above
     $this->DataSource = PaypalBatch::QueryArray($objCondition, $objClauses);
 }
 /**
  * This will save this object's StewardshipBatch instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveStewardshipBatch()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->lstStewardshipBatchStatusType) {
             $this->objStewardshipBatch->StewardshipBatchStatusTypeId = $this->lstStewardshipBatchStatusType->SelectedValue;
         }
         if ($this->calDateEntered) {
             $this->objStewardshipBatch->DateEntered = $this->calDateEntered->DateTime;
         }
         if ($this->calDateCredited) {
             $this->objStewardshipBatch->DateCredited = $this->calDateCredited->DateTime;
         }
         if ($this->txtBatchLabel) {
             $this->objStewardshipBatch->BatchLabel = $this->txtBatchLabel->Text;
         }
         if ($this->txtDescription) {
             $this->objStewardshipBatch->Description = $this->txtDescription->Text;
         }
         if ($this->txtItemCount) {
             $this->objStewardshipBatch->ItemCount = $this->txtItemCount->Text;
         }
         if ($this->txtReportedTotalAmount) {
             $this->objStewardshipBatch->ReportedTotalAmount = $this->txtReportedTotalAmount->Text;
         }
         if ($this->txtActualTotalAmount) {
             $this->objStewardshipBatch->ActualTotalAmount = $this->txtActualTotalAmount->Text;
         }
         if ($this->txtPostedTotalAmount) {
             $this->objStewardshipBatch->PostedTotalAmount = $this->txtPostedTotalAmount->Text;
         }
         if ($this->lstCreatedByLogin) {
             $this->objStewardshipBatch->CreatedByLoginId = $this->lstCreatedByLogin->SelectedValue;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstPaypalBatch) {
             $this->objStewardshipBatch->PaypalBatch = PaypalBatch::Load($this->lstPaypalBatch->SelectedValue);
         }
         // Save the StewardshipBatch object
         $this->objStewardshipBatch->Save();
         // Finally, update any ManyToManyReferences (if any)
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
Пример #7
0
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, PaypalBatch::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
Пример #8
0
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this PaypalBatchMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing PaypalBatch object creation - defaults to CreateOrEdit
  * @return PaypalBatchMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objPaypalBatch = PaypalBatch::Load($intId);
         // PaypalBatch was found -- return it!
         if ($objPaypalBatch) {
             return new PaypalBatchMetaControl($objParentObject, $objPaypalBatch);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a PaypalBatch object with PK arguments: ' . $intId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new PaypalBatchMetaControl($objParentObject, new PaypalBatch());
 }
Пример #9
0
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->dttDateAuthorized) {
         $objObject->dttDateAuthorized = $objObject->dttDateAuthorized->__toString(QDateTime::FormatSoap);
     }
     if ($objObject->dttDateCaptured) {
         $objObject->dttDateCaptured = $objObject->dttDateCaptured->__toString(QDateTime::FormatSoap);
     }
     if ($objObject->objPaypalBatch) {
         $objObject->objPaypalBatch = PaypalBatch::GetSoapObjectFromObject($objObject->objPaypalBatch, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intPaypalBatchId = null;
         }
     }
     if ($objObject->objStewardshipContribution) {
         $objObject->objStewardshipContribution = StewardshipContribution::GetSoapObjectFromObject($objObject->objStewardshipContribution, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intStewardshipContributionId = null;
         }
     }
     return $objObject;
 }
Пример #10
0
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'StewardshipBatchStatusTypeId':
             // Gets the value for intStewardshipBatchStatusTypeId (Not Null)
             // @return integer
             return $this->intStewardshipBatchStatusTypeId;
         case 'DateEntered':
             // Gets the value for dttDateEntered (Not Null)
             // @return QDateTime
             return $this->dttDateEntered;
         case 'DateCredited':
             // Gets the value for dttDateCredited (Not Null)
             // @return QDateTime
             return $this->dttDateCredited;
         case 'BatchLabel':
             // Gets the value for strBatchLabel (Not Null)
             // @return string
             return $this->strBatchLabel;
         case 'Description':
             // Gets the value for strDescription
             // @return string
             return $this->strDescription;
         case 'ItemCount':
             // Gets the value for intItemCount
             // @return integer
             return $this->intItemCount;
         case 'ReportedTotalAmount':
             // Gets the value for fltReportedTotalAmount
             // @return double
             return $this->fltReportedTotalAmount;
         case 'ActualTotalAmount':
             // Gets the value for fltActualTotalAmount
             // @return double
             return $this->fltActualTotalAmount;
         case 'PostedTotalAmount':
             // Gets the value for fltPostedTotalAmount
             // @return double
             return $this->fltPostedTotalAmount;
         case 'CreatedByLoginId':
             // Gets the value for intCreatedByLoginId (Not Null)
             // @return integer
             return $this->intCreatedByLoginId;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'CreatedByLogin':
             // Gets the value for the Login object referenced by intCreatedByLoginId (Not Null)
             // @return Login
             try {
                 if (!$this->objCreatedByLogin && !is_null($this->intCreatedByLoginId)) {
                     $this->objCreatedByLogin = Login::Load($this->intCreatedByLoginId);
                 }
                 return $this->objCreatedByLogin;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PaypalBatch':
             // Gets the value for the PaypalBatch object that uniquely references this StewardshipBatch
             // by objPaypalBatch (Unique)
             // @return PaypalBatch
             try {
                 if ($this->objPaypalBatch === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objPaypalBatch) {
                     $this->objPaypalBatch = PaypalBatch::LoadByStewardshipBatchId($this->intId);
                 }
                 return $this->objPaypalBatch;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         case '_StewardshipContribution':
             // Gets the value for the private _objStewardshipContribution (Read-Only)
             // if set due to an expansion on the stewardship_contribution.stewardship_batch_id reverse relationship
             // @return StewardshipContribution
             return $this->_objStewardshipContribution;
         case '_StewardshipContributionArray':
             // Gets the value for the private _objStewardshipContributionArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_contribution.stewardship_batch_id reverse relationship
             // @return StewardshipContribution[]
             return (array) $this->_objStewardshipContributionArray;
         case '_StewardshipPost':
             // Gets the value for the private _objStewardshipPost (Read-Only)
             // if set due to an expansion on the stewardship_post.stewardship_batch_id reverse relationship
             // @return StewardshipPost
             return $this->_objStewardshipPost;
         case '_StewardshipPostArray':
             // Gets the value for the private _objStewardshipPostArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_post.stewardship_batch_id reverse relationship
             // @return StewardshipPost[]
             return (array) $this->_objStewardshipPostArray;
         case '_StewardshipStack':
             // Gets the value for the private _objStewardshipStack (Read-Only)
             // if set due to an expansion on the stewardship_stack.stewardship_batch_id reverse relationship
             // @return StewardshipStack
             return $this->_objStewardshipStack;
         case '_StewardshipStackArray':
             // Gets the value for the private _objStewardshipStackArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_stack.stewardship_batch_id reverse relationship
             // @return StewardshipStack[]
             return (array) $this->_objStewardshipStackArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 /**
  * Refresh this MetaControl with Data from the local CreditCardPayment object.
  * @param boolean $blnReload reload CreditCardPayment from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objCreditCardPayment->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objCreditCardPayment->Id;
         }
     }
     if ($this->lstCreditCardStatusType) {
         $this->lstCreditCardStatusType->SelectedValue = $this->objCreditCardPayment->CreditCardStatusTypeId;
     }
     if ($this->lblCreditCardStatusTypeId) {
         $this->lblCreditCardStatusTypeId->Text = $this->objCreditCardPayment->CreditCardStatusTypeId ? CreditCardStatusType::$NameArray[$this->objCreditCardPayment->CreditCardStatusTypeId] : null;
     }
     if ($this->lstCreditCardType) {
         $this->lstCreditCardType->SelectedValue = $this->objCreditCardPayment->CreditCardTypeId;
     }
     if ($this->lblCreditCardTypeId) {
         $this->lblCreditCardTypeId->Text = $this->objCreditCardPayment->CreditCardTypeId ? CreditCardType::$NameArray[$this->objCreditCardPayment->CreditCardTypeId] : null;
     }
     if ($this->txtCreditCardLastFour) {
         $this->txtCreditCardLastFour->Text = $this->objCreditCardPayment->CreditCardLastFour;
     }
     if ($this->lblCreditCardLastFour) {
         $this->lblCreditCardLastFour->Text = $this->objCreditCardPayment->CreditCardLastFour;
     }
     if ($this->txtTransactionCode) {
         $this->txtTransactionCode->Text = $this->objCreditCardPayment->TransactionCode;
     }
     if ($this->lblTransactionCode) {
         $this->lblTransactionCode->Text = $this->objCreditCardPayment->TransactionCode;
     }
     if ($this->txtAuthorizationCode) {
         $this->txtAuthorizationCode->Text = $this->objCreditCardPayment->AuthorizationCode;
     }
     if ($this->lblAuthorizationCode) {
         $this->lblAuthorizationCode->Text = $this->objCreditCardPayment->AuthorizationCode;
     }
     if ($this->txtAddressMatchCode) {
         $this->txtAddressMatchCode->Text = $this->objCreditCardPayment->AddressMatchCode;
     }
     if ($this->lblAddressMatchCode) {
         $this->lblAddressMatchCode->Text = $this->objCreditCardPayment->AddressMatchCode;
     }
     if ($this->calDateAuthorized) {
         $this->calDateAuthorized->DateTime = $this->objCreditCardPayment->DateAuthorized;
     }
     if ($this->lblDateAuthorized) {
         $this->lblDateAuthorized->Text = sprintf($this->objCreditCardPayment->DateAuthorized) ? $this->objCreditCardPayment->__toString($this->strDateAuthorizedDateTimeFormat) : null;
     }
     if ($this->calDateCaptured) {
         $this->calDateCaptured->DateTime = $this->objCreditCardPayment->DateCaptured;
     }
     if ($this->lblDateCaptured) {
         $this->lblDateCaptured->Text = sprintf($this->objCreditCardPayment->DateCaptured) ? $this->objCreditCardPayment->__toString($this->strDateCapturedDateTimeFormat) : null;
     }
     if ($this->txtAmountCharged) {
         $this->txtAmountCharged->Text = $this->objCreditCardPayment->AmountCharged;
     }
     if ($this->lblAmountCharged) {
         $this->lblAmountCharged->Text = $this->objCreditCardPayment->AmountCharged;
     }
     if ($this->txtAmountFee) {
         $this->txtAmountFee->Text = $this->objCreditCardPayment->AmountFee;
     }
     if ($this->lblAmountFee) {
         $this->lblAmountFee->Text = $this->objCreditCardPayment->AmountFee;
     }
     if ($this->txtAmountCleared) {
         $this->txtAmountCleared->Text = $this->objCreditCardPayment->AmountCleared;
     }
     if ($this->lblAmountCleared) {
         $this->lblAmountCleared->Text = $this->objCreditCardPayment->AmountCleared;
     }
     if ($this->lstPaypalBatch) {
         $this->lstPaypalBatch->RemoveAllItems();
         $this->lstPaypalBatch->AddItem(QApplication::Translate('- Select One -'), null);
         $objPaypalBatchArray = PaypalBatch::LoadAll();
         if ($objPaypalBatchArray) {
             foreach ($objPaypalBatchArray as $objPaypalBatch) {
                 $objListItem = new QListItem($objPaypalBatch->__toString(), $objPaypalBatch->Id);
                 if ($this->objCreditCardPayment->PaypalBatch && $this->objCreditCardPayment->PaypalBatch->Id == $objPaypalBatch->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstPaypalBatch->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPaypalBatchId) {
         $this->lblPaypalBatchId->Text = $this->objCreditCardPayment->PaypalBatch ? $this->objCreditCardPayment->PaypalBatch->__toString() : null;
     }
     if ($this->chkUnlinkedFlag) {
         $this->chkUnlinkedFlag->Checked = $this->objCreditCardPayment->UnlinkedFlag;
     }
     if ($this->lblUnlinkedFlag) {
         $this->lblUnlinkedFlag->Text = $this->objCreditCardPayment->UnlinkedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstStewardshipContribution) {
         $this->lstStewardshipContribution->RemoveAllItems();
         $this->lstStewardshipContribution->AddItem(QApplication::Translate('- Select One -'), null);
         $objStewardshipContributionArray = StewardshipContribution::LoadAll();
         if ($objStewardshipContributionArray) {
             foreach ($objStewardshipContributionArray as $objStewardshipContribution) {
                 $objListItem = new QListItem($objStewardshipContribution->__toString(), $objStewardshipContribution->Id);
                 if ($this->objCreditCardPayment->StewardshipContribution && $this->objCreditCardPayment->StewardshipContribution->Id == $objStewardshipContribution->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstStewardshipContribution->AddItem($objListItem);
             }
         }
     }
     if ($this->lblStewardshipContributionId) {
         $this->lblStewardshipContributionId->Text = $this->objCreditCardPayment->StewardshipContribution ? $this->objCreditCardPayment->StewardshipContribution->__toString() : null;
     }
     if ($this->lstOnlineDonation) {
         $this->lstOnlineDonation->RemoveAllItems();
         $this->lstOnlineDonation->AddItem(QApplication::Translate('- Select One -'), null);
         $objOnlineDonationArray = OnlineDonation::LoadAll();
         if ($objOnlineDonationArray) {
             foreach ($objOnlineDonationArray as $objOnlineDonation) {
                 $objListItem = new QListItem($objOnlineDonation->__toString(), $objOnlineDonation->Id);
                 if ($objOnlineDonation->CreditCardPaymentId == $this->objCreditCardPayment->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstOnlineDonation->AddItem($objListItem);
             }
         }
     }
     if ($this->lblOnlineDonation) {
         $this->lblOnlineDonation->Text = $this->objCreditCardPayment->OnlineDonation ? $this->objCreditCardPayment->OnlineDonation->__toString() : null;
     }
     if ($this->lstSignupPayment) {
         $this->lstSignupPayment->RemoveAllItems();
         $this->lstSignupPayment->AddItem(QApplication::Translate('- Select One -'), null);
         $objSignupPaymentArray = SignupPayment::LoadAll();
         if ($objSignupPaymentArray) {
             foreach ($objSignupPaymentArray as $objSignupPayment) {
                 $objListItem = new QListItem($objSignupPayment->__toString(), $objSignupPayment->Id);
                 if ($objSignupPayment->CreditCardPaymentId == $this->objCreditCardPayment->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSignupPayment->AddItem($objListItem);
             }
         }
     }
     if ($this->lblSignupPayment) {
         $this->lblSignupPayment->Text = $this->objCreditCardPayment->SignupPayment ? $this->objCreditCardPayment->SignupPayment->__toString() : null;
     }
 }