Skip to content
Merged
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
3 changes: 2 additions & 1 deletion includes/mutation/class-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public static function mutate_and_get_payload() {
throw new UserError( $order_id->get_error_message( 'checkout-error' ) );
}

$order = \WC_Order_Factory::get_order( $order_id );

Choose a reason for hiding this comment

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

Avoid using static access to class '\WC_Order_Factory' in method 'mutate_and_get_payload'.

/**
* Action called after checking out.
*
Expand All @@ -158,7 +159,7 @@ public static function mutate_and_get_payload() {
* @param AppContext $context Request AppContext instance.
* @param ResolveInfo $info Request ResolveInfo instance.
*/
do_action( 'graphql_woocommerce_after_checkout', $order_id, $input, $context, $info );
do_action( 'graphql_woocommerce_after_checkout', $order, $input, $context, $info );

return array_merge( array( 'id' => $order_id ), $results );
} catch ( Exception $e ) {
Expand Down