Ejemplo n.º 1
0
 public void notifyObserversFinishCancel(TxType requestInfo)
 {
     NotifyObservers(observer =>
     {
         observer.onFinishCancel(requestInfo);
     });
 }
Ejemplo n.º 2
0
		public TransactionRegistration(string vendorTxCode, ShoppingBasket basket, string notificationUrl,
							Address billingAddress, Address deliveryAddress, string customerEmail,
							string vendorName, PaymentFormProfile paymentFormProfile, string currencyCode, 
							MerchantAccountType accountType, TxType txType) {
			VendorTxCode = vendorTxCode;
			NotificationURL = notificationUrl;
			this.basket = basket;
			this.billingAddress = billingAddress;
			this.deliveryAddress = deliveryAddress;
			customerEMail = customerEmail;
			this.vendorName = vendorName;
			switch (paymentFormProfile) {
				case PaymentFormProfile.Low:
					profile = LowProfileFormMode;
					break;
				default:
					profile = NormalFormMode;
					break;
			}
			switch (accountType)
			{
				case MerchantAccountType.MailOrder:
					this.accountType=AccountTypeMailOrder;
					break;
				default:
					this.accountType = AccountTypeEcommerce;
					break;
			}
			this.currency = currencyCode;
			this.txType = txType.ToString().ToUpperInvariant();
		}
Ejemplo n.º 3
0
 public TxRecord(TxType txType, decimal amount, DateTime date, decimal balance)
 {
     TxType  = txType;
     Amount  = amount;
     Date    = date;
     Balance = balance;
 }
 public void notifyObserversFinishCancel(TxType requestInfo)
 {
     foreach (ICloverDeviceObserver observer in deviceObservers)
     {
         observer.onFinishCancel(requestInfo);
     }
 }
