#Change event data?

4 messages · Page 1 of 1 (latest)

viral burrow
#

Hi there - I'm currently trying to finish up my Sendgrid integration with my medusa site. All is working well, but medusa's money amounts are always in integers, i.e. x100 from what the user would need to see.

For example, if someone has spent £2.00, that would show as 200.

The issue I'm having is that on Sendgrid you can't do any js to handle this. On the frontend this has been fine as I just /100, but on Sendgrid I'm not able to.

I'm instead thinking the best way is to change the data emitted in the events sent to Sendgrid, so that the amounts are already divided by 100.

Where or how would I do that?

spare ridge
#

There are amounts transformed to correct ones with currency. Check the event data. There should be for example

  "tax_total": "4.00 USD",
  "total": "24.00 USD",
  "subtotal": "24.00 USD",
  "shipping_total": "0.00 USD",

Check the order placed example data: https://docs.medusajs.com/add-plugins/sendgrid/#order-placed

viral burrow
#

oh thank you, I'll check that again