Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 22
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2014
    Messaggi
    47

    Implementazione Gestapay

    Buongiorno
    sto implementando Gestapay sul mio sito
    Ho inserito i parametri richiesti per fare un test con account prova
    ma mi da errore questo è lo script
    codice:
    <%
    Dim XML_SendData
    Dim CryptString
    
    'XML data
    'all the commented nodes are optional, remove the comments if you need to send those 
    
    XML_SendData = "<?xml version=""1.0"" encoding=""utf-8""?>"
    XML_SendData = XML_SendData & "<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">"
    XML_SendData = XML_SendData & " <soap12:Body>"
    XML_SendData = XML_SendData & " <Encrypt xmlns=""https://ecomm.sella.it/"">"
    XML_SendData = XML_SendData & " <shopLogin>GESPAY12345</shopLogin>" 'your Merchant code ex. GesPayXXXXXXX 
    XML_SendData = XML_SendData & " <uicCode>242/uicCode>" 'Currency code ex. 242 for Euro 
    XML_SendData = XML_SendData & " <amount><'%=tot%'></amount>" 'the amount ex. 0.05 
    'XML_SendData = XML_SendData & " <shopTransactionId>string</shopTransactionId>" 'your ShopTransactionID 
    'XML_SendData = XML_SendData & " <cardNumber>string</cardNumber>"
    'XML_SendData = XML_SendData & " <expiryMonth>string</expiryMonth>"
    'XML_SendData = XML_SendData & " <expiryYear>string</expiryYear>"
    'XML_SendData = XML_SendData & " <buyerName>string</buyerName>"
    'XML_SendData = XML_SendData & " <buyerEmail>string</buyerEmail>"
    'XML_SendData = XML_SendData & " <languageId>string</languageId>"
    'XML_SendData = XML_SendData & " <cvv>string</cvv>"
    'XML_SendData = XML_SendData & " <customInfo>string</customInfo>"
    XML_SendData = XML_SendData & " </Encrypt>"
    XML_SendData = XML_SendData & " </soap12:Body>"
    XML_SendData = XML_SendData & "</soap12:Envelope>"
    
    
    
    
    Set xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
    Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
    'Production code
    xmlHTTP.open "POST", "https://testecomm.sella.it/gestpay/gestpayws/WSCryptDecrypt.asmx", false 
    xmlHTTP.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
    xmlHTTP.send XML_SendData
    
    
    strStatus = xmlHTTP.Status
    strRetval = xmlHTTP.responseText
    
    xmlDoc.loadxml(xmlHTTP.responseText)
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").item(0).text
    TransactionResult= xmlDoc.getElementsByTagName("TransactionResult").item(0).text
    ErrorCode= xmlDoc.getElementsByTagName("ErrorCode").item(0).text
    ErrorDescription= xmlDoc.getElementsByTagName("ErrorDescription").item(0).text
    if ErrorCode = 0 then
    EncryptedString = xmlDoc.getElementsByTagName("CryptDecryptString").item(0).text
    end if 
    
    
    Set xmlHTTP = nothing
    Set xmlDoc = nothing
    
    
    if ErrorCode = 0 then
    %>
    
    <form action="https://testecomm.sella.it/gestpay/Pagam.asp">
    <!   for test codes change action to testecomm.sella.it  >
    <input type="hidden" name="a" value="<=GESPAY12345>"> <input type="hidden" name="b" value="<%=EncryptedString%>"> <input type="submit" name="Submit" value="Accedi alla pagina di pagamento"> </form> <%else %> <h3>An Error has occurred:</h3> <% response.write "ErrorCode: " & ErrorCode & "<br>"
    response.write "ErrorDescription: " & ErrorDescription & "<br>"
    end if%> 
    
    
    decryp
    
    <%
    
    
    'Decript
    
    
    Dim EncString 
    
    
    'Encrypted string to decrypt
    
    
    EncString = request("b")
    ShopLogin = request("a")
    
    
    'Decript
    questo è l'errore
    Microsoft VBScript runtime error '800a01a8'
    Object required: 'xmlDoc.getElementsByTagName(...).item(...)'
    /esempio.asp, line 42

    questa è òa stringa
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").ite m(0).text

    Grazie
    Ultima modifica di ghis65; 18-11-2017 a 15:22

  2. #2
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    588

    verifica campo tot

    Quote Originariamente inviata da ghis65 Visualizza il messaggio
    Buongiorno
    sto implementando Gestapay sul mio sito
    Ho inserito i parametri richiesti per fare un test con account prova
    ma mi da errore questo è lo script
    codice:
    <%
    Dim XML_SendData
    Dim CryptString
    
    'XML data
    'all the commented nodes are optional, remove the comments if you need to send those 
    
    XML_SendData = "<?xml version=""1.0"" encoding=""utf-8""?>"
    XML_SendData = XML_SendData & "<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">"
    XML_SendData = XML_SendData & " <soap12:Body>"
    XML_SendData = XML_SendData & " <Encrypt xmlns=""https://ecomm.sella.it/"">"
    XML_SendData = XML_SendData & " <shopLogin>GESPAY12345</shopLogin>" 'your Merchant code ex. GesPayXXXXXXX 
    XML_SendData = XML_SendData & " <uicCode>242/uicCode>" 'Currency code ex. 242 for Euro 
    XML_SendData = XML_SendData & " <amount><'%=tot%'></amount>" 'the amount ex. 0.05 
    'XML_SendData = XML_SendData & " <shopTransactionId>string</shopTransactionId>" 'your ShopTransactionID 
    'XML_SendData = XML_SendData & " <cardNumber>string</cardNumber>"
    'XML_SendData = XML_SendData & " <expiryMonth>string</expiryMonth>"
    'XML_SendData = XML_SendData & " <expiryYear>string</expiryYear>"
    'XML_SendData = XML_SendData & " <buyerName>string</buyerName>"
    'XML_SendData = XML_SendData & " <buyerEmail>string</buyerEmail>"
    'XML_SendData = XML_SendData & " <languageId>string</languageId>"
    'XML_SendData = XML_SendData & " <cvv>string</cvv>"
    'XML_SendData = XML_SendData & " <customInfo>string</customInfo>"
    XML_SendData = XML_SendData & " </Encrypt>"
    XML_SendData = XML_SendData & " </soap12:Body>"
    XML_SendData = XML_SendData & "</soap12:Envelope>"
    
    
    
    
    Set xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
    Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
    'Production code
    xmlHTTP.open "POST", "https://testecomm.sella.it/gestpay/gestpayws/WSCryptDecrypt.asmx", false 
    xmlHTTP.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
    xmlHTTP.send XML_SendData
    
    
    strStatus = xmlHTTP.Status
    strRetval = xmlHTTP.responseText
    
    xmlDoc.loadxml(xmlHTTP.responseText)
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").item(0).text
    TransactionResult= xmlDoc.getElementsByTagName("TransactionResult").item(0).text
    ErrorCode= xmlDoc.getElementsByTagName("ErrorCode").item(0).text
    ErrorDescription= xmlDoc.getElementsByTagName("ErrorDescription").item(0).text
    if ErrorCode = 0 then
    EncryptedString = xmlDoc.getElementsByTagName("CryptDecryptString").item(0).text
    end if 
    
    
    Set xmlHTTP = nothing
    Set xmlDoc = nothing
    
    
    if ErrorCode = 0 then
    %>
    
    <form action="https://testecomm.sella.it/gestpay/Pagam.asp">
    <!   for test codes change action to testecomm.sella.it  >
    <input type="hidden" name="a" value="<=GESPAY12345>"> <input type="hidden" name="b" value="<%=EncryptedString%>"> <input type="submit" name="Submit" value="Accedi alla pagina di pagamento"> </form> <%else %> <h3>An Error has occurred:</h3> <% response.write "ErrorCode: " & ErrorCode & "<br>"
    response.write "ErrorDescription: " & ErrorDescription & "<br>"
    end if%> 
    
    
    decryp
    
    <%
    
    
    'Decript
    
    
    Dim EncString 
    
    
    'Encrypted string to decrypt
    
    
    EncString = request("b")
    ShopLogin = request("a")
    
    
    'Decript
    questo è l'errore
    Microsoft VBScript runtime error '800a01a8'
    Object required: 'xmlDoc.getElementsByTagName(...).item(...)'
    /esempio.asp, line 42

    questa è òa stringa
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").ite m(0).text

    Grazie
    non conosco gestapay ma controlla la riga
    codice:
    <amount><'%=tot%'></amount>" 'the amount ex. 0.05  
    ...     '<%=tot%>'</amount>
    Vic53

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2014
    Messaggi
    47
    Grazie vic53
    se modifico come hai indicato mi dà questo errore
    codice:
    Microsoft VBScript compilation  error '800a0409' 
     Unterminated string constant 
     /esempio.asp, line 14 
    XML_SendData = XML_SendData & " <amount>'<%=tot
    -----------------------------------------------^t
    lasciandolo come prima mi continua a dare questo errore e non capisco come risolverlo.
    se hai idee al riguardo.
    codice:
    Microsoft VBScript runtime  error '800a01a8' 
     Object required: 'xmlDoc.getElementsByTagName(...).item(...)' 
     /esempio.asp, line 42
    
    questa è la stringa
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").ite  m(0).text
    Quote Originariamente inviata da vic53 Visualizza il messaggio
    non conosco gestapay ma controlla la riga
    codice:
    <amount><'%=tot%'></amount>" 'the amount ex. 0.05  
    ...     '<%=tot%>'</amount>
    Ultima modifica di ghis65; 24-11-2017 a 14:33

  4. #4
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,649
    vic53 intendeva dire che questa riga è abbastanza strana:
    codice:
    XML_SendData = XML_SendData & " <amount><'%=tot%'></amount>" 'the amount ex. 0.05
    i due apici nella varialile asp sono fuori luogo, prova così:
    codice:
    XML_SendData = XML_SendData & " <amount><%=tot%></amount>" 'the amount ex. 0.05

  5. #5
    Utente di HTML.it
    Registrato dal
    Feb 2014
    Messaggi
    47
    Grazie Vincent
    Cambiandolo come mi ha scritto la risposta è sempre questa
    codice:
    Microsoft VBScript compilation  error '800a0409' 
     Unterminated string constant 
     /esempio.asp, line 14 
    XML_SendData = XML_SendData & " <amount><%=tot
    ----------------------------------------------^

  6. #6
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,649
    ok, non so come funzioni quel foglio ma pare voglia valori in chiaro: sostituisci la variabile con un valore fisso (del resto l'esempio riporta solo valori fissi)
    anzi... che valore avevi inserito nella variabile, giusto per sapere....

  7. #7
    Utente di HTML.it
    Registrato dal
    Feb 2014
    Messaggi
    47
    Ho già provato Vincent. Sempre uguale.
    torna sempre lo stesso errore
    Il valore è il totale del carrello.
    codice:
    <% PrezzoTotale=0
    for i=0 to ubound(ScontrinoPrezzoArticolo)
    PrezzoTotale=PrezzoTotale+(ScontrinoPrezzoArticolo(i) * ScontrinoQuantitativoArticolo(i))
    next
    tot=replace (FormatNumber((SpeseDiSpedizione + Importo), 2, -1, 0, -1), ",", ".") %>
    se lo metto cosi
    codice:
    XML_SendData = XML_SendData & " <amount><'%=tot%'></amount>" 'the amount ex. 0.05
    va ma mi da questo errore questa stringa
    codice:
    TransactionType= xmlDoc.getElementsByTagName("TransactionType").item(0).text
    ecco l' errore
    codice:
    Microsoft VBScript runtime  error '800a01a8' 
     Object required: 'xmlDoc.getElementsByTagName(...).item(...)' 
     /esempio.asp, line 42
    non capisco che Object chiede.

    con Paypal funziona. Con Gestpay da errore
    Ultima modifica di ghis65; 24-11-2017 a 15:53

  8. #8
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,649
    <'%=tot%'>
    non può funzionare in alcun caso....

  9. #9
    Utente di HTML.it
    Registrato dal
    Feb 2014
    Messaggi
    47
    si vero in Paypal lo uso senza apici...qui non funziona senza

  10. #10
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,649
    ti ho chiesto di provare con valori in chiaro, per provare e tentare di capire dove sta l'errore...
    non è possibile che ci siano apici tra < e %

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.