laravel-paypalpayment icon indicating copy to clipboard operation
laravel-paypalpayment copied to clipboard

ERROR: Got Http response code 401 when accessing https://api.paypal.com/v1/payments/payment. {"name":"UNAUTHORIZED_PAYMENT","message":"Unauthorized payment."

Open JonathanGio opened this issue 7 years ago • 18 comments

Sandbox mode, it works perfectly, but when you switch to LIVE mode, it sends me this error. UNAUTHORIZED_PAYMENT , help me please!!!!

JonathanGio avatar Feb 02 '18 01:02 JonathanGio

@JonathanGio have you changed API keys from sandbox to live ? also see here

binitghetiya avatar Feb 02 '18 04:02 binitghetiya

@binitghetiya Yes, I already change credentials and LIVE mode, and even setPaymentMethod ("paypal") works correctly in LIVE MODE web

JonathanGio avatar Feb 02 '18 05:02 JonathanGio

I also have a problem like that TT

NhuLong avatar Mar 20 '18 03:03 NhuLong

@NhuLong you managed to solve it, my friend

JonathanGio avatar May 01 '18 21:05 JonathanGio

@JonathanGio lograste resolverlo.. ?

ElioD avatar May 23 '18 22:05 ElioD

@ElioD no amigo aun no... tu tienes algo al respecto!!

JonathanGio avatar May 26 '18 02:05 JonathanGio

@JonathanGio I think paypal does not support our area . https://developer.paypal.com/docs/classic/api/currency_codes/#creditcard

NhuLong avatar May 26 '18 02:05 NhuLong

@JonathanGio @NhuLong yes, logre conectarme con todas las formas de paypal, el express, el creditcard y paypal plus.

ElioD avatar May 26 '18 02:05 ElioD

@ElioD podrías explicarme como realizaste el proceso o añadiste algo a la cuenta, tengo la cuenta de empresa y ni aun así, estuve buscando y mi cuenta no podía recibir pagos directos ...

JonathanGio avatar May 26 '18 03:05 JonathanGio

Hola @JonathanGio claro, tienes algún proyecto en el cual lo quieras aplicar y ver como lo tienes para ver que esta fallando.. ?

ElioD avatar May 28 '18 14:05 ElioD

@ElioD Si mira este es mi repositorio https://github.com/JonathanGio/creditcard_paypent_paypal aquí puedes ver como esta estructurado y en Heroku esta en modo live https://serene-chamber-11307.herokuapp.com/ no se que estoy haciendo mal amigo

JonathanGio avatar May 29 '18 18:05 JonathanGio

@JonathanGio deja lo checo.. haber que onda

ElioD avatar May 29 '18 22:05 ElioD

Hola @JonathanGio acabo de ver tu código las credenciales son no se declaran así, tienes que ponerlo así en config/paypal_paymant:

'sandbox', # Account credentials from developer portal 'account' => [ 'client_id' => env('CLIENTE', ''), 'client_secret' => env('SECRET', ''), ], # Connection Information 'http' => [ 'connection_time_out' => 30, 'retry' => 1, ], # Logging Information 'log' => [ 'log_enabled' => true, # When using a relative path, the log file is created # relative to the .php file that is the entry point # for this request. You can also provide an absolute # path here 'file_name' => '../PayPal.log', # Logging level can be one of FINE, INFO, WARN or ERROR # Logging is most verbose in the 'FINE' level and # decreases as you proceed towards ERROR 'log_level' => 'FINE', ], ]; Esas variables las declaras global mente en el arvico .env de aplicación así : CLIENTE= ****************** SECRET= *************** Tienes que checar tus credenciales en ttps://developer.paypal.com, y crear unas en My Apps & Credentials, REST API apps por que si están mal acabo de poner las mías con esos cambios y paso la transacción sin ningún problema. Saludos.

ElioD avatar May 29 '18 23:05 ElioD

Resolve problem ? I have error code 401

gutofurlan avatar Aug 01 '18 13:08 gutofurlan

@ElioD Tendras una copia de tu repo para ver si es mi cuenta ya intente de todo...

JonathanGio avatar Aug 01 '18 20:08 JonathanGio

Hola amigos creo que acabo de encontrar el problema, leyendo la documentacion es necesario activar el uso para pagos con tarjeta para ello hay que ir a nuestra cuenta en www.paypal.com -> Profile -> Profile and settings -> My selling tools -> API access click en "Update", nos aparecera una lista en ella buscamos "REST API integration" y damos click en "Manage REST API apps and credentials".

En la siguiente pagina nos dice claro "All REST API features are available in your sandbox account while testing. Some features will need more information when you enable them for live transactions."(Claramente no damos cuenta porque en modo sandbox todo funciona perfecto) Justo al lado hay un boton "View permissions" nos muestra un modal con una lista de opciones en ella veremos que "Direct cards" dice enable deberemos dar click y seguir los pasos siguientes para habilitar la opcion.

Les dejo el enlace directo a la ultima pagina que menciono: https://www.paypal.com/businessmanage/credentials/apiAccess/applications

Estoy a la espera que mi cliente complete la informacion que se solicitada para habilitar la opcion, tras que confirme que todo funciona doy por confirmada esta solucion.

marteagam avatar Aug 20 '18 22:08 marteagam

@marteagam no amigo hasta ahora e realizado todo lo que hiciste y no amigo, tu ya pudiste solucionarlo

JonathanGio avatar Sep 23 '18 02:09 JonathanGio

@JonathanGio Cambien el mode de la aplicación a live en el archivo de configuración config/paypal_payment. Agregue variables de entorno :nerd_face:

return [
    # Define your application mode here
    'mode' => env('PAYPAL_MODE', 'sandbox'),

    # Account credentials from developer portal
    'account' => [
        'client_id' => env('PAYPAL_CLIENT_ID', ''),
        'client_secret' => env('PAYPAL_CLIENT_SECRET', ''),
    ],

    # Connection Information
    'http' => [
        'connection_time_out' => 30,
        'retry' => 1,
    ],

    # Logging Information
    'log' => [
        'log_enabled' => env('PAYPAL_LOG', true),

        # When using a relative path, the log file is created
        # relative to the .php file that is the entry point
        # for this request. You can also provide an absolute
        # path here
        'file_name' => '../PayPal.log',

        # Logging level can be one of FINE, INFO, WARN or ERROR
        # Logging is most verbose in the 'FINE' level and
        # decreases as you proceed towards ERROR
        'log_level' => 'FINE',
    ],
];

ErickZH avatar Apr 10 '19 15:04 ErickZH