/// <summary> /// Handles the OnClick event of the rbtnPay control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void rbtnPay_OnClick(object sender, EventArgs e) { ucNotificationMessage.Text = string.Empty; ucNotificationMessage.MessageType = NotificationMessageType.Warning; try { var site = DataManager.Sites.SelectById(CurrentUser.Instance.SiteID); if (!site.MainUserID.HasValue) { ucNotificationMessage.Text = "Для данного аккаунта не указан главный пользователь."; return; } var product = DataManager.Product.SelectById(CurrentProductId); var price = DataManager.ProductPrice.SelectById(CurrentPriceId); var paymentStatus = DataManager.PaymentStatus.SelectDefault(product.SiteID); var currency = DataManager.Currency.SelectAll(product.SiteID).FirstOrDefault(o => o.IsDefault); var payment = DataManager.Payment.Save(product.SiteID, Guid.Empty, string.Format("Оплата тарифа {0} за период {1}", product.Title, price.tbl_PriceList.Title), DateTime.Now, null, (int)PaymentType.Income, paymentStatus.ID, site.PayerCompanyID, null, null, null, currency.ID, 1, (decimal)rntxtPriceForPayment.Value, (decimal)rntxtPriceForPayment.Value, null, null); ScriptManager.RegisterStartupScript(Page, typeof(Page), "RBKMoney", RBKMoneyProvider.Pay(payment, site), true); ucNotificationMessage.MessageType = NotificationMessageType.Success; ucNotificationMessage.Text = "Информация об оплате успешно добавлена в систему. Сейчас вы будете перенаправлены на страницу ввода платежных реквизитов."; } catch (Exception ex) { Log.Error("Ошибка оплаты", ex); ucNotificationMessage.Text = "Возникла ошибка при оплате. Повторите попытку позже."; } }
public void ProcessRequest(HttpContext context) { RBKMoneyProvider.Success(context); }