Class HttpHelper
- java.lang.Object
-
- ch.swissbilling.commercial.client.utils.HttpHelper
-
public class HttpHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description HttpHelper(IEnvironmentEndpoints endpoints)Initializes a new instance of the HttpHelper class
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringreadResponse(org.apache.http.HttpResponse response)Method used for reading HTTP responseStringsendQuery(GraphQLQuery query, String token)Method used to post graphQL queriesStringuploadInvoice(File file, String shopId, String token)Method used to upload PDF invoice
-
-
-
Constructor Detail
-
HttpHelper
public HttpHelper(IEnvironmentEndpoints endpoints)
Initializes a new instance of the HttpHelper class- Parameters:
endpoints-
-
-
Method Detail
-
sendQuery
public String sendQuery(GraphQLQuery query, String token)
Method used to post graphQL queries- Parameters:
query- The graphQL query objecttoken- The authorization token- Returns:
- The raw httpResponse string
-
uploadInvoice
public String uploadInvoice(File file, String shopId, String token)
Method used to upload PDF invoice- Parameters:
file- The invoice fileshopId- The merchant's shop idtoken- The authorization token- Returns:
- The TransactionBatchDocument's identifier
-
readResponse
public static String readResponse(org.apache.http.HttpResponse response)
Method used for reading HTTP response- Parameters:
response-- Returns:
-
-