woocommerce / woocommerce-gateway-payfast

South African payment gateway supporting subscriptions, deposits & pre-orders
https://wordpress.org/plugins/woocommerce-payfast-gateway/
43 stars 15 forks source link

Add credentials validation and required field notice for Payfast in sandbox environment. #260

Closed iamdharmesh closed 3 weeks ago

iamdharmesh commented 1 month ago

All Submissions:


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:

  1. Remove all Payfast credentials from the settings and save the settings.
  2. Verify that a notice with the required fields error is visible.
  3. 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.

ankitguptaindia commented 1 month ago

QA Status: Needs feedback

Thanks, @iamdharmesh, for the fixes! I’ve identified scenarios that need to be addressed.

Fields Required Tests:

Credentials Verification:

When the admin adds invalid credentials, a warning notice is displayed in the backend, but the PayFast payment option still appears on the checkout page. Is it possible to hide the PayFast option on the frontend when the credentials are invalid?

https://github.com/user-attachments/assets/dba50e2c-ddc0-4441-b46f-18b35c30f226

iamdharmesh commented 1 month ago

Thanks for testing this @ankitguptaindia,

When the admin adds invalid credentials, a warning notice is displayed in the backend, but the PayFast payment option still appears on the checkout page. Is it possible to hide the PayFast option on the frontend when the credentials are invalid?

Sure, I had added normal credentials validation to show only notice. But now I have updated it to strict validation where notice will be keep showing and payment gateway will not display in the front-end until merchant enter the correct credentials. Could you please help to check once now.

Thank you.

ankitguptaindia commented 1 month ago

QA/Test Report-

Testing Environment -

* WordPress: 6.6.2 * Theme active on store: Twenty Twenty-Four Version: 1.2 * WooCommerce - Version 9.3.3 * PHP: 8.3 * Web Server: Nginx * Browser: Chrome - Version 129 * OS: macOS Sonoma 14.6.1

Test Results -

Fields Required Tests:

Credentials Verification:

ankitguptaindia commented 4 weeks ago

Regression+Smoke Test Report-

Testing Environment -

* WordPress: 6.3.2 * Theme: Twenty Twenty-Four Version: 1.2 * WooCommerce - Version 9.3.3 * PHP: 8.3 * Web Server: Nginx * Browser: Chrome - Version 129 * OS: macOS Sonoma 14.5

Tested with Archive File created via woorelease command.

Please note that this plugin has been tested with the build created by the specified versions ☝🏼 of Composer, Node, and NPM.

Status- Working as expected. Ready to merge 🚀