FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
||||
|
||||
PayPal usando REST
Hola,
estoy tratando de hacer una aplicacion para pago con PayPal (en realidad es para android e iOS pero lo que pruebo funciona en ambos mundos). Uso la REST API de paypal https://developer.paypal.com/webapps...oper/docs/api/ La cuestion es que si puedo obtener el TOKEN, es decir ya me valide el acceso. Pero al hacer el pago (Payment) me devuelve la respuesta JSON en blanco, alguien puede ayudarme. Adjunto codigo fuente. En el codigo fuente no pongo client id y secreto, por cuestion de seguridad. En esta lista esta el codigo fuete y el ejecutable: www.itcmx.com/PayPalREST.rar Por su valiosa ayuda mil gracias Este es el codigo para el token
Y aqui el del payment
__________________
OEsqueda |
#2
|
||||
|
||||
Según estuve viendo, las comunicaciones REST pueden devolver un dato o no. Además de ver el dato devuelto, deberás ver la cabecera HTTP.
Si por ejemplo devuelve 200 es que todo está OK. Si devuelve 404 es que no encontró la página. Mira esto: http://es.wikipedia.org/wiki/Anexo:C...de_estado_HTTP Básicamente 2xx Ok 3xx Redirecciones 4xx Error en cliente 5xx Error en servidor |
#3
|
||||
|
||||
Hola,
si ya vi, cuando solicito el token si obtengo un 200 en el response. Pero en el otro obtengo un 401. Creo que el poblema es cuando envio en la cabecera en el request mi Token que obtuve en el primer paso. He aqui el codigo
Intente usar un tidhttp para el token y otro para el payment, para que estuviera limpio, pero en ambos me marco el mismo error: 401 (http/1.1 401 Unauthorized.) ¿Estoy haciendo algo mal?
__________________
OEsqueda |
#4
|
||||
|
||||
Una pregunta como puedo obtener Request Data y Response Data, me lo piden en paypal pero no veo como obtenerlo.
Cita:
__________________
OEsqueda |
#5
|
||||
|
||||
Prueba con cURL
http://curl.haxx.se/download.html Es un programita que se ejecuta desde línea de comandos. Muy útil para hacer pruebas. Aquí hay algunos ejemplos: http://blogs.plexibus.com/2009/01/15...ing-with-curl/ Al principio del primer ejemplo ponen el parámetro -i para obtener el Response Header, que supongo que es lo que te piden, junto con el "dato" que responda PayPal. Con respecto a Request Data, me imagino que es lo que tu envías. Espero te sirva... |
#6
|
||||
|
||||
Fijate que si, estoy usando el CURL que viene en la pagina de paypal y si uso de ambos sentidos los valores que se generan en la prueba (sandbox) y funciona, algo pasa que no pasa de ese paso que es al hacer el pago y envio los datos.
Mil gracias por tu respuesta PD: en paypal ya me estan solicitando los datos del request y response a ver que me dicen ellos
__________________
OEsqueda |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Rest | roman | La Taberna | 11 | 30-07-2014 16:52:00 |
Datasnap Rest Server | dison | Desarrollo en Delphi para Android | 3 | 16-05-2014 09:48:44 |
REST, Marshaling y \ | iuqrul | Providers | 1 | 08-11-2013 10:51:33 |
Donaciones Paypal, sugerencia. | REHome | La Taberna | 12 | 07-11-2010 16:54:05 |
¿quien usa paypal en México.? | JXJ | La Taberna | 4 | 18-02-2010 22:59:33 |
|