5 Replies - 621 Views - Last Post: 11 August 2018 - 12:03 PM

#1 tekblade   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 21-December 17

Payu sandbox my data doesn't work properly

Posted 09 August 2018 - 08:19 AM

Hi,
I've created account and shop in sandbox PayU(testing purposes):
http://developers.pa...en/restapi.html
I have created account and created fictional Shop.

curl -X POST https://secure.payu.com/pl/standard/user/oauth/authorize \
-d 'grant_type=client_credentials&client_id=145227&client_secret=12f071174cb7eb79d4aac5bc2f07563f'


this is exmample in documentation and returned output is:
{"access_token":"e932c134-e798-4531-9c03-ea462a5b7be6","token_type":"bearer","expires_in":43199,"grant_type":"client_credentials"}


I am changing client_id and client_secret for data that I got in creating shop process.
And the output for my data is:
{"error":"invalid_client","error_description":"Can't find oauthClient with clientId = 337358"}


Regards

Is This A Good Question/Topic? 0
  • +

Replies To: Payu sandbox my data doesn't work properly

#2 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6656
  • View blog
  • Posts: 22,740
  • Joined: 05-May 12

Re: Payu sandbox my data doesn't work properly

Posted 09 August 2018 - 11:48 AM

Is 337358 the id of your production account or sandbox account? Does PayU require different URLs for production vs. sandbox?
Was This Post Helpful? 1
  • +
  • -

#3 tekblade   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 21-December 17

Re: Payu sandbox my data doesn't work properly

Posted 09 August 2018 - 12:55 PM

Sandbox account - the id I am getting after creating new shop.What do you mean about the secound question??I think it is good question

This post has been edited by tekblade: 09 August 2018 - 03:11 PM

Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6656
  • View blog
  • Posts: 22,740
  • Joined: 05-May 12

Re: Payu sandbox my data doesn't work properly

Posted 09 August 2018 - 06:44 PM

I don't use PayU, so my response maybe completely off base. Basically, most sites have https://api.site.com/... as they production, and then https://testing.site.com/... as their testing or sandbox site.
Was This Post Helpful? 0
  • +
  • -

#5 tekblade   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 21-December 17

Re: Payu sandbox my data doesn't work properly

Posted 11 August 2018 - 12:28 AM

I am trying to understand how does it look in java spring:
http://developers.pa...s_api_signature
curl -X POST https://secure.payu.com/pl/standard/user/oauth/authorize \
-d 'grant_type=client_credentials&client_id=145227&client_secret=12f071174cb7eb79d4aac5bc2f07563f'



what is the difference this above with this below:
 curl -X POST https://secure.payu.com/pl/standard/user/oauth/authorize \
-d '{
"grant_type" : "client_credentials",
"client_id" : "145227",
"client_secret" : "12f071174cb7eb79d4aac5bc2f07563f"
}'



In doccumentation is the first way used. The secound doesnt work. The first way does look as form with POST method. I don't know how in java should it be used. Meybe only keyword will be sufficient. I mean eclipse project client. This query must be consumed by Sandbox Rest Service but I dont know the differences between these two pieces of curl code.
Regards

This post has been edited by tekblade: 11 August 2018 - 12:31 AM

Was This Post Helpful? 0
  • +
  • -

#6 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6656
  • View blog
  • Posts: 22,740
  • Joined: 05-May 12

Re: Payu sandbox my data doesn't work properly

Posted 11 August 2018 - 12:03 PM

The first looks like regular HTML form post data. The second line looks like a JSON block.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1