Skip to content

Conversation

@sf-technolgies
Copy link
Contributor

@sf-technolgies sf-technolgies commented Jan 28, 2026

  • PL-1503 related changes
  • Added cache management for MarketPay access_token
  • Support for PWA Add Payment Method (custom attributes on payment instrument and basket)

* PL-1503 related changes
* Added cache management for MarketPay access_token
@sf-technolgies sf-technolgies changed the title PL-1503 Add and Configure MarketPay payment method (preferrence and BM configuration validate) Jan 28, 2026
@sf-technolgies sf-technolgies marked this pull request as draft January 28, 2026 08:03
@sf-technolgies sf-technolgies marked this pull request as ready for review January 28, 2026 08:06
@sf-technolgies sf-technolgies marked this pull request as draft January 28, 2026 08:22
@sf-technolgies sf-technolgies marked this pull request as ready for review January 28, 2026 08:41
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());
Copy link
Member

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 ?

Copy link
Contributor

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());
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants