PageRenderTime 37ms CodeModel.GetById 4ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Kona.Web/Views/Themes/Blue/PayPal.aspx

#
ASP.NET | 131 lines | 115 code | 16 blank | 0 comment | 0 complexity | 41f2b3d8459433c9471d09817e472bad MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <%@ Page Title="" Language="C#" MasterPageFile="Theme.Master" Inherits="System.Web.Mvc.ViewPage" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
  3. <title><%=this.SiteData().SiteName %>: Checkout with PayPal</title>
  4. </asp:Content>
  5. <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
  6. <div id="bdy">
  7. <div class="colmiddle780 cntr">
  8. <h2>Pay with PayPal</h2>
  9. <div class="wrap">
  10. You are about to be redirected to PayPal.com to purchase this order.
  11. Once payment is completed, please be sure to let PayPal redirect you
  12. back to this site. When PayPal redirects you, they send along your transaction
  13. information which we need in order to complete and reconcile your payment.
  14. </div>
  15. <h2>Select Shipping</h2>
  16. <%using (Html.BeginForm()) { %>
  17. <%foreach (ShippingMethod m in this.ShippingMethods().OrderBy(x=>x.Cost)) { %>
  18. <li><input onclick="this.form.submit();" type="radio" value="<%=m.ID %>" name="id" <%=Html.IsChecked(m.ID, this.CurrentCart().ShippingMethodID)%>> <%=m.Display %></li>
  19. <%} %>
  20. <%} %>
  21. <div class="wrap">
  22. <h2>Order Details</h2>
  23. <table width="400">
  24. <tr>
  25. <td width="50%">
  26. <p><b>Shipping To:</b></p>
  27. <p>
  28. <%Html.RenderPartial("AddressDisplay",this.CurrentCart().ShippingAddress); %>
  29. </p>
  30. </td>
  31. <td width="50%">
  32. <p><b>Billing To:</b></p>
  33. <p>
  34. <%Html.RenderPartial("AddressDisplay", this.CurrentCart().BillingAddress); %>
  35. </p>
  36. </td>
  37. </tr>
  38. </table>
  39. <hr />
  40. <table cellspacing="0" cellpadding="5" width="100%">
  41. <tr>
  42. <td><b>Quantity</b></td>
  43. <td ><b>Item</b></td>
  44. <td align="right"><b>Regular</b></td>
  45. <td align="right"><b>Total</b></td>
  46. </tr>
  47. <%foreach(ShoppingCartItem item in this.CurrentCart().Items){%>
  48. <tr>
  49. <td ><%=item.Quantity %></td>
  50. <td ><%=item.Product.Name%></td>
  51. <td align="right"><%=item.Product.Price.ToString("C")%></td>
  52. <td align="right"><%=item.LineTotal.ToString("C") %></td>
  53. </tr>
  54. <%} %>
  55. <tr>
  56. <td colspan="4"><hr /></td>
  57. </tr>
  58. <tr>
  59. <td colspan="3" align="right">Subtotal</td>
  60. <td align="right"><%= this.CurrentCart().SubTotal.ToString("C")%></td>
  61. </tr>
  62. <tr>
  63. <td colspan="3" align="right">Tax</td>
  64. <td align="right"><%= this.CurrentCart().TaxAmount.ToString("C")%></td>
  65. </tr>
  66. <tr>
  67. <td colspan="3" align="right">Shipping (<%= this.CurrentCart().ShippingService%>)</td>
  68. <td align="right"><%= this.CurrentCart().ShippingAmount.ToString("C")%></td>
  69. </tr>
  70. <tr>
  71. <td colspan="3" align="right">Discount:</td>
  72. <td align="right">-<%= this.CurrentCart().DiscountAmount.ToString("C")%></td>
  73. </tr>
  74. <tr>
  75. <td colspan="3" align="right">Grand Total</td>
  76. <td align="right"><b><%= this.CurrentCart().Total.ToString("C")%></b></td>
  77. </tr>
  78. </table>
  79. </div>
  80. <form id="Paypal" name="Paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
  81. <%=Html.Hidden("cmd", "_cart")%>
  82. <%=Html.Hidden("upload", "1")%>
  83. <%=Html.Hidden("business", this.SiteData().PayPalBusinessEmail)%>
  84. <%=Html.Hidden("custom", this.CurrentCart().UserName.ToString())%>
  85. <%=Html.Hidden("tax_cart", this.CurrentCart().TaxAmount.ToLocalCurrency())%>
  86. <%=Html.Hidden("currency_code", this.SiteData().CurrencyCode)%>
  87. <%=Html.Hidden("return", Url.Action("pdt","paypal"))%>
  88. <%=Html.Hidden("cancel_return", Url.Action("Show","Order"))%>
  89. <%if(this.CurrentCart().ShippingAddress!=null){ %>
  90. <%=Html.Hidden("first_name", this.CurrentCart().ShippingAddress.FirstName)%>
  91. <%=Html.Hidden("last_name", this.CurrentCart().ShippingAddress.LastName)%>
  92. <%=Html.Hidden("address1", this.CurrentCart().ShippingAddress.Street1)%>
  93. <%=Html.Hidden("address2", this.CurrentCart().ShippingAddress.Street2)%>
  94. <%=Html.Hidden("city", this.CurrentCart().ShippingAddress.City)%>
  95. <%=Html.Hidden("state", this.CurrentCart().ShippingAddress.StateOrProvince)%>
  96. <%=Html.Hidden("country", this.CurrentCart().ShippingAddress.Country)%>
  97. <%=Html.Hidden("zip", this.CurrentCart().ShippingAddress.Zip)%>
  98. <%}
  99. int itemIndex = 1;
  100. foreach(var item in this.CurrentCart().Items){ %>
  101. <%=Html.Hidden("item_name_"+itemIndex, item.Product.Name)%>
  102. <%=Html.Hidden("amount_" + itemIndex, item.Product.Price.ToLocalCurrency())%>
  103. <%=Html.Hidden("item_number_" + itemIndex, item.Product.SKU)%>
  104. <%=Html.Hidden("quantity_" + itemIndex, item.Quantity.ToString())%>
  105. <%=Html.Hidden("shipping_" + itemIndex, (this.CurrentCart().ShippingAmount / this.CurrentCart().Items.Count()).ToLocalCurrency())%>
  106. <%itemIndex++;
  107. } %>
  108. <div class="checkout-button">
  109. <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" align="left" style="margin-right:7px;" />
  110. </div>
  111. </form>
  112. </div>
  113. </div>
  114. </div>
  115. </asp:Content>