Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
daaf829c
Commit
daaf829c
authored
Apr 10, 2018
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pay as you go issues when opening jobs
parent
72ae2747
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
602 additions
and
130 deletions
+602
-130
MakePaymentFP.java
cmsWebApp/src/performa/form/MakePaymentFP.java
+70
-59
ReplaceCardFP.java
cmsWebApp/src/performa/form/ReplaceCardFP.java
+81
-0
UpdateCardFP.java
cmsWebApp/src/performa/form/UpdateCardFP.java
+25
-12
BaseCompany.java
cmsWebApp/src/performa/orm/BaseCompany.java
+352
-0
Company.java
cmsWebApp/src/performa/orm/Company.java
+20
-12
Company.xml
cmsWebApp/src/performa/orm/Company.xml
+2
-0
CustomServlets_adminPortal.xml
...oot/extensions/adminportal/CustomServlets_adminPortal.xml
+1
-0
billing.jsp
cmsWebApp/webroot/extensions/adminportal/billing.jsp
+1
-1
card_payment.jsp
cmsWebApp/webroot/extensions/adminportal/card_payment.jsp
+6
-26
edit_card_payment.jsp
...bApp/webroot/extensions/adminportal/edit_card_payment.jsp
+17
-7
card_details.jsp
...ebApp/webroot/extensions/adminportal/inc/card_details.jsp
+1
-2
existing_card.jsp
...bApp/webroot/extensions/adminportal/inc/existing_card.jsp
+9
-3
job_payment.jsp
cmsWebApp/webroot/extensions/adminportal/job_payment.jsp
+8
-3
replace_card.jsp
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
+1
-1
replace_card_payment.jsp
...p/webroot/extensions/adminportal/replace_card_payment.jsp
+8
-4
No files found.
cmsWebApp/src/performa/form/MakePaymentFP.java
View file @
daaf829c
package
performa
.
form
;
package
performa
.
form
;
import
com.stripe.Stripe
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
oneit.appservices.config.ConfigMgr
;
import
oneit.appservices.config.ConfigMgr
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.process.SaveFP
;
import
oneit.servlets.process.SaveFP
;
import
oneit.utils.BusinessException
;
import
oneit.utils.BusinessException
;
import
oneit.utils.StringUtils
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.parsers.FieldException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LogMgr
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.StorageException
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.ORMProcessState
;
import
com.stripe.Stripe
;
import
com.stripe.exception.StripeException
;
import
com.stripe.exception.StripeException
;
import
com.stripe.model.Card
;
import
com.stripe.model.Card
;
import
com.stripe.model.Charge
;
import
com.stripe.model.Charge
;
import
java.util.Calendar
;
import
java.util.Date
;
import
oneit.logging.LoggingArea
;
import
oneit.logging.LoggingArea
;
import
oneit.security.SecUser
;
import
oneit.security.SecUser
;
import
oneit.utils.DateDiff
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.Company
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
performa.orm.CompanyUser
;
import
performa.orm.Job
;
import
performa.orm.types.AssessmentType
;
import
performa.orm.types.JobStatus
;
import
performa.utils.StripeUtils
;
import
performa.utils.StripeUtils
;
...
@@ -36,80 +41,85 @@ public class MakePaymentFP extends SaveFP
...
@@ -36,80 +41,85 @@ public class MakePaymentFP extends SaveFP
@Override
@Override
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
p
)
throws
BusinessException
,
StorageException
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
p
)
throws
BusinessException
,
StorageException
{
{
HttpServletRequest
request
=
submission
.
getRequest
();
HttpServletRequest
request
=
submission
.
getRequest
();
Boolean
ppj
=
request
.
getAttribute
(
"PPJ"
)
!=
null
?
(
Boolean
)
request
.
getAttribute
(
"PPJ"
)
:
Boolean
.
FALSE
;
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In MakePaymentFP : "
);
Boolean
editCard
=
request
.
getAttribute
(
"EditCard"
)
!=
null
?
(
Boolean
)
request
.
getAttribute
(
"EditCard"
)
:
Boolean
.
FALSE
;
Boolean
replaceCard
=
request
.
getAttribute
(
"ReplaceCard"
)
!=
null
?
(
Boolean
)
request
.
getAttribute
(
"ReplaceCard"
)
:
Boolean
.
FALSE
;
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
Company
company
=
companyUser
.
getCompany
();
Job
job
=
(
Job
)
process
.
getAttribute
(
"Job"
);
Stripe
.
apiKey
=
STRIPE_KEY
;
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In MakePaymentFP from customer to open job: "
+
company
.
getStripeReference
());
String
token
=
request
.
getParameter
(
"stripe-token-id"
);
if
(
editCard
)
{
UpdateCardFP
.
updateCardDetails
(
process
,
submission
);
}
if
(
StringUtils
.
subBlanks
(
token
)
==
null
)
if
(
replaceCard
)
{
{
throw
new
BusinessException
(
"Updating card details failed, Please contact adminstrator for more info."
);
ReplaceCardFP
.
replaceCardDetails
(
process
,
submission
);
}
}
try
if
(
company
.
getCardID
()
!=
null
&&
ppj
)
{
{
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
try
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
{
Card
card
=
StripeUtils
.
updateCardDetails
(
companyUser
.
getCompany
(),
token
);
Map
<
String
,
Object
>
chargeParams
=
new
HashMap
<>();
Company
company
=
companyUser
.
getCompany
();
chargeParams
.
put
(
"amount"
,
NullArith
.
intVal
(
NullArith
.
multiply
(
job
.
getAssessmentType
()
==
AssessmentType
.
COMPREHENSIVE
?
499.0
:
399.0
,
100
,
0
d
)));
chargeParams
.
put
(
"currency"
,
"aud"
);
chargeParams
.
put
(
"description"
,
"Charges of creating job"
);
chargeParams
.
put
(
"customer"
,
company
.
getStripeReference
());
Charge
.
create
(
chargeParams
);
}
catch
(
StripeException
e
)
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
e
,
"Error while making a payment of company stripe "
+
company
.
getStripeReference
());
throw
new
BusinessException
(
"Stripe payment was failed, Please contact adminstrator for more info."
);
}
}
if
(
company
.
getCardID
()
==
null
)
{
Card
card
=
StripeUtils
.
retrieveCard
(
company
);
company
.
setNameOnCard
(
card
.
getName
());
company
.
setNameOnCard
(
card
.
getName
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
company
.
setCardID
(
card
.
getId
());
company
.
setCardID
(
card
.
getId
());
// cannot subscribe to a plan without card details
StripeUtils
.
updatePlan
(
company
);
}
}
catch
(
StorageException
|
FieldException
e
)
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
e
,
"Error while making payment"
);
}
return
super
.
processForm
(
process
,
submission
,
p
);
}
private
void
performStripePayment
(
SubmissionDetails
submission
)
throws
FieldException
,
BusinessException
{
HttpServletRequest
request
=
submission
.
getRequest
();
String
token
=
request
.
getParameter
(
"stripe-token-id"
);
if
(
StringUtils
.
subBlanks
(
token
)
=
=
null
)
if
(
!
ppj
&&
company
.
getPaymentPlan
()
!
=
null
)
{
{
throw
new
BusinessException
(
"Stripe payment was failed, Please contact adminstrator for more info."
);
// cannot subscribe to a plan without card details
StripeUtils
.
updatePlan
(
company
);
}
}
Stripe
.
apiKey
=
STRIPE_KEY
;
// Charge the Customer instead of the card:
Map
<
String
,
Object
>
chargeParams
=
new
HashMap
<>();
chargeParams
.
put
(
"amount"
,
NullArith
.
intVal
(
NullArith
.
multiply
(
100
d
,
100
,
0
d
)));
chargeParams
.
put
(
"currency"
,
"aud"
);
chargeParams
.
put
(
"description"
,
"Charges of creating job"
);
chargeParams
.
put
(
"source"
,
token
);
Charge
charge
;
try
job
.
setApplyBy
(
DateDiff
.
add
(
DateDiff
.
getToday
(),
Calendar
.
DATE
,
30
));
{
job
.
setOpenDate
(
new
Date
());
charge
=
Charge
.
create
(
chargeParams
);
job
.
setJobStatus
(
JobStatus
.
OPEN
);
}
job
.
setLastEdited
(
new
Date
());
catch
(
StripeException
e
)
if
(
job
.
getShortenedURL
()
==
null
)
{
{
throw
new
BusinessException
(
"Stripe payment failure. Reason :: "
+
e
.
getMessage
()
);
job
.
createShortenedURL
(
);
}
}
if
(
charge
.
getFailureCode
()
!=
null
)
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs
(
process
,
request
);
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
// Update company in intercom
if
(
companyUser
.
getCompany
()
!=
null
)
{
{
String
errorMsg
=
"Stripe payment failure Code :: "
+
charge
.
getFailureCode
()
+
", Message :: "
+
charge
.
getFailureMessage
();
IntercomUtils
.
updateCompany
(
companyUser
.
getCompany
());
if
(
charge
.
getFraudDetails
()
!=
null
)
{
errorMsg
+=
", Fraud Details :: "
+
charge
.
getFraudDetails
();
}
throw
new
BusinessException
(
errorMsg
);
}
}
return
super
.
processForm
(
process
,
submission
,
p
);
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/form/ReplaceCardFP.java
0 → 100644
View file @
daaf829c
package
performa
.
form
;
import
com.stripe.Stripe
;
import
com.stripe.model.Card
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
oneit.appservices.config.ConfigMgr
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.StorageException
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.SaveFP
;
import
oneit.utils.BusinessException
;
import
oneit.utils.StringUtils
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
performa.utils.StripeUtils
;
public
class
ReplaceCardFP
extends
SaveFP
{
public
static
final
String
STRIPE_KEY
=
ConfigMgr
.
getKeyfileString
(
"stripe.key"
,
""
);
public
static
final
String
STRIPE_PUB_KEY
=
ConfigMgr
.
getKeyfileString
(
"stripe.pubkey"
,
""
);
private
static
final
LoggingArea
LOG
=
LoggingArea
.
createLoggingArea
(
"ReplaceCardFP"
);
@Override
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
p
)
throws
BusinessException
,
StorageException
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In ReplaceCardFP to replace card details"
);
replaceCardDetails
(
process
,
submission
);
return
super
.
processForm
(
process
,
submission
,
p
);
}
public
static
void
replaceCardDetails
(
ORMProcessState
process
,
SubmissionDetails
submission
)
throws
BusinessException
{
HttpServletRequest
request
=
submission
.
getRequest
();
Stripe
.
apiKey
=
STRIPE_KEY
;
String
token
=
request
.
getParameter
(
"stripe-token-id"
);
if
(
StringUtils
.
subBlanks
(
token
)
==
null
)
{
throw
new
BusinessException
(
"Updating card details failed, Please contact adminstrator for more info."
);
}
try
{
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
Card
card
=
StripeUtils
.
updateCardDetails
(
companyUser
.
getCompany
(),
token
);
Company
company
=
companyUser
.
getCompany
();
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In ReplaceCardFP replacing card details of company: "
+
company
);
company
.
setNameOnCard
(
card
.
getName
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
company
.
setCardID
(
card
.
getId
());
// cannot subscribe to a plan without card details
if
(
company
.
getPaymentPlan
()
!=
null
)
{
StripeUtils
.
updatePlan
(
company
);
}
}
catch
(
StorageException
|
FieldException
e
)
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
e
,
"Error while replacing stripe card details"
);
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/form/UpdateCardFP.java
View file @
daaf829c
...
@@ -20,6 +20,7 @@ import oneit.servlets.forms.SuccessfulResult;
...
@@ -20,6 +20,7 @@ import oneit.servlets.forms.SuccessfulResult;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.SaveFP
;
import
oneit.servlets.process.SaveFP
;
import
oneit.utils.BusinessException
;
import
oneit.utils.BusinessException
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.Company
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
performa.orm.CompanyUser
;
import
performa.utils.StripeUtils
;
import
performa.utils.StripeUtils
;
...
@@ -35,6 +36,14 @@ public class UpdateCardFP extends SaveFP
...
@@ -35,6 +36,14 @@ public class UpdateCardFP extends SaveFP
Stripe
.
apiKey
=
StripeUtils
.
STRIPE_KEY
;
Stripe
.
apiKey
=
StripeUtils
.
STRIPE_KEY
;
updateCardDetails
(
process
,
submission
);
return
super
.
processForm
(
process
,
submission
,
p
);
}
public
static
void
updateCardDetails
(
ORMProcessState
process
,
SubmissionDetails
submission
)
throws
FieldException
{
try
try
{
{
HttpServletRequest
request
=
submission
.
getRequest
();
HttpServletRequest
request
=
submission
.
getRequest
();
...
@@ -43,35 +52,40 @@ public class UpdateCardFP extends SaveFP
...
@@ -43,35 +52,40 @@ public class UpdateCardFP extends SaveFP
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
Company
company
=
companyUser
.
getCompany
();
Company
company
=
companyUser
.
getCompany
();
Card
card
=
StripeUtils
.
retrieveCard
(
company
);
Card
card
=
StripeUtils
.
retrieveCard
(
company
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In UpdateCardFP updating card details of user : "
,
company
,
" card : "
,
card
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In UpdateCardFP updating card details of user : "
,
company
,
" card : "
,
card
);
Map
<
String
,
Object
>
updateParams
=
new
HashMap
<>();
Map
<
String
,
Object
>
updateParams
=
new
HashMap
<>();
String
expiryDate
=
request
.
getParameter
(
"expiry-date"
);
String
expiryDate
=
request
.
getParameter
(
"expiry-date"
);
String
name
=
request
.
getParameter
(
"holder-name"
);
String
name
=
request
.
getParameter
(
"holder-name"
);
String
addressZip
=
request
.
getParameter
(
"address-zip"
);
String
addressZip
=
request
.
getParameter
(
"address-zip"
);
if
(
expiryDate
!=
null
&&
!
expiryDate
.
isEmpty
()
&&
expiryDate
.
length
()
==
7
)
if
(
expiryDate
!=
null
&&
!
expiryDate
.
isEmpty
()
&&
expiryDate
.
length
()
==
7
)
{
{
updateParams
.
put
(
"exp_month"
,
expiryDate
.
substring
(
0
,
2
));
updateParams
.
put
(
"exp_month"
,
expiryDate
.
substring
(
0
,
2
));
updateParams
.
put
(
"exp_year"
,
expiryDate
.
substring
(
5
,
7
));
updateParams
.
put
(
"exp_year"
,
expiryDate
.
substring
(
5
,
7
));
}
}
if
(
name
!=
null
&&
!
name
.
isEmpty
())
{
updateParams
.
put
(
"name"
,
name
);
company
.
setNameOnCard
(
name
);
}
updateParams
.
put
(
"name"
,
name
);
if
(
addressZip
!=
null
&&
!
addressZip
.
isEmpty
())
updateParams
.
put
(
"address_zip"
,
addressZip
);
{
updateParams
.
put
(
"address_zip"
,
addressZip
);
company
.
setCardPostCode
(
addressZip
);
}
Card
updatedCard
=
card
.
update
(
updateParams
);
Card
updatedCard
=
card
.
update
(
updateParams
);
company
.
setNameOnCard
(
name
);
company
.
setCardPostCode
(
addressZip
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Updated card details of user : "
,
company
,
" updated card : "
,
updatedCard
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Updated card details of user : "
,
company
,
" updated card : "
,
updatedCard
);
}
}
catch
(
AuthenticationException
|
InvalidRequestException
|
APIConnectionException
|
CardException
|
APIException
e
)
catch
(
AuthenticationException
|
InvalidRequestException
|
APIConnectionException
|
CardException
|
APIException
e
)
{
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
e
,
"Error while updating card details of user"
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
e
,
"Error while updating card details of user"
);
}
}
return
super
.
processForm
(
process
,
submission
,
p
);
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/BaseCompany.java
View file @
daaf829c
...
@@ -67,6 +67,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -67,6 +67,8 @@ public abstract class BaseCompany extends BaseBusinessClass
public
static
final
String
FIELD_IsLogoDeleted
=
"IsLogoDeleted"
;
public
static
final
String
FIELD_IsLogoDeleted
=
"IsLogoDeleted"
;
public
static
final
String
FIELD_CompletedProfile
=
"CompletedProfile"
;
public
static
final
String
FIELD_CompletedProfile
=
"CompletedProfile"
;
public
static
final
String
FIELD_PaymentJobCount
=
"PaymentJobCount"
;
public
static
final
String
FIELD_PaymentJobCount
=
"PaymentJobCount"
;
public
static
final
String
FIELD_StripeLast4
=
"StripeLast4"
;
public
static
final
String
FIELD_StripeBrand
=
"StripeBrand"
;
public
static
final
String
SINGLEREFERENCE_AddedByUser
=
"AddedByUser"
;
public
static
final
String
SINGLEREFERENCE_AddedByUser
=
"AddedByUser"
;
public
static
final
String
SINGLEREFERENCE_PaymentPlan
=
"PaymentPlan"
;
public
static
final
String
SINGLEREFERENCE_PaymentPlan
=
"PaymentPlan"
;
public
static
final
String
MULTIPLEREFERENCE_Users
=
"Users"
;
public
static
final
String
MULTIPLEREFERENCE_Users
=
"Users"
;
...
@@ -102,6 +104,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -102,6 +104,8 @@ public abstract class BaseCompany extends BaseBusinessClass
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_IsLogoDeleted
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_IsLogoDeleted
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_CompletedProfile
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_CompletedProfile
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_PaymentJobCount
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_PaymentJobCount
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_StripeLast4
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_StripeBrand
=
DefaultAttributeHelper
.
INSTANCE
;
// Private attributes corresponding to business object data
// Private attributes corresponding to business object data
...
@@ -128,6 +132,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -128,6 +132,8 @@ public abstract class BaseCompany extends BaseBusinessClass
private
Boolean
_IsLogoDeleted
;
private
Boolean
_IsLogoDeleted
;
private
Boolean
_CompletedProfile
;
private
Boolean
_CompletedProfile
;
private
Integer
_PaymentJobCount
;
private
Integer
_PaymentJobCount
;
private
String
_StripeLast4
;
private
String
_StripeBrand
;
// Private attributes corresponding to single references
// Private attributes corresponding to single references
...
@@ -151,6 +157,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -151,6 +157,8 @@ public abstract class BaseCompany extends BaseBusinessClass
private
static
final
AttributeValidator
[]
FIELD_IsLogoDeleted_Validators
;
private
static
final
AttributeValidator
[]
FIELD_IsLogoDeleted_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompletedProfile_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompletedProfile_Validators
;
private
static
final
AttributeValidator
[]
FIELD_PaymentJobCount_Validators
;
private
static
final
AttributeValidator
[]
FIELD_PaymentJobCount_Validators
;
private
static
final
AttributeValidator
[]
FIELD_StripeLast4_Validators
;
private
static
final
AttributeValidator
[]
FIELD_StripeBrand_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyLogo_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyLogo_Validators
;
private
static
final
AttributeValidator
[]
FIELD_HiringTeamType_Validators
;
private
static
final
AttributeValidator
[]
FIELD_HiringTeamType_Validators
;
...
@@ -193,6 +201,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -193,6 +201,8 @@ public abstract class BaseCompany extends BaseBusinessClass
FIELD_IsLogoDeleted_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_IsLogoDeleted
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_IsLogoDeleted_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_IsLogoDeleted
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompletedProfile_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompletedProfile
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompletedProfile_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompletedProfile
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_PaymentJobCount_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_PaymentJobCount
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_PaymentJobCount_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_PaymentJobCount
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_StripeLast4_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_StripeLast4
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_StripeBrand_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_StripeBrand
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyLogo_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyLogo
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyLogo_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyLogo
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_HiringTeamType_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_HiringTeamType
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_HiringTeamType_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_HiringTeamType
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
...
@@ -405,6 +415,40 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -405,6 +415,40 @@ public abstract class BaseCompany extends BaseBusinessClass
}
}
// Meta Info setup
// Meta Info setup
private
static
List
setupAttribMetaData_StripeLast4
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"name"
,
"StripeLast4"
);
metaInfo
.
put
(
"type"
,
"String"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Company.StripeLast4:"
,
metaInfo
);
ATTRIBUTES_METADATA_Company
.
put
(
FIELD_StripeLast4
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Company
.
class
,
"StripeLast4"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Company.StripeLast4:"
,
validators
);
return
validators
;
}
// Meta Info setup
private
static
List
setupAttribMetaData_StripeBrand
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"name"
,
"StripeBrand"
);
metaInfo
.
put
(
"type"
,
"String"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Company.StripeBrand:"
,
metaInfo
);
ATTRIBUTES_METADATA_Company
.
put
(
FIELD_StripeBrand
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Company
.
class
,
"StripeBrand"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Company.StripeBrand:"
,
validators
);
return
validators
;
}
// Meta Info setup
private
static
List
setupAttribMetaData_CompanyName
(
Map
validatorMapping
)
private
static
List
setupAttribMetaData_CompanyName
(
Map
validatorMapping
)
{
{
Map
metaInfo
=
new
HashMap
();
Map
metaInfo
=
new
HashMap
();
...
@@ -772,6 +816,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -772,6 +816,8 @@ public abstract class BaseCompany extends BaseBusinessClass
_IsLogoDeleted
=
(
Boolean
)(
Boolean
.
FALSE
);
_IsLogoDeleted
=
(
Boolean
)(
Boolean
.
FALSE
);
_CompletedProfile
=
(
Boolean
)(
Boolean
.
FALSE
);
_CompletedProfile
=
(
Boolean
)(
Boolean
.
FALSE
);
_PaymentJobCount
=
(
Integer
)(
HELPER_PaymentJobCount
.
initialise
(
_PaymentJobCount
));
_PaymentJobCount
=
(
Integer
)(
HELPER_PaymentJobCount
.
initialise
(
_PaymentJobCount
));
_StripeLast4
=
(
String
)(
HELPER_StripeLast4
.
initialise
(
_StripeLast4
));
_StripeBrand
=
(
String
)(
HELPER_StripeBrand
.
initialise
(
_StripeBrand
));
}
}
...
@@ -3059,6 +3105,202 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -3059,6 +3105,202 @@ public abstract class BaseCompany extends BaseBusinessClass
}
}
}
}
/**
* Get the attribute StripeLast4
*/
public
String
getStripeLast4
()
{
assertValid
();
String
valToReturn
=
_StripeLast4
;
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getStripeLast4
((
Company
)
this
,
valToReturn
);
}
return
valToReturn
;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected
void
preStripeLast4Change
(
String
newStripeLast4
)
throws
FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected
void
postStripeLast4Change
()
throws
FieldException
{
}
public
FieldWriteability
getWriteability_StripeLast4
()
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
/**
* Set the attribute StripeLast4. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public
void
setStripeLast4
(
String
newStripeLast4
)
throws
FieldException
{
boolean
oldAndNewIdentical
=
HELPER_StripeLast4
.
compare
(
_StripeLast4
,
newStripeLast4
);
try
{
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
newStripeLast4
=
bhd
.
setStripeLast4
((
Company
)
this
,
newStripeLast4
);
oldAndNewIdentical
=
HELPER_StripeLast4
.
compare
(
_StripeLast4
,
newStripeLast4
);
}
if
(
FIELD_StripeLast4_Validators
.
length
>
0
)
{
Object
newStripeLast4Obj
=
HELPER_StripeLast4
.
toObject
(
newStripeLast4
);
if
(
newStripeLast4Obj
!=
null
)
{
int
loopMax
=
FIELD_StripeLast4_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Company
.
get
(
FIELD_StripeLast4
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
FIELD_StripeLast4_Validators
[
v
].
checkAttribute
(
this
,
FIELD_StripeLast4
,
metadata
,
newStripeLast4Obj
);
}
}
}
}
catch
(
FieldException
e
)
{
if
(!
oldAndNewIdentical
)
{
e
.
setWouldModify
();
}
throw
e
;
}
if
(!
oldAndNewIdentical
)
{
assertValid
();
Debug
.
assertion
(
getWriteability_StripeLast4
()
!=
FieldWriteability
.
FALSE
,
"Field StripeLast4 is not writeable"
);
preStripeLast4Change
(
newStripeLast4
);
markFieldChange
(
FIELD_StripeLast4
);
_StripeLast4
=
newStripeLast4
;
postFieldChange
(
FIELD_StripeLast4
);
postStripeLast4Change
();
}
}
/**
* Get the attribute StripeBrand
*/
public
String
getStripeBrand
()
{
assertValid
();
String
valToReturn
=
_StripeBrand
;
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getStripeBrand
((
Company
)
this
,
valToReturn
);
}
return
valToReturn
;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected
void
preStripeBrandChange
(
String
newStripeBrand
)
throws
FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected
void
postStripeBrandChange
()
throws
FieldException
{
}
public
FieldWriteability
getWriteability_StripeBrand
()
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
/**
* Set the attribute StripeBrand. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public
void
setStripeBrand
(
String
newStripeBrand
)
throws
FieldException
{
boolean
oldAndNewIdentical
=
HELPER_StripeBrand
.
compare
(
_StripeBrand
,
newStripeBrand
);
try
{
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
newStripeBrand
=
bhd
.
setStripeBrand
((
Company
)
this
,
newStripeBrand
);
oldAndNewIdentical
=
HELPER_StripeBrand
.
compare
(
_StripeBrand
,
newStripeBrand
);
}
if
(
FIELD_StripeBrand_Validators
.
length
>
0
)
{
Object
newStripeBrandObj
=
HELPER_StripeBrand
.
toObject
(
newStripeBrand
);
if
(
newStripeBrandObj
!=
null
)
{
int
loopMax
=
FIELD_StripeBrand_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Company
.
get
(
FIELD_StripeBrand
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
FIELD_StripeBrand_Validators
[
v
].
checkAttribute
(
this
,
FIELD_StripeBrand
,
metadata
,
newStripeBrandObj
);
}
}
}
}
catch
(
FieldException
e
)
{
if
(!
oldAndNewIdentical
)
{
e
.
setWouldModify
();
}
throw
e
;
}
if
(!
oldAndNewIdentical
)
{
assertValid
();
Debug
.
assertion
(
getWriteability_StripeBrand
()
!=
FieldWriteability
.
FALSE
,
"Field StripeBrand is not writeable"
);
preStripeBrandChange
(
newStripeBrand
);
markFieldChange
(
FIELD_StripeBrand
);
_StripeBrand
=
newStripeBrand
;
postFieldChange
(
FIELD_StripeBrand
);
postStripeBrandChange
();
}
}
/**
/**
...
@@ -4037,6 +4279,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4037,6 +4279,8 @@ public abstract class BaseCompany extends BaseBusinessClass
_IsLogoDeleted
=
sourceCompany
.
_IsLogoDeleted
;
_IsLogoDeleted
=
sourceCompany
.
_IsLogoDeleted
;
_CompletedProfile
=
sourceCompany
.
_CompletedProfile
;
_CompletedProfile
=
sourceCompany
.
_CompletedProfile
;
_PaymentJobCount
=
sourceCompany
.
_PaymentJobCount
;
_PaymentJobCount
=
sourceCompany
.
_PaymentJobCount
;
_StripeLast4
=
sourceCompany
.
_StripeLast4
;
_StripeBrand
=
sourceCompany
.
_StripeBrand
;
}
}
}
}
...
@@ -4118,6 +4362,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4118,6 +4362,8 @@ public abstract class BaseCompany extends BaseBusinessClass
_IsLogoDeleted
=
(
Boolean
)(
HELPER_IsLogoDeleted
.
readExternal
(
_IsLogoDeleted
,
vals
.
get
(
FIELD_IsLogoDeleted
)));
//
_IsLogoDeleted
=
(
Boolean
)(
HELPER_IsLogoDeleted
.
readExternal
(
_IsLogoDeleted
,
vals
.
get
(
FIELD_IsLogoDeleted
)));
//
_CompletedProfile
=
(
Boolean
)(
HELPER_CompletedProfile
.
readExternal
(
_CompletedProfile
,
vals
.
get
(
FIELD_CompletedProfile
)));
//
_CompletedProfile
=
(
Boolean
)(
HELPER_CompletedProfile
.
readExternal
(
_CompletedProfile
,
vals
.
get
(
FIELD_CompletedProfile
)));
//
_PaymentJobCount
=
(
Integer
)(
HELPER_PaymentJobCount
.
readExternal
(
_PaymentJobCount
,
vals
.
get
(
FIELD_PaymentJobCount
)));
//
_PaymentJobCount
=
(
Integer
)(
HELPER_PaymentJobCount
.
readExternal
(
_PaymentJobCount
,
vals
.
get
(
FIELD_PaymentJobCount
)));
//
_StripeLast4
=
(
String
)(
HELPER_StripeLast4
.
readExternal
(
_StripeLast4
,
vals
.
get
(
FIELD_StripeLast4
)));
//
_StripeBrand
=
(
String
)(
HELPER_StripeBrand
.
readExternal
(
_StripeBrand
,
vals
.
get
(
FIELD_StripeBrand
)));
//
_AddedByUser
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_AddedByUser
));
_AddedByUser
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_AddedByUser
));
_PaymentPlan
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_PaymentPlan
));
_PaymentPlan
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_PaymentPlan
));
_Users
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Users
));
_Users
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Users
));
...
@@ -4156,6 +4402,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4156,6 +4402,8 @@ public abstract class BaseCompany extends BaseBusinessClass
vals
.
put
(
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
writeExternal
(
_IsLogoDeleted
));
vals
.
put
(
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
writeExternal
(
_IsLogoDeleted
));
vals
.
put
(
FIELD_CompletedProfile
,
HELPER_CompletedProfile
.
writeExternal
(
_CompletedProfile
));
vals
.
put
(
FIELD_CompletedProfile
,
HELPER_CompletedProfile
.
writeExternal
(
_CompletedProfile
));
vals
.
put
(
FIELD_PaymentJobCount
,
HELPER_PaymentJobCount
.
writeExternal
(
_PaymentJobCount
));
vals
.
put
(
FIELD_PaymentJobCount
,
HELPER_PaymentJobCount
.
writeExternal
(
_PaymentJobCount
));
vals
.
put
(
FIELD_StripeLast4
,
HELPER_StripeLast4
.
writeExternal
(
_StripeLast4
));
vals
.
put
(
FIELD_StripeBrand
,
HELPER_StripeBrand
.
writeExternal
(
_StripeBrand
));
vals
.
put
(
SINGLEREFERENCE_AddedByUser
,
_AddedByUser
.
writeExternalData
());
vals
.
put
(
SINGLEREFERENCE_AddedByUser
,
_AddedByUser
.
writeExternalData
());
vals
.
put
(
SINGLEREFERENCE_PaymentPlan
,
_PaymentPlan
.
writeExternalData
());
vals
.
put
(
SINGLEREFERENCE_PaymentPlan
,
_PaymentPlan
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Users
,
_Users
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Users
,
_Users
.
writeExternalData
());
...
@@ -4262,6 +4510,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4262,6 +4510,8 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor
.
visitField
(
this
,
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
toObject
(
getIsLogoDeleted
()));
visitor
.
visitField
(
this
,
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
toObject
(
getIsLogoDeleted
()));
visitor
.
visitField
(
this
,
FIELD_CompletedProfile
,
HELPER_CompletedProfile
.
toObject
(
getCompletedProfile
()));
visitor
.
visitField
(
this
,
FIELD_CompletedProfile
,
HELPER_CompletedProfile
.
toObject
(
getCompletedProfile
()));
visitor
.
visitField
(
this
,
FIELD_PaymentJobCount
,
HELPER_PaymentJobCount
.
toObject
(
getPaymentJobCount
()));
visitor
.
visitField
(
this
,
FIELD_PaymentJobCount
,
HELPER_PaymentJobCount
.
toObject
(
getPaymentJobCount
()));
visitor
.
visitField
(
this
,
FIELD_StripeLast4
,
HELPER_StripeLast4
.
toObject
(
getStripeLast4
()));
visitor
.
visitField
(
this
,
FIELD_StripeBrand
,
HELPER_StripeBrand
.
toObject
(
getStripeBrand
()));
}
}
...
@@ -4677,6 +4927,14 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4677,6 +4927,14 @@ public abstract class BaseCompany extends BaseBusinessClass
{
{
return
HELPER_PaymentJobCount
.
toObject
(
getPaymentJobCount
());
return
HELPER_PaymentJobCount
.
toObject
(
getPaymentJobCount
());
}
}
else
if
(
attribName
.
equals
(
FIELD_StripeLast4
))
{
return
HELPER_StripeLast4
.
toObject
(
getStripeLast4
());
}
else
if
(
attribName
.
equals
(
FIELD_StripeBrand
))
{
return
HELPER_StripeBrand
.
toObject
(
getStripeBrand
());
}
else
else
{
{
return
super
.
getAttribute
(
attribName
);
return
super
.
getAttribute
(
attribName
);
...
@@ -4782,6 +5040,14 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4782,6 +5040,14 @@ public abstract class BaseCompany extends BaseBusinessClass
{
{
return
HELPER_PaymentJobCount
;
return
HELPER_PaymentJobCount
;
}
}
else
if
(
attribName
.
equals
(
FIELD_StripeLast4
))
{
return
HELPER_StripeLast4
;
}
else
if
(
attribName
.
equals
(
FIELD_StripeBrand
))
{
return
HELPER_StripeBrand
;
}
else
else
{
{
return
super
.
getAttributeHelper
(
attribName
);
return
super
.
getAttributeHelper
(
attribName
);
...
@@ -4887,6 +5153,14 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -4887,6 +5153,14 @@ public abstract class BaseCompany extends BaseBusinessClass
{
{
setPaymentJobCount
((
Integer
)(
HELPER_PaymentJobCount
.
fromObject
(
_PaymentJobCount
,
attribValue
)));
setPaymentJobCount
((
Integer
)(
HELPER_PaymentJobCount
.
fromObject
(
_PaymentJobCount
,
attribValue
)));
}
}
else
if
(
attribName
.
equals
(
FIELD_StripeLast4
))
{
setStripeLast4
((
String
)(
HELPER_StripeLast4
.
fromObject
(
_StripeLast4
,
attribValue
)));
}
else
if
(
attribName
.
equals
(
FIELD_StripeBrand
))
{
setStripeBrand
((
String
)(
HELPER_StripeBrand
.
fromObject
(
_StripeBrand
,
attribValue
)));
}
else
else
{
{
super
.
setAttribute
(
attribName
,
attribValue
);
super
.
setAttribute
(
attribName
,
attribValue
);
...
@@ -5015,6 +5289,14 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5015,6 +5289,14 @@ public abstract class BaseCompany extends BaseBusinessClass
{
{
return
getWriteability_PaymentJobCount
();
return
getWriteability_PaymentJobCount
();
}
}
else
if
(
fieldName
.
equals
(
FIELD_StripeLast4
))
{
return
getWriteability_StripeLast4
();
}
else
if
(
fieldName
.
equals
(
FIELD_StripeBrand
))
{
return
getWriteability_StripeBrand
();
}
else
else
{
{
return
super
.
getWriteable
(
fieldName
);
return
super
.
getWriteable
(
fieldName
);
...
@@ -5140,6 +5422,16 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5140,6 +5422,16 @@ public abstract class BaseCompany extends BaseBusinessClass
fields
.
add
(
FIELD_PaymentJobCount
);
fields
.
add
(
FIELD_PaymentJobCount
);
}
}
if
(
getWriteability_StripeLast4
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_StripeLast4
);
}
if
(
getWriteability_StripeBrand
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_StripeBrand
);
}
super
.
putUnwriteable
(
fields
);
super
.
putUnwriteable
(
fields
);
}
}
...
@@ -5172,6 +5464,8 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5172,6 +5464,8 @@ public abstract class BaseCompany extends BaseBusinessClass
result
.
add
(
HELPER_IsLogoDeleted
.
getAttribObject
(
getClass
(),
_IsLogoDeleted
,
false
,
FIELD_IsLogoDeleted
));
result
.
add
(
HELPER_IsLogoDeleted
.
getAttribObject
(
getClass
(),
_IsLogoDeleted
,
false
,
FIELD_IsLogoDeleted
));
result
.
add
(
HELPER_CompletedProfile
.
getAttribObject
(
getClass
(),
_CompletedProfile
,
false
,
FIELD_CompletedProfile
));
result
.
add
(
HELPER_CompletedProfile
.
getAttribObject
(
getClass
(),
_CompletedProfile
,
false
,
FIELD_CompletedProfile
));
result
.
add
(
HELPER_PaymentJobCount
.
getAttribObject
(
getClass
(),
_PaymentJobCount
,
false
,
FIELD_PaymentJobCount
));
result
.
add
(
HELPER_PaymentJobCount
.
getAttribObject
(
getClass
(),
_PaymentJobCount
,
false
,
FIELD_PaymentJobCount
));
result
.
add
(
HELPER_StripeLast4
.
getAttribObject
(
getClass
(),
_StripeLast4
,
false
,
FIELD_StripeLast4
));
result
.
add
(
HELPER_StripeBrand
.
getAttribObject
(
getClass
(),
_StripeBrand
,
false
,
FIELD_StripeBrand
));
return
result
;
return
result
;
}
}
...
@@ -5654,6 +5948,42 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5654,6 +5948,42 @@ public abstract class BaseCompany extends BaseBusinessClass
return
newPaymentJobCount
;
return
newPaymentJobCount
;
}
}
/**
* Get the attribute StripeLast4
*/
public
String
getStripeLast4
(
Company
obj
,
String
original
)
{
return
original
;
}
/**
* Change the value set for attribute StripeLast4.
* May modify the field beforehand
* Occurs before validation.
*/
public
String
setStripeLast4
(
Company
obj
,
String
newStripeLast4
)
throws
FieldException
{
return
newStripeLast4
;
}
/**
* Get the attribute StripeBrand
*/
public
String
getStripeBrand
(
Company
obj
,
String
original
)
{
return
original
;
}
/**
* Change the value set for attribute StripeBrand.
* May modify the field beforehand
* Occurs before validation.
*/
public
String
setStripeBrand
(
Company
obj
,
String
newStripeBrand
)
throws
FieldException
{
return
newStripeBrand
;
}
}
}
...
@@ -5742,6 +6072,14 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5742,6 +6072,14 @@ public abstract class BaseCompany extends BaseBusinessClass
{
{
return
toPaymentJobCount
();
return
toPaymentJobCount
();
}
}
if
(
name
.
equals
(
"StripeLast4"
))
{
return
toStripeLast4
();
}
if
(
name
.
equals
(
"StripeBrand"
))
{
return
toStripeBrand
();
}
if
(
name
.
equals
(
"CompanyName"
))
if
(
name
.
equals
(
"CompanyName"
))
{
{
return
toCompanyName
();
return
toCompanyName
();
...
@@ -5834,6 +6172,10 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5834,6 +6172,10 @@ public abstract class BaseCompany extends BaseBusinessClass
public
PipeLine
<
From
,
Integer
>
toPaymentJobCount
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Integer
>(
FIELD_PaymentJobCount
));
}
public
PipeLine
<
From
,
Integer
>
toPaymentJobCount
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Integer
>(
FIELD_PaymentJobCount
));
}
public
PipeLine
<
From
,
String
>
toStripeLast4
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_StripeLast4
));
}
public
PipeLine
<
From
,
String
>
toStripeBrand
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_StripeBrand
));
}
public
PipeLine
<
From
,
String
>
toCompanyName
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_CompanyName
));
}
public
PipeLine
<
From
,
String
>
toCompanyName
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_CompanyName
));
}
public
PipeLine
<
From
,
BinaryContent
>
toCompanyLogo
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
BinaryContent
>(
FIELD_CompanyLogo
));
}
public
PipeLine
<
From
,
BinaryContent
>
toCompanyLogo
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
BinaryContent
>(
FIELD_CompanyLogo
));
}
...
@@ -5930,6 +6272,16 @@ public abstract class BaseCompany extends BaseBusinessClass
...
@@ -5930,6 +6272,16 @@ public abstract class BaseCompany extends BaseBusinessClass
return
true
;
return
true
;
}
}
if
(
CollectionUtils
.
equals
(
attribName
,
"StripeLast4"
))
{
return
true
;
}
if
(
CollectionUtils
.
equals
(
attribName
,
"StripeBrand"
))
{
return
true
;
}
return
super
.
isTransientAttrib
(
attribName
);
return
super
.
isTransientAttrib
(
attribName
);
}
}
...
...
cmsWebApp/src/performa/orm/Company.java
View file @
daaf829c
package
performa
.
orm
;
package
performa
.
orm
;
import
com.stripe.model.Card
;
import
com.stripe.model.Card
;
import
java.util.Collection
;
import
java.util.Collections
;
import
oneit.logging.LoggingArea
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.BaseBusinessClass
;
import
oneit.objstore.ObjectStatus
;
import
oneit.objstore.ObjectStatus
;
import
oneit.objstore.ValidationContext
;
import
oneit.objstore.ValidationContext
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
...
@@ -156,17 +153,28 @@ public class Company extends BaseCompany
...
@@ -156,17 +153,28 @@ public class Company extends BaseCompany
return
getPaymentPlan
()
!=
null
&&
getPaymentPlan
().
getActiveJobCount
()
>
openJobs
.
length
;
return
getPaymentPlan
()
!=
null
&&
getPaymentPlan
().
getActiveJobCount
()
>
openJobs
.
length
;
}
}
public
String
getCardNumber
()
throws
FieldException
public
Card
getCard
()
throws
FieldException
{
return
StripeUtils
.
retrieveCard
(
this
);
}
public
String
getCardNumber
(
Card
card
)
throws
FieldException
{
{
return
card
!=
null
?
"xxxx-xxxx-xxxx-"
+
card
.
getLast4
()
:
""
;
if
(
getStripeLast4
()
==
null
)
{
Card
card
=
StripeUtils
.
retrieveCard
(
this
);
if
(
card
!=
null
)
{
setStripeLast4
(
card
.
getLast4
());
setStripeBrand
(
card
.
getBrand
());
return
"xxxx-xxxx-xxxx-"
+
getStripeLast4
();
}
else
{
return
""
;
}
}
return
"xxxx-xxxx-xxxx-"
+
getStripeLast4
();
}
}
...
...
cmsWebApp/src/performa/orm/Company.xml
View file @
daaf829c
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
<TRANSIENT
name=
"IsLogoDeleted"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"IsLogoDeleted"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"CompletedProfile"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"CompletedProfile"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"PaymentJobCount"
type=
"Integer"
/>
<TRANSIENT
name=
"PaymentJobCount"
type=
"Integer"
/>
<TRANSIENT
name=
"StripeLast4"
type=
"String"
/>
<TRANSIENT
name=
"StripeBrand"
type=
"String"
/>
<TABLE
name=
"tl_company"
tablePrefix=
"object"
>
<TABLE
name=
"tl_company"
tablePrefix=
"object"
>
...
...
cmsWebApp/webroot/extensions/adminportal/CustomServlets_adminPortal.xml
View file @
daaf829c
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
<FORM
name=
"*.savePayment"
factory=
"Participant"
class=
"performa.form.MakePaymentFP"
/>
<FORM
name=
"*.savePayment"
factory=
"Participant"
class=
"performa.form.MakePaymentFP"
/>
<FORM
name=
"*.managePlans"
factory=
"Participant"
class=
"performa.form.ManagePlansFP"
/>
<FORM
name=
"*.managePlans"
factory=
"Participant"
class=
"performa.form.ManagePlansFP"
/>
<FORM
name=
"*.updateCard"
factory=
"Participant"
class=
"performa.form.UpdateCardFP"
/>
<FORM
name=
"*.updateCard"
factory=
"Participant"
class=
"performa.form.UpdateCardFP"
/>
<FORM
name=
"*.replaceCard"
factory=
"Participant"
class=
"performa.form.ReplaceCardFP"
/>
</NODE>
</NODE>
<NODE
name=
"job_assessment_criteria_add_jsp"
factory=
"Participant"
>
<NODE
name=
"job_assessment_criteria_add_jsp"
factory=
"Participant"
>
...
...
cmsWebApp/webroot/extensions/adminportal/billing.jsp
View file @
daaf829c
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<oneit:button value="Pay" name="
savePayment"
cssClass="hide" id="payNow"
<oneit:button value="Pay" name="
replaceCard"
cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
.toMap() %>'/>
</oneit:form>
</oneit:form>
...
...
cmsWebApp/webroot/extensions/adminportal/card_payment.jsp
View file @
daaf829c
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
SecUser loggedInUser = SecUser.getTXUser(transaction);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request,
"CardPayment")
;
String nextPage = WebUtils.getSamePageInRenderMode(request,
WebUtils.CREATED_JOB) + "&fromJob=true"
;
Job job = (Job) process.getAttribute("Job");
Job job = (Job) process.getAttribute("Job");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
...
@@ -68,34 +68,15 @@
...
@@ -68,34 +68,15 @@
.toMap() %>" />
.toMap() %>" />
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="
updateCard"
cssClass="btn btn-primary large-btn btn-green"
<oneit:button value="Pay and Open Job" name="
savePayment"
cssClass="btn btn-primary large-btn btn-green"
requestAttribs=
"
<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs=
'
<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.mapEntry("Company", company)
.toMap() %>" />
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:form>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</oneit:dynIncluded>
</oneit:dynIncluded>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/edit_card_payment.jsp
View file @
daaf829c
...
@@ -8,16 +8,17 @@
...
@@ -8,16 +8,17 @@
SecUser loggedInUser = SecUser.getTXUser(transaction);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request,
"CardPayment")
;
String nextPage = WebUtils.getSamePageInRenderMode(request,
WebUtils.CREATED_JOB) + "&fromJob=true"
;
Job job = (Job) process.getAttribute("Job");
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function()
$(document).ready(function()
{
{
recalcFunction = setupRecalc ($("
form
"), {'recalcOnError':true});
recalcFunction = setupRecalc ($("
makePayment
"), {'recalcOnError':true});
});
});
</script>
</script>
...
@@ -69,7 +70,6 @@
...
@@ -69,7 +70,6 @@
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
.toMap() %>" />
</div>
</div>
</div>
</div>
...
@@ -80,20 +80,29 @@
...
@@ -80,20 +80,29 @@
<div class="row">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
<input type="hidden" name="expiry-date" />
</div>
<div class="form-group hide">
<input type="hidden" name="holder-name" />
</div>
<div class="form-group hide">
<input type="hidden" name="address-zip" />
</div>
</div>
</div>
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
<oneit:button value="Pay" name="savePayment"
cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
.mapEntry("EditCard", Boolean.TRUE)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</oneit:form>
</oneit:form>
<script src="https://js.stripe.com/v2/"></script>
<script src="https://js.stripe.com/v3/"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
</script>
<oneit:script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/
performa
Stripe.js"/>
<oneit:script src="/scripts/
updateCard
Stripe.js"/>
</oneit:script>
</oneit:script>
</oneit:dynIncluded>
</oneit:dynIncluded>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/inc/card_details.jsp
View file @
daaf829c
...
@@ -61,9 +61,8 @@
...
@@ -61,9 +61,8 @@
<%
<%
if(isEdit)
if(isEdit)
{
{
Card card = company.getCard();
%>
%>
<input type="text" name="cardNumber" value="<%= company.getCardNumber(
card
) %>" class="form-control" readonly>
<input type="text" name="cardNumber" value="<%= company.getCardNumber() %>" class="form-control" readonly>
<%
<%
}
}
else
else
...
...
cmsWebApp/webroot/extensions/adminportal/inc/existing_card.jsp
View file @
daaf829c
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
boolean isEdit = (boolean) getData(request, "IsEdit");
boolean isEdit = (boolean) getData(request, "IsEdit");
String replaceCardPage = WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
String replaceCardPage = WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
String editCardPage = WebUtils.getSamePageInRenderMode(request, "EditCard");
String editCardPage = WebUtils.getSamePageInRenderMode(request, "EditCard");
Card card = company.getCard();
String cardNumber = company.getCardNumber();
Job job = (Job) process.getAttribute("Job");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
%>
<oneit:dynIncluded>
<oneit:dynIncluded>
<div class="form-group row">
<div class="form-group row">
...
@@ -18,12 +20,14 @@
...
@@ -18,12 +20,14 @@
<label>Card on file</label>
<label>Card on file</label>
</div>
</div>
<div class="col-lg-5 col-md-5 col-sm-5" style="margin-top: -20px;">
<div class="col-lg-5 col-md-5 col-sm-5" style="margin-top: -20px;">
<img src="<%= c
ard.getBrand() == "MasterCard"
? "images/master.svg" : "images/visa.svg" %>" style="width:60px;"/>
<img src="<%= c
ompany.getStripeBrand().equals("MasterCard")
? "images/master.svg" : "images/visa.svg" %>" style="width:60px;"/>
<label><%= c
ompany.getCardNumber(card)
%></label>
<label><%= c
ardNumber
%></label>
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2">
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isEdit ? "" : "deselected-link")%>"
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isEdit ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", ppj).toMap())
.toMap() %>">
.toMap() %>">
Edit Card
Edit Card
</oneit:button>
</oneit:button>
...
@@ -31,6 +35,8 @@
...
@@ -31,6 +35,8 @@
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2">
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isReplace ? "" : "deselected-link")%>"
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isReplace ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", ppj).toMap())
.toMap() %>">
.toMap() %>">
Replace Card
Replace Card
</oneit:button>
</oneit:button>
...
...
cmsWebApp/webroot/extensions/adminportal/job_payment.jsp
View file @
daaf829c
...
@@ -107,7 +107,8 @@
...
@@ -107,7 +107,8 @@
<div class="a-label-row text-center">
<div class="a-label-row text-center">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'select-plan enabled': 'select-plan disabled'" company="<%= company %>">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'select-plan enabled': 'select-plan disabled'" company="<%= company %>">
<oneit:button value="Select Plan" name="saveJob" cssClass="btn btn-primary largeBtn btn-green save-btn"
<oneit:button value="Select Plan" name="saveJob" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
.mapEntry("PPJ", Boolean.TRUE)
.mapEntry ("fromPage", fromPage)
.mapEntry ("fromPage", fromPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("restartProcess", Boolean.TRUE)
...
@@ -135,6 +136,7 @@
...
@@ -135,6 +136,7 @@
</div>
</div>
</div>
</div>
<div class="form-page-area payment-optio-sep">
<div class="form-page-area payment-optio-sep">
<div class="a-label-row">
<div class="a-label-row">
<div class="col-md-3 col-sm-3 col-xs-3">
<div class="col-md-3 col-sm-3 col-xs-3">
...
@@ -142,14 +144,17 @@
...
@@ -142,14 +144,17 @@
<div class="col-md-3 col-sm-3 col-xs-3">
<div class="col-md-3 col-sm-3 col-xs-3">
<div class="annual-plan">Pay Per Job</div>
<div class="annual-plan">Pay Per Job</div>
<div class="">
<div class="">
<span class="pay-only-job-amt">$499.00</span>
<span class="pay-only-job-amt">
<oneit:toString value="<%= job.getAssessmentType() == AssessmentType.COMPREHENSIVE ? 499.0 : 399.0%>" mode="Currency"/>
</span>
<span class="pay-only-job-txt">  Open for 30 Days</span>
<span class="pay-only-job-txt">  Open for 30 Days</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="col-md-6 col-sm-6 col-xs-6">
<oneit:button value="Pay for this job only" name="gotoPage" cssClass="btn pay-only-job-btn"
<oneit:button value="Pay for this job only" name="gotoPage" cssClass="btn pay-only-job-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", Boolean.TRUE).toMap())
.toMap() %>" />
.toMap() %>" />
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
View file @
daaf829c
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<oneit:button value="Pay" name="
savePayment
" cssClass="hide" id="payNow"
<oneit:button value="Pay" name="
replaceCard
" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
.toMap() %>'/>
</oneit:form>
</oneit:form>
...
...
cmsWebApp/webroot/extensions/adminportal/replace_card_payment.jsp
View file @
daaf829c
...
@@ -8,15 +8,16 @@
...
@@ -8,15 +8,16 @@
SecUser loggedInUser = SecUser.getTXUser(transaction);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request,
"CardPayment")
;
String nextPage = WebUtils.getSamePageInRenderMode(request,
WebUtils.CREATED_JOB) + "&fromJob=true"
;
Job job = (Job) process.getAttribute("Job");
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function()
$(document).ready(function()
{
{
recalcFunction = setupRecalc ($("
form
"), {'recalcOnError':true});
recalcFunction = setupRecalc ($("
makePayment
"), {'recalcOnError':true});
});
});
</script>
</script>
...
@@ -66,7 +67,7 @@
...
@@ -66,7 +67,7 @@
.toMap() %>" />
.toMap() %>" />
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="
updateCard
" cssClass="btn btn-primary large-btn btn-green"
<oneit:button value="Pay and Open Job" name="
savePayment
" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.mapEntry("Company", company)
.toMap() %>" />
.toMap() %>" />
...
@@ -85,7 +86,10 @@
...
@@ -85,7 +86,10 @@
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
.mapEntry("Company", company)
.mapEntry("ReplaceCard", Boolean.TRUE)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</oneit:form>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
<script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment