PK

ADDRLIN : /HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/
FLL :
Current File : //HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/pagos_runIPN.asp

<!--#include file="includes/openconn.asp" -->

<!--#include file="includes/checkadmin3.asp" -->

<!--#include file="lib\mercadopago.asp"-->
<!--#include file="lib\json2.asp"-->
<%      Dim payment_info
 
        payment_info = request("ipn_info")

        Response.write( "<br>" & payment_info & "<br><br>")

        Dim objJSON,retJSON 

        Set objJSON = JSON
        Set retJSON = objJSON.parse(join(array(payment_info)))

        Response.write( " **** DECODE JSON **** <BR><BR> ")
        Response.write( " - id :" & retJSON.collection.id  & "<br>"  )
        Response.write( " - external_reference :" & retJSON.collection.external_reference  & "<br>" )
        Response.write( " - status : " & retJSON.collection.status  & "<br>"  )
        Response.write( " - payment_type : " & retJSON.collection.payment_type  & "<br>"  )

		rs.open "SELECT * FROM Mercadopago_ipn WHERE idipn = " & request("idipn"),conn,2,2
		rs.movefirst
	
		if retJSON.collection.external_reference <> "" then
			rs("xidpedido") = retJSON.collection.external_reference
			response.Write("IDIPN : " & rs("idipn") & " - " & "IDPEDIDO : " & rs("xidpedido") & " - " & retJSON.collection.status)
		end if	
		
		rs.update
		rs.close

		if retJSON.collection.status = "approved" then
			rs.open "SELECT * FROM Pedidos WHERE idpedido = " & retJSON.collection.external_reference,conn,2,2
			rs.movefirst
		
			rs("xidpe") = 2
			
			rs.update
			rs.close
		end if
%>
<!--#include file="includes/closeconn.asp" -->





PK 99