From c255c9d31380a878cf5fd1670238b95fce85d0d9 Mon Sep 17 00:00:00 2001
From: deedee
Date: Thu, 13 Apr 2017 10:45:52 +0000
Subject: [PATCH 01/13] - build_distui.xml used env var for jboss home -
cache.properties used redis as default - add support for circleci
---
.deploy/circleci/README | 1 +
build_distui.xml | 10 +++++-----
build_tc.xml | 2 +-
circle.yml | 14 +++++++++++++
resources/cache.properties | 40 +++++++++++++++++++-------------------
5 files changed, 41 insertions(+), 26 deletions(-)
create mode 100644 .deploy/circleci/README
create mode 100644 circle.yml
diff --git a/.deploy/circleci/README b/.deploy/circleci/README
new file mode 100644
index 00000000000..ccc83d26270
--- /dev/null
+++ b/.deploy/circleci/README
@@ -0,0 +1 @@
+All files and directories under this directory will be copy to tc-website root on circleci env before build
diff --git a/build_distui.xml b/build_distui.xml
index ea15361eb91..2891cd71278 100644
--- a/build_distui.xml
+++ b/build_distui.xml
@@ -1,4 +1,5 @@
+
@@ -23,11 +24,10 @@
-
-
-
-
-
+
+
+
+
diff --git a/build_tc.xml b/build_tc.xml
index 99e73c79cee..e557f8a5de6 100644
--- a/build_tc.xml
+++ b/build_tc.xml
@@ -847,7 +847,7 @@
-
+
diff --git a/circle.yml b/circle.yml
new file mode 100644
index 00000000000..cf0f59c209b
--- /dev/null
+++ b/circle.yml
@@ -0,0 +1,14 @@
+machine:
+ services:
+ - docker
+
+checkout:
+ pre:
+ - git clone https://github.com/topcoder-platform/tc-website-glue glue
+ - git clone https://github.com/topcoder-platform/tc-website-shared shared
+ - git clone https://github.com/topcoder-platform/tc-website-external-artifacts
+
+
+test:
+ override:
+ - cp -Rf .deploy/circleci/* . && docker run -v ${HOME}:/root/tc-platform appiriodevops/tc-website:build
diff --git a/resources/cache.properties b/resources/cache.properties
index dc972fd0e86..2341322ab5f 100755
--- a/resources/cache.properties
+++ b/resources/cache.properties
@@ -1,33 +1,33 @@
-cache.primary = localhost:8501
+#cache.primary = localhost:8501
#cache.secondary = 63.118.154.182:8502
# allow at most 25000 items in the cache
-cache.size = 25000
+#cache.size = 25000
# sync every 10 seconds
-cache.synctime = 10000
+#cache.synctime = 10000
# check every minute
-cache.expirecheck = 60000
+#cache.expirecheck = 60000
# expire after 10 hours
-cache.expiretime = 3600000
+#cache.expiretime = 3600000
### Use the following configurations to use JBoss Cache as cache ###
-host_url = env.topcoder.com:2199
-jndi_name = TCCache
-cache_admin_jndi_name = TCCacheAdmin
-cache_client_class=com.topcoder.web.common.cache.JbossCacheClient
+#host_url = env.topcoder.com:2199
+#jndi_name = TCCache
+#cache_admin_jndi_name = TCCacheAdmin
+#cache_client_class=com.topcoder.web.common.cache.JbossCacheClient
### Use the following configurations to use REDIS as cache ###
-
-#cache_client_class=com.topcoder.web.common.cache.RedisCacheClient
-#tc_subject_cache_address_class=com.topcoder.web.common.cache.address.TCSubjectAddress
-#request_cache_address_class=com.topcoder.web.common.cache.address.RequestAddress
-
+#
+cache_client_class=com.topcoder.web.common.cache.RedisCacheClient
+tc_subject_cache_address_class=com.topcoder.web.common.cache.address.TCSubjectAddress
+request_cache_address_class=com.topcoder.web.common.cache.address.RequestAddress
+#
#format: redis://username:password@my.host:6389
-#redis.uri=redis://cache.topcoder.com:6379
-
-
-#redis.maxTotalConnections=50
-#redis.maxIdleConnections=30
-#redis.minIdleConnections=1
+redis.uri=redis://env.topcoder.com:6379
+#
+#
+redis.maxTotalConnections=50
+redis.maxIdleConnections=30
+redis.minIdleConnections=1
From 708aadf9cf6945ff4acfeb0e087148a3f4b705cb Mon Sep 17 00:00:00 2001
From: deedee
Date: Thu, 13 Apr 2017 12:13:33 +0000
Subject: [PATCH 02/13] update circle.yml
---
circle.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/circle.yml b/circle.yml
index cf0f59c209b..4baf3f224fc 100644
--- a/circle.yml
+++ b/circle.yml
@@ -6,7 +6,7 @@ checkout:
pre:
- git clone https://github.com/topcoder-platform/tc-website-glue glue
- git clone https://github.com/topcoder-platform/tc-website-shared shared
- - git clone https://github.com/topcoder-platform/tc-website-external-artifacts
+ - git clone https://github.com/topcoder-platform/tc-website-external-artifacts external-artifacts
test:
From 9ca1ee73846270c26723ca3af1d885272f0dbdf2 Mon Sep 17 00:00:00 2001
From: sah2ed
Date: Fri, 28 Apr 2017 18:53:30 +0100
Subject: [PATCH 03/13] Sync to revision 85917 from svn upstream.
---
.../web/common/model/UserSSOLogin.hbm.xml | 18 ++
resources/reg/hibernate.cfg.xml | 4 +
.../topcoder/web/common/dao/DAOFactory.java | 7 +
.../web/common/dao/UserSSOLoginDAO.java | 31 +++
.../dao/hibernate/DAOFactoryHibernate.java | 9 +
.../hibernate/UserSSOLoginDAOHibernate.java | 50 ++++
.../dao/querytool/DAOFactoryQueryTool.java | 10 +
.../web/common/model/UserSSOLogin.java | 228 ++++++++++++++++++
.../tc/controller/request/myhome/Home.java | 3 +
.../topcoder/web/tc/view/my_home/index.jsp | 30 ++-
10 files changed, 378 insertions(+), 12 deletions(-)
create mode 100644 resources/hibernate/com/topcoder/web/common/model/UserSSOLogin.hbm.xml
create mode 100644 src/main/com/topcoder/web/common/dao/UserSSOLoginDAO.java
create mode 100644 src/main/com/topcoder/web/common/dao/hibernate/UserSSOLoginDAOHibernate.java
create mode 100644 src/main/com/topcoder/web/common/model/UserSSOLogin.java
diff --git a/resources/hibernate/com/topcoder/web/common/model/UserSSOLogin.hbm.xml b/resources/hibernate/com/topcoder/web/common/model/UserSSOLogin.hbm.xml
new file mode 100644
index 00000000000..b947fce0b8b
--- /dev/null
+++ b/resources/hibernate/com/topcoder/web/common/model/UserSSOLogin.hbm.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/reg/hibernate.cfg.xml b/resources/reg/hibernate.cfg.xml
index 809e45aae9f..62f5ac9671a 100644
--- a/resources/reg/hibernate.cfg.xml
+++ b/resources/reg/hibernate.cfg.xml
@@ -154,6 +154,10 @@
+
+
+
+
diff --git a/src/main/com/topcoder/web/common/dao/DAOFactory.java b/src/main/com/topcoder/web/common/dao/DAOFactory.java
index 86081aa8287..f7054641131 100644
--- a/src/main/com/topcoder/web/common/dao/DAOFactory.java
+++ b/src/main/com/topcoder/web/common/dao/DAOFactory.java
@@ -234,6 +234,13 @@ public interface DAOFactory {
*/
UserSocialLoginDAO getUserSocialLoginDAO();
+ /**
+ * Gets the instance of {@link UserSSOLoginDAO}.
+ *
+ * @return the dao.
+ */
+ UserSSOLoginDAO getUserSSOLoginDAO();
+
/**
* Gets the instance of {@link UserApiSpinDAO}.
*
diff --git a/src/main/com/topcoder/web/common/dao/UserSSOLoginDAO.java b/src/main/com/topcoder/web/common/dao/UserSSOLoginDAO.java
new file mode 100644
index 00000000000..fd5d06043d2
--- /dev/null
+++ b/src/main/com/topcoder/web/common/dao/UserSSOLoginDAO.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 TopCoder Inc., All Rights Reserved.
+ */
+package com.topcoder.web.common.dao;
+
+import com.topcoder.web.common.model.UserSSOLogin;
+
+import java.util.List;
+
+/**
+ *
+ * An interface for the UserSSOLogin DAO.
+ *
+ *
+ *
+ * Thread safety: This class is thread-safe.
+ *
+ *
+ * @author kht.tc
+ * @version 1.0
+ */
+public interface UserSSOLoginDAO extends GenericDAO {
+ /**
+ * Find UserSSOLogin by user id.
+ *
+ * @param userId the user id
+ * @return retrieved list
+ */
+ List findByUserId(long userId);
+ UserSSOLogin findByProviderIdAndSSOUserId(long providerId, String ssoUserId);
+}
diff --git a/src/main/com/topcoder/web/common/dao/hibernate/DAOFactoryHibernate.java b/src/main/com/topcoder/web/common/dao/hibernate/DAOFactoryHibernate.java
index 5eff3c342d9..a17d31c97e9 100644
--- a/src/main/com/topcoder/web/common/dao/hibernate/DAOFactoryHibernate.java
+++ b/src/main/com/topcoder/web/common/dao/hibernate/DAOFactoryHibernate.java
@@ -379,6 +379,15 @@ public UserSocialLoginDAO getUserSocialLoginDAO() {
return new UserSocialLoginDAOHibernate();
}
+ /**
+ * Gets the instance of {@link UserSSOLoginDAO}.
+ *
+ * @return the dao.
+ */
+ public UserSSOLoginDAO getUserSSOLoginDAO() {
+ return new UserSSOLoginDAOHibernate();
+ }
+
/**
* Gets the instance of {@link UserApiSpinDAO}.
*
diff --git a/src/main/com/topcoder/web/common/dao/hibernate/UserSSOLoginDAOHibernate.java b/src/main/com/topcoder/web/common/dao/hibernate/UserSSOLoginDAOHibernate.java
new file mode 100644
index 00000000000..a04765b2be9
--- /dev/null
+++ b/src/main/com/topcoder/web/common/dao/hibernate/UserSSOLoginDAOHibernate.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2017 TopCoder Inc., All Rights Reserved.
+ */
+package com.topcoder.web.common.dao.hibernate;
+
+import com.topcoder.web.common.dao.UserSSOLoginDAO;
+import com.topcoder.web.common.model.UserSSOLogin;
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.criterion.Restrictions;
+
+import java.util.List;
+
+/**
+ *
+ * An implementation for the UserSSOLogin DAO.
+ *
+ *
+ *
+ * Thread safety: This class is thread-safe.
+ *
+ *
+ * @author kht.tc
+ * @version 1.0
+ */
+public class UserSSOLoginDAOHibernate extends GenericBase
+ implements UserSSOLoginDAO {
+
+ /**
+ * Find UserSSOLogin by user id.
+ *
+ * @param userId the user id
+ * @return retrieved list
+ */
+ public List findByUserId(long userId) {
+ Query q = getSession().createQuery("from UserSSOLogin " +
+ " where id.userId = " + userId ).setCacheable(false);
+
+ return q.list();
+ }
+
+ public UserSSOLogin findByProviderIdAndSSOUserId(long providerId, String ssoUserId) {
+ Criteria c = getSession().createCriteria(UserSSOLogin.class)
+ .add(Restrictions.eq("ssoUserId", ssoUserId))
+ .add(Restrictions.eq("id.providerId", providerId));
+ List ret = c.list();
+ return ret.isEmpty() ? null : (UserSSOLogin) ret.get(0);
+
+ }
+}
diff --git a/src/main/com/topcoder/web/common/dao/querytool/DAOFactoryQueryTool.java b/src/main/com/topcoder/web/common/dao/querytool/DAOFactoryQueryTool.java
index 00bc651320c..1a365e7772c 100644
--- a/src/main/com/topcoder/web/common/dao/querytool/DAOFactoryQueryTool.java
+++ b/src/main/com/topcoder/web/common/dao/querytool/DAOFactoryQueryTool.java
@@ -366,6 +366,15 @@ public UserSocialLoginDAO getUserSocialLoginDAO() {
throw new RuntimeException("Not supported");
}
+ /**
+ * Gets the instance of {@link UserSSOLoginDAO}.
+ *
+ * @return nothing, will throw exception.
+ */
+ public UserSSOLoginDAO getUserSSOLoginDAO() {
+ throw new RuntimeException("Not supported");
+ }
+
/**
* Gets the instance of {@link UserApiSpinDAO}.
*
@@ -405,4 +414,5 @@ public EmailRequestDAO getEmailRequestDAO() {
public DocuSignEnvelopeDAO getDocuSignEnvelopeDAO() {
throw new RuntimeException("Not supported");
}
+
}
diff --git a/src/main/com/topcoder/web/common/model/UserSSOLogin.java b/src/main/com/topcoder/web/common/model/UserSSOLogin.java
new file mode 100644
index 00000000000..978d125c5b8
--- /dev/null
+++ b/src/main/com/topcoder/web/common/model/UserSSOLogin.java
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2017 TopCoder Inc., All Rights Reserved.
+ */
+package com.topcoder.web.common.model;
+
+import java.io.Serializable;
+
+/**
+ *
+ * This class represents a User SSO Login entity.
+ *
+ *
+ *
+ * Thread safety: This class is thread-safe.
+ *
+ *
+ * @author kht.tc
+ * @version 1.0
+ */
+public class UserSSOLogin extends Base {
+
+ /**
+ * The id.
+ */
+ private Identifier id;
+
+ /**
+ * The sso user name.
+ */
+ private String ssoUserName;
+
+ /**
+ * THe sso email.
+ */
+ private String ssoEmail;
+
+
+ private String ssoUserId;
+
+ /**
+ * Get the id.
+ *
+ * @return the id.
+ */
+ public Identifier getId() {
+ return id;
+ }
+
+ /**
+ * Set the id.
+ *
+ * @param id the id.
+ */
+ public void setId(Identifier id) {
+ this.id = id;
+ }
+
+ /**
+ * Get sso user name.
+ *
+ * @return the name.
+ */
+ public String getSsoUserName() {
+ return ssoUserName;
+ }
+
+ /**
+ * Set the sso user name.
+ *
+ * @param ssoUserName the name.
+ */
+ public void setSsoUserName(String ssoUserName) {
+ this.ssoUserName = ssoUserName;
+ }
+
+ /**
+ * Get the sso email.
+ *
+ * @return the email.
+ */
+ public String getSsoEmail() {
+ return ssoEmail;
+ }
+
+ /**
+ * Set the sso email.
+ *
+ * @param ssoEmail the email.
+ */
+ public void setSsoEmail(String ssoEmail) {
+ this.ssoEmail = ssoEmail;
+ }
+
+
+ public String getSsoUserId() {
+ return ssoUserId;
+ }
+
+ public void setSsoUserId(String ssoUserId) {
+ this.ssoUserId = ssoUserId;
+ }
+
+ /**
+ * Get the hash code.
+ *
+ * @return the hash code.
+ */
+ public int hashCode() {
+ return id.hashCode();
+ }
+
+ /**
+ * Check whether equals to other object.
+ *
+ * @param obj the object to check.
+ * @return whether equals.
+ */
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ return id.equals(((UserSSOLogin) obj).getId());
+ }
+
+ /**
+ * The class used to represent the id of user social login.
+ */
+ public static class Identifier implements Serializable {
+ /**
+ * The user id.
+ */
+ private long userId;
+
+ /**
+ * The sso provider id.
+ */
+ private long providerId;
+
+ /**
+ * Identifier.
+ *
+ * @param userId the user id.
+ * @param providerId the sso provider id.
+ */
+ public Identifier(long userId, long providerId) {
+ this.userId = userId;
+ this.providerId = providerId;
+ }
+
+ /**
+ * The default ctor.
+ */
+ public Identifier() {
+ }
+
+ /**
+ * Get user id.
+ *
+ * @return the user id.
+ */
+ public long getUserId() {
+ return userId;
+ }
+
+ /**
+ * Set user id.
+ *
+ * @param userId the user id.
+ */
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ /**
+ * Get sso provider id.
+ *
+ * @return the provider id.
+ */
+ public long getProviderId() {
+ return providerId;
+ }
+
+ /**
+ * Set provider id.
+ *
+ * @param providerId the provider id.
+ */
+ public void setProviderId(long providerId) {
+ this.providerId = providerId;
+ }
+
+ /**
+ * Check whether id equals to other object.
+ *
+ * @param o the object to check.
+ * @return whether equals.
+ */
+ public boolean equals(Object o) {
+ if (o == null) {
+ return false;
+ }
+ try {
+ Identifier id = (Identifier) o;
+ return id.getUserId() == userId
+ && id.getProviderId() == providerId;
+ } catch (ClassCastException e) {
+ return false;
+ }
+
+ }
+
+ /**
+ * Get the hash code.
+ *
+ * @return the hash code.
+ */
+ public int hashCode() {
+ final int PRIME = 31;
+ return (int) (userId * PRIME + providerId);
+ }
+ }
+}
diff --git a/src/main/com/topcoder/web/tc/controller/request/myhome/Home.java b/src/main/com/topcoder/web/tc/controller/request/myhome/Home.java
index 2a51b883c3c..3199f01729c 100644
--- a/src/main/com/topcoder/web/tc/controller/request/myhome/Home.java
+++ b/src/main/com/topcoder/web/tc/controller/request/myhome/Home.java
@@ -77,6 +77,9 @@ protected void dbProcessing() throws Exception {
getRequest().setAttribute("hasSocialAccount",
!DAOUtil.getFactory().getUserSocialLoginDAO().findByUserId(getUser().getId()).isEmpty());
+ getRequest().setAttribute("hasSSOAccount",
+ !DAOUtil.getFactory().getUserSSOLoginDAO().findByUserId(getUser().getId()).isEmpty());
+
setNextPage("/my_home/index.jsp");
setIsNextPageInContext(true);
}
diff --git a/src/main/com/topcoder/web/tc/view/my_home/index.jsp b/src/main/com/topcoder/web/tc/view/my_home/index.jsp
index e65795edc61..57a5648daec 100755
--- a/src/main/com/topcoder/web/tc/view/my_home/index.jsp
+++ b/src/main/com/topcoder/web/tc/view/my_home/index.jsp
@@ -1,7 +1,7 @@
<%--
- Author: isv, pvmagacho, TCSASSEMBLER
- - Version: 1.5
- - Copyright (C) 2010 - 2013 TopCoder Inc., All Rights Reserved.
+ - Version: 1.6
+ - Copyright (C) 2010 - 2017 TopCoder Inc., All Rights Reserved.
-
- Description: This page renders the Home page displayed to TopCoder member. It renders the details on user
- account (name, address, phone, etc) as well as navigation links to various areas providing other user account
@@ -25,6 +25,9 @@
-
- Changes in 1.5 (Release Assembly - Social Login Linking for Existing User):
- - Add Add/Remove social login link and auth0 logic.
+ -
+ - Changes in 1.6
+ - - Hide Add/Remove social login link and related script from SSO user.
--%>
<%@ page import="com.topcoder.shared.util.ApplicationServer"%>
@@ -59,6 +62,7 @@
From 37aa9f317f53045d829a7909790514cd8f5719a8 Mon Sep 17 00:00:00 2001
From: ajefts
Date: Tue, 13 Jun 2017 13:56:15 -0400
Subject: [PATCH 10/13] Replace GA with Segment
---
.../com/topcoder/web/studio/view/foot.jsp | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/main/com/topcoder/web/studio/view/foot.jsp b/src/main/com/topcoder/web/studio/view/foot.jsp
index f7f89e9e897..ad4d2b24dc9 100644
--- a/src/main/com/topcoder/web/studio/view/foot.jsp
+++ b/src/main/com/topcoder/web/studio/view/foot.jsp
@@ -58,18 +58,11 @@
<%-- #footer ends --%>
-
+
From 9632da622ee3dc4e237324011c0228ec2afcbb57 Mon Sep 17 00:00:00 2001
From: Guiqiang Zhang
Date: Fri, 11 Aug 2017 09:13:02 +0800
Subject: [PATCH 11/13] add payment method for wipro
---
resources/taglib/tc-webtags.tld | 5 ++
.../web/common/model/PaymentMethod.java | 19 +++-
.../web/common/tag/RadioButtonTag.java | 14 +++
.../com/topcoder/web/ejb/pacts/Constants.java | 18 ++--
.../web/ejb/pacts/PactsServicesBean.java | 90 +++++++++++++------
.../web/ejb/pacts/PactsServicesLocal.java | 12 ++-
.../legacy/pacts/bean/DataInterfaceBean.java | 17 +++-
.../myhome/EditPaymentPreferences.java | 59 ++++++++----
.../tc/view/my_home/paymentPreferences.jsp | 27 +++++-
9 files changed, 200 insertions(+), 61 deletions(-)
diff --git a/resources/taglib/tc-webtags.tld b/resources/taglib/tc-webtags.tld
index 613357022e7..d743bcf4c11 100755
--- a/resources/taglib/tc-webtags.tld
+++ b/resources/taglib/tc-webtags.tld
@@ -185,6 +185,11 @@
false
true
+
+ disabled
+ false
+ true
+
diff --git a/src/main/com/topcoder/web/common/model/PaymentMethod.java b/src/main/com/topcoder/web/common/model/PaymentMethod.java
index c9b1a4e16f7..d83d61f6ce2 100644
--- a/src/main/com/topcoder/web/common/model/PaymentMethod.java
+++ b/src/main/com/topcoder/web/common/model/PaymentMethod.java
@@ -4,12 +4,21 @@
/**
* A class to hold Payment Method data.
*
- * @author VolodymyrK
+ *
+ * Version 1.1 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Added eligible attribute to determinate whether the payment method is allowed or not.
+ *
+ *
+ *
+ * @author VolodymyrK, TCSCODER
+ * @version 1.1
*/
public class PaymentMethod extends Base {
private Long id;
private String name;
+ private boolean eligible = true;
public PaymentMethod() {
}
@@ -30,4 +39,12 @@ public void setName(String name) {
this.name = name;
}
+ public boolean isEligible() {
+ return eligible;
+ }
+
+ public void setEligible(boolean eligible) {
+ this.eligible = eligible;
+ }
+
}
diff --git a/src/main/com/topcoder/web/common/tag/RadioButtonTag.java b/src/main/com/topcoder/web/common/tag/RadioButtonTag.java
index 927b50744e7..fa31e30a4db 100644
--- a/src/main/com/topcoder/web/common/tag/RadioButtonTag.java
+++ b/src/main/com/topcoder/web/common/tag/RadioButtonTag.java
@@ -4,11 +4,18 @@
* User: dok
* Date: Jan 3, 2005
* Time: 5:53:26 PM
+ *
+ * Version 1.1 (Topcoder - Add New Payment Provider) 08/08/2017
+ * - Add "disabled" attribute
+ *
+ * @author dok, TCSCODER
+ * @version 1.1
*/
public class RadioButtonTag extends BaseTag {
private String value = null;
private String selected = null;
private String onClick = null;
+ private String disabled = null;
public int doStartTag() {
StringBuffer ret = new StringBuffer();
@@ -25,6 +32,9 @@ public int doStartTag() {
}
if (onClick != null)
ret.append("onClick=\"").append(onClick).append("\" ");
+ if (disabled != null) {
+ ret.append("disabled ");
+ }
ret.append("/>");
pageContext.getOut().print(ret.toString());
} catch (java.io.IOException ioe) {
@@ -48,6 +58,10 @@ public void setOnClick(String onClick) {
this.onClick = onClick;
}
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
protected void init() {
this.value = null;
this.selected = null;
diff --git a/src/main/com/topcoder/web/ejb/pacts/Constants.java b/src/main/com/topcoder/web/ejb/pacts/Constants.java
index c256ada8685..aa5d93d7bb3 100644
--- a/src/main/com/topcoder/web/ejb/pacts/Constants.java
+++ b/src/main/com/topcoder/web/ejb/pacts/Constants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 - 2012 TopCoder Inc., All Rights Reserved.
+ * Copyright (C) 2004 - 2017 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.web.ejb.pacts;
@@ -75,7 +75,7 @@
*
* - Added common payment types for all tracks. No more separate payments for architecture, assembly, components etc.
*
- *
+ *
*
*
* Version 1.10 (Member Payments Automation Assembly 1.0) Change notes:
@@ -84,8 +84,15 @@
*
*
*
- * @author pulky, VolodymyrK, isv
- * @version 1.10
+ *
+ * Version 1.11 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Added {@link WIPRO_PAYROLL_PAYMENT_METHOD_ID} constant.
+ *
+ *
+ *
+ * @author pulky, VolodymyrK, isv, TCSCODER
+ * @version 1.11
*/
public interface Constants {
@@ -271,10 +278,11 @@ public interface Constants {
public static final long NOT_SET_PAYMENT_METHOD_ID = 1;
public static final long PAYPAL_PAYMENT_METHOD_ID = 2;
public static final long PAYONEER_PAYMENT_METHOD_ID = 5;
+ public static final long WIPRO_PAYROLL_PAYMENT_METHOD_ID = 7;
/**
* A long
providing the ID of Western Union
payment method.
- *
+ *
* @since 1.10
*/
public static final long WESTERN_UNION_PAYMENT_METHOD_ID = 6;
diff --git a/src/main/com/topcoder/web/ejb/pacts/PactsServicesBean.java b/src/main/com/topcoder/web/ejb/pacts/PactsServicesBean.java
index 37a262ccb1f..ca19df025a1 100755
--- a/src/main/com/topcoder/web/ejb/pacts/PactsServicesBean.java
+++ b/src/main/com/topcoder/web/ejb/pacts/PactsServicesBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 - 2012 TopCoder Inc., All Rights Reserved.
+ * Copyright (C) 2004 - 2017 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.web.ejb.pacts;
@@ -126,11 +126,17 @@
* method.
*
*
+ *
+ * Version 1.8 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Added {@link #hasWiproSSOAccount(long)} method.
+ *
+ *
*
* VERY IMPORTANT: remember to update serialVersionUID if needed.
*
- * @author Dave Pecora, pulky, isv, Vitta, Blues, FireIce
- * @version 1.7
+ * @author Dave Pecora, pulky, isv, Vitta, Blues, FireIce, TCSCODER
+ * @version 1.8
* @see PactsConstants
*/
public class PactsServicesBean extends BaseEJB implements PactsConstants {
@@ -1539,7 +1545,7 @@ public void saveUserPaymentMethod(long userId, long paymentMethodId) {
if (userId == 0) {
throw new IllegalArgumentException("Invalid user ID");
}
-
+
if (paymentMethodId <= 0) {
throw new IllegalArgumentException("Invalid payment method ID.");
}
@@ -1608,7 +1614,7 @@ public void saveUserPayPalAccount(long userId, String payPalAccount) {
if (payPalAccount == null) {
throw new IllegalArgumentException("Invalid email address of the PayPal account");
}
-
+
PreparedStatement insertPs = null, updatePs = null;
Connection conn = null;
try {
@@ -3203,7 +3209,7 @@ public Map findPayments(Map searchCriteria) throws SQLException {
StringBuffer whereClauses = new StringBuffer(300);
whereClauses.append(" WHERE 1=1 ");
-
+
ArrayList objects = new ArrayList();
Iterator i = searchCriteria.keySet().iterator();
try {
@@ -3759,7 +3765,7 @@ public double computePaymentNetAmount(int paymentTypeId, double grossAmount, lon
log.debug("In computePaymentNetAmount");
Connection c = null;
-
+
try {
c = DBMS.getConnection(trxDataSource);
@@ -3813,7 +3819,7 @@ public double computePaymentNetAmount(int paymentTypeId, double grossAmount, lon
} else {
return grossAmount;
}
-
+
// Round to lower pennie
BigDecimal bd = new BigDecimal(netAmount).setScale(2, RoundingMode.HALF_DOWN);
double roundedNetAmount = bd.doubleValue();
@@ -5334,7 +5340,7 @@ public int generateRoundPayments(long roundId, boolean makeChanges, int paymentT
}
/**
-
+
* Generates all the payments for the people who won money for the given project (winners and
* and review board members).
* It doesn't insert the payments in the DB, just generates and returns them.
@@ -5376,7 +5382,7 @@ public List generateComponentPayments(long projectId, long status, String client
getWinners.append(" ELSE ROUND(ri7.value) ");
getWinners.append(" END::float AS payment ");
- getWinners.append(" FROM tcs_catalog:project p ");
+ getWinners.append(" FROM tcs_catalog:project p ");
getWinners.append(" INNER JOIN tcs_catalog:project_category_lu pcl ON pcl.project_category_id = p.project_category_id ");
getWinners.append(" INNER JOIN tcs_catalog:resource r ON r.project_id = p.project_id AND r.resource_role_id = 1 ");
getWinners.append(" INNER JOIN tcs_catalog:resource_info ri1 ON r.resource_id = ri1.resource_id AND ri1.resource_info_type_id = 1 ");
@@ -5398,10 +5404,10 @@ public List generateComponentPayments(long projectId, long status, String client
long resourceId = rsc.getLongItem(i, "resource_id");
long projectCategoryId = rsc.getLongItem(i, "project_category_id");
String submissionType = rsc.getStringItem(i, "submission_type");
-
+
double penalty = penalties.get(coderId) == null ? 0.0 : penalties.get(coderId);
double amount = rsc.getDoubleItem(i, "payment")*(1.0-penalty);
-
+
log.info("Generating payment. Coder: " + coderId + " placed: " + placed + " amount: " + amount + " penalty: " + penalty + " resourceId: " + resourceId);
if (amount < 0.01) {
log.info("Ignoring the payment because of zero or negative amount.");
@@ -5413,7 +5419,7 @@ public List generateComponentPayments(long projectId, long status, String client
if (projectCategoryId == 37) { // If Marathon Match
if (rsc.getItem(i, "mm_round_id").getResultData() == null) {
log.info("MM round ID is not set. Ignoring the payment.");
- continue;
+ continue;
}
long mmRoundId = rsc.getLongItem(i, "mm_round_id");
@@ -5433,7 +5439,7 @@ public List generateComponentPayments(long projectId, long status, String client
// Calculate the due date for the 2nd installment.
// It should be max(general due date assigned by the system, SECOND_INSTALLMENT_HOLD_PERIOD days from now).
- Calendar cal = Calendar.getInstance();
+ Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, SECOND_INSTALLMENT_HOLD_PERIOD);
payment2 = fillPaymentData(payment2);
@@ -5448,8 +5454,8 @@ public List generateComponentPayments(long projectId, long status, String client
} else if (submissionType.startsWith("Checkpoint Submission")) {
payments.add(new ContestCheckpointPayment(coderId, amount, client, projectId, placed));
}
-
- resourceIds.add(new Long(resourceId));
+
+ resourceIds.add(new Long(resourceId));
} else {
log.info("Payments for the coder " + coderId + " are skipped because he/she still has pending late deliverables.");
}
@@ -5494,7 +5500,7 @@ public List generateComponentPayments(long projectId, long status, String client
log.info("Payments for the coder " + coderId + " are skipped because he/she still has pending late deliverables.");
continue;
}
-
+
String paymentType = rsc.getStringItem(i, "payment_type");
double penalty = penalties.get(coderId) == null ? 0.0 : penalties.get(coderId);
double amount = rsc.getDoubleItem(i, "paid");
@@ -5505,7 +5511,7 @@ public List generateComponentPayments(long projectId, long status, String client
ComponentProjectReferencePayment p = null;
int projectType = getProjectType(projectId);
-
+
if (paymentType.startsWith("Copilot Payment")) {
// The penalties are not applied to the copilot payments
p = new CopilotPayment(coderId, amount, client, projectId);
@@ -5537,8 +5543,8 @@ public List generateComponentPayments(long projectId, long status, String client
return payments;
}
- /**
- * Returns the maximum of two dates. A null date is considered to be less than any non-null date.
+ /**
+ * Returns the maximum of two dates. A null date is considered to be less than any non-null date.
*/
private static Date max(Date d1, Date d2) {
if (d1 == null && d2 == null) {
@@ -5559,7 +5565,7 @@ private static Date max(Date d1, Date d2) {
* is still in the 24 hours window since the moment of creation (which means the late member can still explain it).
*
* @param projectId The ID of the project
- * @return List of user IDs who have pending late deliverables for this project.
+ * @return List of user IDs who have pending late deliverables for this project.
* @throws SQLException If there was some error retrieving the data.
*/
private List getPendingUserIds(long projectId) throws SQLException {
@@ -5569,9 +5575,9 @@ private List getPendingUserIds(long projectId) throws SQLException {
query.append(" ld.resource_id = r.resource_id and r.project_id = " + projectId + " and ");
query.append(" r.resource_id = ri.resource_id and ri.resource_info_type_id = 1 and ");
query.append(" ld.forgive_ind=0 and ");
- query.append(" ((ld.explanation is not null and ld.response is null) "); // if the explained record is waiting for the response
+ query.append(" ((ld.explanation is not null and ld.response is null) "); // if the explained record is waiting for the response
query.append(" or (ld.explanation is null and ld.create_date>current-24 units hour)) "); // or if the late member still has time to explain (24 hours)
-
+
List userIds = new ArrayList();
ResultSetContainer rsc = runSelectQuery(query.toString());
for (int i = 0; i < rsc.size(); i++) {
@@ -5598,19 +5604,19 @@ private Map getPaymentPenalties(long projectId) throws SQLException
query.append(" r.project_id=" + projectId + " and r.resource_id=ld.resource_id and r.resource_id=ri.resource_id and ");
query.append(" ri.resource_info_type_id=1 and ld.forgive_ind=0 ");
query.append(" group by 1 ");
-
+
Map penalties = new HashMap();
ResultSetContainer rsc = runSelectQuery(query.toString());
for (int i = 0; i < rsc.size(); i++) {
long userId = rsc.getLongItem(i, "user_id");
long delay = rsc.getLongItem(i, "total_delay");
long rejectedFinalFixes = rsc.getLongItem(i, "rejected_final_fixes");
-
+
long paymentPenaltyPercentage = (delay>0 ? 5 : 0) + (delay/3600) + rejectedFinalFixes * 5;
if (paymentPenaltyPercentage > 50) {
paymentPenaltyPercentage = 50;
}
-
+
penalties.put(userId, (double)paymentPenaltyPercentage/100.0);
}
return penalties;
@@ -6513,7 +6519,7 @@ private int getProjectType(long projectId) throws SQLException {
}
private boolean isStudioProject(long projectId) throws SQLException {
- ResultSetContainer rsc = runSelectQuery("SELECT pcl.project_type_id FROM tcs_catalog:project_category_lu pcl, " +
+ ResultSetContainer rsc = runSelectQuery("SELECT pcl.project_type_id FROM tcs_catalog:project_category_lu pcl, " +
" tcs_catalog:project p WHERE p.project_category_id=pcl.project_category_id and p.project_id=" + projectId);
if (rsc.size() == 0) {
@@ -6748,12 +6754,12 @@ public List findCoderPayments(long coderId, int paymentTypeId, long referenceId)
searchCriteria.put(PAYMENT_REFERENCE_ID, String.valueOf(referenceId));
return findCoderPayments(searchCriteria);
}
-
+
/**
* Find a Jira payment by its issue key.
* @param jiraIssueKey the issue key.
* @return the Jira payments for the given issue, or empty if not found
- * @throws RemoteException if there is an error
+ * @throws RemoteException if there is an error
* @throws Exception if there is an error
* @throws InvalidStatusException if there is an error
*/
@@ -7075,6 +7081,32 @@ public ResultSetContainer getContestsInfo(long eid) throws SQLException {
}
+ /**
+ * Returns true if the specified user is a Wipro SSO user.
+ *
+ * @param userId The user ID to check.
+ * @return Whether the user is a Wipro SSO user.
+ * @throws SQLException If there is some problem querying the database
+ */
+ public boolean hasWiproSSOAccount(long userId) throws SQLException {
+ StringBuffer query = new StringBuffer(300);
+ query.append("SELECT COUNT(*) FROM user u ");
+ query.append(" JOIN user_sso_login su ON su.user_id = u.user_id ");
+ query.append(" JOIN sso_login_provider sp ON sp.sso_login_provider_id = su.provider_id AND sp.name = 'wipro-adfs' ");
+ query.append("WHERE u.user_id = " + userId);
+
+ Connection c = null;
+ boolean ret = false;
+ try {
+ c = DBMS.getConnection(DBMS.COMMON_OLTP_DATASOURCE_NAME);
+ ResultSetContainer rsc = runSelectQuery(c, query.toString());
+ ret = Integer.parseInt(rsc.getItem(0, 0).toString()) > 0;
+ } finally {
+ close(c);
+ }
+ return ret;
+ }
+
class AlgorithmContestPaymentDataRetriever extends AlgorithmContestPayment {
private final String roundName;
private final Date dueDate;
diff --git a/src/main/com/topcoder/web/ejb/pacts/PactsServicesLocal.java b/src/main/com/topcoder/web/ejb/pacts/PactsServicesLocal.java
index 2bba2ade4d2..91379f1e1f0 100644
--- a/src/main/com/topcoder/web/ejb/pacts/PactsServicesLocal.java
+++ b/src/main/com/topcoder/web/ejb/pacts/PactsServicesLocal.java
@@ -36,9 +36,15 @@
* populating the payment statuses for the given resource ids.
*
*
+ *
+ * Version 1.2 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Added {@link #hasWiproSSOAccount(long)} method.
+ *
+ *
*
- * @author Dave Pecora, FireIce
- * @version 1.1
+ * @author Dave Pecora, FireIce, TCSCODER
+ * @version 1.2
* @see PactsServicesBean
* @see com.topcoder.web.tc.controller.legacy.pacts.bean.DataInterfaceBean
*/
@@ -266,6 +272,8 @@ List generateComponentPayments(long projectId, long status, String client, List
ResultSetContainer getAffidavitHistory(long userId, boolean pendingOnly, int sortColumn, boolean sortAscending) throws SQLException;
+ boolean hasWiproSSOAccount(long userId) throws SQLException;
+
// ================== Methods from the Client Service ==================
BasePayment addPayment(BasePayment payment) throws SQLException;
diff --git a/src/main/com/topcoder/web/tc/controller/legacy/pacts/bean/DataInterfaceBean.java b/src/main/com/topcoder/web/tc/controller/legacy/pacts/bean/DataInterfaceBean.java
index ebb5276ba12..58e19961cf7 100755
--- a/src/main/com/topcoder/web/tc/controller/legacy/pacts/bean/DataInterfaceBean.java
+++ b/src/main/com/topcoder/web/tc/controller/legacy/pacts/bean/DataInterfaceBean.java
@@ -79,9 +79,15 @@
* populating the payment statuses for the given resource ids.
*
*
+ *
+ * Version 1.2 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Added {@link #hasWiproSSOAccount(long)} method.
+ *
+ *
*
- * @author Dave Pecora, FireIce
- * @version 1.1
+ * @author Dave Pecora, FireIce, TCSCODER
+ * @version 1.2
* @see ResultSetContainer
* @see PactsServicesBean
* @see PactsConstants
@@ -1638,7 +1644,7 @@ public BasePayment fillPaymentData(BasePayment payment) throws RemoteException,
public double computePaymentNetAmount(int paymentTypeId, double grossAmount, long coderId) throws RemoteException, SQLException {
PactsServicesLocal ps = getEjbHandle();
return ps.computePaymentNetAmount(paymentTypeId, grossAmount, coderId);
- }
+ }
public BasePayment addPayment(BasePayment payment) throws RemoteException, SQLException {
PactsServicesLocal ps = getEjbHandle();
@@ -1796,6 +1802,11 @@ public String getInvoiceNumber(long paymentId) throws RemoteException, SQLExcept
PactsServicesLocal ps = getEjbHandle();
return ps.getInvoiceNumber(paymentId);
}
+
+ public boolean hasWiproSSOAccount(long userId) throws RemoteException, SQLException {
+ PactsServicesLocal ps = getEjbHandle();
+ return ps.hasWiproSSOAccount(userId);
+ }
}
diff --git a/src/main/com/topcoder/web/tc/controller/request/myhome/EditPaymentPreferences.java b/src/main/com/topcoder/web/tc/controller/request/myhome/EditPaymentPreferences.java
index 8e9875a1f49..fec5611707b 100644
--- a/src/main/com/topcoder/web/tc/controller/request/myhome/EditPaymentPreferences.java
+++ b/src/main/com/topcoder/web/tc/controller/request/myhome/EditPaymentPreferences.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2016 TopCoder Inc., All Rights Reserved.
+ * Copyright (C) 2010-2017 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.web.tc.controller.request.myhome;
@@ -23,6 +23,7 @@
import static com.topcoder.web.tc.Constants.MINIMUM_PAYMENT_ACCRUAL_AMOUNT;
import static com.topcoder.web.ejb.pacts.Constants.PAYPAL_PAYMENT_METHOD_ID;
import static com.topcoder.web.ejb.pacts.Constants.PAYONEER_PAYMENT_METHOD_ID;
+import static com.topcoder.web.ejb.pacts.Constants.WIPRO_PAYROLL_PAYMENT_METHOD_ID;
import java.text.SimpleDateFormat;
import java.util.regex.Matcher;
@@ -37,7 +38,7 @@
*
* Version 1.2 Change notes:
*
- * - Updated {@link #savePaymentPreferences()} method to send email to user in case payment method or PayPal
+ *
- Updated {@link #savePaymentPreferences()} method to send email to user in case payment method or PayPal
* account has changed.
*
*
@@ -45,13 +46,22 @@
*
* Version 1.3 Change notes:
*
- * - Updated {@link #dbProcessing()} method to take measures for preventing possible
Cross-Site Request
+ * - Updated {@link #dbProcessing()} method to take measures for preventing possible
Cross-Site Request
* Forgery
attacks.
*
*
*
- * @author isv, VolodymyrK
- * @version 1.3
+ *
+ * Version 1.4 (Topcoder - Add New Payment Provider) Change notes:
+ *
+ * - Updated {@link #loadPaymentMethods()} and {@link #savePaymentPreferences()} methods to check
+ * if signed in user is a Wipro SSO user. If the user is not Wipro SSO User, the Wipro Payroll payment method will be filtered out.
+ The only available payment method option a Wipro SSO User will be Wipro Payroll.
+ *
+ *
+ *
+ * @author isv, VolodymyrK, TCSCODER
+ * @version 1.4
*/
public class EditPaymentPreferences extends ShortHibernateProcessor {
@@ -84,7 +94,7 @@ public class EditPaymentPreferences extends ShortHibernateProcessor {
private static final String EMAIL_PATTERN = "([_A-Za-z0-9-\\+]+)(\\.[_A-Za-z0-9-\\+]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})";
private Pattern pattern;
-
+
/**
* Constructs new EditPaymentPreferences
instance.
* Simply initializes the regex pattern object..
@@ -151,6 +161,7 @@ protected void dbProcessing() throws Exception {
*/
private void loadPaymentMethods() throws Exception {
DataInterfaceBean dataBean = new DataInterfaceBean();
+ boolean wiproUser = dataBean.hasWiproSSOAccount(getUser().getId());
ResultSetContainer rsc = (ResultSetContainer) dataBean.getPaymentMethods().get(PactsConstants.PAYMENT_METHOD_LIST);
List paymentMethods = new ArrayList();
@@ -160,13 +171,22 @@ private void loadPaymentMethods() throws Exception {
String methodDesc = TCData.getTCString(rsr, "payment_method_desc", "method", true);
boolean active = TCData.getTCBoolean(rsr, "active", true, true);
+ // skip wipro payroll payment method if user is not a Wipro SSO user
+ if (methodID == WIPRO_PAYROLL_PAYMENT_METHOD_ID && !wiproUser) {
+ continue;
+ }
if (active) {
PaymentMethod paymentMethod = new PaymentMethod();
paymentMethod.setId(methodID);
paymentMethod.setName(methodDesc);
+ // mark other payments as ineligible for Wipro SSO user
+ if (methodID != WIPRO_PAYROLL_PAYMENT_METHOD_ID && wiproUser) {
+ paymentMethod.setEligible(false);
+ }
paymentMethods.add(paymentMethod);
}
}
+ getRequest().setAttribute("wiproUser", wiproUser);
getRequest().setAttribute("paymentMethods", paymentMethods);
}
@@ -208,6 +228,7 @@ private void loadPayoneerStatus() {
private void savePaymentPreferences() throws Exception {
TCRequest request = getRequest();
DataInterfaceBean dataBean = new DataInterfaceBean();
+ boolean wiproUser = dataBean.hasWiproSSOAccount(getUser().getId());
// Parse accrual amount from request and validate that it's numeric and is greater than minimum allowed value
String accrualAmountValue = request.getParameter(ACCRUAL_AMOUNT_PARAM);
@@ -234,7 +255,7 @@ private void savePaymentPreferences() throws Exception {
} catch (NumberFormatException e) {
addError(PAYMENT_METHOD_PARAM, "Payment method ID must be an integer number");
}
-
+
if (paymentMethodId == PAYONEER_PAYMENT_METHOD_ID) {
PayoneerService.PayeeStatus payeeStatus = PayoneerService.getPayeeStatus(getUser().getId());
if (payeeStatus == PayoneerService.PayeeStatus.NOT_REGISTERED) {
@@ -249,6 +270,10 @@ private void savePaymentPreferences() throws Exception {
addError(PAYPAL_ACCOUNT_PARAM, "You must specify your PayPal account email address");
}
+ if (paymentMethodId == WIPRO_PAYROLL_PAYMENT_METHOD_ID && !wiproUser) {
+ addError(PAYMENT_METHOD_PARAM, "You must be signed in with Wipro SSO to use Wipro Payroll");
+ }
+
if (!hasErrors()) {
if (newAccrualAmount < MINIMUM_PAYMENT_ACCRUAL_AMOUNT) {
addError(ACCRUAL_AMOUNT_PARAM,
@@ -320,7 +345,7 @@ private void forwardToEditPaymentPreferencesView(String paymentAccrualAmount, St
}
/**
- * Sends an email to email address for current user in case either payment method or PayPal email address have
+ *
Sends an email to email address for current user in case either payment method or PayPal email address have
* changed when servicing the request for updating user's payment preferences.
*
* @param oldPaymentMethodId a long
providing the ID of old payment method.
@@ -331,7 +356,7 @@ private void forwardToEditPaymentPreferencesView(String paymentAccrualAmount, St
* @since 1.2
*/
private void sendEmailOnPaymentPreferencesUpdated(Long oldPaymentMethodId, long paymentMethodId,
- String oldPayPalAccount, String payPalAccountValue,
+ String oldPayPalAccount, String payPalAccountValue,
String toAddress) {
try {
SimpleDateFormat formatter = new SimpleDateFormat(EMAIL_TIMESTAMP_FORMAT);
@@ -341,7 +366,7 @@ private void sendEmailOnPaymentPreferencesUpdated(Long oldPaymentMethodId, long
", your Payment Preference " +
"information was updated.");
emailBody.append("The following changes have been made:
");
-
+
emailBody.append("");
if (oldPaymentMethodId == null) {
emailBody.append("- Payment Method was set to ")
@@ -351,7 +376,7 @@ private void sendEmailOnPaymentPreferencesUpdated(Long oldPaymentMethodId, long
.append(resolvePaymentMethod(oldPaymentMethodId).getName()).append(" to ")
.append(resolvePaymentMethod(paymentMethodId).getName()).append(".
");
}
-
+
if (isEmpty(oldPayPalAccount)) {
emailBody.append("- Your PayPal account email address was set to ")
.append(isEmpty(payPalAccountValue) ? "" : payPalAccountValue).append(".
");
@@ -367,7 +392,7 @@ private void sendEmailOnPaymentPreferencesUpdated(Long oldPaymentMethodId, long
emailBody.append("If you did not initiate these changes, " +
"please contact TopCoder immediately.
");
-
+
TCSEmailMessage message = new TCSEmailMessage();
message.setFromAddress(Constants.PAYMENT_PREFS_UPDATE_EMAIL_FROM_ADDRESS);
message.setToAddress(toAddress, TCSEmailMessage.TO);
@@ -383,10 +408,10 @@ private void sendEmailOnPaymentPreferencesUpdated(Long oldPaymentMethodId, long
/**
* Gets the details for payment method matching the specified ID.
- *
+ *
* @param paymentMethodId a long
providing the ID of payment method.
- * @return a PaymentMethod
providing the details for payment method matching the specified ID or
- * null
if such a method is not found.
+ * @return a PaymentMethod
providing the details for payment method matching the specified ID or
+ * null
if such a method is not found.
* @since 1.2
*/
@SuppressWarnings("unchecked")
@@ -396,14 +421,14 @@ private PaymentMethod resolvePaymentMethod(long paymentMethodId) {
if (paymentMethod.getId() == paymentMethodId) {
return paymentMethod;
}
-
+
}
return null;
}
/**
* Checks if PayPal account has changed.
- *
+ *
* @param oldPayPalAccount a String
providing old PayPal account.
* @param newPayPalAccount a String
providing new PayPal account.
* @return true
if PayPal account has changed; false
otherwise.
diff --git a/src/main/com/topcoder/web/tc/view/my_home/paymentPreferences.jsp b/src/main/com/topcoder/web/tc/view/my_home/paymentPreferences.jsp
index c0204a49054..d718feedd78 100644
--- a/src/main/com/topcoder/web/tc/view/my_home/paymentPreferences.jsp
+++ b/src/main/com/topcoder/web/tc/view/my_home/paymentPreferences.jsp
@@ -1,11 +1,15 @@
<%--
- - Author: isv
+ - Author: isv, TCSCODER
- Version: 1.1 (Member Payment Improvements Release assembly v1.0)
- - Copyright (C) 2010-2016 TopCoder Inc., All Rights Reserved.
+ - Version: 1.2 (Topcoder - Add New Payment Provider)
+ - Copyright (C) 2010-2017 TopCoder Inc., All Rights Reserved.
-
- Description: This page provides a web form for managing user payment preferences. Such a form includes input
- field for setting the payment accrual amount for now.
- v1.1 changes: implemented Synchronizer Token Pattern for web form.
+ - v1.2 changes:
+ - - if the user is Wipro SSO User, only the Wipro Payroll option will be enabled, other options will be disabled.
+ - - Add a description for Wipro Payroll in Payment Provider section.
--%>
<%@ page contentType="text/html;charset=utf-8" %>
@@ -81,7 +85,7 @@