Преглед на файлове

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 седмици
родител
ревизия
621d78ac0f
променени са 1 файла, в които са добавени 15 реда и са изтрити 9 реда
  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