Do not sent order in approve response

This commit is contained in:
Alex P 2023-05-31 16:15:19 +03:00
parent 43594105a2
commit 508fe0ee48
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 3 additions and 3 deletions

View file

@ -93,7 +93,7 @@ const PayPalComponent = ({
throw new Error(config.scriptData.labels.error.generic)
}
const order = json.data;
const order = await actions.order.get();
setPaypalOrder(order);

View file

@ -180,7 +180,7 @@ class ApproveOrderEndpoint implements EndpointInterface {
);
}
$this->session_handler->replace_order( $order );
wp_send_json_success( $order->to_array() );
wp_send_json_success();
}
if ( $this->order_helper->contains_physical_goods( $order ) && ! $order->status()->is( OrderStatus::APPROVED ) && ! $order->status()->is( OrderStatus::CREATED ) ) {
@ -198,7 +198,7 @@ class ApproveOrderEndpoint implements EndpointInterface {
$this->session_handler->replace_funding_source( $funding_source );
$this->session_handler->replace_order( $order );
wp_send_json_success( $order->to_array() );
wp_send_json_success();
return true;
} catch ( Exception $error ) {
$this->logger->error( 'Order approve failed: ' . $error->getMessage() );