add default values to merchantCity and merchantName params
This commit is contained in:
parent
95067dfca5
commit
69d0c95adf
@ -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,
|
||||
|
@ -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 = () => {
|
||||
>
|
||||
<img v-if="qrCode != ''" :src="qrCode" alt="QR code image" />
|
||||
<div>
|
||||
<span class="text-black font-semibold mr-1">Chave pixModel:</span>
|
||||
<span class="text-black font-semibold mr-1">Chave pix:</span>
|
||||
<span class="text-gray-700">{{ pixModel.pixKey }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="pixModel.name.trim() != ''">
|
||||
<span class="text-black font-semibold mr-1"
|
||||
>Nome do Beneficiário:</span
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user