Pārlūkot izejas kodu

feat: :sparkles: feat(fluxo pos pagamento pix) Foi adicionado a notificação após confimação de pagamento do pix

Foi adicionado a notificação após confimação de pagamento do pix

fase:dev | origin:escopo
kayo henrique 3 nedēļas atpakaļ
vecāks
revīzija
621d78ac0f
1 mainītis faili ar 15 papildinājumiem un 9 dzēšanām
  1. 15 9
      src/components/dashboard/SchedulePaymentPixDialog.vue

+ 15 - 9
src/components/dashboard/SchedulePaymentPixDialog.vue

@@ -164,17 +164,23 @@ const stopPolling = () => {
 }
 
 const applyPaymentStatus = (nextPayment) => {
-  if (!nextPayment) return
+ if (nextPayment.status === 'paid') {
+  processing.value = false
 
-  payment.value = nextPayment
+  $q.notify({
+    type: 'positive',
+    message: 'Pagamento confirmado!',
+    position: 'top',
+  })
+
+  paymentStore.clearPixPaymentForServicePackage(itemId.value)
+  stopPolling()
+
+  onDialogOK()
+
+  return
+}
 
-  if (nextPayment.status === 'paid') {
-    success.value = true
-    processing.value = false
-    paymentStore.clearPixPaymentForServicePackage(itemId.value)
-    stopPolling()
-    return
-  }
 
   if (['failed', 'cancelled'].includes(nextPayment.status)) {
     processing.value = false