-
Notifications
You must be signed in to change notification settings - Fork 0
Add and Configure MarketPay payment method (preferrence and BM configuration validate) #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| log.info("GetService Marketing _url:" + svc.getURL()+'/'+serviceType); | ||
| log.info("GetService token:" + payload.token); | ||
| log.info("GetService Marketing _url:" + svc.getURL() + '/' + serviceType); | ||
| log.info("GetService token:" + getAuthToken()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a good idea to log the token ? Maybe just a portion of it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emicha I have removed the logs.
| svc.setRequestMethod(method); | ||
| svc.addHeader('Content-Type', 'application/json'); | ||
| svc.addHeader('Authorization', 'Bearer ' + payload.token); | ||
| svc.addHeader('Authorization', 'Bearer ' + getAuthToken()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are calling getAuthToken when logging, and then getAuthToken again when setting the headers, so fundamentally you are creating two tokens for the same request, and logging only one of them.
That sounds wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emicha I have removed the getAuthToken that was logged also we are caching the token for 3500 seconds and fetching the token from that and if not found we fetch the fresh token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean caching?
When you work with 1 session, you need to always use the same token.
When you work with a different session, you should have a different token.
Is that implemented?
Uh oh!
There was an error while loading. Please reload this page.