Overview
The Freshy development team built a fraud-prevention mechanism into a client’s WooCommerce checkout process by adding a required confirmation checkbox that only appears when the customer selects a different shipping address from their billing address.
This feature was designed to deter fraudulent transactions, log authorization consent, and provide verifiable order data — including timestamp and IP address — for use in chargeback disputes.
Issue background
The client experienced an increase in chargeback disputes for orders shipped to addresses different from the billing address. These disputes were often difficult to contest, as there was no proof the cardholder had approved shipment to an alternate location.
To address this, the client requested a fraud prevention feature that required explicit authorization from the purchaser whenever a shipping address differed from the billing address.
Diagnosis
After reviewing the checkout flow, Freshy’s developers confirmed:
- WooCommerce did not natively include a conditional confirmation step for differing addresses.
- Any modification needed to integrate seamlessly with the checkout template without affecting payment gateways or other plugins.
- The client wanted to record whether the box was checked, the timestamp of confirmation, and the IP address of the customer.
- This data needed to be saved as order metadata, displayed in the WooCommerce admin panel, and optionally emailed to internal staff for record-keeping.
Resolution steps
The Freshy team implemented a custom PHP solution using WooCommerce’s existing hooks and checkout validation methods.
- Added a conditional checkbox to checkout
The checkbox only appears when the customer checks “Ship to a different address.” It is marked as a required field, preventing checkout until selected.Example text:
“I certify that I am the authorized cardholder and accept shipment to this address. This confirmation will be logged with a timestamp and IP address as part of fraud prevention.”
- Implemented validation logic
If the shipping address differs and the box is unchecked, checkout is blocked with a custom error message. Validation runs server-side to prevent bypassing via JavaScript manipulation. - Stored authorization data as order metadata
Three new metadata fields were created and saved to each order:auth_confirm_shipping_addressauth_confirm_shipping_timestampauth_confirm_shipping_ip
The IP was captured using WooCommerce’s built-in function:
$ip = WC_Geolocation::get_ip_address(); - Displayed confirmation in admin
The authorization status, timestamp, and IP address were added to the WooCommerce order details panel for review. This provides internal staff with clear visibility during fraud investigations or refund reviews. - Added merchant email notifications
A custom WooCommerce email template was created to notify staff when the fraud-prevention checkbox was triggered.
Email subject example:“Authorization Record: Different Shipping Address Consent – Order #[OrderID]”
The email includes:
- Order ID
- Checkbox status
- Timestamp
- Customer IP address
- A note confirming that the shipping address differed from billing
- Thorough testing and refinement
The feature was tested using both active and test payment gateways. QA verified that the logic triggered only when required, appeared correctly styled within the checkout flow, and logged all necessary data without performance impact.
Final outcome
After deployment, customers shipping to a different address must now explicitly confirm authorization before completing checkout.
This new logic achieved the following:
- Added a visible deterrent against fraudulent orders.
- Created a traceable record of cardholder consent with date, time, and IP logs.
- Provided merchants with valuable evidence for chargeback rebuttals.
- Maintained compatibility with all existing payment gateways and checkout extensions.
The client’s checkout experience remains user-friendly while gaining an important layer of security and compliance.
Key takeaways
- Custom conditional logic in WooCommerce checkout can significantly reduce fraudulent transactions.
- Logging authorization metadata provides merchants with verifiable order data for dispute protection.
- Using WooCommerce hooks allows seamless integration without disrupting payment gateways or plugin updates.
- Proactive fraud prevention builds trust and reduces administrative burden on support teams.
If your WooCommerce store needs custom checkout logic or enhanced fraud-prevention features, contact Freshy to learn how we can improve your eCommerce security and compliance workflows.