Skip to content

Conversation

@tamaralogeecom
Copy link
Collaborator

@tamaralogeecom tamaralogeecom commented Dec 29, 2025

What is the goal?

  • Register the integration webhook in Sequra and enable webhook re-registration on the Connection page

References

How is it being implemented?

  • Implemented RegexProvider
  • Added encodeURIComponent to replace values in the URL path
  • Updated CORE version for integration registration logic
  • Updated CORE UI version to render the button and handle webhook re-registration
  • Added a migration to register webhooks for existing users

How is it tested?

  • Run the command to check the PHP syntax
  • Manual tests
    • New installation
      • Install and enable the SeQura module in the Magento 2 system.
      • Test the onboarding flow.
      • Test webhook re-registration on the Connection Settings page.
    • Existing installation
      • Update the SeQura module in the Magento 2 system.
      • Test module behavior
      • Test webhook re-registration on the Connection Settings page.

@tamaralogeecom
Copy link
Collaborator Author

We have noticed that an “Advanced” section has been added in the latest CORE UI version. Should these changes be included in the current onboarding implementation for the Magento 2 integration? They would require implementing a new endpoint and backend business logic. If this is something that should be included at this point, then the exact requirements for what the endpoint should return need to be clearly defined.

@tamaralogeecom
Copy link
Collaborator Author

We also observed that encodeURIComponent was replaced with a direct string replacement for {storeId} in the API calls. This approach does not work for the Magento 2 integration because Magento generates the backend URL and automatically encodes URI components when {storeId} or any other value is added to the path. That encoded value must then be replaced. For now, the JS controllers in the Magento integration are overridden so that encodeURIComponent is still used, ensuring the plugin behaves as expected.

@tamaralogeecom
Copy link
Collaborator Author

Please provide us with the translations for the button on the Connection Settings page, which allows merchants to re-register their store integration for the corresponding deployment target:

Button label:

  • Re-register webhooks

Success message:

  • Webhooks were re-registered successfully.

Error message:

  • Webhooks were not re-registered successfully.

@mescalantea
Copy link
Contributor

We also observed that encodeURIComponent was replaced with a direct string replacement for {storeId} in the API calls. This approach does not work for the Magento 2 integration because Magento generates the backend URL and automatically encodes URI components when {storeId} or any other value is added to the path. That encoded value must then be replaced. For now, the JS controllers in the Magento integration are overridden so that encodeURIComponent is still used, ensuring the plugin behaves as expected.

Thanks @tamaralogeecom for pointing this out. I've submitted a solution via this PR. Please have a look at it

@mescalantea
Copy link
Contributor

We have noticed that an “Advanced” section has been added in the latest CORE UI version. Should these changes be included in the current onboarding implementation for the Magento 2 integration? They would require implementing a new endpoint and backend business logic. If this is something that should be included at this point, then the exact requirements for what the endpoint should return need to be clearly defined.

This new section is not part of the Onboarding flow. It is accesible once the onboarding is completed. I would implement it in a new PR due you will need to do several changes to support it. There's a working implementation in the woocommerce repository you can use as a guide.

@mescalantea
Copy link
Contributor

mescalantea commented Dec 30, 2025

Please provide us with the translations for the button on the Connection Settings page, which allows merchants to re-register their store integration for the corresponding deployment target:

Button label:

  • Re-register webhooks
    🇪🇸 Volver a registrar webhooks
    🇫🇷 Re-enregistrer les webhooks
    🇮🇹 Registrare nuovamente i webhook
    🇵🇹 Registrar novamente os webhooks

Success message:

  • Webhooks were re-registered successfully.
    🇪🇸 Los webhooks se registraron nuevamente con éxito.
    🇫🇷 Les webhooks ont été réenregistrés avec succès.
    🇮🇹 I webhook sono stati registrati nuovamente con successo.
    🇵🇹 Os webhooks foram registrados novamente com sucesso.

