4
4
import java .math .BigDecimal ;
5
5
import java .net .URLEncoder ;
6
6
import java .util .ArrayList ;
7
+ import java .util .Arrays ;
7
8
import java .util .Date ;
8
9
import java .util .Enumeration ;
10
+ import java .util .HashSet ;
9
11
import java .util .List ;
10
12
import java .util .Locale ;
13
+ import java .util .Set ;
11
14
import java .util .UUID ;
12
15
13
16
import javax .servlet .http .HttpServletRequest ;
@@ -507,7 +510,7 @@ public ModelAndView processCCPayment(
507
510
{
508
511
if (this .registerCloudName (cloudName , phone , email , password , PaymentType .CreditCard .toString (), payment .getPaymentId (), request .getLocale ()))
509
512
{
510
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
513
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
511
514
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
512
515
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
513
516
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -524,7 +527,7 @@ public ModelAndView processCCPayment(
524
527
"" ,request )) != null )
525
528
{
526
529
// forwardingPage += "/cloudPage";
527
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
530
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
528
531
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
529
532
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
530
533
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -542,7 +545,7 @@ public ModelAndView processCCPayment(
542
545
if ((mv = acm .createAdditionalClouds (cloudName , payment , null ,
543
546
"" , getRegisteredEmailAddress (), getRegisteredPhoneNumber (), request )) != null )
544
547
{
545
- forwardingPage = getRNpostRegistrationLandingPage ();
548
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage();
546
549
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
547
550
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
548
551
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -559,7 +562,7 @@ public ModelAndView processCCPayment(
559
562
cspModel )) != null )
560
563
{
561
564
// forwardingPage += "/cloudPage";
562
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
565
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
563
566
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
564
567
statusText = "Congratulations " + cloudName
565
568
+ "! You have successfully purchased giftcodes." ;
@@ -655,7 +658,7 @@ public ModelAndView makePayment(
655
658
}
656
659
}
657
660
658
- String forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL() ;
661
+ String forwardingPage = request . getContextPath (); // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL() ;
659
662
String statusText = "" ;
660
663
661
664
String [] paramValues = request .getParameterValues ("paymentType" );
@@ -855,7 +858,7 @@ public ModelAndView makePayment(
855
858
if (this .registerCloudName (cloudName , phone , email , password , PaymentType .PromoCode .toString () , giftCodesVal , request .getLocale ()))
856
859
{
857
860
// forwardingPage += "/cloudPage";
858
- forwardingPage = getRNpostRegistrationLandingPage () ; // RegistrationManager.getCspInviteURL();
861
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; // RegistrationManager.getCspInviteURL();
859
862
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
860
863
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
861
864
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -889,7 +892,7 @@ public ModelAndView makePayment(
889
892
// for
890
893
{
891
894
// forwardingPage += "/cloudPage";
892
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
895
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
893
896
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
894
897
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
895
898
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -910,7 +913,7 @@ public ModelAndView makePayment(
910
913
{
911
914
if (mv .getViewName ().equals ("additionalCloudDone" )) // all additional clouds have been paid for
912
915
{
913
- forwardingPage = getRNpostRegistrationLandingPage ();
916
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage();
914
917
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
915
918
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
916
919
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -945,7 +948,11 @@ public ModelAndView makePayment(
945
948
946
949
regSession .setGiftCode (giftCodesVal );
947
950
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
949
956
&& paymentForm .getNumberOfClouds () < giftCodes .length )
950
957
{
951
958
errors = true ;
@@ -1029,7 +1036,7 @@ public ModelAndView makePayment(
1029
1036
* mv.addObject("accountInfo", accountForm);
1030
1037
*/
1031
1038
// forwardingPage += "/cloudPage";
1032
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
1039
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
1033
1040
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
1034
1041
statusText = "Thank you " + cloudName + " for your personal cloud order.<br/>"
1035
1042
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -1069,7 +1076,7 @@ public ModelAndView makePayment(
1069
1076
// paid for
1070
1077
{
1071
1078
// forwardingPage += "/cloudPage";
1072
- forwardingPage = getRNpostRegistrationLandingPage () ; //RegistrationManager.getCspInviteURL();
1079
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage() ; //RegistrationManager.getCspInviteURL();
1073
1080
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
1074
1081
statusText = "Thank you " + cloudName + " for your dependent cloud order.<br/>"
1075
1082
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -1094,7 +1101,7 @@ public ModelAndView makePayment(
1094
1101
{
1095
1102
if (mv .getViewName ().equals ("additionalCloudDone" )) // all additional clouds have been paid for
1096
1103
{
1097
- forwardingPage = getRNpostRegistrationLandingPage ();
1104
+ forwardingPage += "/welcome" ; // getRNpostRegistrationLandingPage();
1098
1105
queryStr = this .formatQueryStr (cloudName , regSession .getRnQueryString (), request );
1099
1106
statusText = "Thank you " + cloudName + " for your additional cloudname order.<br/>"
1100
1107
+ "We are processing your order and will notify you once it completes registration in the network." ;
@@ -1173,7 +1180,7 @@ public ModelAndView makePayment(
1173
1180
mv .addObject ("StripeJavaScript" ,
1174
1181
StripePaymentProcessor .getJavaScript (cspModel , amount , desc ));
1175
1182
mv .addObject ("postURL" , cspHomeURL + "/ccpayment" );
1176
-
1183
+ mv . addObject ( "cspTCURL" , this . getRegistrationManager (). getCspTCURL ());
1177
1184
} else if (cspModel .getPaymentGatewayName ().equals ("SAGEPAY" ))
1178
1185
{
1179
1186
logger .debug ("Payment gateway is SAGEPAY" );
@@ -1620,7 +1627,18 @@ public ModelAndView showConfirmationForm(
1620
1627
this .clearPaymentInfo ();
1621
1628
return mv ;
1622
1629
}
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
+ }
1624
1642
public boolean postLatitudeLongitudeInfo () throws Exception
1625
1643
{
1626
1644
String latLongPostURL = RegistrationManager .getLatLongPostURL ();
0 commit comments