impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
340 stars 191 forks source link

fix: ensure legitimate South Korean zip code doesn't result in error #3910

Closed samsmith89 closed 5 years ago

samsmith89 commented 5 years ago

Bug Report

User Story

As a site admin, I want my donors in South Korea to be able to submit a donation without causing a zip code error so that I can accept donations from a wider breadth of possible donors.

Current Behavior

Currently, when using a South Korean zip code, I receive an error stating that the zip code is invalid.

In 2015 there was a change from 6 digit zip codes to 5 digit zip codes in the South Korean postal system. Using either a 5 digit or 6 digit zip code results in this error.

Expected Behavior

I expect for donors with a legitimate South Koren zip code to submit donations without receiving an error.

Bug Type

Steps to Reproduce

  1. Create a donation with a South Korean address
  2. When the donation is processing see the error that displays on the page

Visuals

screen shot 2018-12-20 at 9 09 13 am

Possible Solution

Here is a line of code in core that appears to be handling the zip validation: https://github.com/impress-org/give/blob/3f201f6937ee8f191d9efbaea8541e2dd9b5b74a/includes/process-donation.php#L1328

Related

https://secure.helpscout.net/conversation/736162780/31486

An article of South Korean zip codes: https://en.wikipedia.org/wiki/List_of_postal_codes_in_South_Korea

Acceptance Criteria

Environment

Operating System
  • Platform: Mac OS X
Browser
  • Name: Chrome
WordPress System Info ### WordPress Environment ### Home URL: http://give.local Site URL: http://give.local WP Version: 4.9.9 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_US Permalink Structure: /%postname%/ Show on Front: posts Table Prefix Length: wp_ Table Prefix Length: 3 Table Prefix Status: Acceptable Admin AJAX: Accessible Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed, in-progress, failed, acf-disabled, wc-pending, wc-processing, wc-on-hold, wc-completed, wc-cancelled, wc-refunded, wc-failed, refunded, revoked, cancelled, abandoned, processing, preapproval, give_subscription ### Server Environment ### Hosting Provider: DBH: localhost, SRV: give.local TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: Apache/2.4.10 (Debian) PHP Version: 7.1.4 PHP Post Max Size: 1,000 MB PHP Time Limit: 900 PHP Max Input Vars: 3000 PHP Max Upload Size: 1,000 MB cURL Version: ❌ 7.38.0, OpenSSL/1.0.1t - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: 5.6.34 Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Give Configuration ### Give Version: 2.3.1 Give Cache: Enabled Database Updates: All DB Updates Completed. Give Cache: Enabled Give Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Donor Note✔Email access✔Renewal Receipt Email✔Subscription Cancelled Email❌Subscription Completed Email✔Subscription Reminder Email✔Subscriptions Email Access Upgraded From: 2.3.0 Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://give.local/donation-confirmation/ Failure Page: http://give.local/donation-failed/ Donation History Page: http://give.local/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: PayPal Standard, Test Donation, Offline Donation, Stripe - Credit Card, Authorize.net Default Payment Gateway: PayPal Standard PayPal IPN Verification: Disabled PayPal IPN Notifications: N/A Donor Email Access: Enabled ### Active Give Add-ons ### Give - Authorize.net Gateway: ✔ Licensed – by WordImpress – 1.4.3 Give - Braintree Gateway: ❌ Unlicensed – by GiveWP – 1.2.3 Give - CCAvenue Gateway: ❌ Unlicensed – by GiveWP – 1.0.4 Give - Donation Upsells for WooCommerce: ❌ Unlicensed – by GiveWP – 1.1.0 Give - Fee Recovery: ❌ Unlicensed – by GiveWP – 1.7.2 Give - Form Field Manager: ❌ Unlicensed – by GiveWP – 1.4.1 Give - Google Analytics Donation Tracking: ❌ Unlicensed – by GiveWP – 1.2.1 Give - MailChimp: ❌ Unlicensed – by GiveWP – 1.4.3 Give - Manual Donations: ❌ Unlicensed – by GiveWP – 1.4.2 Give - PayPal Pro Gateway: ❌ Unlicensed – by GiveWP – 1.2.1 Give - Paytm Gateway: ✔ Licensed – by WordImpress – 1.0.1 Give - PDF Receipts: ❌ Unlicensed – by GiveWP – 2.3.2 Give - Recurring Donations: ❌ Unlicensed – by GiveWP – 1.8.2 Give - Stripe Gateway: ❌ Unlicensed – by GiveWP – 2.1.2 Give - Tributes: ❌ Unlicensed – by GiveWP – 1.5.2 Sam's Helper Function: ❌ Unlicensed – by WordImpress – 1.0 ### Other Active Plugins ### Advanced Custom Fields: by Elliot Condon – 5.7.7 Give - Hook Helper: by Ravinder Kumar – 1.0 Transients Manager: by Pippin Williamson – 1.7.5 WooCommerce: by Automattic – 3.5.2 ### Inactive Plugins ### All-in-One WP Migration: by ServMask – 6.78 Contact Form 7: by Takayuki Miyoshi – 5.0.4 Elementor: by Elementor.com – 2.3.2 Give - Email Reports: by WordImpress – 1.1.2 Give - Gift Aid: by WordImpress – 1.1.6 Give - GoCardless Gateway: by WordImpress – 1.2.1 Give - Razorpay: by WordImpress – 1.2.0 Gutenberg: by Gutenberg Team – 4.1.1 Intelligence: by LevelTen – 1.3.1 Invisible reCaptcha: by Mihai Chelaru – 1.2.1 WordPress Importer: by wordpressdotorg – 0.6.4 WP Business Reviews: by Impress.org – 1.0.0 ### Active MU Plugins ### Bypass Login: by Stephen Carnam – 1.1.0 ### Theme ### Name: Twenty Seventeen Version: 1.7 Author URL: https://wordpress.org/ Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme
kevinwhoffman commented 5 years ago

@samsmith89 The error you are seeing is likely because you have letters in the zip code. The existing validation pattern should work with 5 numbers. While Wikipedia shows examples like 043NN, I believe the NN is just a placeholder for some numbers.

When I see examples on other sites, I see that they only use 5 numbers like 03187 (https://thesoulofseoul.net/2015/07/06/the-addresses-are-changing-again/).

I recommend getting more information from the customer as to the address they are using that is causing the error. Our validation pattern should account for the updated 5-digit format that took place in 2015, and we do not have any other known reports. Our pattern is also in line with WooCommerce and EDD, so I'm hesitant to suggest a change without more information.

kevinwhoffman commented 5 years ago

Closing as we think this was a misunderstanding regarding Korean postal code format.