/// <summary>
 /// Prepares payment form that will be sent (by user) to payment portal. Can establish a payment transaction if payment process requires it.
 /// </summary>
 /// <param name="order">Order info (id, price to be paid, ..)</param>
 /// <param name="portalLocale">Current user locale, can be send to payment portal to enforce the same.</param>
 /// <param name="urls">Urls that should be provided to payment portal to notify Storefront about success or to return back to portal. Notification is further processed by the <see cref="GetPaymentInfo"/>.</param>
 /// <param name="setupForm">Custom setup of payment method, can be <code>null</code> when no setup requested. See <see cref="CreateSetupForm"/></param>
 /// <returns>Payment form (to be send) plus optionally id of established transaction (to be stored).</returns>
 public PreparedPayment PreparePayment(Order order, string portalLocale, ReturnUrls urls, NameValueCollection setupForm)
 {
     var paymentForm = PaymentForm.Post(
         _settings.Pay ? urls.Notify : urls.Cancel,
         CreatePaymentFormFields(order, setupForm));
     return new PreparedPayment(paymentForm, EncodePriceAndStatusIntoTransaction(order.TotalPriceIncludingTax, PaymentStatus));
 }
示例#2
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation(" ---- FACEBLUR REQUEST PROCESS START ----");

            object responseMessage = null;
            string url             = req.Query["url"];

            try
            {
                bool isValidUrl = Uri.IsWellFormedUriString(url, UriKind.Absolute);

                if (isValidUrl)
                {
                    var urlImageBlurredSAS = await Helper.Main(log, url);

                    responseMessage = new ReturnUrls()
                    {
                        UrlOriginalImg = url, UrlBlurredSASImg = urlImageBlurredSAS.Item1, ResMsg = urlImageBlurredSAS.Item2
                    };
                }
                else
                {
                    responseMessage = "url parameter is null or not well formed https.";
                }
            }
            catch (Exception e)
            {
                responseMessage = "opsss ... something when wrong. See internal log for details";
                log.LogError(e.Message);
            }
            finally {
                log.LogInformation(" ---- FACEBLUR REQUEST PROCESS END ----");
            }

            return(new OkObjectResult(responseMessage));
        }