From: Gustaf N. <ne...@wu...> - 2019-11-17 09:58:25
|
On 17.11.19 00:00, Iuri Sampaio wrote: > I was expecting to get the same thing with ns_http. However, when I > ran https://api.sandbox.paypal.com/v1/oauth2/token > <https://api.sandbox.paypal.com/v1/oauth2/token> status returns 0 and > body returns null. It’;s available at ttps://evex.co/paypal-checkout > <ttps://evex.co/paypal-checkout> Hi Iuri, not sure, what might be wrong on your side, it is working for me (see below). I've tried this under maxOS and Linux. Maybe a problem with versions? If you see this failing as well with the tip version of NaviServer (which i was testing with) you can turn on debugging on the task level with ns_logctl severity Debug(task) on or if this is not sufficient on the driver level ns_logctl severity Debug(ns:driver) on all the best -gn PS: You should probably alter your credentials on api.sandbox.paypal.com % set h [ns_set create] % ns_set update $h Authorization "Basic QWJCN2VaRzJVeUJsb1JlVG8tUWRvRnhmMzZnZlNKbmQ1REpEbEllQ2FjZHgzdDJwMEs1aTZXUVNwTHRNVDdYT2JtUVBQREowLTZQblJLUTI6RUpmRG8zeEw2cFBhWXpKOGdRMERjeUV2Y2RSTU0tX2pGMElIZVdJc185SUJkbXF0UkN3QWRYRXloRTBkM1lNT0JIb2t2STkzWXd0Q2tpSkY=" % ns_set update $h "Accept" "application/json" % ns_set update $h "Accept-Language" "en_US" % ns_set update $h "Content-Type" "application/json" % ns_http run -method POST -headers $h -body grant_type=client_credentials https://api.sandbox.paypal.com/v1/oauth2/token status 200 time 1:503938 headers d13 body {{"scope":"https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/.* https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks","access_token":"A21AAHMkTt1pYmD_syssLe1hHdsndPOP8WU60PHmfAcCrol39OoB3rP9vIwbIBPZzHF1jlp9_Mnu1t8NN4oA096PJzLdP6Msw","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":32400,"nonce":"2019-11-17T09:42:14ZFs7vTotrg8oVWwjwsFg7k9pSpMvwCc3-nCaKUrtltuE"}} https {sslversion TLSv1.2 cipher AES256-SHA256} |