Skip to content

Commit

Permalink
Merge pull request #16 from adimillenium/master
Browse files Browse the repository at this point in the history
NEW PSP changes for reference app
  • Loading branch information
ajitkumarchauhan1704 authored Jan 16, 2024
2 parents 6cfa69e + a101963 commit 729b7b9
Show file tree
Hide file tree
Showing 4 changed files with 792 additions and 174 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ the License. You may obtain a copy of the License at:</p>
</code></pre>
<p>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.</p>
specific language governing permissions and limitations under the License.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -123,4 +123,4 @@ public static String resourceContent(String classpathName) {
throw new IllegalArgumentException("Cannot load resource from classpath '" + classpathName + "'.", ex);
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 729b7b9

Please sign in to comment.