<% End Sub
'##########################################################################################################
'--> FIM SUB mostra_campos_cartao
'########################################################################################################
'========================================================================================================
'########################################################################################################
'FUNCTION GerarTid_VBV
' - Funcao responsável for formatar o Transaction ID (TID) para transações da modalidade VBV da Visa
' - Função chamada no arquivo inicia_transacao.asp
'##########################################################################################################
Function GerarTid_VBV(shopid,pagamento)
if len(shopid)<> 10 then
response.write("Tamanho do shopid deve ser 10 dígitos")
exit function
else
if not isnumeric(shopid) then
response.write("Shopid deve ser numérico")
exit function
end if
end if
shopid = mid(shopid,5,5)
if len(pagamento)<> 4 then
response.write("Tamanho do código de pagamento deve ser 4 dígitos.")
exit function
end if
if not isnumeric(frequencia) then
response.write("Frequência deve ser numérica")
exit function
end if
'Hora Minuto Segundo e Décimo de Segundo
hora=right("00" & hour(time),2)
minuto=right("00" & minute(time),2)
segundo=right("00" & second(time),2)
'Na falta do décimo de segundo "d", utilizar função "proximo"
hhmmssd=hora&minuto&segundo&proximo
'Obter Data Juliana
d0=DateSerial (year(date), "1", "1")
datajuliana=right("000" & (Date - d0 + 1),3)
'obter último dígito do ano
ano = right(year(date()),1)
'Formatar Tid
GerarTid_VBV=shopid&ano&datajuliana&hhmmssd&pagamento
End Function
'##########################################################################################################
'--> FIM FUNCTION GerarTid_VBV
'########################################################################################################
'========================================================================================================
'########################################################################################################
'FUNCTION GerarTid_MOSET
' - Funcao responsável for formatar o Transaction ID (TID) para transações da modalidade MOSET da Visa
' - Função chamada no arquivo inicia_transacao.asp
'##########################################################################################################
Function GerarTid_MOSET(shopid,pagamento)
If len(shopid)<> 10 Then
Response.write("Tamanho do shopid deve ser 10 dígitos")
Exit Function
Else
If Not isnumeric(shopid) Then
Response.write("Shopid deve ser numérico")
Exit Function
End If
End If
If len(pagamento)<> 4 Then
Response.write("Tamanho do código de pagamento deve ser 4 dígitos.")
Exit Function
End If
'Número da Maquineta
shopid_formatado=mid(shopid,4,6)
'Hora Minuto Segundo e Décimo de Segundo
hora=right("00" & hour(time),2)
minuto=right("00" & minute(time),2)
segundo=right("00" & second(time),2)
'Na falta do décimo de segundo "d", utilizar função "proximo"
hhmmssd=hora&minuto&segundo&proximo
'Obter Data Juliana
d0=DateSerial (year(date), "1", "1")
datajuliana=right("000" & (Date - d0 + 1),3)
'Formatar Tid
GerarTid_MOSET=shopid_formatado&datajuliana&hhmmssd&pagamento
End Function
'##########################################################################################################
'--> FIM FUNCTION GerarTid_MOSET
'########################################################################################################
'========================================================================================================
'########################################################################################################
'FUNCTION proximo
' - Funcao responsável por garantir que o Transaction ID (TID) não sejam repetidos numa compra simultanea
' - Função chamada no arquivo funcoes_cartao.asp
'##########################################################################################################
function proximo
if application("dc")=9 then
application("dc")=0
else
application("dc")=application("dc")+1
end if
proximo=application("dc")
end function
'##########################################################################################################
'--> FIM FUNCTION proximo
'########################################################################################################
'========================================================================================================
'########################################################################################################
'SUB exibe_dados_pagamento
' -
' -
'##########################################################################################################
Sub exibe_dados_pagamento(FCTforma_pagamento,FCTvalor_total,FCTvalor_Cambio)
'Abre conexao ao XML dos meios de pagto.
Call abre_ArquivoXML(Application("XMLMeiosPagamentos"),FctobjXML,FctobjRoot)
' Monta o valor total do pedido com a taxa de cambio
varValor_TotalExib = FCTvalor_total*FatorCambio(FCTvalor_Cambio)
Set configuracao = FctobjRoot.selectSingleNode("configuracao/pagto[@nome_pagto='"& FCTforma_pagamento &"']")
'Para pagamento pelo REDECARD (Diners ou Mastercard)
IF (FCTforma_pagamento = "Mastercard") OR (FCTforma_pagamento = "Diners") THEN
If configuracao.getAttribute("permite_parcelamento") = "sim" Then
%>
<%=Application("FcartTxtTitDadosCobranca")%>
<% If FCTforma_pagamento = "Mastercard" Then %>
<% Else %>
<% End If %>
<%
Else
%>
<%
End If
'Para pagamento pelo VISA
ELSEIF (FCTforma_pagamento = "Amex") THEN
If configuracao.getAttribute("permite_parcelamento") = "sim" Then
%>
<%
Else
%>
<%
End If
'Para pagamento pelo VISA
ELSEIF (FCTforma_pagamento = "Visa") OR (FCTforma_pagamento = "VisaElectron") THEN
If configuracao.getAttribute("permite_parcelamento") = "sim" Then
%>
<%
END IF
'Fecha conexao ao XML dos meios de pagto.
Call fecha_ArquivoXML(Application("XMLMeiosPagamentos"),FctobjXML,FctobjRoot)
End Sub
'########################################################################################################
'--> FIM SUB exibe_dados_pagamento
'########################################################################################################
%>