コード例 #1
0
        /// <summary>
        /// Patch CatalogBase type
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this PaymentInEntity source, PaymentInEntity target)
        {
            if (target == null)
                throw new ArgumentNullException("target");

            source.Patch((OperationEntity)target);

            var patchInjectionPolicy = new PatchInjection<PaymentInEntity>(x => x.CustomerId, x => x.OrganizationId, x => x.GatewayCode, x => x.Purpose, x => x.OuterId, x => x.Status, x => x.AuthorizedDate, x => x.CapturedDate, x => x.VoidedDate, x => x.IsCancelled, x => x.CancelledDate, x => x.CancelReason);
            target.InjectFrom(patchInjectionPolicy, source);

            if (!source.Addresses.IsNullCollection())
            {
                source.Addresses.Patch(target.Addresses, new AddressComparer(), (sourceAddress, targetAddress) => sourceAddress.Patch(targetAddress));
            }
        }
コード例 #2
0
        public static PaymentInEntity ToDataModel(this PaymentIn paymentIn, CustomerOrderEntity orderEntity)
        {
            if (paymentIn == null)
                throw new ArgumentNullException("paymentIn");

            var retVal = new PaymentInEntity();
            retVal.InjectFrom(paymentIn);

            retVal.Currency = paymentIn.Currency.ToString();
            retVal.Status = paymentIn.PaymentStatus.ToString();

         
            if (paymentIn.BillingAddress != null)
            {
                retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { paymentIn.BillingAddress.ToDataModel() });
            }
            return retVal;
        }
コード例 #3
0
		public static PaymentInEntity ToDataModel(this PaymentIn paymentIn)
		{
			if (paymentIn == null)
				throw new ArgumentNullException("paymentIn");

			var retVal = new PaymentInEntity();
			retVal.InjectFrom(paymentIn);

			retVal.Currency = paymentIn.Currency.ToString();

			if (paymentIn.Properties != null)
			{
				retVal.Properties = new ObservableCollection<OperationPropertyEntity>(paymentIn.Properties.Select(x => x.ToDataModel()));
			}
			if (paymentIn.BillingAddress != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { paymentIn.BillingAddress.ToDataModel() });
			}
			return retVal;
		}