PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.4.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.4.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
← All changes | includes/WooCommerce/Subscriptions.php +7 -4 2.4.0 → 2.4.1 View file →
@@ -1791,9 +1791,10 @@
1791 1791
1792 1792 return array(
1793 1793 'amount' => (float) $data['amount'],
1794 1794 'order_id' => (string) $data['bp_order_id'],
1795 - 'payment_date' => current_time( 'mysql' ),
1795 + // UTC, like every other writer of this table (see Classes\PaymentDateMigration).
1796 + 'payment_date' => gmdate( 'Y-m-d H:i:s' ),
1796 1797 'source' => 'stripe',
1797 1798 'transaction_id' => ! empty( $intent->id ) ? sanitize_text_field( $intent->id ) : '',
1798 1799 'customer_info' => maybe_serialize( $intent ),
1799 1800 'form_fields_info' => maybe_serialize( $form_fields_info ),
@@ -3341,11 +3342,13 @@
3341 3342 * meta. Safe to call whether or not WooCommerce is active — returns null
3342 3343 * when WooCommerce (or the order) is unavailable, and the caller keeps
3343 3344 * its un-hydrated base row.
3344 3345 *
3345 - * Dates are returned as site-local `Y-m-d H:i:s` strings — the same shape
3346 - * as the transactions table's `payment_date` — so the React admin formats
3347 - * them with the one date helper it already has.
3346 + * Dates are returned as site-local `Y-m-d H:i:s` strings (the subscription
3347 + * filter compares `start_date` in site time), and the React admin renders
3348 + * them as wall-clock times with `formatDateCompact()`. Note the transactions
3349 + * table's `payment_date` is different: it is stored in UTC and rendered with
3350 + * `formatDateTime()`, which converts it to the site timezone.
3348 3351 *
3349 3352 * @param int $subscription_id Parent (subscription) order id.
3350 3353 * @return array|null
3351 3354 * @since 2.4.0