Esempio n. 1
0
        /// <summary>
        /// Instantiates a new <see cref="SwishPaymentRequest"/> with the provided parameters.
        /// </summary>
        /// <param name="prices">List of prices object to give discounts.</param>
        /// <param name="description">Textual description of the payment.</param>
        /// <param name="payerReference">Refence to the payer in the merchant systems.</param>
        /// <param name="userAgent">The UserAgent string of the payers device.</param>
        /// <param name="language">The payers prefered langauge.</param>
        /// <param name="urls">Object describing relevant URLs for this payment.</param>
        /// <param name="payeeInfo">Object holding information about the merchant-</param>
        /// <param name="prefillInfo">Known information about the payer than can be
        /// pre-filled in the payment window.</param>
        public SwishPaymentRequest(IEnumerable <IPrice> prices,
                                   string description,
                                   string payerReference,
                                   string userAgent,
                                   Language language,
                                   IUrls urls,
                                   IPayeeInfo payeeInfo,
                                   PrefillInfo prefillInfo)
        {
            var swishRequest = new SwishRequestData();

            Payment = new SwishPaymentRequestDetails(prices, description, payerReference, userAgent, language, urls, payeeInfo, prefillInfo, swishRequest);
        }
Esempio n. 2
0
        public SwishPaymentRequestDetailsDto(SwishPaymentRequestDetails payment)
        {
            Currency       = payment.Currency.ToString();
            Description    = payment.Description;
            Intent         = payment.Intent.ToString();
            Language       = payment.Language.ToString();
            Operation      = payment.Operation.Value;
            PayeeInfo      = new PayeeInfoResponseDto(payment.PayeeInfo);
            PayerReference = payment.PayerReference;
            PrefillInfo    = new PrefillInfoDto(payment.PrefillInfo);
            Prices         = new List <PriceDto>();
            foreach (var item in payment.Prices)
            {
                Prices.Add(new PriceDto(item));
            }
            Swish     = new SwishPaymentOptionsDto(payment.Swish);
            Urls      = new UrlsDto(payment.Urls);
            UserAgent = payment.UserAgent;

            if (payment.Metadata != null)
            {
                Metadata = new MetadataDto(payment.Metadata);
            }
        }