Skip to content

Commit

Permalink
metadata, referral, loyalty should be cast as object
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnDB committed Jun 15, 2022
1 parent 996db33 commit ba60695
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CustomEvents.php
Original file line number Diff line number Diff line change
@@ -37,15 +37,15 @@ public function track($event, $customer, $metadata = null, $referral = null, $lo
];

if ($metadata) {
$params['metadata'] = $metadata;
$params['metadata'] = (object)$metadata;
}

if ($referral) {
$params['referral'] = $referral;
$params['referral'] = (object)$referral;
}

if ($loyalty) {
$params['loyalty'] = $loyalty;
$params['loyalty'] = (object)$loyalty;
}

return $this->client->post("/events", $params);

0 comments on commit ba60695

Please sign in to comment.