python - PayPal Error 10002 Using Permissions API and TransactionSearch -


I have a permission request that looks like this:

  timestamp, signature = GenPermissionsAuthHeader. getAuthHeader (str (self.username), str (self.password), str (access_token), str (token_secret), "POST", "https://api-3t.sandbox.paypal.com/nvp") # https : //svcs.sandbox.paypal.com/Permissions/GetBasicPersonalData log.info (timestamp) log.info (signature) authorization_header = "timestamp =" + timestamp + ", token =" + access_token + ", signature =" + sign Log.info (authorization_header) header = {"x-paypal-authorization": authorization_header,} url = "https://api-3t.sandbox.paypal.com/nvp" nvp_params = {"method": "transaction Search "," STARTDATE ":" 2012-01-01T05: 38: 48Z ",} r = requests.post (url, data = nvp_perm, header = header) log.info (rtext) self.response .content_disposition = "text / html" self.response.write (r.text)   

I have access to tokens and tokens from the permission API using my PayPal credentials "Sandbox Accounts under "Accounts."

When I run this method, I get an error message:

  TIMESTAMP = 2014% 2d04% 2d21T22% 3a 50% 3a 18 zed; Correlation ID = C8F 9212035 B 60 & ACK = Failure and version = 0% 2e000000 and created = 10277387 and L_arrowode 0 = 10002 and LCHRTMSEE 0 = Authentication% 2f authorization% 20 FAIL D & L_LOMMSSE 0 = you 20 %% 20% 20 %% 20% discount 20%% 20this% 20API% 20call & amp; L_SEVERITYCODE0 = No errors   

I can call GetBasicPersonalDetails and it starts working. Any help would be great, thanks!

I got the answer, I did not find the "SUBJECT" parameter being sent for payment on the parameter string Therefore, only if someone else gets the full run on it in the future, the full code happens after allowing the sandbox to run a test payment:

  def test_sales (auto, access_token = None, token_secret = none): timestamp, sign = genPermissionsAuthHeader.getAuthHeader (str (self.username), str (self.password), str (access_token), str (token_secret), "PO ST "," https: //api-3t.sandbox .paypal.com / nvp ") # https://svcs.sandbox.paypal.com/Permissions/GetBasicPersonalData log.info (timestamp) log.info (signature) Authority_Hedre = "Timestamp =" + timestamp + ", token =" + access_token + ", sign =" + signature log.info (authorization_header) header = {"X-PayPal-authorization": authorization_header,} url = "https: // Api-3t.sandbox.paypal.com/nvp "nvp_params", "payment", "payment", "sale", "amt": "22.00", "accc": "4111111111111111", "cvv2" "111", "FIRST": "Jane", "LASTNAME": "Smith", "EXPDATE": "012018", "IPADDRESS": "127.0.0.1", "STREET": "123 Str" Enliven ", "R Jy ":" CO "," zip ":" 80112 "," version ":" 86 "," signature "self. Signature, "USER": self Username, "PWD": self Password, "SUBJECT": "person_who_you_acting_on_behalf_of@domain.com"} r = requests. Post (url, data = nvp_user, header = header) log.info ("search transaction \ n \ n" + R.text + "\ n \ n ") self.response.content_disposition =" text / html "self.response.write (urllib.unquote (r.text) .decode ('utf8'))   

and I To create the used headers:

Hope this helps someone, thanks!

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -