-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from TransbankDevelopers/chore/prepare-releas…
…e-5.0.0 chore: prepare release 5.0.0
- Loading branch information
Showing
120 changed files
with
3,975 additions
and
1,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
package cl.transbank.common; | ||
|
||
/** | ||
* This class contains the constants used in the API. | ||
*/ | ||
public class ApiConstants { | ||
public static String WEBPAY_ENDPOINT = "rswebpaytransaction/api/webpay/v1.2"; | ||
public static String ONECLICK_ENDPOINT = "rswebpaytransaction/api/oneclick/v1.2"; | ||
public static String PATPASS_COMERCIO_ENDPOINT = "restpatpass/v1/services"; | ||
|
||
public static int BUY_ORDER_LENGTH = 26; | ||
public static int SESSION_ID_LENGTH = 61; | ||
public static int RETURN_URL_LENGTH = 255; | ||
public static int AUTHORIZATION_CODE_LENGTH = 6; | ||
public static int CARD_EXPIRATION_DATE_LENGTH = 5; | ||
public static int CARD_NUMBER_LENGTH = 19; | ||
public static int TBK_USER_LENGTH = 40; | ||
public static int USER_NAME_LENGTH = 40; | ||
public static int COMMERCE_CODE_LENGTH = 12; | ||
public static int TOKEN_LENGTH = 64; | ||
public static int EMAIL_LENGTH = 100; | ||
public static final String WEBPAY_ENDPOINT = | ||
"rswebpaytransaction/api/webpay/v1.2"; | ||
public static final String ONECLICK_ENDPOINT = | ||
"rswebpaytransaction/api/oneclick/v1.2"; | ||
public static final String PATPASS_COMERCIO_ENDPOINT = | ||
"restpatpass/v1/services"; | ||
public static final String HEADER_COMMERCE_CODE_NAME = "Tbk-Api-Key-Id"; | ||
public static final String HEADER_API_KEY_NAME = "Tbk-Api-Key-Secret"; | ||
public static final int BUY_ORDER_LENGTH = 26; | ||
public static final int SESSION_ID_LENGTH = 61; | ||
public static final int RETURN_URL_LENGTH = 255; | ||
public static final int AUTHORIZATION_CODE_LENGTH = 6; | ||
public static final int CARD_EXPIRATION_DATE_LENGTH = 5; | ||
public static final int CARD_NUMBER_LENGTH = 19; | ||
public static final int TBK_USER_LENGTH = 40; | ||
public static final int USER_NAME_LENGTH = 40; | ||
public static final int COMMERCE_CODE_LENGTH = 12; | ||
public static final int TOKEN_LENGTH = 64; | ||
public static final int EMAIL_LENGTH = 100; | ||
public static final String TOKEN_TEXT = "token"; | ||
public static final String BUY_ORDER_TEXT = "buyOrder"; | ||
|
||
/** | ||
* Private constructor to prevent instantiation. | ||
*/ | ||
private ApiConstants() { | ||
// This constructor is intentionally empty. Nothing to see here. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
package cl.transbank.common; | ||
|
||
/** | ||
* This class holds the API keys for the integration environment. | ||
*/ | ||
public class IntegrationApiKeys { | ||
public static String WEBPAY = "579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C"; | ||
public static String PATPASS_COMERCIO = "cxxXQgGD9vrVe4M41FIt"; | ||
|
||
/** | ||
* The API key for Webpay in the integration environment. | ||
*/ | ||
public static final String WEBPAY = | ||
"579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C"; | ||
|
||
/** | ||
* The API key for Patpass Comercio in the integration environment. | ||
*/ | ||
public static final String PATPASS_COMERCIO = "cxxXQgGD9vrVe4M41FIt"; | ||
|
||
/** | ||
* Private constructor to prevent instantiation. | ||
*/ | ||
private IntegrationApiKeys() { | ||
// This constructor is intentionally empty. | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/cl/transbank/common/IntegrationCommerceCodes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 43 additions & 22 deletions
65
src/main/java/cl/transbank/common/IntegrationTypeHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,51 @@ | ||
package cl.transbank.common; | ||
|
||
/** | ||
* This class provides helper methods to get the integration type for Webpay and Patpass. | ||
*/ | ||
public class IntegrationTypeHelper { | ||
public static String getWebpayIntegrationType(IntegrationType integrationType){ | ||
switch(integrationType){ | ||
case LIVE: | ||
return "https://webpay3g.transbank.cl"; | ||
case MOCK: | ||
return ""; | ||
case TEST: | ||
return "https://webpay3gint.transbank.cl"; | ||
case SERVER_MOCK: | ||
return "http://localhost:8888"; | ||
} | ||
|
||
/** | ||
* Returns the Webpay integration type based on the provided integration type. | ||
* @param integrationType The integration type. | ||
* @return The Webpay integration URL. | ||
*/ | ||
public static String getWebpayIntegrationType( | ||
IntegrationType integrationType | ||
) { | ||
switch (integrationType) { | ||
case LIVE: | ||
return "https://webpay3g.transbank.cl"; | ||
case MOCK: | ||
return ""; | ||
case TEST: | ||
return "https://webpay3gint.transbank.cl"; | ||
case SERVER_MOCK: | ||
return "http://localhost:8888"; | ||
default: | ||
return "https://webpay3gint.transbank.cl"; | ||
} | ||
public static String getPatpassIntegrationType(IntegrationType integrationType){ | ||
switch(integrationType){ | ||
case LIVE: | ||
return "https://www.pagoautomaticocontarjetas.cl"; | ||
case MOCK: | ||
return ""; | ||
case TEST: | ||
return "https://pagoautomaticocontarjetasint.transbank.cl"; | ||
case SERVER_MOCK: | ||
return "http://localhost:8888"; | ||
} | ||
} | ||
|
||
/** | ||
* Returns the Patpass integration type based on the provided integration type. | ||
* @param integrationType The integration type. | ||
* @return The Patpass integration URL. | ||
*/ | ||
public static String getPatpassIntegrationType( | ||
IntegrationType integrationType | ||
) { | ||
switch (integrationType) { | ||
case LIVE: | ||
return "https://www.pagoautomaticocontarjetas.cl"; | ||
case MOCK: | ||
return ""; | ||
case TEST: | ||
return "https://pagoautomaticocontarjetasint.transbank.cl"; | ||
case SERVER_MOCK: | ||
return "http://localhost:8888"; | ||
default: | ||
return "https://pagoautomaticocontarjetasint.transbank.cl"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.