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
344 stars 191 forks source link

Donations should always show the same date as the payment gateway #4708

Closed Benunc closed 1 year ago

Benunc commented 4 years ago

Bug Report

User Story

As a user, I want to be able to easily reconcile records with the payment gateway by checking the dates on both.

Details

If a donation is marked as having occurred at 12:03 AM on Stripe, it should also show 12:03 AM on GiveWP. This is especially true of end-of-year donations where there are tax implications.

Current Behavior

If a donation is initiated at 11:45PM, it's recorded as two different dates on Stripe and the site. That's because the Payment succeeded time stamp is the important one, not the payment started time stamp. Here's an image for clarity:

image

Expected Behavior

I expect both payment gateway and GiveWP to have the same date.

Bug Type

I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

(not really applicable)

  1. Trigger a donation where the start and succeeded events are on different dates.
  2. note that the dates are off between stripe and GiveWP.

Possible Solution

Use a different webhook event to set the date?

Related

https://secure.helpscout.net/conversation/1135295580/62389/

Acceptance Criteria

Environment

WordPress System Info ### WordPress Environment ### Home URL: https://livegive.wpsteward.com Site URL: https://livegive.wpsteward.com WP Version: 5.4.1 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_8138bfdc07_ Table Prefix Length: 14 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, give_subscription ### Server Environment ### Hosting Provider: DBH: localhost, SRV: livegive.wpsteward.com TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: Apache/2.4.43 (Unix) OpenSSL/1.0.1f PHP Version: 7.1.33 PHP Post Max Size: 1 GB PHP Time Limit: 30 PHP Max Input Vars: 5000 PHP Max Upload Size: 512 MB cURL Version: ❌ 7.35.0, OpenSSL/1.0.1f - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: ❌ 5.5.62 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### GiveWP Configuration ### GiveWP Version: 2.6.2 GiveWP Cache: Enabled Database Updates: All DB Updates Completed. Database Tables: ✔ wp_8138bfdc07_give_donors - 1.0✔ wp_8138bfdc07_give_donormeta - 1.0✔ wp_8138bfdc07_give_comments - 1.0✔ wp_8138bfdc07_give_commentmeta - 1.0✔ wp_8138bfdc07_give_sessions - 1.0✔ wp_8138bfdc07_give_logs - 1.0✔ wp_8138bfdc07_give_logmeta - 1.0✔ wp_8138bfdc07_give_formmeta - 1.0✔ wp_8138bfdc07_give_sequential_ordering - 1.0✔ wp_8138bfdc07_give_donationmeta - 1.0 GiveWP Cache: Enabled GiveWP Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Donation Note❌Email access❌Renewal Receipt Email✔Renewal Receipt Email❌Subscription Cancelled Email❌Subscription Cancelled Email❌Subscription Completed Email❌Subscription Reminder Email❌Subscriptions Email Access✔Subscription Payment Failed Email Upgraded From: 2.6.1 Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: https://livegive.wpsteward.com/donation-confirmation/ Failure Page: https://livegive.wpsteward.com/donation-failed/ Donation History Page: https://livegive.wpsteward.com/donation-history/ GiveWP Forms Slug: /donations/ Enabled Payment Gateways: Offline Donation, PayPal Standard, PayPal Payments Pro, Authorize.net eCheck (ACH), Braintree, Stripe - Apple Pay, Stripe - Credit Card, Stripe - Checkout, Stripe + Plaid, Stripe - Google Pay, Stripe iDEAL Default Payment Gateway: Stripe + Plaid PayPal IPN Verification: Enabled PayPal IPN Notifications: IPN received for #211 ( 9EH155265E921591R ) on 09/20/2019 at 14:04. Status VERIFIED Donor Email Access: Disabled Stripe Webhook Notifications: May 4, 2020 7:02 pm Square Token Renewal Date: 2020-04-15 13:30:46 ### Active GiveWP Add-ons ### Give - 2Checkout Gateway: ✔ Licensed – by GiveWP – 1.1.4 Give - Annual Receipts: ✔ Licensed – by GiveWP – 1.0.2 Give - Authorize.net Gateway: ✔ Licensed – by GiveWP – 1.4.6 Give - Braintree Gateway: ✔ Licensed – by GiveWP – 1.2.4 Give - CCAvenue Gateway: ✔ Licensed – by GiveWP – 1.0.4 Give - Currency Switcher: ✔ Licensed – by GiveWP – 1.3.7 Give - Fee Recovery: ✔ Licensed – by GiveWP – 1.7.8 Give - Form Field Manager: ✔ Licensed – by GiveWP – 1.4.4 Give - Google Analytics Donation Tracking: ✔ Licensed – by GiveWP – 1.2.4 Give - MailChimp: ✔ Licensed – by GiveWP – 1.4.6 Give - Manual Donations: ✔ Licensed – by GiveWP – 1.4.6 Give - PayPal Pro Gateway: ✔ Licensed – by GiveWP – 1.2.2 Give - PDF Receipts: ✔ Licensed – by GiveWP – 2.3.6 Give - Per Form Gateways: ✔ Licensed – by GiveWP – 1.0.2 Give - Recurring Donations: ✔ Licensed – by GiveWP – 1.10.1 Give - Square: ✔ Licensed – by GiveWP – 1.1.1 Give - Stripe Gateway: ✔ Licensed – by GiveWP – 2.2.5 Give - Tributes: ✔ Licensed – by GiveWP – 1.5.6 Give - Zapier: ✔ Licensed – by GiveWP – 1.3.0 ### Other Active Plugins ### Advanced CF7 DB: by Vsourz Digital – 1.7.2 Disable Gutenberg: by Jeff Starr – 2.1 Email Cop: by Ashfame – 0.1.1 Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.10.4 User Role Editor: by Vladimir Garagulya – 4.53.1 User Switching: by John Blackbourn & contributors – 1.5.4 WP Rollback: by Impress.org – 1.7.0 ### Inactive Plugins ### Ben's Helper Functions: by BenUNC – Elementor: by Elementor.com – 2.9.8 Give - AmeriCloud Payments: by AmeriCloud Solutions, Inc. – 1.3.4 Give - Constant Contact: by GiveWP – 1.2.4 Give - Database HealthCheck: by WordImpress – 0.0.2 Give - Email Reports: by GiveWP – 1.1.4 Give - Form Countdown: by GiveWP – 1.0.1 Give - Mollie Gateway: by GiveWP – 1.2.4 Give - PayFast Payment Gateway: by WordImpress – 1.0.2 Give - Paytm Gateway: by GiveWP – 1.1.0 Hello Dolly: by Matt Mullenweg – 1.7.2 Loco Translate: by Tim Whitlock – 2.3.3 Page Builder by SiteOrigin: by SiteOrigin – 2.10.15 Plugin Detective - Troubleshooting: by N Squared – 1.1.6 Query Monitor: by John Blackbourn – 3.5.2 Shortcode in Menus: by Gagan Deep Singh – 3.5 Simple Social Shout for GiveWP: by Matt Cromwell – 1.0 SiteOrigin Widgets Bundle: by SiteOrigin – 1.16.1 Stop Donor Spam: by Matt Cromwell – 1.2.0 Tickera: by Tickera.com – 3.4.6.9 Wordfence Security: by Wordfence – 7.4.6 WP Crontrol: by John Blackbourn & crontributors – 1.8.1 ### Active MU Plugins ### api-hacks.php: by – helpr-mu.php: by – per-form-currency.php: by – ### Theme ### Name: Twenty Seventeen Version: 2.3 Author URL: https://wordpress.org/ 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
DevinWalker commented 4 years ago

@Benunc after reading the ticket it looks like perhaps we should be catching an additional webhook and updating the date + time of the donation. @mehul0810 can you take a look at this?

jonwaldstein commented 2 years ago

@ravinderk @kjohnson can we sneak this fix in somewhere while updating gateways with the gateway api?

ravinderk commented 2 years ago

@jonwaldstein According to the current Stripe payment flow donation is complete when we get this two webhook 👇 or we get immediate feedback for payment from Stripe which processes donations on the website.

invoice.payment_succeeded
payment_intent.succeeded

In both cases, the donation complete date will be correct and matched to the stripe payment (the difference can be in seconds). @Benunc do know any case where the donation complete date can be different from Stripe payment? I am not able to reproduce this with the new gateway API.

I will suggest using the event date mentioned in (☝️ webhook ) event data as the donation complete date to match the Stripe payment.

cc: @kjohnson @Benunc

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for an additional 14 days with no activity.