Client model for FinancialPaymentDetail that includes all the fields that are available for GETs. Use this for GETs (use FinancialPaymentDetailEntity for POST/PUTs)
Inheritance: FinancialPaymentDetailEntity
Ejemplo n.º 1
0
 /// <summary>
 /// Copies the base properties from a source FinancialPaymentDetail object
 /// </summary>
 /// <param name="source">The source.</param>
 public void CopyPropertiesFrom(FinancialPaymentDetail source)
 {
     this.Id = source.Id;
     this.AccountNumberMasked           = source.AccountNumberMasked;
     this.BillingLocationId             = source.BillingLocationId;
     this.CreditCardTypeValueId         = source.CreditCardTypeValueId;
     this.CurrencyTypeValueId           = source.CurrencyTypeValueId;
     this.ExpirationMonth               = source.ExpirationMonth;
     this.ExpirationMonthEncrypted      = source.ExpirationMonthEncrypted;
     this.ExpirationYear                = source.ExpirationYear;
     this.ExpirationYearEncrypted       = source.ExpirationYearEncrypted;
     this.FinancialPersonSavedAccountId = source.FinancialPersonSavedAccountId;
     this.ForeignGuid                       = source.ForeignGuid;
     this.ForeignKey                        = source.ForeignKey;
     this.GatewayPersonIdentifier           = source.GatewayPersonIdentifier;
     this.ModifiedAuditValuesAlreadyUpdated = source.ModifiedAuditValuesAlreadyUpdated;
     this.NameOnCard                        = source.NameOnCard;
     this.NameOnCardEncrypted               = source.NameOnCardEncrypted;
     this.CreatedDateTime                   = source.CreatedDateTime;
     this.ModifiedDateTime                  = source.ModifiedDateTime;
     this.CreatedByPersonAliasId            = source.CreatedByPersonAliasId;
     this.ModifiedByPersonAliasId           = source.ModifiedByPersonAliasId;
     this.Guid      = source.Guid;
     this.ForeignId = source.ForeignId;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Uploads the scanned item.
        /// </summary>
        /// <param name="scannedDocInfo">The scanned document information.</param>
        private void UploadScannedItem( ScannedDocInfo scannedDocInfo )
        {
            RockRestClient client = EnsureUploadScanRestClient();

            // upload image of front of doc
            string frontImageFileName = string.Format( "image1_{0}.png", DateTime.Now.ToString( "o" ).RemoveSpecialCharacters() );
            int frontImageBinaryFileId = client.UploadBinaryFile( frontImageFileName, Rock.Client.SystemGuid.BinaryFiletype.CONTRIBUTION_IMAGE.AsGuid(), scannedDocInfo.FrontImagePngBytes, false );

            // upload image of back of doc (if it exists)
            int? backImageBinaryFileId = null;
            if ( scannedDocInfo.BackImageData != null )
            {
                // upload image of back of doc
                string backImageFileName = string.Format( "image2_{0}.png", DateTime.Now.ToString( "o" ).RemoveSpecialCharacters() );
                backImageBinaryFileId = client.UploadBinaryFile( backImageFileName, Rock.Client.SystemGuid.BinaryFiletype.CONTRIBUTION_IMAGE.AsGuid(), scannedDocInfo.BackImagePngBytes, false );
            }

            FinancialPaymentDetail financialPaymentDetail = new FinancialPaymentDetail();
            financialPaymentDetail.CurrencyTypeValueId = scannedDocInfo.CurrencyTypeValue.Id;
            financialPaymentDetail.Guid = Guid.NewGuid();
            var financialPaymentDetailId = client.PostData<FinancialPaymentDetail>( "api/FinancialPaymentDetails", financialPaymentDetail ).AsIntegerOrNull();

            FinancialTransaction financialTransaction = new FinancialTransaction();

            financialTransaction.BatchId = batchPage.SelectedFinancialBatch.Id;
            financialTransaction.TransactionCode = string.Empty;
            financialTransaction.Summary = string.Empty;

            financialTransaction.Guid = Guid.NewGuid();
            financialTransaction.TransactionDateTime = batchPage.SelectedFinancialBatch.BatchStartDateTime;

            financialTransaction.FinancialPaymentDetailId = financialPaymentDetailId;
            financialTransaction.SourceTypeValueId = scannedDocInfo.SourceTypeValue.Id;

            financialTransaction.TransactionTypeValueId = transactionTypeValueContribution.Id;

            int? uploadedTransactionId;

            if ( scannedDocInfo.IsCheck )
            {
                financialTransaction.TransactionCode = scannedDocInfo.CheckNumber;
                financialTransaction.MICRStatus = scannedDocInfo.BadMicr ? MICRStatus.Fail : MICRStatus.Success;

                FinancialTransactionScannedCheck financialTransactionScannedCheck = new FinancialTransactionScannedCheck();

                // Rock server will encrypt CheckMicrPlainText to this since we can't have the DataEncryptionKey in a RestClient
                financialTransactionScannedCheck.FinancialTransaction = financialTransaction;
                financialTransactionScannedCheck.ScannedCheckMicrData = scannedDocInfo.ScannedCheckMicrData;
                financialTransactionScannedCheck.ScannedCheckMicrParts = scannedDocInfo.ScannedCheckMicrParts;

                uploadedTransactionId = client.PostData<FinancialTransactionScannedCheck>( "api/FinancialTransactions/PostScanned", financialTransactionScannedCheck ).AsIntegerOrNull();
            }
            else
            {
                uploadedTransactionId = client.PostData<FinancialTransaction>( "api/FinancialTransactions", financialTransaction as FinancialTransaction ).AsIntegerOrNull();
            }

            // upload FinancialTransactionImage records for front/back
            FinancialTransactionImage financialTransactionImageFront = new FinancialTransactionImage();
            financialTransactionImageFront.BinaryFileId = frontImageBinaryFileId;
            financialTransactionImageFront.TransactionId = uploadedTransactionId.Value;
            financialTransactionImageFront.Order = 0;
            financialTransactionImageFront.Guid = Guid.NewGuid();
            client.PostData<FinancialTransactionImage>( "api/FinancialTransactionImages", financialTransactionImageFront );

            if ( backImageBinaryFileId.HasValue )
            {
                FinancialTransactionImage financialTransactionImageBack = new FinancialTransactionImage();
                financialTransactionImageBack.BinaryFileId = backImageBinaryFileId.Value;
                financialTransactionImageBack.TransactionId = uploadedTransactionId.Value;
                financialTransactionImageBack.Order = 1;
                financialTransactionImageBack.Guid = Guid.NewGuid();
                client.PostData<FinancialTransactionImage>( "api/FinancialTransactionImages", financialTransactionImageBack );
            }

            scannedDocInfo.TransactionId = uploadedTransactionId;
            financialTransaction.Id = uploadedTransactionId ?? 0;
            financialTransaction.CreatedDateTime = financialTransaction.CreatedDateTime ?? DateTime.Now;

            var transactionList = batchPage.grdBatchItems.DataContext as BindingList<FinancialTransaction>;
            transactionList.Insert( 0, financialTransaction );

            _itemsUploaded++;
            ShowUploadStats();
            ShowUploadSuccess();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Copies the base properties from a source FinancialPaymentDetail object
 /// </summary>
 /// <param name="source">The source.</param>
 public void CopyPropertiesFrom( FinancialPaymentDetail source )
 {
     this.Id = source.Id;
     this.AccountNumberMasked = source.AccountNumberMasked;
     this.BillingLocationId = source.BillingLocationId;
     this.CreditCardTypeValueId = source.CreditCardTypeValueId;
     this.CurrencyTypeValueId = source.CurrencyTypeValueId;
     this.ExpirationMonthEncrypted = source.ExpirationMonthEncrypted;
     this.ExpirationYearEncrypted = source.ExpirationYearEncrypted;
     this.ForeignGuid = source.ForeignGuid;
     this.ForeignKey = source.ForeignKey;
     this.ModifiedAuditValuesAlreadyUpdated = source.ModifiedAuditValuesAlreadyUpdated;
     this.NameOnCardEncrypted = source.NameOnCardEncrypted;
     this.CreatedDateTime = source.CreatedDateTime;
     this.ModifiedDateTime = source.ModifiedDateTime;
     this.CreatedByPersonAliasId = source.CreatedByPersonAliasId;
     this.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId;
     this.Guid = source.Guid;
     this.ForeignId = source.ForeignId;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Copies the base properties from a source FinancialPaymentDetail object
 /// </summary>
 /// <param name="source">The source.</param>
 public void CopyPropertiesFrom( FinancialPaymentDetail source )
 {
     this.Id = source.Id;
     this.AccountNumberMasked = source.AccountNumberMasked;
     this.BillingLocationId = source.BillingLocationId;
     this.CreditCardTypeValueId = source.CreditCardTypeValueId;
     this.CurrencyTypeValueId = source.CurrencyTypeValueId;
     this.ExpirationMonthEncrypted = source.ExpirationMonthEncrypted;
     this.ExpirationYearEncrypted = source.ExpirationYearEncrypted;
     this.NameOnCardEncrypted = source.NameOnCardEncrypted;
     this.Guid = source.Guid;
     this.ForeignId = source.ForeignId;
 }