public async Task <IActionResult> Pay(string id)
        {
            try
            {
                var order = await this.ordersService.GetByIdAsync(id);

                if (order == null ||
                    order.UserName != this.User.Identity.Name ||
                    order.PaymentStatus != PaymentStatus.Pending)
                {
                    return(this.RedirectToAction("My", "Orders"));
                }

                var paymentInfo = new
                {
                    Amount      = order.ProductPrice,
                    Description = order.ProductName,
                    this.destinationBankAccountConfiguration.DestinationBankName,
                    this.destinationBankAccountConfiguration.DestinationBankCountry,
                    this.destinationBankAccountConfiguration.DestinationBankSwiftCode,
                    this.destinationBankAccountConfiguration.DestinationBankAccountUniqueId,
                    this.destinationBankAccountConfiguration.RecipientName,

                    // ! PaymentInfo can also contain custom properties
                    // ! that will be returned on payment completion

                    // ! OrderId is a custom property and is not required
                    OrderId = order.Id
                };

                // generate the returnUrl where the payment result will be received
                var returnUrl = this.directPaymentsConfiguration.SiteUrl + ReturnPath;

                // generate signed payment request
                var paymentRequest = DirectPaymentsHelper.GeneratePaymentRequest(
                    paymentInfo, this.directPaymentsConfiguration.SiteKey, returnUrl);

                // redirect the user to the CentralApi for payment processing
                var paymentPostRedirectModel = new PaymentPostRedirectModel
                {
                    Url = this.directPaymentsConfiguration.CentralApiPaymentUrl,
                    PaymentDataFormKey = PaymentDataFormKey,
                    PaymentData        = paymentRequest
                };

                return(this.View("PaymentPostRedirect", paymentPostRedirectModel));
            }
            catch
            {
                return(this.RedirectToAction("My", "Orders"));
            }
        }