Stripe connect: linking standalone account in java -


i'm trying set stripe connect (https://stripe.com/docs/connect/standalone-accounts) on application, i'm failing set link between platform , standalone account. provides curl code execute, , examples in ruby, python, php , node; no java.

the curl call follows:

curl https://connect.stripe.com/oauth/token \ -d client_secret=sk_test_ighhugcqkmxa8yyai9ocqpzr \ -d code=authorization_code \ -d grant_type=authorization_code 

it looks pretty simple, have no idea how works. have been looking around trying figure out how make call in java, , far haven't been able to. taking code found somewhere based on oltu , building on it, came following:

oauthclientrequest exchangerequest = oauthclientrequest                 .tokenlocation("https://connect.stripe.com/oauth/token")                 .setgranttype(granttype.authorization_code)                 .setparameter("client_secret", project.getpartnerstripesecretapikey())                 .setcode(authorizationcode)                 .buildbodymessage();                  map<string,string> headers =new hashmap<string, string>();                  exchangerequest.setheaders(headers);                 oauthclient oauthclient = new oauthclient(new urlconnectionclient());                  githubtokenresponse oauthresponse = oauthclient.accesstoken(exchangerequest, githubtokenresponse.class);                 log.info("stripe response: "+oauthresponse.tostring());                string accesstoken = oauthresponse.getaccesstoken(); 

but fails following error:

oauthproblemexception{error='invalid_request', description='missing parameters: access_token', uri='null', state='null', scope='null', redirecturi='null', responsestatus=0, parameters={}} 

could please let me know i'm doing wrong, or recommend better approach call (preferably example)?

thanks in advance


Comments