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 {
|
interface PixParams {
|
||||||
pixKey: string;
|
pixKey: string;
|
||||||
merchantCity: string;
|
merchantCity?: string;
|
||||||
merchantName: string;
|
merchantName?: string;
|
||||||
value?: number;
|
value?: number;
|
||||||
transactionId?: string;
|
transactionId?: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
@ -16,8 +16,8 @@ interface PixParams {
|
|||||||
|
|
||||||
const pix = ({
|
const pix = ({
|
||||||
pixKey,
|
pixKey,
|
||||||
merchantCity,
|
merchantCity = "city",
|
||||||
merchantName,
|
merchantName = "name",
|
||||||
value,
|
value,
|
||||||
message,
|
message,
|
||||||
cep,
|
cep,
|
||||||
|
@ -29,8 +29,12 @@ const submit = () => {
|
|||||||
|
|
||||||
const pixQrCode = pix({
|
const pixQrCode = pix({
|
||||||
pixKey: pixModel.value.pixKey,
|
pixKey: pixModel.value.pixKey,
|
||||||
merchantName: pixModel.value.name,
|
merchantName: pixModel.value.name.trim()
|
||||||
merchantCity: pixModel.value.city,
|
? pixModel.value.name
|
||||||
|
: "name",
|
||||||
|
merchantCity: pixModel.value.city.trim()
|
||||||
|
? pixModel.value.city
|
||||||
|
: "city",
|
||||||
transactionId: pixModel.value.transactionId.trim()
|
transactionId: pixModel.value.transactionId.trim()
|
||||||
? pixModel.value.transactionId
|
? pixModel.value.transactionId
|
||||||
: "***",
|
: "***",
|
||||||
@ -150,10 +154,10 @@ const submit = () => {
|
|||||||
>
|
>
|
||||||
<img v-if="qrCode != ''" :src="qrCode" alt="QR code image" />
|
<img v-if="qrCode != ''" :src="qrCode" alt="QR code image" />
|
||||||
<div>
|
<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>
|
<span class="text-gray-700">{{ pixModel.pixKey }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-if="pixModel.name.trim() != ''">
|
||||||
<span class="text-black font-semibold mr-1"
|
<span class="text-black font-semibold mr-1"
|
||||||
>Nome do Beneficiário:</span
|
>Nome do Beneficiário:</span
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user