diff --git a/src/utils/QrCodePix.ts b/src/utils/QrCodePix.ts index 5981b47..633fa3e 100644 --- a/src/utils/QrCodePix.ts +++ b/src/utils/QrCodePix.ts @@ -4,8 +4,8 @@ import { crc16ccitt } from "crc"; interface PixParams { pixKey: string; - merchantCity: string; - merchantName: string; + merchantCity?: string; + merchantName?: string; value?: number; transactionId?: string; message?: string; @@ -16,8 +16,8 @@ interface PixParams { const pix = ({ pixKey, - merchantCity, - merchantName, + merchantCity = "city", + merchantName = "name", value, message, cep, diff --git a/src/views/QrCodeForm.vue b/src/views/QrCodeForm.vue index b5d4fcb..46e8463 100644 --- a/src/views/QrCodeForm.vue +++ b/src/views/QrCodeForm.vue @@ -29,8 +29,12 @@ const submit = () => { const pixQrCode = pix({ pixKey: pixModel.value.pixKey, - merchantName: pixModel.value.name, - merchantCity: pixModel.value.city, + merchantName: pixModel.value.name.trim() + ? pixModel.value.name + : "name", + merchantCity: pixModel.value.city.trim() + ? pixModel.value.city + : "city", transactionId: pixModel.value.transactionId.trim() ? pixModel.value.transactionId : "***", @@ -150,10 +154,10 @@ const submit = () => { > QR code image
- Chave pixModel: + Chave pix: {{ pixModel.pixKey }}
-
+
Nome do Beneficiário: