-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store balance transaction ID in order metadata #7945
Changes from 1 commit
f33af70
fbc8664
7f9fc28
1bf3da7
83d5af8
d73ab09
5f1a297
8c2f80f
1e58fcc
a7bef87
adc9a67
1f4681a
69c82bd
bb87366
4d9d729
e745e71
2af5d52
8022a4a
edd6872
16f83e8
d3d2655
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -773,12 +773,12 @@ public function get_fraud_meta_box_type_for_order( $order ) : string { | |
/** | ||
* Given the payment intent data, adds it to the given order as metadata and parses any notes that need to be added | ||
* | ||
* @param WC_Order $order The order. | ||
* @param WC_Payments_API_Abstract_Intention $intent The payment or setup intention object. | ||
* @param WC_Order $order The order. | ||
* @param WC_Payments_API_Payment_Intention|WC_Payments_API_Setup_Intention $intent The payment or setup intention object. | ||
* | ||
* @throws Order_Not_Found_Exception | ||
*/ | ||
public function attach_intent_info_to_order( WC_Order $order, WC_Payments_API_Abstract_Intention $intent ) { | ||
public function attach_intent_info_to_order( WC_Order $order, $intent ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. part of this method ( calling the setters and calling the save method) is identical to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with this, common code can be extracted to a separate function as part of this refactor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dpaun1985 @naman03malhotra Thanks for the feedback. I fixed the code duplication in a7bef87. In the long term, I think it's desirable to remove the legacy method and keep only the refactored one. This will allow us to care about only one method when adding new intent properties to order meta.
Unfortunately, I cannot change the name as I'd like my changes to apply to all uses of this method. |
||
// first, let's prepare all the metadata needed for refunds, required for status change etc. | ||
$intent_id = $intent->get_id(); | ||
$intent_status = $intent->get_status(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting Psalm UndefinedMethod linting error, so replaced the abstract class type hint with a list of possible concrete types. I wonder if there's a proper way to use abstract types as type hints without Psalm complaining.