Skip to content

Commit 07e4393

Browse files
authored
Merge pull request #205 from mahajanmahesh935/PaymentEndpoints
TASK #00000 : Whitelist stripe-signature header and remove session from endpoint
2 parents 77b54d0 + f30b1df commit 07e4393

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/common/middleware/apiConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,12 +1507,12 @@ export const apiList = {
15071507
'/user/v1/fields/download-file/:id': createRouteObject({
15081508
get: {},
15091509
}),
1510-
'/user/v1/payments/session/initiate': createRouteObject({
1510+
'/user/v1/payments/initiate': createRouteObject({
15111511
post: {
15121512
ROLE_CHECK: rolesGroup.common,
15131513
},
15141514
}),
1515-
'/user/v1/payments/session/:id/status': createRouteObject({
1515+
'/user/v1/payments/:id/status': createRouteObject({
15161516
get: {
15171517
ROLE_CHECK: rolesGroup.common,
15181518
},

src/middleware/gateway.service.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export class GatewayService {
3131
if (oheaders['organisationid']) {
3232
newheaders['organisationid'] = oheaders['organisationid'];
3333
}
34+
if (oheaders['stripe-signature']) {
35+
newheaders['stripe-signature'] = oheaders['stripe-signature'];
36+
}
3437

3538
try {
3639
const response = await axios({
@@ -99,6 +102,8 @@ export class GatewayService {
99102
headers.academicyearid = oheaders.academicyearid;
100103
if (oheaders?.organisationid)
101104
headers.organisationid = oheaders.organisationid;
105+
if (oheaders['stripe-signature'])
106+
headers['stripe-signature'] = oheaders['stripe-signature'];
102107
response = await axios({
103108
method: method.toLowerCase(),
104109
url,
@@ -153,6 +158,9 @@ export class GatewayService {
153158
if (oheaders['organisationid']) {
154159
newheaders['organisationid'] = oheaders['organisationid'];
155160
}
161+
if (oheaders['stripe-signature']) {
162+
newheaders['stripe-signature'] = oheaders['stripe-signature'];
163+
}
156164

157165
try {
158166
const response = await axios({
@@ -294,6 +302,8 @@ export class GatewayService {
294302
headers.organisationid = oheaders.organisationid;
295303
if (oheaders['x-channel-id'])
296304
headers['x-channel-id'] = oheaders['x-channel-id'];
305+
if (oheaders['stripe-signature'])
306+
headers['stripe-signature'] = oheaders['stripe-signature'];
297307

298308
response = await axios({
299309
method: method.toLowerCase(),

0 commit comments

Comments
 (0)