8000 Fall back to charge metdata order_id when missing order metadata charge_id by htdat · Pull Request #10476 · Automattic/woocommerce-payments · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fall back to charge metdata order_id when missing order metadata charge_id #10476

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions includes/wc-payment-api/class-wc-payments-api-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2564,9 +2564,16 @@ private function get_order_info_from_intention_object( $intention_id ) {
* @return array
*/
private function add_order_info_to_charge_object( $charge_id, $object ) {
$order = $this->wcpay_db->order_from_charge_id( $charge_id );
$object = $this->add_order_info_to_object( $order, $object );
$order = $this->wcpay_db->order_from_charge_id( $charge_id );
if ( false === $order && isset( $object['metadata'] ) ) {
// Try to find the order_id from the charge metadata.
$order_id = $object['metadata']['order_id'] ?? null;
if ( $order_id ) {
$order = $this->wcpay_db->order_from_order_id( $order_id );
}
}

$object = $this->add_order_info_to_object( $order, $object );
return $object;
}

Expand Down
Loading
0