Skip to content

Commit

Permalink
Wrap more things in ApiResource.fullUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Jan 3, 2023
1 parent 8f743a8 commit 770bc13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/stripe/model/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -105,7 +105,8 @@ public static File create(Map<String, Object> 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);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/net/OAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static String authorizeUrl(Map<String, Object> params, RequestOptions opt
*/
public static TokenResponse token(Map<String, Object> 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);
}
Expand All @@ -63,7 +63,7 @@ public static DeauthorizedAccount deauthorize(Map<String, Object> params, Reques
Map<String, Object> 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);
Expand Down

0 comments on commit 770bc13

Please sign in to comment.