Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public static class FormExtensions
  2. {
  3. private class DirectPostForm : IDisposable
  4. {
  5. private readonly HtmlHelper _helper;
  6.  
  7. public DirectPostForm(HtmlHelper helper, string apiLogin, string transactionKey, decimal amount,
  8. string returnUrl, bool isTest)
  9. {
  10. _helper = helper;
  11. _helper.ViewContext.Writer.Write(DPMFormGenerator.OpenForm(apiLogin, transactionKey, amount, returnUrl,
  12. isTest));
  13. }
  14.  
  15. public void Dispose()
  16. {
  17. _helper.ViewContext.Writer.Write(DPMFormGenerator.EndForm());
  18. }
  19. }
  20.  
  21. public static IDisposable BeginDirectPostForm(this HtmlHelper helper, string apiLogin, string transactionKey,
  22. decimal amount,
  23. string returnUrl, bool isTest)
  24. {
  25. return new DirectPostForm(helper, apiLogin, transactionKey, amount, returnUrl, isTest);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement