Jelajahi Sumber

Merge branch 'feat/diaria-kay-fluxo-pos-pagamento-pix' of Softpar/sfp_front_vue_diarista_cliente into development

zntt 2 minggu lalu
induk
melakukan
af3e1f6919

+ 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

+ 10 - 3
src/components/dashboard/SchedulePaymentProcessingDialog.vue

@@ -72,10 +72,17 @@ onMounted(async () => {
     })
 
     if (payment.status !== 'paid') {
-      throw new Error(payment.failure_message || 'Pagamento não confirmado.')
-    }
+        throw new Error(payment.failure_message || 'Pagamento não confirmado.')
+      }
+
+      $q.notify({
+        type: 'positive',
+        message: 'Pagamento confirmado!',
+        position: 'top',
+      })
 
-    success.value = true
+      onDialogOK()
+      
   } catch (e) {
     console.error('Erro ao pagar:', e)