-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add params to list endpoints: - buyers - transactions - payment-methods
- Loading branch information
1 parent
2d463ee
commit 84534f7
Showing
5 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.gr4vy.sdk; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
import java.net.URLEncoder; | ||
import java.util.Map; | ||
|
||
public class Helper { | ||
static String urlEncodeUTF8(String s) { | ||
try { | ||
return URLEncoder.encode(s, "UTF-8"); | ||
} catch (UnsupportedEncodingException e) { | ||
throw new UnsupportedOperationException(e); | ||
} | ||
} | ||
static String urlEncodeUTF8(Map<?,?> map) { | ||
StringBuilder sb = new StringBuilder(); | ||
for (Map.Entry<?,?> entry : map.entrySet()) { | ||
if (sb.length() > 0) { | ||
sb.append("&"); | ||
} | ||
sb.append(String.format("%s=%s", | ||
urlEncodeUTF8(entry.getKey().toString()), | ||
urlEncodeUTF8(entry.getValue().toString()) | ||
)); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters