omise / omise-magento

Omise Magento Plugin
https://docs.opn.ooo/magento-plugin
MIT License
34 stars 19 forks source link

[FRON-1465]: Check for the validity of the public and secret keys in the payment section when merchants adds them. #346

Closed aashishgurung closed 2 years ago

aashishgurung commented 2 years ago

1. Objective

Prevent merchants from entering invalid Omise Payment keys.

Jira Ticket: #1465 (https://omise.atlassian.net/browse/FRON-1465)

2. Description of change

Created a new plugin or interceptor ConfigSectionPaymentPlugin which holds logic to check the validity of the keys before saving it to the database. Did some refactoring on the Omise\Payment\Model\Config\Config.php.

3. Quality assurance

Run these command before testing:

php bin/magento cache:flush
php bin/magento setup:di:compile

Go the the payment configuration section and test the following cases.

Should be a success:

Should fail

Screen Shot 2565-05-19 at 10 43 41

🔧 Environments:

kan98 commented 2 years ago

sorry I just saw PR is still in draft mode, can ignore my comments for now 🤦🏽