@pandait.tech/payment-nuvei 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -894,7 +894,8 @@ function createWebhookHandler(deps) {
894
894
  logger.log(
895
895
  `Webhook: Order ${orderId} \u2192 ${newStatus} (status_detail: ${transaction.status_detail})`
896
896
  );
897
- if (newStatus === "paid" && deps.onPaymentSucceeded) {
897
+ const transitionedToPaid = newStatus === "paid" && !finalStatuses.includes(currentStatus);
898
+ if (transitionedToPaid && deps.onPaymentSucceeded) {
898
899
  try {
899
900
  await deps.onPaymentSucceeded({ ...orderData, id: orderId });
900
901
  } catch (err) {