Skip to content

Commit

Permalink
fix: Report purchase events to mParticle when bundling ecommerce data
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Oct 4, 2024
1 parent f0cfe2e commit 9809c25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BrazeKit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ var constructor = function () {
quantity,
eventAttributes
);

return reportEvent;
}

function logPurchaseEventPerProduct(event) {
Expand Down
3 changes: 3 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,7 @@ user.getUserIdentities is not a function,\n`;
baz: 'bar',
};

debugger;
mParticle.forwarder.process({
EventName: 'eCommerce - Purchase',
EventDataType: MessageType.Commerce,
Expand Down Expand Up @@ -1832,6 +1833,8 @@ user.getUserIdentities is not a function,\n`;
var purchaseEventProperties = window.braze.purchaseEventProperties[0];

purchaseEventProperties.should.eql(expectedPurchaseEvent);

reportService.event.should.be.ok();
});

it('should call changeUser and openSession on init with userIdentificationType MPID passed in forwarding settings', function() {
Expand Down

0 comments on commit 9809c25

Please sign in to comment.