NetTalk Central

Author Topic: Another CURL problem - Paypal  (Read 3568 times)

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Another CURL problem - Paypal
« on: October 13, 2015, 09:15:35 PM »
Hi Bruce, as per Richards question on show 71, I have a similar problem, unable to send data to Pay Pal.  Using Build 8-62

*** UPDATE *** 8.42 works as in it makes an Authorization component in the heading,  Although Paypal still rejects it.- testing other versions now.  852 works too

Their doco is very good and they offer an example in CURL which works OK.
Using the Net Talk Demo (8.62) - Web Client  I tried to do the same, but get a very stubborn error that wont go away.
As per show 71 I set up the server on 127.0.0.1 and pointed CURL to it,  this gave me the desired result.

However, when I point a Net Talk WebClient at it, some fields are missing.  See long image below.  
Looks like the  Authorization does not appear in the output ?

1.    shows the Clients setup, Note the Authentication tab  (which does not generate anything in the output)  holds my paypal login and password.
2.    shows the log for the POST, it is missing the content length and the Authorization
3.    shows the server side
4.    shows the Net Talk Server when CURL sends the request.



[attachment deleted by admin]
« Last Edit: October 14, 2015, 02:43:57 AM by MyBrainIsFull »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11247
    • View Profile
Re: Another CURL problem - Paypal
« Reply #1 on: October 19, 2015, 11:57:29 PM »
hi Kevin,

There was a change in Build 8.60 necessitated by the new Auth-Header support on the server side.

Basically the equate
Net:WebBasicAuthentication
changed from value 0 to value 2

So, if you are using equates in your code this basically has no effect on you. However if you've had to use a fixed value (like for a radio button on a window, as the netDemo example does) then the value of the radio button has to change from 0 to 2. (because you can't use equates in the screen designer.)

In the NetDemo example the authorizaion is set with the following code;

      If AuthenticationType = Net:WebBasicAuthentication
        ThisWebClient.Authorization = ThisWebClient.CreateAuthorizationString (Username, Password, AuthenticationType,AuthNoWrap)
      ElsIf AuthenticationType = Net:WebDigestAuthentication 
        ThisWebClient.Authorization = ThisWebClient.CreateAuthorizationString (Username, Password, AuthenticationType)
      End   
     
but of course this presumes that the local variable (AuthenticationType) has the correct options on the window.

I think it's something along these lines which is affecting your code as well.

cheers
Bruce