Skip to content

Commit

Permalink
Added cart_hash key to webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
plance committed Nov 26, 2024
1 parent 36f0d52 commit 09b93d0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Yes. <a href="https://stape.io/blog/how-to-set-up-facebook-conversion-api">How t

= 2.1.24 =
* Added Order paid completed webhook
* Added cart_hash key to webhooks

= 2.1.23 =
* Fix purchase event
Expand Down
1 change: 1 addition & 0 deletions includes/class-gtm-server-side-webhook-completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function woocommerce_order_status_completed( $order_id ) {

$request = array(
'event' => 'order_completed',
'cart_hash' => $order->get_cart_hash(),
'ecommerce' => array(
'transaction_id' => esc_attr( $order->get_order_number() ),
'affiliation' => '',
Expand Down
1 change: 1 addition & 0 deletions includes/class-gtm-server-side-webhook-processing.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function woocommerce_order_status_processing( $order_id ) {

$request = array(
'event' => 'order_paid',
'cart_hash' => $order->get_cart_hash(),
'ecommerce' => array(
'transaction_id' => esc_attr( $order->get_order_number() ),
'affiliation' => '',
Expand Down
1 change: 1 addition & 0 deletions includes/class-gtm-server-side-webhook-purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function woocommerce_new_order( $order_id, $order ) {

$request = array(
'event' => 'purchase',
'cart_hash' => $order->get_cart_hash(),
'ecommerce' => array(
'transaction_id' => esc_attr( $order->get_order_number() ),
'affiliation' => '',
Expand Down
1 change: 1 addition & 0 deletions includes/class-gtm-server-side-webhook-refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function woocommerce_order_refunded( $order_id, $refund_id ) {

$request = array(
'event' => 'refund',
'cart_hash' => $order->get_cart_hash(),
'ecommerce' => array(
'transaction_id' => esc_attr( $order->get_order_number() ),
'value' => GTM_Server_Side_WC_Helpers::instance()->formatted_price( $order->get_total() ),
Expand Down

0 comments on commit 09b93d0

Please sign in to comment.