Skip to content

Commit

Permalink
Add value to payment, fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlavtox committed Nov 6, 2023
1 parent 0f9abfe commit 9af1d3f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions classes/GoogleAnalyticsTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public function renderPurchaseEvent($orderProducts, $orderData, $callbackUrl)
}

$callbackData = [
'orderid' => $orderData['id'],
'orderid' => $orderData['transaction_id'],
'customer' => $orderData['customer'],
];

$eventData = [
'transaction_id' => (int) $orderData['id'],
'transaction_id' => (int) $orderData['transaction_id'],
'affiliation' => $orderData['affiliation'],
'value' => (float) $orderData['revenue'],
'value' => (float) $orderData['value'],
'tax' => (float) $orderData['tax'],
'shipping' => (float) $orderData['shipping'],
'currency' => $orderData['currency'],
Expand Down
1 change: 1 addition & 0 deletions classes/Hook/HookDisplayBackOfficeHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function processOrder($idOrder)
'add_payment_info',
[
'currency' => $orderData['currency'],
'value' => (float) $orderData['value'],
'payment_type' => $orderData['payment_type'],
'items' => $orderProducts,
]
Expand Down
1 change: 1 addition & 0 deletions classes/Hook/HookDisplayOrderConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function run()
'add_payment_info',
[
'currency' => $orderData['currency'],
'value' => (float) $orderData['value'],
'payment_type' => $orderData['payment_type'],
'items' => $orderProducts,
]
Expand Down
6 changes: 3 additions & 3 deletions classes/Wrapper/OrderWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public function wrapOrder($order)
$currency = new Currency((int) $order->id_currency);

return [
'id' => (int) $order->id,
'transaction_id' => (int) $order->id,
'affiliation' => Shop::isFeatureActive() ? $this->context->shop->name : Configuration::get('PS_SHOP_NAME'),
'revenue' => (float) $order->total_paid,
'value' => (float) $order->total_paid,
'shipping' => (float) $order->total_shipping,
'tax' => (float) $order->total_paid_tax_incl - $order->total_paid_tax_excl,
'customer' => (int) $order->id_customer,
'currency' => $currency->iso_code,
'payment_type' => (int) $order->payment,
'payment_type' => (string) $order->payment,
];
}
}

0 comments on commit 9af1d3f

Please sign in to comment.