Last post Jan 06, 2016 06:31 AM by sudo10
Member
75 Points
318 Posts
Jan 05, 2016 09:12 AM|volar5|LINK
Hi all:
I have a paypal button. I try to test it in sandbox. My script is:
sbparametros.Append("cmd=_xclick") sbparametros.Append("&business=martin@cresolia.com") sbparametros.Append("&amount=" & importe_articulo("importe")) sbparametros.Append("&item_number=" & referencia_articulo()) sbparametros.Append("&item_name=" & nombre_articulo("nombre")) sbparametros.Append("&quantity=" & nombre_articulo("cantidad")) If trpuntos.Visible Then sbparametros.Append("&discount_amount=" & descuento_empresa()) sbparametros.Append("&tax=" & importe_articulo("iva")) sbparametros.Append("¤cy_code=EUR") sbparametros.Append("&lc=ES") sbparametros.Append("&return=" & poner_paypal_return()) sbparametros.Append("&cancel_return=" & poner_paypal_cancel_return()) sbparametros.Append("&no_shipping=1") sbparametros.Append("&cbt=" & GetGlobalResourceObject("rgeneral", "pulsarparacontinuarelpago")) 'Response.Redirect("https://www.paypal.com/cgi-bin/webscr?" & sbparametros.ToString) Response.Redirect("https://www.sandbox.paypal.com?" & sbparametros.ToString)
It goes of to paypal. But when it try to redirect my pages it goes to the same hank you page in paypal, doesn't redirect to my pages
What happens? Miss I anything? Maybe it is the call to Sandbox.
TIA
Contributor
7095 Points
1966 Posts
Jan 05, 2016 10:56 AM|anuj_koundal|LINK
Hi Volar
Auto return feature is by default turned off in paypal. Enable auto return feature.
For More info: http://stackoverflow.com/questions/7642895/setting-paypal-return-url-and-making-it-auto-return
Jan 05, 2016 12:02 PM|volar5|LINK
Hi again:
Thanks. I know now where to specify autoreturn
Now my doubt is if I have to specify twice my url return, in my pages and in paypal.
I use variables that need the aspx page to know their value.
Jan 05, 2016 12:20 PM|volar5|LINK
Hi:
I have read the url in the button is the url it tries to return.
I ask if I have to have my pages on internet to try the sanbox because I give a logical url, not physical
Can u help me?
Jan 05, 2016 12:43 PM|volar5|LINK
These are the functions of return. U seeI use logical path, not physical.
Function poner_paypal_cancel_return() As String Dim strenlace As String strenlace = "graciaspublicarobras.aspx?" & Request.QueryString.ToString & "&titulo=" & Master.Page.Title strenlace &= IIf(ddlmodos.Enabled, "&pagos=" & ddlmodos.SelectedValue, "") Return Server.UrlEncode(strenlace) End Function Function poner_paypal_return() As String Dim strenlace As String, intobra As Integer = ddlclasesobras.SelectedValue, cphcontenido As ContentPlaceHolder = Master.FindControl("cphcontenido") strenlace = "graciaspublicarobras.aspx?" & Request.QueryString.ToString & "&titulo=" & Master.Page.Title & IIf(Request.Cookies("cuenta") IsNot Nothing, "&obra=" & intobra, "") & "&id0=" & ddlobras.SelectedValue & "&tiposobras=" & ddltiposobras.SelectedValue & "&ttiposobras=" & ddltiposobras.SelectedItem.Text & "&idiomas=" & ddlidiomas.SelectedValue & "&tidioma=" & ddlidiomas.SelectedItem.Text & "&modospublicacion=" & ddlmodospublicacion.SelectedValue & "&npublicaciones=" & ddlnpublicaciones.SelectedValue & "&que=" & txtque.Text & IIf(tdregistro1.Visible, "®istro=" & txtregistro.Text, "") If locprueba.Visible Then strenlace &= "&prueba=" & Replace(Replace(Server.HtmlEncode(locprueba.Text), "<span class=""centrado"">", "*span class=""centrado""*"), "</span>", "*/span*") If trpublicacionprivada.Visible Then Dim strfichero As String, strextension As String If fufichero.HasFile Then strfichero = fufichero.PostedFile.FileName strextension = Path.GetExtension(strfichero).ToLower strfichero = Left(strfichero, InStrRev(strfichero, ".") - 1) strfichero = Left(strfichero, 21) & strextension strenlace &= "&fichero=" & strfichero If lblfichero.Text <> "" Then strenlace &= "&fichero_anterior=" & lblfichero.Text Else strenlace &= "&fichero=" & lblfichero.Text End If strenlace &= "&importepublicacion=" & txtimportepublicacion.Text End If If pnldatos.Visible Then strenlace &= "&seudonimo=" & txtseudonimo.Text & "&contrasena=" & txtcontrasena.Text & "&nombre=" & txtnombre.Text & "&apellidos=" & txtapellidos.Text & "&correo=" & txtcorreo.Text & "®iones=" & ddlregiones.SelectedValue & "&tregiones=" & ddlregiones.SelectedItem.Text & "&tpaises=" & ddlpaises.SelectedItem.Text If pnlotrosdatos.Visible Then strenlace &= "&direccion=" & txtdireccion.Text & "&localidad=" & txtlocalidad.Text & "&tipoidentificaciones=" & ddltiposidentificaciones.SelectedValue & "ttipoidentificaciones=" & ddltiposidentificaciones.SelectedItem.Text & "&identificacion=" & txtidentificacion.Text If chkffiscal.Checked Then strenlace &= "&nombre_factura=" & txtnombre_factura.Text & "&apellidos_factura=" & txtapellidos_factura.Text & "&tipoidentificaciones_factura=" & ddltiposidentificaciones_factura.SelectedValue & "ttipoidentificaciones_factura=" & ddltiposidentificaciones_factura.SelectedItem.Text & "&identificacion_factura=" & txtidentificacion_factura.Text & "&direccion_factura=" & txtdireccion_factura.Text & "&localidad_factura=" & txtlocalidad_factura.Text & "®iones_factura=" & ddlregiones_factura.SelectedValue & "&tregiones_factura=" & ddlregiones_factura.SelectedItem.Text & "&paises_factura=" & ddlpaises_factura.SelectedValue & "&tpaises_factura=" & ddlpaises_factura.SelectedItem.Text strenlace &= "&importe=" & DirectCast(rptimporte.Items(0).FindControl("litimporte"), Literal).Text & "&iva=" & Left(DirectCast(rptimporte.Items(0).FindControl("litiva"), Literal).Text, InStr(DirectCast(rptimporte.Items(0).FindControl("litiva"), Literal).Text, "%") - 1) & "&total=" & DirectCast(rptimporte.Items(0).FindControl("littotal"), Literal).Text If trpuntos.Visible Then strenlace &= "&puntos=" & ddlusar.SelectedValue & "&puntosfinales=" & lblpuntosfinales.Text & "&puntosiniciales=" & lblpuntosiniciales.Text & "&importefinal=" & DirectCast(rptimporteconpuntos.Items(0).FindControl("litimporte"), Literal).Text & "&ivafinal=" & Left(DirectCast(rptimporteconpuntos.Items(0).FindControl("litiva"), Literal).Text, InStr(DirectCast(rptimporteconpuntos.Items(0).FindControl("litiva"), Literal).Text, "%") - 1) & "&totalfinal=" & DirectCast(rptimporteconpuntos.Items(0).FindControl("littotal"), Literal).Text If DirectCast(rptimporte.Items(0).FindControl("litimporte"), Literal).Text > 0 Then strenlace &= "&mensajepagos=" & Replace(Server.HtmlEncode(lblmensajepagos.Text), "<br />", "*br*") & "&modos=" & ddlmodos.SelectedValue & "&tmodos=" & ddlmodos.SelectedItem.Text strenlace &= "&monedas=" & ddlmonedas.SelectedValue & "&tmonedas=" & ddlmonedas.SelectedItem.Text & "&pagado=on" If rptcambio.Visible Then strenlace &= "&fcambio=" & DirectCast(rptcambio.Items(0).FindControl("lblcambio"), Label).Text & "&cotizacion=" & Mid(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, "=") + 1, InStr(InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, "=") + 1, DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, " ") - InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, "=") - 1) & "&divisa_empresa=" & Mid(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, " ") + 1, InStrRev(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, "=") - InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, " ") - 1) & "&divisa_plural=" & Mid(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, InStr(InStr(DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, "=") + 1, DirectCast(rptcambio.Items(0).FindControl("lblcotizacion"), Label).Text, " ") + 1) Return Server.UrlEncode(strenlace) End Function
In this way, I am addressing to paypal. But when it comes to redirect to my pages after the payment, it doesn't do it?
Have I to give a pysical path to the return?
Jan 05, 2016 12:48 PM|volar5|LINK
As I supposed the url has to be physical, absolute.
This seems I have to have my pages on production to test the sandbox. Right?
Jan 05, 2016 02:17 PM|volar5|LINK
I could do it.
Now I get an error
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
What does it mean?
Jan 05, 2016 02:22 PM|volar5|LINK
The page I use for returning is a https. Can I do this return page in this protocol without any problem?
550 Points
194 Posts
Jan 06, 2016 06:31 AM|sudo10|LINK
You could ask the folllowing link for help.
https://www.paypal-community.com/t5/US-PayPal-Community/ct-p/US
Member
75 Points
318 Posts
About Paypal
Jan 05, 2016 09:12 AM|volar5|LINK
Hi all:
I have a paypal button. I try to test it in sandbox. My script is:
It goes of to paypal. But when it try to redirect my pages it goes to the same hank you page in paypal, doesn't redirect to my pages
What happens? Miss I anything? Maybe it is the call to Sandbox.
TIA
Contributor
7095 Points
1966 Posts
Re: About Paypal
Jan 05, 2016 10:56 AM|anuj_koundal|LINK
Hi Volar
Auto return feature is by default turned off in paypal. Enable auto return feature.
For More info: http://stackoverflow.com/questions/7642895/setting-paypal-return-url-and-making-it-auto-return
Asp .Net Tutorials | www.codingfusion.com
Bank IFSC Codes
Ajax Control Toolkit
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 12:02 PM|volar5|LINK
Hi again:
Thanks. I know now where to specify autoreturn
Now my doubt is if I have to specify twice my url return, in my pages and in paypal.
I use variables that need the aspx page to know their value.
TIA
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 12:20 PM|volar5|LINK
Hi:
I have read the url in the button is the url it tries to return.
I ask if I have to have my pages on internet to try the sanbox because I give a logical url, not physical
Can u help me?
TIA
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 12:43 PM|volar5|LINK
Hi:
These are the functions of return. U seeI use logical path, not physical.
In this way, I am addressing to paypal. But when it comes to redirect to my pages after the payment, it doesn't do it?
Have I to give a pysical path to the return?
TIA
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 12:48 PM|volar5|LINK
Hi:
As I supposed the url has to be physical, absolute.
This seems I have to have my pages on production to test the sandbox. Right?
TIA
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 02:17 PM|volar5|LINK
Hi again:
I could do it.
Now I get an error
What does it mean?
TIA
Member
75 Points
318 Posts
Re: About Paypal
Jan 05, 2016 02:22 PM|volar5|LINK
Hi again:
The page I use for returning is a https. Can I do this return page in this protocol without any problem?
TIA
Member
550 Points
194 Posts
Re: About Paypal
Jan 06, 2016 06:31 AM|sudo10|LINK
You could ask the folllowing link for help.
https://www.paypal-community.com/t5/US-PayPal-Community/ct-p/US