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.