FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda, convertir a Fivewin
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Ayuda, convertir a Fivewin
Posted: Fri Aug 18, 2023 07:38 PM
Que tal a Todos
Ando con esto que me acaban de mandar
(De un banco de aqui en Mexico)
Code (fw): Select all Collapse
<html>
  <title>Cobro/Venta - M5G</title>
<body>
  <head><h1>Cobro/Venta</h1></head>
    <form action="http://localhost:8081/upay/" method="POST">
    <p style="font-family:'Courier New'">    
    <input type="hidden"    value="T060S000"    name="dcs_form">
    Monto............:
    <input value="11.00"    name="trn_amount"><br>        
    Pago Directo/MSI.:
    <input value="1"        name="trn_qty_pay"><br>
    Moneda (MXN: 484):
    <input value="484"      name="trn_cur_id1"><br>
    <input type="hidden"    value="http://www.google.com.mx/"  name="dcs_reply_get">
    <input type="submit">
    </p>
    </form>
</body>
</html>
Alguien me puede echar la mano para hacerlo en Fivewin?

Gracias.
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Ayuda, convertir a Fivewin
Posted: Sat Aug 19, 2023 03:25 PM
¿Qué quieres hacer es esto? Explicar con más detalle.

https://imgur.com/kks0ko0



Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1144
Joined: Mon Feb 05, 2007 07:15 PM
Re: Ayuda, convertir a Fivewin
Posted: Sat Aug 19, 2023 06:25 PM
es un método POST xHarbour
hay que saber al momento de darle enviar como se compone la URL
aquí un ejemplo de como se realiza el método POST
Code (fw): Select all Collapse
LOCAL cUrl := "http://localhost:8081/upay/"
LOCAL cHttps   := cUrl
LOCAL hJson := {=>}
LOCAL hResult := {=>}
LOCAL cResp := ""
hJson["trn_amount"] := 11.00
hJson["trn_qty_pay"] := "1"
hJson["trn_cur_id1"] := 484.00
cJson := hb_jsonencode( hJson )

? cJson
Try
   oHttp := CreateObject("winhttp.winhttprequest.5.1")
   oHttp:Open("POST", cHttps ,.f.)
   oHttp:SetRequestHeader("Content-Type","application/json")
   oHttp:Send( cJson )

   cResp := oHttp:ResponseText()
   ? "resp", cResp
   hb_jsondecode( cResp, @hResult )
      ? hResult["trn_cur_id1"]

Catch
      MsgStop( "Error" )
      Return cResp
END
SALUDOS !
Cesar Cortes Cruz

SysCtrl Software

Mexico



' Sin +- FWH es mejor "

Continue the discussion