Error message:

  • Webhooks were not re-registered successfully.
    🇪🇸 No se pudieron volver a registrar los webhooks.
    🇫🇷 Les webhooks n’ont pas pu être réenregistrés avec succès.
    🇮🇹 Non è stato possibile registrare nuovamente i webhook.
    🇵🇹 Não foi possível registrar novamente os webhooks.

@tamaralogeecom

@m1k3lm m1k3lm marked this pull request as ready for review January 8, 2026 16:49
Copilot AI review requested due to automatic review settings January 8, 2026 16:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements webhook registration functionality in Sequra for a Magento 2 integration. The changes include adding a webhook re-registration button on the Connection Settings page, implementing a RegexProvider for validation, updating the CORE and CORE UI library versions, and adding an Advanced section with debug logging capabilities.

Key Changes:

  • Added webhook re-registration functionality with UI button and backend endpoint
  • Implemented regex validation system with ValidationService updates
  • Added Advanced/Debug section for log management
  • Updated CORE UI library to enable new features
  • Fixed URL parameter encoding (changed from encodeURIComponent wrapping to inline usage)
  • Added comprehensive translation updates for 5 languages (EN, ES, FR, IT, PT)

Reviewed changes

Copilot reviewed 36 out of 41 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
StateController.js (override) Adds Advanced state/pages, fixes URL encoding, adds data store clearing
SettingsController.js (override) Updates to use new encoding pattern and adds SequraFE.customHeader
PaymentController.js (override) Adds support link, updates encoding, handles payment method icons
ConnectionSettingsForm.js Implements webhook re-registration button and handler
AdvancedController.js New controller for debug logs management page
ValidationService.js Adds regex provider requirement check and new validation methods
UtilityService.js Adds getMenuItems helper for navigation
ResponseService.js Adds successHandler for success messages
ElementGenerator.js Adds createActionsBar and createSupportLink helpers
GeneralSettingsForm.js Adds service-related fields and validation
Translation files Comprehensive updates for webhook, debug, and service features
sequra-core.css Major styling updates with proper scoping and new components
index.phtml Adds regex configuration and ValidationService loading
sequra_configuration_index.xml Updates script loading order
package.json Updates CORE UI version to feature branch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 306 to 312
elem.style.display = 'none'
elem.innerHTML = '';
});
document.querySelectorAll('.sqm--log-details').forEach(elem => {
elem.classList.remove('sqm--log-details-open');
});
}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid automated semicolon insertion (92% of all statements in the enclosing function have an explicit semicolon).

Suggested change
elem.style.display = 'none'
elem.innerHTML = '';
});
document.querySelectorAll('.sqm--log-details').forEach(elem => {
elem.classList.remove('sqm--log-details-open');
});
}
elem.style.display = 'none';
elem.innerHTML = '';
});
document.querySelectorAll('.sqm--log-details').forEach(elem => {
elem.classList.remove('sqm--log-details-open');
});
};

Copilot uses AI. Check for mistakes.
}
}
return countriesString ? translate('countries.enabledCountries').replace('{countries}', countriesString) : '';
}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Copilot uses AI. Check for mistakes.

return regexExp.test(str);
// Update the visibility of the fields.
const selector = '.sq-field-wrapper:has(.sq-service-related-field), .sq-field-wrapper.sq-service-related-field'
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).

Copilot uses AI. Check for mistakes.
)
]
);
}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid automated semicolon insertion (96% of all statements in the enclosing function have an explicit semicolon).

Suggested change
}
};

Copilot uses AI. Check for mistakes.
switch (page) {
case SequraFE.appPages.ONBOARDING.COUNTRIES:
if (!dataStore.connectionSettings?.connectionData?.every(c => c.username)) {
page = SequraFE.appPages.ONBOARDING.CONNECT
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid automated semicolon insertion (96% of all statements in the enclosing function have an explicit semicolon).

Copilot uses AI. Check for mistakes.
Tamara Vukovic added 2 commits January 13, 2026 17:43
ISSUE: LIS-90
ISSUE: LIS-90
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.

3 participants