Skip to content

Commit 93280c2

Browse files
committed
Merge pull request #31 from RespectNetwork/integration
Fix for post registration landing page.
2 parents b23842d + 3d24635 commit 93280c2

File tree

3 files changed

+118
-20
lines changed

3 files changed

+118
-20
lines changed

src/main/java/net/respectnetwork/csp/application/controller/PersonalCloudController.java

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
import java.math.BigDecimal;
55
import java.net.URLEncoder;
66
import java.util.ArrayList;
7+
import java.util.Arrays;
78
import java.util.Date;
89
import java.util.Enumeration;
10+
import java.util.HashSet;
911
import java.util.List;
1012
import java.util.Locale;
13+
import java.util.Set;
1114
import java.util.UUID;
1215

1316
import javax.servlet.http.HttpServletRequest;
@@ -507,7 +510,7 @@ public ModelAndView processCCPayment(
507510
{
508511
if (this.registerCloudName(cloudName, phone, email, password, PaymentType.CreditCard.toString(), payment.getPaymentId(), request.getLocale()))
509512
{
510-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
513+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
511514
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
512515
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
513516
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -524,7 +527,7 @@ public ModelAndView processCCPayment(
524527
"",request)) != null)
525528
{
526529
// forwardingPage += "/cloudPage";
527-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
530+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
528531
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
529532
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
530533
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -542,7 +545,7 @@ public ModelAndView processCCPayment(
542545
if ((mv = acm.createAdditionalClouds(cloudName, payment, null,
543546
"", getRegisteredEmailAddress(), getRegisteredPhoneNumber(), request)) != null)
544547
{
545-
forwardingPage = getRNpostRegistrationLandingPage();
548+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage();
546549
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
547550
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
548551
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -559,7 +562,7 @@ public ModelAndView processCCPayment(
559562
cspModel)) != null)
560563
{
561564
// forwardingPage += "/cloudPage";
562-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
565+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
563566
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
564567
statusText = "Congratulations " + cloudName
565568
+ "! You have successfully purchased giftcodes.";
@@ -655,7 +658,7 @@ public ModelAndView makePayment(
655658
}
656659
}
657660

658-
String forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL() ;
661+
String forwardingPage = request.getContextPath(); //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL() ;
659662
String statusText = "";
660663

661664
String[] paramValues = request.getParameterValues("paymentType");
@@ -855,7 +858,7 @@ public ModelAndView makePayment(
855858
if (this.registerCloudName(cloudName, phone, email, password, PaymentType.PromoCode.toString() , giftCodesVal, request.getLocale()))
856859
{
857860
// forwardingPage += "/cloudPage";
858-
forwardingPage = getRNpostRegistrationLandingPage() ; // RegistrationManager.getCspInviteURL();
861+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; // RegistrationManager.getCspInviteURL();
859862
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
860863
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
861864
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -889,7 +892,7 @@ public ModelAndView makePayment(
889892
// for
890893
{
891894
// forwardingPage += "/cloudPage";
892-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
895+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
893896
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
894897
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
895898
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -910,7 +913,7 @@ public ModelAndView makePayment(
910913
{
911914
if (mv.getViewName().equals("additionalCloudDone")) // all additional clouds have been paid for
912915
{
913-
forwardingPage = getRNpostRegistrationLandingPage();
916+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage();
914917
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
915918
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
916919
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -945,7 +948,11 @@ public ModelAndView makePayment(
945948

946949
regSession.setGiftCode(giftCodesVal);
947950

948-
if (giftCodes != null
951+
Set<String> giftCodeSet = new HashSet<String>(Arrays.asList(giftCodes));
952+
if(giftCodeSet.size() != giftCodes.length) {
953+
errors = true;
954+
errorText = "Please provide unique giftcode for each cloud.";
955+
} else if (giftCodes != null
949956
&& paymentForm.getNumberOfClouds() < giftCodes.length)
950957
{
951958
errors = true;
@@ -1029,7 +1036,7 @@ public ModelAndView makePayment(
10291036
* mv.addObject("accountInfo", accountForm);
10301037
*/
10311038
// forwardingPage += "/cloudPage";
1032-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
1039+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
10331040
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
10341041
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
10351042
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -1069,7 +1076,7 @@ public ModelAndView makePayment(
10691076
// paid for
10701077
{
10711078
// forwardingPage += "/cloudPage";
1072-
forwardingPage = getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
1079+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
10731080
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
10741081
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
10751082
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -1094,7 +1101,7 @@ public ModelAndView makePayment(
10941101
{
10951102
if (mv.getViewName().equals("additionalCloudDone")) // all additional clouds have been paid for
10961103
{
1097-
forwardingPage = getRNpostRegistrationLandingPage();
1104+
forwardingPage += "/welcome"; //getRNpostRegistrationLandingPage();
10981105
queryStr = this.formatQueryStr(cloudName, regSession.getRnQueryString(), request);
10991106
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
11001107
+ "We are processing your order and will notify you once it completes registration in the network.";
@@ -1173,7 +1180,7 @@ public ModelAndView makePayment(
11731180
mv.addObject("StripeJavaScript",
11741181
StripePaymentProcessor.getJavaScript(cspModel, amount, desc));
11751182
mv.addObject("postURL", cspHomeURL + "/ccpayment");
1176-
1183+
mv.addObject("cspTCURL", this.getRegistrationManager().getCspTCURL());
11771184
} else if (cspModel.getPaymentGatewayName().equals("SAGEPAY"))
11781185
{
11791186
logger.debug("Payment gateway is SAGEPAY");
@@ -1620,7 +1627,18 @@ public ModelAndView showConfirmationForm(
16201627
this.clearPaymentInfo();
16211628
return mv;
16221629
}
1623-
1630+
1631+
@RequestMapping(value = "/welcome", method = RequestMethod.POST)
1632+
public ModelAndView showWelcomePage(HttpServletRequest request, Model model) {
1633+
logger.info("showing welcome page " + request.getParameter("csp")
1634+
+ "::" + request.getParameter("cloudname"));
1635+
ModelAndView mv = null;
1636+
mv = new ModelAndView("welcome");
1637+
mv.addObject("cloudName", request.getParameter("name"));
1638+
mv.addObject("csp", request.getParameter("csp"));
1639+
mv.addObject("cspLoginURL", request.getContextPath() + "/login");
1640+
return mv;
1641+
}
16241642
public boolean postLatitudeLongitudeInfo() throws Exception
16251643
{
16261644
String latLongPostURL = RegistrationManager.getLatLongPostURL();

src/main/webapp/WEB-INF/views/postTxn.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/ico/apple-touch-icon-72-precomposed.png" />
3030
<link rel="apple-touch-icon-precomposed" href="img/ico/apple-touch-icon-57-precomposed.png" />
3131
<link rel="shortcut icon" href="img/ico/favicon.png" />
32-
<script>
32+
<!-- <script>
3333
function goToRNlandingPage()
3434
{
3535
@@ -40,7 +40,7 @@
4040
window.open(url+urlAndQs,"_self");
4141
}
4242
43-
</script>
43+
</script> -->
4444
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
4545
</head>
4646
<body>
@@ -69,8 +69,8 @@
6969
<div class="span8">
7070
<div class="middle" style="text-align:left !important; font-size:25px;"><p><span th:utext="${statusText}"/></p>
7171
<p class="primary">
72-
<div style="text-align:center !important;" th:if="${#strings.length(queryStr) == 0}">
73-
<form action="#" role="form" name="txnCompletionForm" th:action="${postURL}" method="${submitMethod}">
72+
<div style="text-align:center !important;">
73+
<form action="#" role="form" name="txnCompletionForm" th:action="${postURL}" th:method="${submitMethod}">
7474

7575
<input type="hidden" id="cloudname" name="cloudname" th:value="${cloudName}" />
7676
<input type="hidden" id="statusText" name="statusText" th:value="${statusText}" />
@@ -81,7 +81,7 @@
8181
</div>
8282

8383

84-
<div th:if="${#strings.length(queryStr)}">
84+
<!-- <div th:if="${#strings.length(queryStr)}">
8585
8686
<input type="hidden" id="cloudname" name="cloudname" th:value="${cloudName}" />
8787
<input type="hidden" id="statusText" name="statusText" th:value="${statusText}" />
@@ -90,7 +90,7 @@
9090
<input type="hidden" id="queryStr" name="queryStr" th:value="${queryStr}" />
9191
<button type="button" id="goToRN" class="button big" onclick="goToRNlandingPage();">Continue</button>
9292
93-
</div>
93+
</div> -->
9494
</p>
9595
</div>
9696
</div>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<!-- HTML5 Boilerplate -->
4+
<!--[if lt IE 7]> <html xmlns:th="http://www.thymeleaf.org" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
5+
<!--[if IE 7]> <html xmlns:th="http://www.thymeleaf.org" class="no-js lt-ie9 lt-ie8"> <![endif]-->
6+
<!--[if IE 8]> <html xmlns:th="http://www.thymeleaf.org" class="no-js lt-ie9"> <![endif]-->
7+
<!--[if gt IE 8]> <html xmlns:th="http://www.thymeleaf.org" class="no-js"> <![endif]-->
8+
<head>
9+
<meta charset="utf-8" />
10+
<title>Respect Network</title>
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
12+
<meta name="description" content="" />
13+
<meta name="author" content="" />
14+
15+
<!-- CSS -->
16+
<link href="css/bootstrap.css" rel="stylesheet" />
17+
<link href="css/bootstrap-responsive.css" rel="stylesheet" />
18+
<link href="css/style.css" rel="stylesheet" />
19+
<link href="https://s3.amazonaws.com/rnfonts/demo.css" rel="stylesheet" type="text/css" />
20+
21+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
22+
<!--[if lt IE 9]>
23+
<script src="js/html5shiv.js"></script>
24+
<![endif]-->
25+
26+
<!-- Fav and touch icons -->
27+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/ico/apple-touch-icon-144-precomposed.png" />
28+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/ico/apple-touch-icon-114-precomposed.png" />
29+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/ico/apple-touch-icon-72-precomposed.png" />
30+
<link rel="apple-touch-icon-precomposed" href="img/ico/apple-touch-icon-57-precomposed.png" />
31+
<link rel="shortcut icon" href="img/ico/favicon.png" />
32+
</head>
33+
<body>
34+
35+
36+
<!-- Part 1: Wrap all page content here -->
37+
<div id="wrap">
38+
39+
<!-- Fixed navbar -->
40+
<div class="navbar navbar-fixed-top">
41+
<div class="navbar-inner">
42+
<div class="container">
43+
<div class="row">
44+
<div class="span4 smallTop"><img src="img/RespectNetwork_Logo_H_RGB.png" />
45+
</div>
46+
47+
</div>
48+
49+
</div>
50+
</div>
51+
</div>
52+
<!-- Begin page content -->
53+
<div class="bodyContainer">
54+
<div class="row-fluid">
55+
<div class="span2"></div>
56+
<div class="span8">
57+
<div class="middle" style="text-align:left !important; font-size:25px;">
58+
<p class="primary"><p align="justify">Congratulations! on your purchase and welcome to the family.</p>
59+
<p align="justify">With your purchase today, you also receive a lifetime membership in the Respect Network, the world's first global private network of personal and business clouds. Tell your family and friends! Let them know to act now, and grab your preferred =cloudname, while the names are still available. After the first one million =cloud names are sold the price will be higher and renewable annually. To order, you can log back in and invite them by <a th:href="${cspLoginURL}">clicking this link.</a>
60+
</p>
61+
62+
</p>
63+
</div>
64+
</div>
65+
<div class="span2"></div>
66+
67+
</div>
68+
</div>
69+
</div>
70+
71+
<div id="footer">
72+
<div class="row-fluid">
73+
<div class="span1"></div>
74+
<div class="span10 cspMain">YOUR CLOUD SERVICE PROVIDER | <img src="img/csp_logo.png" /> &nbsp;
75+
</div>
76+
</div>
77+
</div>
78+
79+
</body>
80+
</html>

0 commit comments

Comments
 (0)