Ejemplo n.º 5
0
        private void BindData()
        {
            BuildQuery();

            if (SqlQuery.Trim().Length > 0)
            {
                int iCount = 1;

                lvResultList.Items.Clear();

                SqlCommand cmd = new SqlCommand();
                cmd.CommandText    = SqlQuery;
                cmd.CommandTimeout = ConfigHelper.CommandTimeout;
                cmd.CommandType    = CommandType.Text;

                using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(cmd))
                {
                    while (reader.Read())
                    {
                        ListViewItem lvItem = lvResultList.Items.Add(reader.GetGuid(0).ToString());
                        lvItem.SubItems.Add(iCount.ToString());
                        lvItem.SubItems.Add(reader.GetString(1));
                        lvItem.SubItems.Add(TxType.ToString());
                        lvItem.SubItems.Add(reader.GetDateTime(3).ToString(DateTimeHelper.GetDateFormat()));

                        iCount++;
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public TxStartRequestMessage(PayIntent payIntent, Order order, TxType type)
     : base(Methods.TX_START, 2)
 {
     this.payIntent = payIntent;
     this.order     = order;
     requestInfo    = type;
 }
Ejemplo n.º 7
0
        public bool Before_eip_1559_has_to_be_legacy_or_access_list_tx(TxType txType, bool eip2930, bool eip1559)
        {
            byte[] sigData = new byte[65];
            sigData[31] = 1; // correct r
            sigData[63] = 1; // correct s
            sigData[64] = 38;
            Signature   signature = new(sigData);
            Transaction tx        = Build.A.Transaction
                                    .WithType(txType)
                                    .WithChainId(ChainId.Mainnet)
                                    .WithMaxPriorityFeePerGas(txType == TxType.EIP1559 ? 10.GWei() : 5.GWei())
                                    .WithMaxFeePerGas(txType == TxType.EIP1559 ? 10.GWei() : 5.GWei())
                                    .WithAccessList(txType == TxType.AccessList || txType == TxType.EIP1559 ? new AccessList(new Dictionary <Address, IReadOnlySet <UInt256> >()) : null)
                                    .WithSignature(signature).TestObject;

            tx.Type = txType;

            TxValidator  txValidator = new(1);
            IReleaseSpec releaseSpec = new ReleaseSpec()
            {
                IsEip2930Enabled = eip2930, IsEip1559Enabled = eip1559
            };

            return(txValidator.IsWellFormed(tx, releaseSpec));
        }
Ejemplo n.º 8
0
 public TxStartRequestMessage(PayIntent payIntent, Order order, TxType type, bool suppressOnScreenTips)
     : base(Methods.TX_START)
 {
     this.payIntent            = payIntent;
     this.order                = order;
     requestInfo               = type;
     this.suppressOnScreenTips = suppressOnScreenTips;
 }
Ejemplo n.º 9
0
 public TxEntry(BigInteger height, string hash, uint timestamp, decimal fee, TxType type)
 {
     this.height    = height;
     this.hash      = hash;
     this.timestamp = timestamp;
     this.fee       = fee;
     this.type      = type;
 }
Ejemplo n.º 10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            SetAttributes();

            SelectedTxNumber = string.Empty;
            txtTxType.Text   = TxType.ToString();
        }
Ejemplo n.º 11
0
 public static void Iht8x8Add(TxType txType, ReadOnlySpan <int> input, Span <byte> dest, int stride, int eob)
 {
     if (txType == TxType.DctDct)
     {
         Idct8x8Add(input, dest, stride, eob);
     }
     else
     {
         Iht8x864Add(input, dest, stride, (int)txType);
     }
 }
Ejemplo n.º 12
0
 public static void HighbdIht16x16Add(TxType txType, ReadOnlySpan <int> input, Span <ushort> dest, int stride, int eob, int bd)
 {
     if (txType == TxType.DctDct)
     {
         HighbdIdct16x16Add(input, dest, stride, eob, bd);
     }
     else
     {
         HighbdIht16x16256Add(input, dest, stride, (int)txType, bd);
     }
 }
Ejemplo n.º 13
0
        //public void ReadWrite(UserId userId)
        //{
        //    userId.ReadWrite(this);
        //}

        public void ReadWrite(ref TxType serable)
        {
            var txType = (uint)serable;

            this.ReadWriteAsVarInt(ref txType);

            if (!this.Serializing)
            {
                serable = (TxType)txType;
            }
        }
Ejemplo n.º 14
0
        public bool Chain_Id_required_for_non_legacy_transactions_after_Berlin(TxType txType)
        {
            byte[] sigData = new byte[65];
            sigData[31] = 1; // correct r
            sigData[63] = 1; // correct s
            sigData[64] = 38;
            Signature   signature = new(sigData);
            Transaction tx        = Build.A.Transaction
                                    .WithType(txType > TxType.AccessList ? TxType.Legacy : txType)
                                    .WithAccessList(txType == TxType.AccessList ? new AccessList(new Dictionary <Address, IReadOnlySet <UInt256> >()) : null)
                                    .WithSignature(signature).TestObject;

            tx.Type = txType;

            TxValidator txValidator = new(ChainId.Mainnet);

            return(txValidator.IsWellFormed(tx, Berlin.Instance));
        }
Ejemplo n.º 15
0
        public bool Before_eip_2930_has_to_be_legacy_tx(TxType txType, bool eip2930)
        {
            byte[] sigData = new byte[65];
            sigData[31] = 1; // correct r
            sigData[63] = 1; // correct s
            sigData[64] = 38;
            Signature   signature = new(sigData);
            Transaction tx        = Build.A.Transaction
                                    .WithType(txType > TxType.AccessList ? TxType.Legacy : txType)
                                    .WithChainId(ChainId.Mainnet)
                                    .WithAccessList(txType == TxType.AccessList ? new AccessList(new Dictionary <Address, IReadOnlySet <UInt256> >()) : null)
                                    .WithSignature(signature).TestObject;

            tx.Type = txType;

            TxValidator txValidator = new(1);

            return(txValidator.IsWellFormed(tx, eip2930 ? Berlin.Instance : MuirGlacier.Instance));
        }
Ejemplo n.º 16
0
		public TransactionRegistrationResponse Send(RequestContext context, string vendorTxCode, ShoppingBasket basket,
								Address billingAddress, Address deliveryAddress, string customerEmail, PaymentFormProfile paymentFormProfile = PaymentFormProfile.Normal, string currencyCode="GBP",
								MerchantAccountType accountType=MerchantAccountType.Ecommerce, TxType txType=TxType.Payment) {
			string sagePayUrl = configuration.RegistrationUrl;
			string notificationUrl = urlResolver.BuildNotificationUrl(context);

			var registration = new TransactionRegistration(
				vendorTxCode, basket, notificationUrl,
				billingAddress, deliveryAddress, customerEmail,
				configuration.VendorName,
				paymentFormProfile, currencyCode, accountType, txType);

			var serializer = new HttpPostSerializer();
			var postData = serializer.Serialize(registration);

			var response = requestSender.SendRequest(sagePayUrl, postData);

			var deserializer = new ResponseSerializer();
			return deserializer.Deserialize<TransactionRegistrationResponse>(response);
		}
Ejemplo n.º 17
0
        public bool MaxFeePerGas_is_required_to_be_greater_than_MaxPriorityFeePerGas(TxType txType, int maxFeePerGas, int maxPriorityFeePerGas)
        {
            byte[] sigData = new byte[65];
            sigData[31] = 1; // correct r
            sigData[63] = 1; // correct s
            sigData[64] = 38;
            Signature   signature = new(sigData);
            Transaction tx        = Build.A.Transaction
                                    .WithType(txType > TxType.AccessList ? TxType.Legacy : txType)
                                    .WithMaxPriorityFeePerGas((UInt256)maxPriorityFeePerGas)
                                    .WithMaxFeePerGas((UInt256)maxFeePerGas)
                                    .WithAccessList(txType == TxType.AccessList ? new AccessList(new Dictionary <Address, IReadOnlySet <UInt256> >()) : null)
                                    .WithChainId(ChainId.Mainnet)
                                    .WithSignature(signature).TestObject;

            tx.Type = txType;

            TxValidator txValidator = new(ChainId.Mainnet);

            return(txValidator.IsWellFormed(tx, London.Instance));
        }
Ejemplo n.º 18
0
 public BaseTx(TxType txType)
 {
     this.TxType = txType;
 }
Ejemplo n.º 19
0
 public abstract void doTxStart(PayIntent payIntent, Order order, TxType requestInfo);
Ejemplo n.º 20
0
        /// <summary>
        /// Gets a list of transactions. Multisend transaction is not available in this API.
        /// Query Window: Default query window is latest 24 hours; The maximum start - end query window is 3 months.
        /// </summary>
        /// <returns></returns>
        public TransactionsResponse GetTransactions(string address, TransactionSide transactionSide = TransactionSide.All, TxType txType = TxType.All,
                                                    string txAsset = "", long blockHeight = 0, string symbol = "",
                                                    long limit     = 0, long offset       = 0, int startTime = 0, int endTime = 0)
        {
            //Call specific settings
            string        urlPattern    = "{0}/transactions?address={1}";
            string        url           = string.Format(urlPattern, _env.HttpsApiAddress, address);
            StringBuilder sbQueyrFilter = new StringBuilder();

            if (transactionSide != TransactionSide.All)
            {
                sbQueyrFilter.AppendFormat("&side={0}", transactionSide.ToString());
            }
            if (txType != TxType.All)
            {
                sbQueyrFilter.AppendFormat("&txType={0}", txType.ToString());
            }
            if (!string.IsNullOrWhiteSpace(txAsset))
            {
                sbQueyrFilter.AppendFormat("&txAsset={0}", txAsset);
            }
            if (blockHeight > 0)
            {
                sbQueyrFilter.AppendFormat("&blockHeight={0}", blockHeight);
            }
            if (endTime > 0)
            {
                sbQueyrFilter.AppendFormat("&endTime={0}", endTime);
            }
            if (limit > 0)
            {
                sbQueyrFilter.AppendFormat("&limit={0}", limit);
            }
            if (offset > 0)
            {
                sbQueyrFilter.AppendFormat("&offset={0}", offset);
            }
            if (startTime > 0)
            {
                sbQueyrFilter.AppendFormat("&startTime={0}", startTime);
            }


            if (sbQueyrFilter.Length > 0)
            {
                url = string.Format("{0}{1}", url, sbQueyrFilter);
            }

            int callsPerMinuteAllowed = 60;

            //Generic items for calls
            var response = GetStringResponse(url, urlPattern, callsPerMinuteAllowed, 60);

            //Call specific processing of returned values
            var ret = JsonConvert.DeserializeObject <TransactionsResponse>(response);

            return(ret);
        }
Ejemplo n.º 21
0
        public async Task <TransactionsResponse> GetTransactionsAsync(string address, TransactionSide transactionSide = TransactionSide.All, TxType txType = TxType.All,
                                                                      string txAsset = "", long blockHeight = 0, string symbol = "",
                                                                      long limit     = 0, long offset       = 0, int startTime = 0, int endTime = 0)
        {
            var br = await Task.Run(() =>
            {
                return(GetTransactions(address, transactionSide, txType, txAsset, blockHeight, symbol, limit, offset, startTime, endTime));
            });

            return(br);
        }
Ejemplo n.º 22
0
        public static bool HasCoinbaseMaturity(this TxType txType)
        {
            var type = (int)txType;

            return(type > 0 && type < 30);
        }
Ejemplo n.º 23
0
 public override void doTxStart(PayIntent payIntent, Order order, TxType requestInfo)
 {
     sendObjectMessage(new TxStartRequestMessage(payIntent, order, requestInfo));
 }
Ejemplo n.º 24
0
 public TransactionBuilder <T> WithType(TxType txType)
 {
     TestObjectInternal.Type = txType;
     return(this);
 }
Ejemplo n.º 25
0
 public ReceiptBuilder WithTxType(TxType txType)
 {
     TestObject.TxType = txType;
     return(this);
 }
Ejemplo n.º 26
0
 public static bool IsTxTypeWithAccessList(this TxType txType)
 {
     return(txType != TxType.Legacy);
 }
Ejemplo n.º 27
0
        void parseContent(String content, TxType type)
        {
            String[] lines = content.Split("\r\n");

            switch (type)
            {
            case TxType.HD1:
                Console.WriteLine("Radio ID,Callsign,Name,City,State,Country,Remarks");
                break;

            case TxType.D868:
                Console.WriteLine("Radio ID,Callsign,Name,City,State,Country,Remarks");
                break;

            case TxType.D878:
                Console.WriteLine("Radio ID,Callsign,Name,City,State,Country,Remarks,Call Type,Call Alert");
                break;

            case TxType.GD77:
                Console.WriteLine("Number,Name,Call ID,Type,Ring Style,Call Receive Tone,Repeater Slot override");
                break;

            case TxType.MD380:      // and MD390, MD2017, RT82
                Console.WriteLine("Radio ID, Callsign, Name, NickName, City, State, Country,");
                break;

            case TxType.RT73:     // and RT3S
                Console.WriteLine("Radio ID, Callsign, Name, NickName, City, State/Prov, Country");
                break;

            case TxType.DM1701:
                Console.WriteLine("Radio ID,Callsign,Name,Nickname,City,State,Country,Remarks");
                break;

            case TxType.D578:
                Console.WriteLine("No,Radio ID, Callsign, Name, City, State, Country, Remarks, Call Type,Call Alert");
                break;

            default:
                break;
            }

            bool   capitalizeNames = capitalize();
            bool   firstLetter     = firstletter();
            String noName          = noname();

            for (int i = 0; i < lines.Length; i++)
            {
                String[] user = lines[i].Split(separator);

                String shieldId = user[0];
                String name     = user[1];
                String dmrId    = "";

                if (name.Length == 0)
                {
                    name = noName;
                }
                if (firstLetter && name.Length > 0)
                {
                    name = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(name.ToLower());
                }

                if (user.Length == 3)
                {
                    dmrId = user[2];
                }
                else
                {
                    String user1 = user[1];
                    String user2 = user[2];

                    if (firstLetter && user1.Length > 0)
                    {
                        user1 = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(user1.ToLower());
                    }
                    if (firstLetter && user2.Length > 0)
                    {
                        user2 = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(user2.ToLower());
                    }

                    name  = user1 + "-" + user2;
                    dmrId = user[3];
                }

                name = name.Trim();

                if (capitalizeNames)
                {
                    name = name.ToUpper();
                }

                String city  = "";
                String state = "";
                String country;
                String remarks  = "";
                String nickName = "";

                if (dmrId.Length > 7)
                {
                    dmrId = dmrId.Substring(0, 7);     // remove any comment
                }
                switch (shieldId.Substring(0, 2))
                {
                case "FS":
                    country = "France";
                    state   = Departements.getDepartement(shieldId.Substring(2, 2));
                    break;

                case "ES":
                    country = "Espagne";
                    break;

                case "US":
                    country = "USA";
                    break;

                case "BS":
                    country = "Belgique";
                    break;

                case "CS":
                    country = "Canada";
                    break;

                case "HS":
                    country = "Suisse";
                    break;

                default:
                    country = "";
                    break;
                }

                if (nickName.Length == 0)
                {
                    nickName = noName;
                }
                if (firstLetter && nickName.Length > 0)
                {
                    nickName = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(nickName.ToLower());
                }

                if (city.Length == 0)
                {
                    city = noName;
                }
                if (firstLetter && city.Length > 0)
                {
                    city = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(city.ToLower());
                }

                if (state.Length == 0)
                {
                    state = noName;
                }
                if (firstLetter && state.Length > 0)
                {
                    state = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(state.ToLower());
                }

                if (country.Length == 0)
                {
                    country = noName;
                }
                if (firstLetter && country.Length > 0)
                {
                    country = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(country.ToLower());
                }

                if (capitalizeNames)
                {
                    nickName = nickName.ToUpper();
                    city     = city.ToUpper();
                    state    = state.ToUpper();
                    country  = country.ToUpper();
                }

                switch (type)
                {
                case TxType.HD1:     // ailucne HD1
                    Console.WriteLine("Private Call," + shieldId + "," + name + "," + city + "," + state + "," + country + "," + dmrId);
                    break;

                case TxType.D868:     // AnyTone 868
                    Console.WriteLine(dmrId + "," + shieldId + "," + name + "," + city + "," + state + "," + country + "," + remarks);
                    break;

                case TxType.D878:     // AnyTone 878
                    Console.WriteLine(dmrId + "," + shieldId + "," + name + "," + city + "," + state + "," + country + "," + remarks + ",Private Call,None");
                    break;

                case TxType.GD77:     // GD77
                    Console.WriteLine(i + 1 + "," + shieldId + " " + name + "," + dmrId + "," + "Private Call" + "," + "On" + "," + "None" + "," + "None");
                    break;

                case TxType.MD380:
                    Console.WriteLine(dmrId + "," + shieldId + "," + name + "," + nickName + "," + city + "," + state + "," + country + ",");
                    break;

                case TxType.RT73:
                    Console.WriteLine(dmrId + "," + shieldId + "," + name + "," + nickName + "," + city + "," + state + "," + country);
                    break;

                case TxType.DM1701:
                    Console.WriteLine(dmrId + "," + shieldId + "," + name + "," + nickName + "," + city + "," + state + "," + country + "," + remarks);
                    break;

                case TxType.D578:
                    Console.WriteLine("," + dmrId + "," + shieldId + "," + name + "," + city + "," + state + "," + country + "," + remarks + ",Private Call,None");
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 28
0
        public TransactionRegistrationResponse Send(RequestContext context, string vendorTxCode, ShoppingBasket basket,
                                                    Address billingAddress, Address deliveryAddress, string customerEmail, PaymentFormProfile paymentFormProfile = PaymentFormProfile.Normal, string currencyCode = "GBP",
                                                    MerchantAccountType accountType = MerchantAccountType.Ecommerce, TxType txType = TxType.Payment)
        {
            string sagePayUrl      = configuration.RegistrationUrl;
            string notificationUrl = urlResolver.BuildNotificationUrl(context);

            var registration = new TransactionRegistration(
                vendorTxCode, basket, notificationUrl,
                billingAddress, deliveryAddress, customerEmail,
                configuration.VendorName,
                paymentFormProfile, currencyCode, accountType, txType);

            var serializer = new HttpPostSerializer();
            var postData   = serializer.Serialize(registration);

            var response = requestSender.SendRequest(sagePayUrl, postData);

            var deserializer = new ResponseSerializer();

            return(deserializer.Deserialize <TransactionRegistrationResponse>(response));
        }