diff --git a/src/main/java/com/stripe/model/File.java b/src/main/java/com/stripe/model/File.java index ec7a2bbb574..086898129dc 100644 --- a/src/main/java/com/stripe/model/File.java +++ b/src/main/java/com/stripe/model/File.java @@ -92,7 +92,7 @@ public static File create(FileCreateParams params) throws StripeException { */ public static File create(FileCreateParams params, RequestOptions options) throws StripeException { - checkNullTypedParams(String.format("%s/v1/files", Stripe.getUploadBase()), params); + checkNullTypedParams(ApiResource.fullUrl(Stripe.getUploadBase(), options, "/v1/files"), params); return create(params.toMap(), options); } @@ -105,7 +105,8 @@ public static File create(Map params, RequestOptions options) throws StripeException { return request( RequestMethod.POST, - String.format("%s/v1/files", Stripe.getUploadBase()), + ApiResource.fullUrl( + Stripe.getUploadBase(), options, "/v1/files"), params, File.class, options); diff --git a/src/main/java/com/stripe/net/OAuth.java b/src/main/java/com/stripe/net/OAuth.java index 6d235ea96a8..a8bac5adc2e 100644 --- a/src/main/java/com/stripe/net/OAuth.java +++ b/src/main/java/com/stripe/net/OAuth.java @@ -46,7 +46,7 @@ public static String authorizeUrl(Map params, RequestOptions opt */ public static TokenResponse token(Map params, RequestOptions options) throws StripeException { - String url = Stripe.getConnectBase() + "/oauth/token"; + String url = ApiResource.fullUrl(Stripe.getConnectBase(), options,"/oauth/token"); return OAuth.stripeResponseGetter.oauthRequest( ApiResource.RequestMethod.POST, url, params, TokenResponse.class, options); } @@ -63,7 +63,7 @@ public static DeauthorizedAccount deauthorize(Map params, Reques Map paramsCopy = new HashMap<>(); paramsCopy.putAll(params); - String url = Stripe.getConnectBase() + "/oauth/deauthorize"; + String url = ApiResource.fullUrl(Stripe.getConnectBase(), options, "/oauth/deauthorize"); paramsCopy.put("client_id", getClientId(paramsCopy, options)); return OAuth.stripeResponseGetter.oauthRequest( ApiResource.RequestMethod.POST, url, paramsCopy, DeauthorizedAccount.class, options);