diff --git a/src/main/java/com/razorpay/Constants.java b/src/main/java/com/razorpay/Constants.java index f66ab8ff..98452716 100755 --- a/src/main/java/com/razorpay/Constants.java +++ b/src/main/java/com/razorpay/Constants.java @@ -167,7 +167,7 @@ public class Constants { // Auth constants static final String AUTHORIZE = "authorize"; - static final String TOKEN = "token"; - static final String REVOKE = "revoke"; + static final String TOKEN = "/token"; + static final String REVOKE = "/revoke"; } diff --git a/src/main/java/com/razorpay/OAuthTokenClient.java b/src/main/java/com/razorpay/OAuthTokenClient.java index ea06af7b..e37df9c7 100644 --- a/src/main/java/com/razorpay/OAuthTokenClient.java +++ b/src/main/java/com/razorpay/OAuthTokenClient.java @@ -45,7 +45,7 @@ public String getAuthURL(JSONObject request) throws RazorpayException { public OAuthToken getAccessToken(JSONObject request) throws RazorpayException { GetAccessTokenViaAuthCodeRequestDTO getAccessTokenViaAuthCodeRequestDTO = convertToGetAccessTokenViaAuthCodeRequestDTO(request); validateGetAccessTokenViaAuthCodeRequestDTO(getAccessTokenViaAuthCodeRequestDTO); - return post(null, "/token", request, Constants.AUTH); + return post(null, Constants.TOKEN, request, Constants.AUTH); } public OAuthToken getAccessTokenFromRefreshToken(JSONObject request) throws RazorpayException { @@ -53,14 +53,14 @@ public OAuthToken getAccessTokenFromRefreshToken(JSONObject request) throws Razo validateGetAccessTokenViaRefreshTokenRequestDTO(getAccessTokenViaRefreshTokenRequestDTO); request.put("grant_type", "refresh_token"); - return post(null, "/token", request, Constants.AUTH); + return post(null, Constants.TOKEN, request, Constants.AUTH); } public OAuthToken revokeToken(JSONObject request) throws RazorpayException { RevokeTokenRequestDTO revokeTokenRequestDTO = convertToRevokeTokenRequestDTORequestDTO(request); validateRevokeTokenRequestDTO(revokeTokenRequestDTO); - return patch(null, "/revoke", request, Constants.AUTH); + return patch(null, Constants.REVOKE, request, Constants.AUTH); } private AuthURLRequestDTO convertToAuthRequestDTO(JSONObject request) {