• Resolved michellekoen

    (@michellekoen)


    Hello,

    I just received a message from Stripe saying that 80 webhook requests returned a HTTP 301.

    All our donations have been marked as Completed, so it’s not making any functional difference to the site, as far as I can see.

    To try and fix this problem I have deleted and re-input the webhook. I then ran a test donation which status is as follow

    System – May 4, 2023, 12:18 pm
    Status changed from Pending to Complete. – Delete

    System – May 4, 2023, 12:18 pm
    Stripe Charge/Payment Intent ID: pi_3N3rkFEEFsnsEhUI1GRCrh8R – Delete

    System?–?May 4, 2023, 12:18 pm
    Stripe Payment Intent Client Secret: pi_xxx?–?Delete

    System?–?May 4, 2023, 12:18 pm
    Stripe Customer ID: cus_xxx –?Delete

    System?–?May 4, 2023, 12:18 pm
    Donation accepted with Stripe account “santifm.org (acct_xxx)” using Stripe Connect.?–?Delete

    System?–?May 4, 2023, 12:18 pm
    Stripe Source/Payment Method ID: pm_xxx?–?Delete

    However, when I look in Stripe at the Test Payments I still see
    301 ERR Invalid encoding: ISO-8859-1

    I can’t see anything obvious doing the redirect in our HTACCESS.

    I have purged and disabled our caching plugin and tried disabling various suspect plugins.

    I hope that you can help find a solution.
    Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @michellekoen,
    Glad you reached out.

    You mentioned you are only seeing 301 errors on test payments, is that right?

    A 301 error means there is a redirect, and that can happen for a couple of reasons.

    1. A possible issue with your webhook (which you’ve ruled out, so no worries there)
    2. A plugin or security solution. Firewalls and Coming Soon plugins are common culprits for this.
    3. The hosting provider.

    In this case, I’m leaning very heavily toward the hosting provider. I’d recommend reaching out to them for clarification about redirects. If that doesn’t help get you going, I’ll need a look at your system information to see if we can get some traction for what may be causing the redirection. You can send this by navigating to Donations > Tools > System Info (tab) and clicking the button to “Get System Report” and copy/paste that into your reply here.

    Let me know if you have any questions about this in the meantime, I’m happy to help.

    Thread Starter michellekoen

    (@michellekoen)

    Thanks for getting back to me.

    It could be redirects. I’m not excellent at understanding HTACCESS and how this might work with a POST request. However, this looks like a pretty standard WP HTACCESS

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_expires.c>
    #
    </IfModule>
    Options -Indexes
    <IfModule mod_headers.c>
    #	Header set X-Endurance-Cache-Level "2"
    #	Header set X-nginx-cache "WordPress"
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /santi/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /santi/index.php [L]
    </IfModule>
    
    # END WordPress
    

    Here’s my system report

    ### WordPress Environment ###
    
    Home URL: https://santifm.org/santi
    Site URL: https://santifm.org/santi
    WP Version: 6.2
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_AU
    Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
    Show on Front: page
    Page on Front: Welcome to Santi (#4134)
    Page for Posts: News (#4136)
    Table Prefix Length: ##_
    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, refunded, failed, revoked, cancelled, abandoned, processing, preapproval, dp-rewrite-republish
    
    ### Server Environment ###
    
    Hosting Provider: DBH: localhost, SRV: santifm.org
    TLS Connection: Connection uses TLS 1.3
    TLS Connection: Probably Okay
    Server Info: Apache
    PHP Version: 7.4.33
    PHP Post Max Size: 516 MB
    PHP Time Limit: 60
    PHP Max Input Vars: 1000
    PHP Max Upload Size: 250 MB
    cURL Version: 8.0.1, OpenSSL/1.1.1t
    SUHOSIN Installed: –
    MySQL Version: 5.7.23
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    gzip: ?
    GD Graphics Library: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### GiveWP Configuration ###
    
    GiveWP Version: 2.27.0
    GiveWP Cache: Enabled
    Database Updates: All DB Updates Completed.
    Database Updates: All database migrations completed.
    Database Tables: ? wp_give_donors? wp_give_donormeta? wp_give_comments? wp_give_commentmeta? wp_give_sessions? wp_give_formmeta? wp_give_sequential_ordering? wp_give_donationmeta? wp_give_revenue? wp_give_migrations? wp_give_log
    GiveWP Cache: Enabled
    GiveWP Cache: ?New Donation?Donation Receipt?Donation Processing Receipt?New Offline Donation?Offline Donation Instructions?New User Registration?User Registration Information?Donation Note?Email access
    Upgraded From: 2.25.2
    Test Mode: Enabled
    Currency Code: AUD
    Currency Position: Before
    Decimal Separator: .
    Thousands Separator: ,
    Success Page: https://santifm.org/santi/donation-confirmation/
    Failure Page: https://santifm.org/santi/donation-failed/
    Donation History Page: https://santifm.org/santi/donor-dashboard/
    GiveWP Forms Slug: /donations/
    Enabled Payment Gateways: Stripe - Credit Card, PayPal Standard, Offline Donation
    Default Payment Gateway: Stripe - Credit Card
    PayPal IPN Notifications: IPN received for #12459 ( 40L58807S7218652M ) on 04/30/2023 at 12:38. Status VERIFIED
    Donor Email Access: Enabled
    Stripe Webhook Notifications: N/A
    
    ### Active GiveWP Add-ons ###
    
    
    ### Other Active Plugins ###
    
    Add Posts to Pages: by Arsham Mirshah – 1.4.1
    Akismet Anti-Spam: by Automattic – 5.1
    Donations via PayPal: by Tips and Tricks HQ, Johan Steen – 1.9.10
    Increase Maximum Upload File Size: by Imagify – 2.0.4
    MailPoet: by MailPoet – 4.13.0
    MailPoet Premium: by MailPoet – 4.13.0
    Modal Block: by Mark Bird – 2.1
    Mu Manager: by Jose Mortellaro – 0.0.1
    Ninja Forms: by Saturday Drive – 3.6.23
    Post Type Switcher: by Triple J Software, Inc. – 3.2.1
    Pretty Google Calendar: by LBell – 1.4.1
    Say What?: by Ademti Software – 2.1.4
    Term Management Tools: by theMikeD, scribu – 2.0.1
    UpdraftPlus - Backup/Restore: by UpdraftPlus.Com, DavidAnderson – 1.23.3
    User Stats: by Dean Robinson – 1.0.7
    WP-Filebase: by Fabian Schlieper – 3.4.4
    Yoast Duplicate Post: by Enrico Battocchi & Team Yoast – 4.5
    
    ### Inactive Plugins ###
    
    Fast Secure Contact Form: by Mike Challis, Ken Carlson – 4.0.51
    Image Pro: by Mihai Valentin – 0.36
    IP Threat Blocker by Musubu: by Musubu – 1.1.1
    Jetpack: by Automattic – 12.0
    MailChimp: by MailChimp – 1.5.8
    Wordfence Security: by Wordfence – 7.9.2
    WP Force SSL: by WebFactory Ltd – 1.65
    
    ### Active MU Plugins ###
    
    SSO: by Garth Mortensen, Mike Hansen – 0.4
    
    ### Theme ###
    
    Name: SantiFM2016
    Version: 0.1
    Author URL: https://mkgd.net
    Child Theme: No – If you're modifying GiveWP on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme
    

    Hi @michellekoen,

    Thanks for sending along that information.

    I’m still leaning towards a redirect being your issue here. If you navigate over to your Stripe dashboard, you should be able to click one of those donations and see a record of webhook activity and/or error codes. You’ll see a 200 response for the donation being received, but if you scroll down a bit you should see the 301 error with some additional details. Those details will pinpoint right where the trouble is coming from.

    Usually this comes down to a very subtle difference between your site, and your webhook URL. Sometimes it’s a little more obvious, like the site using HTTP and then being redirected to HTTPS. But in some cases it comes down to something very small, like an extra /. We need to know exactly where the difference is to be able to correct it to stop that redirection.

    Because you are receiving completed donations, we know your webhook is communicating, we just need to close that communication loop. A 301 will stop recurring donations from completing successfully, so we’ll want to get it squared away.

    Give the code a look in your Stripe dashboard, and let me know what you find. Once we have a little more context, we should be able to set things right.

    Keep me posted, I’m happy to help with questions along the way!

    Hi @michellekoen,
    I know you are giving things a look here, and that you might need a little extra time. I’m marking this as resolved for now, but if you come across any new information or have any questions you can send that along right here and I’ll be happy to hop in!

    Thread Starter michellekoen

    (@michellekoen)

    Hi @stephanieliy

    As stated in the OP I’m getting

    payment_intent.succeeded

    Response
    301 ERR
    Invalid encoding: ISO-8859-1

    The details of the request are as follows:

    {
    "id": "evt_3N2Q1fEEFsnsEhUI1gqHzaLG",
    "object": "event",
    "api_version": "2022-11-15",
    "created": 1682821813,
    "data": {
    "object": {
    "id": "pi_3N2Q1fEEFsnsEhUI1Bm0Iu5P",
    "object": "payment_intent",
    "amount": 5000,
    "amount_capturable": 0,
    "amount_details": {
    "tip": {
    }
    },
    "amount_received": 5000,
    "application": "ca_9aCrgIfxIYTRTkMvw30fMqg92su6Sr1i",
    "application_fee_amount": 100,
    "automatic_payment_methods": null,
    "canceled_at": null,
    "cancellation_reason": null,
    "capture_method": "automatic",
    "client_secret": "xxx",
    "confirmation_method": "automatic",
    "created": 1682821811,
    "currency": "aud",
    "customer": "cus_No25PHNT2yUI3W",
    "description": "Vesak Donations: $50.00 -Xxxx xxxx ([email protected])",
    "invoice": null,
    "last_payment_error": null,
    "latest_charge": "ch_3N2Q1fEEFsnsEhUI1W4H70I5",
    "livemode": true,
    "metadata": {
    "Donation Post ID": "12456",
    "Sequential ID": "33",
    "Email": "[email protected]"
    },
    "next_action": null,
    "on_behalf_of": null,
    "payment_method": "pm_1N2Q1eEEFsnsEhUIwvMBB9sQ",
    "payment_method_options": {
    "card": {
    "installments": null,
    "mandate_options": null,
    "network": null,
    "request_three_d_secure": "automatic"
    }
    },
    "payment_method_types": [
    "card"
    ],
    "processing": null,
    "receipt_email": null,
    "review": null,
    "setup_future_usage": null,
    "shipping": null,
    "source": null,
    "statement_descriptor": "SANTI FOREST MONASTERY",
    "statement_descriptor_suffix": null,
    "status": "succeeded",
    "transfer_data": null,
    "transfer_group": null
    }
    },
    "livemode": true,
    "pending_webhooks": 1,
    "request": {
    "id": "req_8lbYAbxxeMpVT9u",
    "idempotency_key": "b3abb94a-cb1b-427a-830a-c07ac1c87c5a"
    },
    "type": "payment_intent.succeeded"
    }

    I can’t see anything pointing to what you described. There are no URLs in this response.

    • This reply was modified 1 year, 10 months ago by michellekoen.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stripe Webhook Error 301’ is closed to new replies.