Foros

 
ForumForumForos DNNForos DNNComercio Electr...Comercio Electr...Problemillas con pasarela de pago con tarjeta :)Problemillas con pasarela de pago con tarjeta :)
Anterior Anterior
 
Siguiente Siguiente
Nuevo Mensaje
 20/11/2009 8:39
 

Bueno pues parece que problemas de premisos no es, porque le he dado todos los permisos del mundo, y siguo obtniendo en sermepa: error 302 y por supuesto, sigue esto perdiendo la sesión :S

Nuevo Mensaje
 20/11/2009 12:01
 

Pues nada, ya funciona el IPN, era porque tenía un fallo el fichero ipn y por eso la pasarela recibia el error.

Lo que no consigo solucionar, es que pierdo la sesión de los usuarios!!! ¿alguien sabe a que se debe?? o como solucionarlo??? :(

Nuevo Mensaje
 20/11/2009 12:04
 

enhorabuena por el IPN, pero realmente no entiendo el motivo por el que puedes estar perdiendo la sesión, has probado a ejecutar en modo debug???

Quizás si adjuntas el archivo de código se pueda ver algo más...

Nuevo Mensaje
 23/11/2009 8:30
 
 Modificado por elijo_otroo  en 23/11/2009 9:35:55

Yo tampoco lo entiendo, lo único que he hecho ha sido elegir como pasarela de pago con tarjeta, la llamada "NAB", y luego, modificar un poco el código de NABCheckout.aspx.vb para que cuando se lance NABCheckout.aspx, pues el formulario que contrulla lleve mis parametros y mi direccion y eso. Y vamos, funcionar funciona, lo pone a pagado y eso, pero pierde la sesión :S

Adjunto fichero para que veas que no hago nada raro (o si! xD que 4 ojos ven mas que 2), puede que tenga algunos fallos si copiais el código al editor, pero es porque he quitado muchas de las cosas que tengo comentadas para que se mas facil de leer y lo mismo me he comido algo, pero funcionar, funciona =)

' ***********************************************************
' CATALooK.netStore - http://www.dnnsoft.com
' Copyright (c) 2003-2009 CATALooK Software Susanne Koehler
' support@dnnsoft.com
' ***********************************************************
Option Strict On

Imports DotNetNuke.Common
Imports DotNetNuke
Imports System.Globalization
Imports DotNetNuke.Entities.Users
Imports System.Collections.Specialized
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Web.Security


Namespace CATALooK

Public Class NABCheckout
Inherits Framework.PageBase

#Region " Vom Web Form Designer generierter Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

'CODEGEN: This method call is required by the Web Form Designer
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'This call is required by the Web Form Designer.
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim _StoreAdminInfo As New StoreAdminInfo(PortalSettings.PortalId)
Dim objUserInfo As UserInfo = UserProfileController.GetCurrentUserInfo(PortalSettings.PortalId)


Dim FieldCollection As New NameValueCollection
Dim key As String
Dim numero_pedido As String
Dim total_pedido As String

Dim Url As String = ""

With _StoreAdminInfo

If .CCAdditionalParameters <> "" Then
Dim selections() As String = Split(.CCAdditionalParameters, ControlChars.CrLf)
Dim i As Integer
Dim TotalIntervals As Integer = -1
Dim startdate As Date = ModuleUtils.CATNullDate
For i = 0 To selections.Length - 1
If selections(i) <> "" AndAlso selections(i).IndexOf("=") > -1 Then
Dim param() As String = selections(i).Split("="c)
Select Case param(0).ToLower
Case "url"
'Url = param(1)
Case Else
'FieldCollection.Add(param(0), param(1))
End Select
End If
Next
End If

If Url = "" OrElse .IsLicensed = False Then
Dim TestURL, ProdURL As String
TestURL = "https://sis-t.sermepa.es:25443/sis/realizarPago"
ProdURL = "https://sis-t.sermepa.es:25443/sis/realizarPago"
Url = Convert.ToString(IIf(.IsLicensed = False OrElse .CCTestMode, TestURL, ProdURL))
End If
End With

If Not Request.QueryString("OrderID") Is Nothing Then
'order, aqui es donde pruebo, al pulsar "pagar ahora" que hay junto a los pedidos en "Mis pedidos" y elegir tarjeta
Dim OrderID As Integer = Convert.ToInt32(Request.QueryString("OrderID"))

Dim orderHistory As OrdersDB = New OrdersDB
Dim storeprice As CATALooK.eStorePriceType = eStorePriceType.net 'deberia ser generico, pero al perder sesion no anda, igual con el 1
Dim myOrderDetails As OrderDetails = orderHistory.CAT_OrdersDetail(OrderID, storeprice, 1) ' _StoreAdminInfo.StorePriceType, PortalSettings.PortalId

FieldCollection.Add("Ds_Merchant_Amount", Int(Round(myOrderDetails.Total, 2) * 100).ToString)
total_pedido = Int(Round(myOrderDetails.Total, 2) * 100).ToString

