woocommerce-gateway-payfast
woocommerce-gateway-payfast copied to clipboard
Add credentials validation and required field notice for Payfast in sandbox environment.
All Submissions:
- [x] Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
- [ ] Have you written new tests for your changes, as applicable?
- [x] Have you successfully run tests with your changes locally?
- [ ] Will this change require new documentation or changes to existing documentation?
Changes proposed in this Pull Request:
This PR adds credentials validation in the Payfast payment settings when the settings are saved and displays a corresponding notice. It also makes changes to show a required credentials field notice when the credentials are blank, and it prevents Payfast from appearing on the front-end checkout page. Previously, this required notice was only implemented for the production environment. This PR ensures it works for the sandbox environment as well.
Closes #216
Steps to test the changes in this Pull Request:
- Remove all Payfast credentials from the settings and save the settings.
- Verify that a notice with the required fields error is visible.
- Try saving invalid credentials and verify that the merchant is prompted with an invalid credentials error.
Changelog entry
Add - Credentials validation and required field notice for Payfast in the sandbox environment