Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
userManagement
Commits
5bb31b14
Commit
5bb31b14
authored
1 year ago
by
shishir suman
Browse files
Options
Download
Patches
Plain Diff
changes for adding condition for student retotal request
parent
417d86e4
feature_update_fee
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/tarento/upsmf/userManagement/services/impl/PaymentServiceImpl.java
+30
-4
...psmf/userManagement/services/impl/PaymentServiceImpl.java
src/main/resources/application.properties
+1
-0
src/main/resources/application.properties
with
31 additions
and
4 deletions
+31
-4
src/main/java/com/tarento/upsmf/userManagement/services/impl/PaymentServiceImpl.java
+
30
−
4
View file @
5bb31b14
...
...
@@ -44,6 +44,7 @@ public class PaymentServiceImpl implements PaymentService {
private
String
AFFILIATION_PAYMENT_GATEWAY_ENDPOINT
;
private
String
EXAM_PAYMENT_GATEWAY_ENDPOINT
;
private
String
FEE_STATUS_UPDATE_ENDPOINT
;
private
String
RETOTALING_FEE_STATUS_UPDATE_ENDPOINT
;
private
String
EXAMS_AUTH_TOKEN
;
private
String
AES_KEY_FOR_PAYMENT_SUCCESS
;
...
...
@@ -58,6 +59,7 @@ public class PaymentServiceImpl implements PaymentService {
AES_KEY_FOR_PAYMENT_SUCCESS
=
getPropertyValue
(
"aes_key_for_payment_success"
);
EXAM_PAYMENT_GATEWAY_ENDPOINT
=
getPropertyValue
(
"exam_payment_Gateway_EndPoint"
);
FEE_STATUS_UPDATE_ENDPOINT
=
getPropertyValue
(
"exam_fee_status_update_EndPoint"
);
RETOTALING_FEE_STATUS_UPDATE_ENDPOINT
=
getPropertyValue
(
"retotaling_fee_status_update_EndPoint"
);
EXAMS_AUTH_TOKEN
=
getPropertyValue
(
"exam_service_auth_token"
);
}
...
...
@@ -79,12 +81,18 @@ public class PaymentServiceImpl implements PaymentService {
strEndPoint
=
REGISTRATION_PAYMENT_GATEWAY_ENDPOINT
;
}
else
if
(
strings
.
contains
(
"affiliation"
))
{
strEndPoint
=
AFFILIATION_PAYMENT_GATEWAY_ENDPOINT
;
}
else
if
(
strings
.
contains
(
"exam"
)
||
strings
.
contains
(
"EXAM"
))
{
}
else
if
(
strings
.
contains
(
"exam
_institute
"
)
||
strings
.
contains
(
"EXAM
_INSTITUTE
"
))
{
strEndPoint
=
EXAM_PAYMENT_GATEWAY_ENDPOINT
;
// get ref no
String
referenceNo
=
requestData
.
get
(
"ReferenceNo"
);
// update db for provided transaction id
updateStudentFeeStatus
(
referenceNo
);
updateInstituteFeeStatus
(
referenceNo
);
}
else
if
(
strings
.
contains
(
"exam_retotaling"
)
||
strings
.
contains
(
"EXAM_RETOTALING"
))
{
strEndPoint
=
EXAM_PAYMENT_GATEWAY_ENDPOINT
;
// get ref no
String
referenceNo
=
requestData
.
get
(
"ReferenceNo"
);
// update db for provided transaction id
updateStudentRetotalingFeeStatus
(
referenceNo
);
}
String
responseString
=
""
,
transaction_status
=
""
;
String
transactionDetails
=
getTransactionDetails
(
requestData
);
...
...
@@ -109,7 +117,7 @@ public class PaymentServiceImpl implements PaymentService {
return
new
ResponseEntity
<
String
>(
null
,
httpHeaders
,
HttpStatus
.
NOT_FOUND
);
}
private
void
update
Student
FeeStatus
(
String
referenceNo
)
{
private
void
update
Institute
FeeStatus
(
String
referenceNo
)
{
logger
.
info
(
"updating student fee for ref - {}"
,
referenceNo
);
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
...
...
@@ -123,7 +131,25 @@ public class PaymentServiceImpl implements PaymentService {
logger
.
info
(
"Student Fee updated successfully"
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"Error in processing request "
);
logger
.
error
(
"Error in updating status for institute exam fee request "
);
}
}
private
void
updateStudentRetotalingFeeStatus
(
String
referenceNo
)
{
logger
.
info
(
"updating student fee for ref - {}"
,
referenceNo
);
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
httpHeaders
.
set
(
"x-authenticated-user-token"
,
EXAMS_AUTH_TOKEN
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
<
String
>(
referenceNo
,
httpHeaders
);
logger
.
info
(
"exam url - {}"
,
FEE_STATUS_UPDATE_ENDPOINT
);
try
{
ResponseEntity
responseEntity
=
restTemplate
.
postForObject
(
RETOTALING_FEE_STATUS_UPDATE_ENDPOINT
,
entity
,
ResponseEntity
.
class
);
logger
.
info
(
"Update student fee status - {}"
,
responseEntity
);
if
(
responseEntity
!=
null
&&
responseEntity
.
getStatusCode
()
==
HttpStatus
.
OK
)
{
logger
.
info
(
"Student Fee updated successfully"
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"Error in updating status for retotaling request "
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/application.properties
+
1
−
0
View file @
5bb31b14
...
...
@@ -22,6 +22,7 @@ registration_payment_Gateway_EndPoint =https://registration.uphrh.in/payment-res
affiliation_payment_Gateway_EndPoint
=
https://applicant.upsmfac.org/payment-response
exam_payment_Gateway_EndPoint
=
https://exam.uphrh.in/payment-response
exam_fee_status_update_EndPoint
=
retotaling_fee_status_update_EndPoint
=
exam_service_auth_token
=
spring.datasource.url
=
jdbc:postgresql://localhost:5432/frac_tool
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets