Microform v2 js needs to be changed based on JWT token

Created on 18 December 2024, 6 days ago

Problem/Motivation

Cybersource changed the way they work with microform, they are doing the change gradually on test enviroments first and when your account changes the microform will not work anymore the way it is on the module now.

https://support.visaacceptance.com/knowledgebase/Knowledgearticle/?code=...

On April 2025 they will change production environment to this new request.

Proposed resolution

As required in the documentation we need to change the way we load the microform JS file to load it from URL that wll be sent from JWT token, in my experiences it works but not if i fully follow the docs because including the crossorigin and integrity attributes will trigger CORS error.
So we can go with a partial solution, but as far as i can see drupal do not let us to have a dynamic library changing it's path based on an logic so we must change it with a hook_library_info_alter but inside this hook i do not have the file path from JWT, so i'm propose to cache it's value on src/PluginForm/FlexForm.php to use it on the hook.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇧🇷Brazil thiagomoraesp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024