Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode HTML entity encoding in the site name before sending data to Payfast. #219

Merged
merged 3 commits into from
May 7, 2024

Conversation

iamdharmesh
Copy link
Member

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • 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:

The PR addresses the signature mismatch error. Upon investigation, I discovered that the mismatch was due to HTML entity encoding in the site/blog name for special characters. We are sending the blog name in the item name and item description values, and the signature is being generated based on the encoded HTML entity. However, the value in the form is sent with decoded HTML entity, causing the mismatch. This PR resolves the issue by generating the signature based on the decoded HTML entity.

Steps to test the changes in this Pull Request:

  1. Set the site title to something that uses a special character, e.g., Bob's Site (Please try different combinations).
  2. Add a product to the cart and place an order.
  3. Verify that the order has been placed successfully without any issues.

Changelog entry

Fix - Resolved signature mismatch error caused by HTML entity encoding in site/blog name.

Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

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

Using html_entity_decode looks good to me. 🚢

@ankitguptaindia
Copy link
Member

QA Report-

Tested this PR after changing the site name with a different combination of names with special characters. Combinations are listed below.

  • Bob's Site

  • "Beyond the Stars: Exploring the Universe ✨"

  • Sérénité: Discovering Inner Peace

  • Test Site Ankit

  • testy-toad-5lhm4.instawp.xyz

  • 𝓢𝓱𝓪𝓭𝓸𝔀𝓼 & 𝓢𝓱𝓲𝓶𝓶𝓮𝓻𝓼: 𝓝𝓪𝓿𝓲𝓰𝓪𝓽𝓲𝓷𝓰 𝓽𝓱𝓮 𝓦𝓸𝓻𝓵𝓭 𝔀𝓲𝓽𝓱 @ % $ 𝓒𝓱𝓪𝓻𝓪𝓬𝓽𝓮𝓻𝓼

  • 𝓢𝓱𝓪𝓭𝓸𝔀𝓼 & 𝓢𝓱𝓲𝓶𝓶𝓮𝓻𝓼: 𝓝𝓪𝓿𝓲𝓰𝓪𝓽𝓲𝓷𝓰 𝓽𝓱𝓮 𝓦𝓸𝓻𝓵𝓭 𝔀𝓲𝓽𝓱 𝓒𝓱𝓪𝓻𝓪𝓬𝓽𝓮𝓻𝓼

  • This is Blog for @NKit's testin%g & user flow %testi&ng!!

  • The Art of Flourishing: Embracing Life's Twists & Turns 🌿

  • etc

  • Tested cases with Theme 2024 and Storefront

  • ITNs update properly in Payfast dashboard.

image

image

image

@dkotter dkotter mentioned this pull request May 7, 2024
16 tasks
@dkotter dkotter modified the milestones: Future Release, 1.6.4 May 7, 2024
@dkotter dkotter marked this pull request as ready for review May 7, 2024 14:43
@dkotter dkotter merged commit 8b01276 into trunk May 7, 2024
5 checks passed
@dkotter dkotter deleted the fix/blogname-encoding branch May 7, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants