diff --git a/README.md b/README.md index 9b524dd..d28092e 100644 --- a/README.md +++ b/README.md @@ -152,4 +152,4 @@ the License. You may obtain a copy of the License at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License.

\ No newline at end of file +specific language governing permissions and limitations under the License.

diff --git a/src/main/java/com/mastercard/developers/elevate/accelerator/helper/RequestHelper.java b/src/main/java/com/mastercard/developers/elevate/accelerator/helper/RequestHelper.java index 39b7cde..b5cf49e 100644 --- a/src/main/java/com/mastercard/developers/elevate/accelerator/helper/RequestHelper.java +++ b/src/main/java/com/mastercard/developers/elevate/accelerator/helper/RequestHelper.java @@ -41,7 +41,7 @@ public final class RequestHelper { private static final String KEYSTORE_ALIAS = "mastercard.elevate.client.ref.app.keystore.alias"; private static final String KEYSTORE_PASSWORD = "mastercard.elevate.client.ref.app.keystore.password"; private static final String TYPE_PK_CS12 = "PKCS12"; - + private static final String READ_TIME_OUT = "mastercard.elevate.client.ref.app.read.timeout"; private static final String CHECK_ELIGIBILITY_PAYLOAD = resourceContent("templates/" + "check-eligibility-payload.json"); private static final String REDEMPTIONS_PAYLOAD = resourceContent("templates/" + "redemptions-payload.json"); @@ -89,7 +89,7 @@ public static ApiClient signRequest() { getEncryptionConfig(prop))).addInterceptor( new OkHttpOAuth1Interceptor(prop.getProperty(CONSUMER_KEY), getPrivateKey())) .build(); - return new ApiClient().setHttpClient(client).setBasePath(prop.getProperty(BASE_URL)); + return new ApiClient().setHttpClient(client).setBasePath(prop.getProperty(BASE_URL)).setReadTimeout(Integer.parseInt(prop.getProperty(READ_TIME_OUT))); } private static PrivateKey getPrivateKey() { @@ -123,4 +123,4 @@ public static String resourceContent(String classpathName) { throw new IllegalArgumentException("Cannot load resource from classpath '" + classpathName + "'.", ex); } } -} \ No newline at end of file +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b931a20..d95d3bc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,6 +4,7 @@ mastercard.elevate.client.ref.app.consumer.key=dummy mastercard.elevate.client.ref.app.keystore.alias=dummyalias mastercard.elevate.client.ref.app.keystore.password=dummypassword mastercard.elevate.client.ref.app.encryption.file=src/main/resources/dummy.pem +mastercard.elevate.client.ref.app.read.timeout=60000 logging.level.root=INFO logging.level.org.springframework.*:INFO diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 4e70509..806e7ce 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -12,80 +12,109 @@