Guest User

Untitled

a guest
Jan 21st, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Shop.Storefront.Cart.Web.Models.Payments
  4. {
  5. /// <summary>
  6. /// Represents the result of a payment command.
  7. /// </summary>
  8. public class PaymentCommandResult
  9. {
  10. /// <summary>
  11. /// Returns an <see cref="PaymentCommandResult" /> with a success set to true.
  12. /// </summary>
  13. public static PaymentCommandResult SuccessfulCommand =>
  14. new PaymentCommandResult
  15. {
  16. Success = true
  17. };
  18.  
  19. /// <summary>
  20. /// Returns an <see cref="PaymentCommandResult" /> with a success set to false.
  21. /// </summary>
  22. public static PaymentCommandResult UnsuccessfulCommand =>
  23. new PaymentCommandResult
  24. {
  25. Success = false
  26. };
  27.  
  28. /// <summary>
  29. /// Gets or sets the redirect URL.
  30. /// </summary>
  31. /// <value>URI that the user must be redirected to to complete the payment.</value>
  32. public Uri RedirectUri { get; set; }
  33.  
  34. /// <summary>
  35. /// Gets or sets the required action.
  36. /// </summary>
  37. /// <value>Represents the required following actions.</value>
  38. public PaymentCommandRequiredAction RequiredAction { get; set; }
  39.  
  40. /// <summary>
  41. /// Gets or sets a value indicating whether the command executed successfully.
  42. /// </summary>
  43. public bool Success { get; set; }
  44.  
  45. /// <summary>
  46. /// Returns a <see cref="PaymentCommandResult" /> with success set to true and the given redirectUri.
  47. /// </summary>
  48. /// <param name="redirectUri">The redirect <see cref="Uri" />.</param>
  49. /// <returns>The <see cref="PaymentCommandResult" /></returns>
  50. public static PaymentCommandResult SuccessfulRedirect(Uri redirectUri)
  51. {
  52. return new PaymentCommandResult
  53. {
  54. Success = true,
  55. RedirectUri = redirectUri
  56. };
  57. }
  58. }
  59. }
Add Comment
Please, Sign In to add comment