Forum Replies Created

Viewing 15 replies - 1 through 15 (of 105 total)
  • Thread Starter ariban99

    (@ariban99)

    Hi Jack,

    I pulled the raw headers from a standard WooCommerce core email that also double-sent, and I found the definitive root cause.

    The headers show an explicit delay between generation and transmission: X-WP-Mail-SMTP-Queued: 19:21:18 Date: 19:22:51

    The source is tracing back to core WooCommerce: class-wc-email.php:1136.

    Because we use the Outlook API mailer, the connection to Microsoft is occasionally hitting a brief lag. Because of our strict server background processing/cron environment, that 90-second delay is causing WordPress to assume a failure and re-trigger the entire execution chain, resulting in duplicate Message-IDs being generated a minute later.

    This isn’t a CusRev issue at all, but an API timeout/background processing conflict with our SMTP provider. I am enabling background email queuing within WP Mail SMTP to decouple the live API processing from the database hooks.

    Thank you again for the excellent debugging framework to help track this down!


    HeadersDate: Wed, 20 May 2026 19:22:50 +0000 From: zzzz> Reply-To: zzzz> Message-ID: <[email protected]> X-Mailer: WPMailSMTP/Mailer/outlook 4.8.0 X-WP-Mail-SMTP-Queued: Wed, 20 May 2026 19:21:15 +0000 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bitSourceWooCommerce /var/www/clients/client0/web1/web/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php:1136

    HeadersDate: Wed, 20 May 2026 19:22:51 +0000 From: xxxx> Reply-To: xxx> Message-ID: <[email protected]> X-Mailer: WPMailSMTP/Mailer/outlook 4.8.0 X-WP-Mail-SMTP-Queued: Wed, 20 May 2026 19:21:18 +0000 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bitSourceWooCommerce /var/www/clients/client0/web1/web/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php:1136

    Thread Starter ariban99

    (@ariban99)

    Hi Jack,

    An update on this: I’ve discovered that this double-sending issue is actually happening across all store emails (including standard WooCommerce transactional emails), not just the review reminders.

    Our WP Mail SMTP logs show two separate entries with completely unique Message-IDs generated at the exact same timestamp for multiple types of emails.

    Because it’s a store-wide issue, it looks like it’s happening at the server/environment layer. We run a headless cron setup (DISABLE_WP_CRON is true) along with a persistent Redis Object Cache and Cloudflare.

    My next steps are to temporarily disable the object caching layer and check if a race condition in our AJAX/checkout hooks is duplicating the core database triggers. I’ll update the thread if flushing the persistent cache solves the duplicate execution loops across the board.

    • This reply was modified 3 weeks, 1 day ago by ariban99.
    Thread Starter ariban99

    (@ariban99)

    still happening.

    only your plugin is effected. We use wpsmtp plugin to handle the sending. Not aure if its something from that too? But nothing else like woocommerce orders. Shipment updates all send once only

    Thread Starter ariban99

    (@ariban99)

    i dont have anything like that and its only been the last few weeks.

    Based on your response is seems that you are sure its not your plugin so i will try to figure out what else is causing this.

    thank you

    Thread Starter ariban99

    (@ariban99)

    i checked the debug file it shows error postcode is required, but in woocommerce, with Nigeria, the postcode is hidden and wont show. its also not allowwing me to attached photos here so i uploaded them to google drive https://drive.google.com/drive/folders/1vap6Zahkpe2vL-D1eqla_5z9L0E-MXW0?usp=sharing

    2025-11-20T22:55:56+00:00Info API request CONTEXT: {"uid":"3e82ded","content":"{n "accountNumber": {n "value": "781145971"n },n "requestedShipment": {n "rateRequestType": [n "ACCOUNT",n "LIST"n ],n "pickupType": "DROPOFF_AT_FEDEX_LOCATION",n "requestedPackageLineItems": [n {n "groupPackageCount": 1,n "weight": {n "units": "LB",n "value": 0.156n }n }n ],n "customsClearanceDetail": {n "commercialInvoice": {n "shipmentPurpose": "SOLD"n },n "dutiesPayment": {n "paymentType": "SENDER"n },n "commodities": []n },n "packagingType": "YOUR_PACKAGING",n "shipper": {n "address": {n "streetLines": [n "743 Waiakamilo Rd",n "Ste A1"n ],n "city": "Honolulu",n "stateOrProvinceCode": "HI",n "postalCode": "96817",n "countryCode": "US"n }n },n "recipient": {n "address": {n "streetLines": [n "26 Oshipitan Street"n ],n "city": "Lagos",n "stateOrProvinceCode": "LA",n "postalCode": "100231",n "countryCode": "NG",n "residential": truen }n }n },n "carrierCodes": []n}","env":"PROD","url":"rate/v1/rates/quotes"} 2025-11-20T22:55:56+00:00Error Recipient postal code is required Additional context2025-11-20T22:55:57+00:00Info API response CONTEXT: {"uid":"3e82ded","content":"{n "transactionId": "31949299-b298-44df-939f-96899c6b58b4",n "output": {n "rateReplyDetails": [n {n "serviceType": "FEDEX_INTERNATIONAL_PRIORITY",n "serviceName": "FedEx International Priority\u00ae",n "packagingType": "YOUR_PACKAGING",n "customerMessages": [n {n "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE",n "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties\/taxes\/fees will be responsible for any applicable Clearance Entry Fees."n }n ],n "ratedShipmentDetails": [n {n "rateType": "ACCOUNT",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 266.31,n "totalBaseCharge": 245.66,n "totalNetCharge": 43.86,n "totalVatCharge": 0,n "totalNetFedExCharge": 43.86,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 43.86,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "M",n "dimDivisor": 166,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 8.98,n "totalFreightDiscount": 210.78,n "freightDiscount": [n {n "type": "VOLUME",n "description": "Volume discount",n "amount": 210.78,n "percent": 85.8n }n ],n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 8.98n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 0n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "PRODUCT",n "currency": "USD",n "rateScale": "US001OFM_2P_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 266.31,n "packageRateDetail": {n "rateType": "PAYOR_ACCOUNT_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 245.66,n "netFreight": 34.88,n "totalSurcharges": 8.98,n "netFedExCharge": 43.86,n "totalTaxes": 0,n "netCharge": 43.86,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 210.78,n "freightDiscounts": [n {n "type": "VOLUME",n "description": "Volume",n "amount": 210.78,n "percent": 85.8n }n ],n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 8.98n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 0n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n },n {n "rateType": "LIST",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 0,n "totalBaseCharge": 245.66,n "totalNetCharge": 310.17,n "totalVatCharge": 0,n "totalNetFedExCharge": 310.17,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 310.17,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "M",n "dimDivisor": 139,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 64.51,n "totalFreightDiscount": 0,n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 63.51n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "COUNTRY",n "currency": "USD",n "rateScale": "US001OFM_2P_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 0,n "packageRateDetail": {n "rateType": "PAYOR_LIST_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 245.66,n "netFreight": 245.66,n "totalSurcharges": 64.51,n "netFedExCharge": 310.17,n "totalTaxes": 0,n "netCharge": 310.17,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 0,n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 63.51n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n }n ],n "operationalDetail": {n "ineligibleForMoneyBackGuarantee": false,n "astraDescription": "IP EOD",n "airportId": "CDG",n "serviceCode": "2P"n },n "signatureOptionType": "SERVICE_DEFAULT",n "serviceDescription": {n "serviceId": "EP1000000300",n "serviceType": "FEDEX_INTERNATIONAL_PRIORITY",n "code": "2P",n "names": [n {n "type": "long",n "encoding": "utf-8",n "value": "FedEx International Priority\u00ae"n },n {n "type": "long",n "encoding": "ascii",n "value": "FedEx International Priority"n },n {n "type": "medium",n "encoding": "utf-8",n "value": "FedEx International Priority"n },n {n "type": "medium",n "encoding": "ascii",n "value": "FedEx International Priority"n },n {n "type": "short",n "encoding": "utf-8",n "value": "IPED"n },n {n "type": "short",n "encoding": "ascii",n "value": "IPED"n },n {n "type": "abbrv",n "encoding": "ascii",n "value": "OA"n }n ],n "serviceCategory": "parcel",n "description": "International Priority EOD (IP EOD)",n "astraDescription": "IP EOD"n }n },n {n "serviceType": "INTERNATIONAL_ECONOMY",n "serviceName": "FedEx International Economy\u00ae",n "packagingType": "YOUR_PACKAGING",n "customerMessages": [n {n "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE",n "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties\/taxes\/fees will be responsible for any applicable Clearance Entry Fees."n }n ],n "ratedShipmentDetails": [n {n "rateType": "ACCOUNT",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 140.51,n "totalBaseCharge": 129.07,n "totalNetCharge": 23.05,n "totalVatCharge": 0,n "totalNetFedExCharge": 23.05,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 23.05,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "US001O",n "dimDivisor": 166,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 4.72,n "totalFreightDiscount": 110.74,n "freightDiscount": [n {n "type": "VOLUME",n "description": "Volume discount",n "amount": 110.74,n "percent": 85.8n }n ],n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 4.72n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 0n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "PRODUCT",n "currency": "USD",n "rateScale": "US001OFM_03_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 140.51,n "packageRateDetail": {n "rateType": "PAYOR_ACCOUNT_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 129.07,n "netFreight": 18.33,n "totalSurcharges": 4.72,n "netFedExCharge": 23.05,n "totalTaxes": 0,n "netCharge": 23.05,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 110.74,n "freightDiscounts": [n {n "type": "VOLUME",n "description": "Volume",n "amount": 110.74,n "percent": 85.8n }n ],n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 4.72n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 0n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n },n {n "rateType": "LIST",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 0,n "totalBaseCharge": 129.07,n "totalNetCharge": 163.56,n "totalVatCharge": 0,n "totalNetFedExCharge": 163.56,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 163.56,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "US001O",n "dimDivisor": 139,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 34.49,n "totalFreightDiscount": 0,n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 33.49n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "COUNTRY",n "currency": "USD",n "rateScale": "US001OFM_03_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 0,n "packageRateDetail": {n "rateType": "PAYOR_LIST_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 129.07,n "netFreight": 129.07,n "totalSurcharges": 34.49,n "netFedExCharge": 163.56,n "totalTaxes": 0,n "netCharge": 163.56,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 0,n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 33.49n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n }n ],n "operationalDetail": {n "ineligibleForMoneyBackGuarantee": false,n "astraDescription": "IE",n "airportId": "CDG",n "serviceCode": "04"n },n "signatureOptionType": "SERVICE_DEFAULT",n "serviceDescription": {n "serviceId": "EP1000000004",n "serviceType": "INTERNATIONAL_ECONOMY",n "code": "04",n "names": [n {n "type": "long",n "encoding": "utf-8",n "value": "FedEx International Economy\u00ae"n },n {n "type": "long",n "encoding": "ascii",n "value": "FedEx International Economy"n },n {n "type": "medium",n "encoding": "utf-8",n "value": "FedEx International Economy\u00ae"n },n {n "type": "medium",n "encoding": "ascii",n "value": "FedEx International Economy"n },n {n "type": "short",n "encoding": "utf-8",n "value": "IE"n },n {n "type": "short",n "encoding": "ascii",n "value": "IE"n },n {n "type": "abbrv",n "encoding": "ascii",n "value": "IE"n }n ],n "serviceCategory": "parcel",n "description": "International Economy",n "astraDescription": "IE"n }n },n {n "serviceType": "FEDEX_INTERNATIONAL_CONNECT_PLUS",n "serviceName": "FedEx International Connect Plus",n "packagingType": "YOUR_PACKAGING",n "customerMessages": [n {n "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE",n "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties\/taxes\/fees will be responsible for any applicable Clearance Entry Fees."n }n ],n "ratedShipmentDetails": [n {n "rateType": "ACCOUNT",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 105.55,n "totalBaseCharge": 118.82,n "totalNetCharge": 45.12,n "totalVatCharge": 0,n "totalNetFedExCharge": 45.12,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 45.12,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "M",n "dimDivisor": 139,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 10.24,n "totalFreightDiscount": 83.94,n "freightDiscount": [n {n "type": "VOLUME",n "description": "Volume discount",n "amount": 83.94,n "percent": 85.56n }n ],n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 9.24n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "COUNTRY",n "currency": "USD",n "rateScale": "USALLFM_EC_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 105.55,n "packageRateDetail": {n "rateType": "PAYOR_ACCOUNT_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 118.82,n "netFreight": 34.88,n "totalSurcharges": 10.24,n "netFedExCharge": 45.12,n "totalTaxes": 0,n "netCharge": 45.12,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 83.94,n "freightDiscounts": [n {n "type": "VOLUME",n "description": "Volume",n "amount": 83.94,n "percent": 85.56n }n ],n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 9.24n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n },n {n "rateType": "LIST",n "ratedWeightMethod": "ACTUAL",n "totalDiscounts": 0,n "totalBaseCharge": 118.82,n "totalNetCharge": 150.67,n "totalVatCharge": 0,n "totalNetFedExCharge": 150.67,n "totalDutiesAndTaxes": 0,n "totalNetChargeWithDutiesAndTaxes": 150.67,n "totalDutiesTaxesAndFees": 0,n "totalAncillaryFeesAndTaxes": 0,n "shipmentRateDetail": {n "rateZone": "M",n "dimDivisor": 139,n "fuelSurchargePercent": 25.75,n "totalSurcharges": 31.85,n "totalFreightDiscount": 0,n "surCharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 30.85n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "pricingCode": "",n "currencyExchangeRate": {n "fromCurrency": "USD",n "intoCurrency": "USD",n "rate": 1n },n "totalBillingWeight": {n "units": "LB",n "value": 0.2n },n "dimDivisorType": "COUNTRY",n "currency": "USD",n "rateScale": "USALLFM_EC_YOUR_PACKAGING",n "totalRateScaleWeight": {n "units": "LB",n "value": 1n }n },n "ratedPackages": [n {n "groupNumber": 0,n "effectiveNetDiscount": 0,n "packageRateDetail": {n "rateType": "PAYOR_LIST_SHIPMENT",n "ratedWeightMethod": "ACTUAL",n "baseCharge": 118.82,n "netFreight": 118.82,n "totalSurcharges": 31.85,n "netFedExCharge": 150.67,n "totalTaxes": 0,n "netCharge": 150.67,n "totalRebates": 0,n "billingWeight": {n "units": "LB",n "value": 0.2n },n "totalFreightDiscounts": 0,n "surcharges": [n {n "type": "FUEL",n "description": "Fuel Surcharge",n "level": "SHIPMENT",n "amount": 30.85n },n {n "type": "DEMAND",n "description": "Demand Surcharge",n "level": "SHIPMENT",n "amount": 1n }n ],n "currency": "USD"n },n "sequenceNumber": 1n }n ],n "currency": "USD"n }n ],n "operationalDetail": {n "ineligibleForMoneyBackGuarantee": false,n "astraDescription": "ICP",n "airportId": "CDG",n "serviceCode": "EC"n },n "signatureOptionType": "SERVICE_DEFAULT",n "serviceDescription": {n "serviceId": "EP1000000305",n "serviceType": "FEDEX_INTERNATIONAL_CONNECT_PLUS",n "code": "EC",n "names": [n {n "type": "long",n "encoding": "utf-8",n "value": "FedEx International Connect Plus"n },n {n "type": "long",n "encoding": "ascii",n "value": "FedEx International Connect Plus"n },n {n "type": "medium",n "encoding": "utf-8",n "value": "FedEx Intl Connect Plus"n },n {n "type": "medium",n "encoding": "ascii",n "value": "FedEx Intl Connect Plus"n },n {n "type": "short",n "encoding": "utf-8",n "value": "ICP"n },n {n "type": "short",n "encoding": "ascii",n "value": "ICP"n },n {n "type": "abbrv",n "encoding": "ascii",n "value": "MN"n }n ],n "serviceCategory": "parcel",n "description": "International Connect Plus",n "astraDescription": "ICP"n }n }n ],n "quoteDate": "2025-11-20",n "encoded": falsen }n}","env":"PROD"} 2025-11-20T22:56:04+00:00Error Recipient postal code is required Additional context{ "uid": "a26b285" }2025-11-20T22:58:21+00:00Error Recipient postal code is required Additional context{ "uid": "d5b4aab" }

    Thank you for selling with WooCommerce.

    Version 10.3.5
    Thread Starter ariban99

    (@ariban99)

    yes not its working but your message is not proper. it says Payment declined. Approved. Billing address didn’t match the card (AVS).
    it says declined and then approved! anyways, we put your snippet with a more friendly english.

    Thread Starter ariban99

    (@ariban99)

    no difference, here is my snippet code

    add_filter( ‘woocommerce_add_error’, ‘paypal_three_decline_cases_fixed’, 10, 1 );
    function paypal_three_decline_cases_fixed( $message ) {
    // Only PayPal declines
    if ( strpos( $message, ‘Payment declined’ ) === false ) {
    return $message;
    }

    // 1. Get the raw PayPal response -------------------------------------------------
    $raw = WC()->session->get( 'angelleye_ppcp_error' );          // v9+ session key
    if ( ! $raw ) {
        $raw = WC()->session->get( 'paypal_error_details' );      // older key
    }
    
    // If still empty, try the order meta (set after process_payment)
    if ( ! $raw && ! empty( $_POST['order_id'] ) ) {
        $order = wc_get_order( absint( $_POST['order_id'] ) );
        if ( $order ) {
            $raw = $order->get_meta( '_angelleye_ppcp_error' )   // current meta key
                ?: $order->get_meta( '_paypal_response' )
                ?: $order->get_meta( 'paypal_error_details' );
        }
    }
    
    $error_text = is_string( $raw ) ? $raw : ( is_array( $raw ) ? wp_json_encode( $raw ) : '' );
    
    // 2. 1. BANK / ISSUER BLOCKED ---------------------------------------------------
    $bank_keywords = [ '15007', '15006', 'CARD_DECLINED', 'issuer declined', 'bank declined', 'contact your bank' ];
    foreach ( $bank_keywords as $kw ) {
        if ( stripos( $error_text, $kw ) !== false ) {
            return 'Declined: Card issuer blocked. Contact your bank, then retry.<br><br>Rechazado: Banco bloqueó. Contacta a tu banco y reintenta.';
        }
    }
    
    // 3. 2. AVS (ADDRESS) MISMATCH --------------------------------------------------
    $avs_keywords = [ '15005', 'AVS', 'address verification', 'billing address', 'zip', 'postal' ];
    foreach ( $avs_keywords as $kw ) {
        if ( stripos( $error_text, $kw ) !== false ) {
            return 'Declined: Address mismatch. Fix billing & retry or try another card. Temp hold drops in 1–10 days.<br><br>Rechazado: Dirección no coincide. Corrige facturación y reintenta o usa otra tarjeta. Retención temporal se libera en 1–10 días.';
        }
    }
    
    // 4. 3. CVC / 3-DIGIT CODE WRONG ------------------------------------------------
    $cvc_keywords = [ '15004', 'CVC', 'CVV', 'security code', 'card verification' ];
    foreach ( $cvc_keywords as $kw ) {
        if ( stripos( $error_text, $kw ) !== false ) {
            return 'Declined: Wrong security code. Re-enter the 3-digit code on the back of your card.<br><br>Rechazado: Código de seguridad incorrecto. Ingresa los 3 dígitos del reverso de la tarjeta.';
        }
    }
    
    // 5. Fallback – generic but helpful
    return 'Declined. Please check your card details and ensure billing address is correct.<br><br>Rechazado. Verifica los datos de tu tarjeta y asegúrate de que la dirección de facturación sea correcta.';

    }


    Thread Starter ariban99

    (@ariban99)

    i actually see that paypal never provides a reasons it can be multiple reasons why its declined so i updated the snippet to this (until you pass along paypals error that shows in the admin)

    add_filter( 'woocommerce_add_error', 'paypal_decline_clean', 10, 1 );
    function paypal_decline_clean( $message ) {
    if ( strpos( $message, 'Payment declined' ) === false ) {
    return $message;
    }

    return 'Payment declined. Please double-check your billing address (most common issue), card number, and security code. Temporary hold drops in 1–10 days.<br><br>Pago rechazado. Revisa tu dirección de facturación (causa más común), número de tarjeta y código de seguridad. Retención temporal se libera en 1–10 días.';
    }
    Thread Starter ariban99

    (@ariban99)

    i was able to fix this error with this snippet

    add_filter( ‘woocommerce_add_error’, ‘custom_paypal_avs_error_message’, 10, 1 );
    function custom_paypal_avs_error_message( $message ) {
    if ( strpos( $message, ‘Payment declined’ ) !== false ) {
    return ‘Order Declined: Billing Address Mismatch. Please retry with the correct address. If it’s correct but still declined, try another card. The pending charge will be removed within 10 business days.
    <BR><BR>
    Pedido rechazado: discrepancia en la dirección de facturación. Vuelva a intentarlo con la dirección correcta. Si es correcta pero sigue siendo rechazada, pruebe con otra tarjeta. El cargo pendiente se eliminará en un máximo de 10 días hábiles.’;
    }
    return $message;
    }

    Thread Starter ariban99

    (@ariban99)

    this latest version broke the checkout. it just keeps on turning and turning for ever and never finalizes.

    i had to put back the version 9.0.46 that works perfect but with no proper explanation.

    Thread Starter ariban99

    (@ariban99)

    sorry i was traveling. actually it is not working properly.

    in the back end i see this

    Address Verification Result
    N : None – Transaction was declined.

    the customer however sees this: declined no pending reason provided

    it should show them an error something like:
    Order Declined: Billing Address Mismatch. Please retry with the correct address. If it’s correct but still declined, try another card. The pending charge will be removed within 10 business days.

    or do you have an option to change teh text either with a snippet or in your app? a customized text for different error reasons?

    Thread Starter ariban99

    (@ariban99)

    thank you.

    ill install and try it

    Thread Starter ariban99

    (@ariban99)

    i reached out to cloudways.

    their “solution that they implemented” broke my site and i lost all sales over the weekend. They somehow said its an ftp issue which made no sense at all

    so we removed their solution and turned off minify html, css and js and its working now.

    we cant use the minify functions with astra pro i guess.

    Thread Starter ariban99

    (@ariban99)

    amazing. Ill download and try it out

    Thread Starter ariban99

    (@ariban99)

    yeah there’s a time limit mine passed that time I’ll just change the API in the back end

Viewing 15 replies - 1 through 15 (of 105 total)