Skip to content

Conversation

@wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Sep 29, 2025

Base PR #4613
P2 peNR48-1Jc-p2

Changes proposed in this Pull Request:

As part of the Order Helper class project, I am including some additional meta keys to be handled by the new class and implementing the new methods across our codebase.

The metas handled here are: _stripe_customer_id, _stripe_card_id, _stripe_upe_payment_type, _stripe_upe_waiting_for_redirect, and _stripe_upe_redirect_processed.

Testing instructions

  • Code review
  • Check if the tests are still passing
  • Perform some basic smoke testing to confirm no regression was introduced

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa requested review from a team, annemirasol and malithsen and removed request for a team October 1, 2025 17:53
@wjrosa wjrosa marked this pull request as ready for review October 1, 2025 17:53
@wjrosa wjrosa requested review from a team and daledupreez and removed request for a team and annemirasol October 6, 2025 11:52
Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some feedback, based mostly on the naming, but there are one or two other areas that may drive changes. I'll dive into testing after confirming we don't plan to make any changes.

* @param string $payment_type
* @return false|void
*/
public function update_stripe_upe_payment_type( ?WC_Order $order = null, string $payment_type = '' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question on the types: might we expect instances of WC_Order_Refund to be supplied to any of these helper methods? If so, we might want to loosen the types to accept ?WC_Abstract_Order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code, I don't think so. I don't see any references to WC_Order_Refund in the flows where this method is called. But happy to make this change if you think it is safer 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my side, I was mostly flagging it as a possible concern. I don't know the full codebase well enough to know what objects we expect, so having the strict type might be a subtle compatibility issue. Using WC_Abstract_Order would be less likely to break, even if we never see a refund or similar, while the slightly more restrictive type would throw an exception for an unexpected object.

Maybe this is something we should tackle in a separate, dedicated follow-up if we decide to make any changes.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM, and the tests are clean, so I think we should 🚢 .

Copy link
Contributor

@malithsen malithsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These updates look good to me, and smoke tests didn't reveal any issues.

@wjrosa wjrosa enabled auto-merge (squash) October 14, 2025 20:08
@wjrosa wjrosa merged commit 494341e into develop Oct 14, 2025
40 checks passed
@wjrosa wjrosa deleted the dev/handling-more-stripe-order-metas branch October 14, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants