From 5c2a03f78f8b667a600523c5d003c120903892fe Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Thu, 20 Jun 2019 14:08:05 -0400 Subject: [PATCH] Fix AppInfo param name Change `"partnerId"` to `"partner_id"` --- stripe/src/main/java/com/stripe/android/AppInfo.java | 2 +- stripe/src/test/java/com/stripe/android/ApiRequestTest.java | 2 +- stripe/src/test/java/com/stripe/android/AppInfoTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stripe/src/main/java/com/stripe/android/AppInfo.java b/stripe/src/main/java/com/stripe/android/AppInfo.java index 67e2969dc98..9ac92f437b9 100644 --- a/stripe/src/main/java/com/stripe/android/AppInfo.java +++ b/stripe/src/main/java/com/stripe/android/AppInfo.java @@ -78,7 +78,7 @@ Map createClientHeaders() { appInfo.put("name", mName); appInfo.put("version", mVersion); appInfo.put("url", mUrl); - appInfo.put("partnerId", mPartnerId); + appInfo.put("partner_id", mPartnerId); final Map header = new HashMap<>(1); header.put("application", new JSONObject(appInfo).toString()); diff --git a/stripe/src/test/java/com/stripe/android/ApiRequestTest.java b/stripe/src/test/java/com/stripe/android/ApiRequestTest.java index 62745cf2ba4..0e3e18e8747 100644 --- a/stripe/src/test/java/com/stripe/android/ApiRequestTest.java +++ b/stripe/src/test/java/com/stripe/android/ApiRequestTest.java @@ -180,7 +180,7 @@ public void getHeaders_withAppInfo() throws JSONException { final JSONObject userAgentData = new JSONObject(headers.get("X-Stripe-Client-User-Agent")); assertEquals( "{\"name\":\"MyAwesomePlugin\"," + - "\"partnerId\":\"pp_partner_1234\"," + + "\"partner_id\":\"pp_partner_1234\"," + "\"version\":\"1.2.34\"," + "\"url\":\"https:\\/\\/myawesomeplugin.info\"}", userAgentData.getString("application")); diff --git a/stripe/src/test/java/com/stripe/android/AppInfoTest.java b/stripe/src/test/java/com/stripe/android/AppInfoTest.java index e1d66af51cf..263f353cabc 100644 --- a/stripe/src/test/java/com/stripe/android/AppInfoTest.java +++ b/stripe/src/test/java/com/stripe/android/AppInfoTest.java @@ -25,7 +25,7 @@ public void toUserAgent() { public void createClientHeaders() { final Map header = new HashMap<>(); header.put("application", - "{\"name\":\"MyAwesomePlugin\",\"partnerId\":\"pp_partner_1234\"," + + "{\"name\":\"MyAwesomePlugin\",\"partner_id\":\"pp_partner_1234\"," + "\"version\":\"1.2.34\",\"url\":\"https://myawesomeplugin.info\"}"); assertEquals(header, APP_INFO.createClientHeaders()); }