Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Shop.Storefront.Cart.Web.Models.Payments
- {
- /// <summary>
- /// Represents the result of a payment command.
- /// </summary>
- public class PaymentCommandResult
- {
- /// <summary>
- /// Returns an <see cref="PaymentCommandResult" /> with a success set to true.
- /// </summary>
- public static PaymentCommandResult SuccessfulCommand =>
- new PaymentCommandResult
- {
- Success = true
- };
- /// <summary>
- /// Returns an <see cref="PaymentCommandResult" /> with a success set to false.
- /// </summary>
- public static PaymentCommandResult UnsuccessfulCommand =>
- new PaymentCommandResult
- {
- Success = false
- };
- /// <summary>
- /// Gets or sets the redirect URL.
- /// </summary>
- /// <value>URI that the user must be redirected to to complete the payment.</value>
- public Uri RedirectUri { get; set; }
- /// <summary>
- /// Gets or sets the required action.
- /// </summary>
- /// <value>Represents the required following actions.</value>
- public PaymentCommandRequiredAction RequiredAction { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the command executed successfully.
- /// </summary>
- public bool Success { get; set; }
- /// <summary>
- /// Returns a <see cref="PaymentCommandResult" /> with success set to true and the given redirectUri.
- /// </summary>
- /// <param name="redirectUri">The redirect <see cref="Uri" />.</param>
- /// <returns>The <see cref="PaymentCommandResult" /></returns>
- public static PaymentCommandResult SuccessfulRedirect(Uri redirectUri)
- {
- return new PaymentCommandResult
- {
- Success = true,
- RedirectUri = redirectUri
- };
- }
- }
- }
Add Comment
Please, Sign In to add comment