Exemplo n.º 1
0
        public CardPaymentAcceptUrlApiModel(GetPaymentServiceUrlResult result) : base(result)
        {
            Assert.IsNotNull(result, "result");

            if (result.Success)
            {
                var serviceUrl = new Uri(result.Url);
                ServiceUrl    = result.Url;
                MessageOrigin = $"{serviceUrl.Scheme}://{serviceUrl.Authority}";
            }
            else
            {
                SetErrors(result);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CardPaymentAcceptUrlJsonResult"/> class.
        /// </summary>
        /// <param name="result">The result.</param>
        public CardPaymentAcceptUrlJsonResult(GetPaymentServiceUrlResult result)
            : base(result)
        {
            Assert.IsNotNull(result, "result");

            if (result.Success)
            {
                var serviceUrl = new Uri(result.Url);
                this.ServiceUrl    = result.Url;
                this.MessageOrigin = string.Format(CultureInfo.InvariantCulture, "{0}://{1}", serviceUrl.Scheme, serviceUrl.Authority);
            }
            else
            {
                this.SetErrors(result);
            }
        }
Exemplo n.º 3
0
        private string GetBasePaymentServiceUrl(GetPaymentServiceUrlRequest request, GetPaymentServiceUrlResult result, List <PaymentProperty> serviceRequestProperties)
        {
            var getPaymentAcceptPointResponse = this.ExecutePaymentServiceRequest(
                serviceRequestProperties,
                GetPaymentAcceptPointRelativeUri,
                request.Locale,
                result.SystemMessages);

            if (getPaymentAcceptPointResponse != null)
            {
                var getPaymentAcceptPointResponseProperties = PaymentProperty.ConvertToHashtable(getPaymentAcceptPointResponse.Properties);

                var paymentAcceptUrl = string.Empty;
                PaymentProperty.GetPropertyValue(
                    getPaymentAcceptPointResponseProperties,
                    GenericNamespace.TransactionData,
                    TransactionDataProperties.PaymentAcceptUrl,
                    out paymentAcceptUrl);

                return(paymentAcceptUrl);
            }

            return(string.Empty);
        }