Ejemplo n.º 1
0
        /// <summary>
        /// 获取支付Html
        /// </summary>
        public void GetPaymentHtml(PaymentTransaction transaction, ref HtmlString html)
        {
            var templateManager = Application.Ioc.Resolve <TemplateManager>();
            var apiData         = transaction.Api.ExtraData.GetOrDefault <ApiData>("ApiData") ?? new ApiData();
            var paymentChannels = new PaymentChannelListItemProvider().GetItems()
                                  .Where(c => apiData.PaymentChannels.Contains(c.Value))
                                  .ToList();
            var form = new PingppPayForm();

            form.Bind();
            html = new HtmlString(templateManager.RenderTemplate(
                                      "finance.payment.pingpp/pingpp_pay.html", new {
                transactionId = transaction.Id,
                paymentChannels,
                form
            }));
        }
Ejemplo n.º 2
0
        public IActionResult Pay()
        {
            var form = new PingppPayForm();

            return(new JsonResult(form.Submit()));
        }