FieldCollection.Add("Ds_Merchant_MerchantData", OrderID.ToString & "p" & PortalSettings.PortalId.ToString & "p" & "order")
numero_pedido = OrderID.ToString()

Else
'cart esto ni lo estoy probando
Dim cart As ShoppingCartDB = New ShoppingCartDB
' Calculate shopping cart ID
Dim cartId As String = cart.GetShoppingCartId()

Dim objCartPrice As New CartPriceInfo
Dim objCartPrices As New CartPriceController
objCartPrice = objCartPrices.GetCartPrice(objUserInfo.UserID, cart.GetShipToID(cartId), PortalSettings.PortalId)

FieldCollection.Add("Ds_Merchant_Amount", Int(Round(objCartPrice.CartTotal, 2) * 100).ToString)
total_pedido = Int(Round(objCartPrice.CartTotal, 2) * 100).ToString

FieldCollection.Add("Ds_Merchant_MerchantData", objUserInfo.UserID.ToString & "p" & PortalSettings.PortalId.ToString & "p" & "cart")
numero_pedido = cartId

End If

If numero_pedido.Length < 4 Then
If numero_pedido.Length = 1 Then
numero_pedido = "000" & numero_pedido
End If
If numero_pedido.Length = 2 Then
numero_pedido = "00" & numero_pedido
End If
If numero_pedido.Length = 3 Then
numero_pedido = "0" & numero_pedido
End If
End If

Dim strDatosFirma As String
Dim strFirma As String
Dim strClaveComercio As String = "qwertyasdf0123456789"

strDatosFirma = total_pedido & numero_pedido & "xxxxxxxxx" & "978" & "0" & "https://miweb/desktopmodules/CATALooKStore/ProxyPayIPN.aspx" & strClaveComercio ' & "http://www.sermepa.es"
strFirma = FormsAuthentication.HashPasswordForStoringInConfigFile(strDatosFirma, "sha1")


FieldCollection.Add("Ds_Merchant_Order", numero_pedido)
FieldCollection.Add("Ds_Merchant_Currency", "978")
FieldCollection.Add("Ds_Merchant_ProductDescription", "Compra en demo tienda")
FieldCollection.Add("Ds_Merchant_Titular", "Titular de la compra")
FieldCollection.Add("Ds_Merchant_MerchantURL", "https://miweb/desktopmodules/CATALooKStore/ProxyPayIPN.aspx")
FieldCollection.Add("Ds_Merchant_UrlOK", AddHTTP(GetDomainName(Request)) & "/tienda1")
FieldCollection.Add("Ds_Merchant_MerchantCode", "xxxxxxxxx")
FieldCollection.Add("Ds_Merchant_MerchantSignature", strFirma)
FieldCollection.Add("Ds_Merchant_Terminal", "1")
FieldCollection.Add("Ds_Merchant_TransactionType", "0")

Dim Method As String = "POST"
Dim FormName As String = "frmRemotePOST"

Response.Clear()
Response.Write("<html><head></head>")
Response.Write(String.Format("<body onload=""document.{0}.submit()"">", FormName))
Response.Write(String.Format("<form name=""{0}"" action=""{1}"" method=""{2}"">", FormName, Url, Method))

For Each key In FieldCollection.Keys
If FieldCollection(key) <> "" Then
Response.Write(String.Format("<input type=""hidden"" name=""{0}"" value=""{1}"">", key, FieldCollection(key)))
End If
Next

Response.Write("</form>")
Response.Write("</body></html>")

System.Web.HttpContext.Current.Response.End()

End Sub

End Class

End Namespace


Un saludo, y muchas gracias.

Nuevo Mensaje
 23/11/2009 8:46
 
 Modificado por elijo_otroo  en 23/11/2009 11:08:23

alaaaa ahora me reconoce parte del código y no me deja editar el mensaje anterior xD así que no puedo cambiar el palabrejo "contrulla" que duelen hasta los ojos, a construya :)

Y bueno, aclarar, que luego llamo a ProxyPayIPN.aspx de forma intencionada (y que ya funciona) pero que ese no tiene nada que ver con la sesion, porque ni siquiera se carga en el navegador, lo único que hace es tratar la respuesta del sermepa.

Un saludo.

Anterior Anterior
 
Siguiente Siguiente
ForumForumForos DNNForos DNNComercio Electr...Comercio Electr...Problemillas con pasarela de pago con tarjeta :)Problemillas con pasarela de pago con tarjeta :)

En total, tenemos 1098 nuevo(s) hilo(s) y 5265 nuevo(s) mensaje(s)
Los hilos más populares han estado en ¿por que?
Los hilos más activos han estado en no veo el portal desde los pc's de la red

Más activos


UserTotalPosts
jmaldonadom 1101
anonymous 798
javier 488
Faco 395
hiunkeru 184
vitolo 182
Guillaume 168
ccolonia 159
dormio 157
elijo_otroo 138
sonsai 84
Dreamvk 67
tirillos 48
vte_torres 47
oskr226 46

Últimos Mensajes...