medusa
medusa copied to clipboard
PaymentService not available for import in the event subscriber
I'm trying to use PaymentService.event.UPDATE in a subscriber. However I can't import it same way I can ProductService or OrderService. I'm not sure if that's a bug or documentation is wrong? PayementService: https://github.com/medusajs/medusa/blob/276278cbe7b3bb0367b8276589bc10f587240870/packages/medusa/src/services/payment.ts#L32
I am not sure I understand what you mean. Can I get you to elaborate?
You can reference these events in two ways 1) as a raw string or 2) using the static property (as you allude to).
.subscribe("payment.updated", ....)
.subscribe(PaymentService.Events.UPDATED, ....)
I tried using this example to make a subscriber: https://github.com/medusajs/medusa-starter-default/tree/master/src/subscribers for some reason when I try to replace ProductService with PaymentService it can not be done.