Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ Contributions to PG Java SDK are welcome! Here's how you can contribute:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
3. make sure to setup the pre-commit hook by running the command `pre-commit install`
4. Commit your changes (`git commit -m 'Add some amazing feature'`)
5. Push to the branch (`git push origin feature/amazing-feature`)
6. Open a Pull Request

Please ensure your code follows the project's coding standards and includes appropriate tests.

Expand Down
2 changes: 1 addition & 1 deletion formatter.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<profiles version="21">
<profile kind="CodeFormatterProfile" name="OM Formatter" version="21">
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.phonepe</groupId>
<artifactId>pg-sdk-java</artifactId>
<version>2.2.1</version>
<version>2.2.2</version>
<name>B2B JAVA SDK</name>
<url>https://github.com/PhonePe/phonepe-pg-sdk-java</url>
<description>Phonepe PG JAVA SDK</description>
Expand Down
51 changes: 26 additions & 25 deletions src/main/java/com/phonepe/sdk/pg/common/constants/Headers.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,32 @@
@Slf4j
public class Headers {

private final Properties properties = new Properties();
private final String PROPERTIES_FILE_NAME = "/sdk.properties";
private final Properties properties = new Properties();
private final String PROPERTIES_FILE_NAME = "/sdk.properties";

static {
try (InputStream input = Headers.class.getResourceAsStream(PROPERTIES_FILE_NAME)) {
if (input == null) {
log.error("Could not find {}", PROPERTIES_FILE_NAME);
} else {
properties.load(input);
}
} catch (Exception e) {
log.error("Failed to load SDK properties: {}", e.getMessage());
}
}
static {
try (InputStream input = Headers.class.getResourceAsStream(PROPERTIES_FILE_NAME)) {
if (input == null) {
log.error("Could not find {}", PROPERTIES_FILE_NAME);
} else {
properties.load(input);
}
} catch (Exception e) {
log.error("Failed to load SDK properties: {}", e.getMessage());
}
}

public static final String API_VERSION = "V2";
public static final String SUBSCRIPTION_API_VERSION = properties.getProperty("sdk.version");
public static final String INTEGRATION = "API";
public static final String SDK_VERSION = properties.getProperty("sdk.version");
public static final String SDK_TYPE = "BACKEND_JAVA_SDK";
public static final String SOURCE = "x-source";
public static final String SOURCE_VERSION = "x-source-version";
public static final String SOURCE_PLATFORM = "x-source-platform";
public static final String SOURCE_PLATFORM_VERSION = "x-source-platform-version";
public static final String OAUTH_AUTHORIZATION = "Authorization";
public static final String CONTENT_TYPE = "Content-Type";
public static final String ACCEPT = "Accept";
public static final String API_VERSION = "V2";
public static final String SUBSCRIPTION_API_VERSION = properties.getProperty("sdk.version");
public static final String INTEGRATION = "API";
public static final String SDK_VERSION = properties.getProperty("sdk.version");
public static final String SDK_TYPE = "BACKEND_JAVA_SDK";
public static final String SOURCE = "x-source";
public static final String SOURCE_VERSION = "x-source-version";
public static final String SOURCE_PLATFORM = "x-source-platform";
public static final String SOURCE_PLATFORM_VERSION = "x-source-platform-version";
public static final String OAUTH_AUTHORIZATION = "Authorization";
public static final String CONTENT_TYPE = "Content-Type";
public static final String ACCEPT = "Accept";
public static final String X_DEVICE_OS = "x-device-os";
}
Loading