@@ -60,7 +60,7 @@ public class BitPay {
6060 * Constructor for use if the keys and SIN are managed by this library.
6161 * @param clientName - The label for this client.
6262 * @param envUrl - The target server URL.
63- * @throws BitPayException
63+ * @throws BitPayException
6464 */
6565 public BitPay (String clientName , String envUrl ) throws BitPayException
6666 {
@@ -383,7 +383,7 @@ private Hashtable<String, String> responseToTokenCache(HttpResponse response) th
383383 // we can map to a hashtable.
384384 json = json .replaceAll ("\\ [" , "" );
385385 json = json .replaceAll ("\\ ]" , "" );
386-
386+ json = json . replaceAll ( " \\ }, \\ {" , "," );
387387 if (json .length () > 0 ) {
388388 _tokenCache = new ObjectMapper ().readValue (json , new TypeReference <Hashtable <String ,String >>(){});
389389 }
@@ -497,7 +497,7 @@ private HttpResponse get(String uri) throws BitPayException
497497 return this .get (uri , null );
498498 }
499499
500- private HttpResponse post (String uri , String json , boolean signatureRequired ) throws BitPayException
500+ private HttpResponse post (String uri , String json , boolean signatureRequired ) throws BitPayException
501501 {
502502 try {
503503 HttpPost post = new HttpPost (_baseUrl + uri );
@@ -526,17 +526,17 @@ private HttpResponse post(String uri, String json, boolean signatureRequired) th
526526 }
527527 }
528528
529- private HttpResponse post (String uri , String json ) throws BitPayException
529+ private HttpResponse post (String uri , String json ) throws BitPayException
530530 {
531531 return this .post (uri , json , false );
532532 }
533533
534- private HttpResponse postWithSignature (String uri , String json ) throws BitPayException
534+ private HttpResponse postWithSignature (String uri , String json ) throws BitPayException
535535 {
536536 return this .post (uri , json , true );
537537 }
538538
539- private String responseToJsonString (HttpResponse response ) throws BitPayException
539+ private String responseToJsonString (HttpResponse response ) throws BitPayException
540540 {
541541 if (response == null ) {
542542 throw new BitPayException ("Error: HTTP response is null" );
0 commit comments