Skip to content

Commit 9a8e733

Browse files
author
Grace Yim
committed
Include baseUri when creating new instance of ToopherApi
1 parent 4343e29 commit 9a8e733

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/com/toopher/ToopherIframe.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.toopher;
22

3+
import java.net.URISyntaxException;
34
import java.nio.charset.Charset;
45
import java.util.*;
56
import java.net.URLEncoder;
@@ -187,7 +188,7 @@ public String getUserManagementUrl(String userName, Map<String, String> extras)
187188
* @throws SignatureValidationError Thrown when exceptional condition is encountered while validating data
188189
* @throws RequestError Thrown when postback resource type is invalid
189190
*/
190-
public Object processPostback(Map<String, String> params, String requestToken, Map<String, String> extras) throws SignatureValidationError, RequestError {
191+
public Object processPostback(Map<String, String> params, String requestToken, Map<String, String> extras) throws SignatureValidationError, RequestError, URISyntaxException {
191192
Map<String, String> toopherData = urlDecodeIframeData(params);
192193

193194
if (toopherData.containsKey("error_code")) {
@@ -201,7 +202,7 @@ public Object processPostback(Map<String, String> params, String requestToken, M
201202
} else {
202203
Map<String, String> validatedData = validateData(toopherData, requestToken, extras);
203204

204-
ToopherApi toopherApi = new ToopherApi(consumerKey, consumerSecret);
205+
ToopherApi toopherApi = new ToopherApi(consumerKey, consumerSecret, baseUri);
205206
String resourceType = validatedData.get("resource_type");
206207
if (resourceType.equals("authentication_request")) {
207208
return new AuthenticationRequest(createAuthenticationRequestJson(validatedData), toopherApi);
@@ -225,7 +226,7 @@ public Object processPostback(Map<String, String> params, String requestToken, M
225226
* @throws SignatureValidationError Thrown when exceptional condition is encountered while validating data
226227
* @throws RequestError Thrown when postback resource type is invalid
227228
*/
228-
public Object processPostback(Map<String, String> params, String requestToken) throws SignatureValidationError, RequestError {
229+
public Object processPostback(Map<String, String> params, String requestToken) throws SignatureValidationError, RequestError, URISyntaxException {
229230
return processPostback(params, requestToken, new HashMap<String, String>());
230231
}
231232

@@ -237,7 +238,7 @@ public Object processPostback(Map<String, String> params, String requestToken) t
237238
* @throws SignatureValidationError Thrown when exceptional condition is encountered while validating data
238239
* @throws RequestError Thrown when postback resource type is invalid
239240
*/
240-
public Object processPostback(Map<String, String> params) throws SignatureValidationError, RequestError {
241+
public Object processPostback(Map<String, String> params) throws SignatureValidationError, RequestError, URISyntaxException {
241242
return processPostback(params, null);
242243
}
243244

0 commit comments

Comments
 (0)