Merge branch 'integration/dummy-project' of github.com:medusajs/medusa into integration/dummy-project

This commit is contained in:
Sebastian Rindom
2020-07-10 12:26:02 +02:00
5 changed files with 105 additions and 22 deletions
@@ -0,0 +1,14 @@
class OrderSubscriber {
constructor({ klarnaProviderService, eventBusService }) {
this.klarnaProviderService_ = klarnaProviderService
this.eventBus_ = eventBusService
this.eventBus_.subscribe("order.completed", async (order) => {
const klarnaOrderId = order.payment_method.data.id
await this.klarnaProviderService_.acknowledgeOrder(klarnaOrderId)
})
}
}
export default OrderSubscriber