コード例 #1
0
        /// <summary>
        /// Instantiates a new <see cref="SwishPaymentRequestDetails"/> 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>
        /// <param name="swishRequest">Sets Swish payment specific options.</param>
        protected internal SwishPaymentRequestDetails(IEnumerable <IPrice> prices,
                                                      string description,
                                                      string payerReference,
                                                      string userAgent,
                                                      Language language,
                                                      IUrls urls,
                                                      IPayeeInfo payeeInfo,
                                                      PrefillInfo prefillInfo,
                                                      SwishRequestData swishRequest)
        {
            Operation      = Operation.Purchase;
            Intent         = PaymentIntent.Sale;
            Currency       = new Currency("SEK");
            Description    = description;
            PayerReference = payerReference;
            UserAgent      = userAgent;
            Language       = language;
            Urls           = urls;
            PayeeInfo      = payeeInfo;
            PrefillInfo    = prefillInfo;
            Swish          = swishRequest;

            foreach (var price in prices)
            {
                Prices.Add(price);
            }
        }
コード例 #2
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);
        }