hotfix(paypal): create new payment session if update fails (#186)

This commit is contained in:
Sebastian Rindom
2021-02-26 13:13:28 +01:00
committed by GitHub
parent dc75b9e983
commit 1b7fa59bf7
2 changed files with 6 additions and 1 deletions

View File

@@ -30,6 +30,11 @@ export default async (req, res) => {
const purchaseUnit = order.purchase_units[0]
const cartId = purchaseUnit.custom_id
if (!cartId) {
res.sendStatus(200)
return
}
const manager = req.scope.resolve("manager")
const cartService = req.scope.resolve("cartService")
const orderService = req.scope.resolve("orderService")

View File

@@ -206,7 +206,7 @@ class PayPalProviderService extends PaymentService {
return sessionData
} catch (error) {
throw error
return this.createPayment(cart)
}
}