Implementacion Ticket Giftcards

You might also like

You are on page 1of 2

vModel.responsePayService.value?.

let { responsePay ->


vModel.dataGiftcards.value?.let { dataGiftCard ->
val section = vModel.viewConfig.value?.paymentService

val shareText =
if (section == "negocio_comunidad") "Compartir con mi cliente"
else "Compartir"

val buttonModel = if(section == "negocio_comunidad"){


BAPYButtonModel(
icon = R.drawable.gsvc_ic_action_share,
primaryText = shareText,
onClick = {finishFlow()},
type = GSVCButtonModel.Type.Detail
)
}else{
BAPYButtonModel(
icon = R.drawable.gsvc_ic_action_share,
primaryText = shareText
)
}

nextFragment(BAPYTicketFragment(BAPYPaymentTicketData(
dataAmount = GSVCAmountModel(
amountTicket = dataGiftCard.amount.toString(),
dateTicket = getDateAndTimeTicket(),
titleTicket = getString(R.string.success_pay),
type = GSVCAmountType.PESO,
location = ""
),

dataDescription = GSVCPurchaseDescription (
urlList =
mutableListOf(getModelInfoGiftCard(dataGiftCard.nombreComercial,
dataGiftCard.amount.toInt()).img),
productInfo =
getModelInfoGiftCard(dataGiftCard.nombreComercial,
dataGiftCard.amount.toInt()).desc,
caption = "$
{getString(R.string.gift_cards_operation_folio)} ${responsePay.dataPay?.idMove}",
),

dataCode = GSVCCodeModel(
link = getModelInfoGiftCard(dataGiftCard.nombreComercial,
dataGiftCard.amount.toInt()).webLink,
code = codigo,
description =
getString(R.string.gift_cards_copy_page_code),
message = getString(R.string.gift_cards_copied_code),
icon = R.drawable.ic_icons_system_actions_copy_off,
iconColor = GSVCSecondary200,
linkColor = GSVCSecondary100,
linkOnClick = {
val url =
getModelInfoGiftCard(dataGiftCard.nombreComercial,
dataGiftCard.amount.toInt()).webUrl
if (url.isNotEmpty()) {
startActivity(Intent(Intent.ACTION_VIEW,
Uri.parse(url)))
}
}
),

dataButton = buttonModel,
dataCard = listOf(
GSVCCardModel(
type = GSVCCardModel.Type.Informative,
onClick = {},
text1 = "${getString(R.string.gift_cards_sms_received)}
${
getPhoneFormat(BAPYOwnerUserModel.myPhone)
} con los pasos para canjear el código. Esto puede
tardar algunos minutos.",
icon = R.drawable.gsvc_ic_system_communication_timer_on
)
),

dataExit = GSVCExitModel(
primaryText = getString(R.string.gift_cards_exit)
) { finishFlow() },
onClickClose = { finishFlow() },
onClickShare = { }
)
)
)
}
}

You might also like