Adds update payment + minor fixes
This commit is contained in:
@@ -603,19 +603,7 @@ class OrderService extends BaseService {
|
||||
provider_id
|
||||
)
|
||||
|
||||
const captureData = await paymentProvider.capturePayment(data)
|
||||
|
||||
// If Adyen is used as payment provider, we need to check the
|
||||
// validity of the capture request
|
||||
if (
|
||||
captureData.data.pspReference &&
|
||||
captureData.data.response !== "[capture-received]"
|
||||
) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.INVALID_ARGUMENT,
|
||||
"Could not process capture"
|
||||
)
|
||||
}
|
||||
await paymentProvider.capturePayment(data)
|
||||
|
||||
return this.orderModel_
|
||||
.updateOne(
|
||||
|
||||
@@ -30,14 +30,6 @@ class OrderSubscriber {
|
||||
await this.customerService_.addAddress(order.customer_id, address)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("order.placed", async order => {
|
||||
await this.cartService_.delete(order.cart_id).catch(err => {
|
||||
if (err.type !== "not_found") {
|
||||
throw err
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("order.placed", this.handleDiscounts)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user