-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
94 additions
and
86 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
27 changes: 11 additions & 16 deletions
27
...sAndroid/src/main/java/com/emerchantpay/gateway/genesisandroid/api/constants/Endpoints.kt
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,23 +1,18 @@ | ||
package com.emerchantpay.gateway.genesisandroid.api.constants | ||
|
||
import java.io.Serializable | ||
enum class Endpoints(val endpointName: String) { | ||
// Domain for E-ComProcessing's Genesis instance | ||
ECOMPROCESSING("e-comprocessing.net"), | ||
|
||
class Endpoints(val endpointName: String) : Serializable { | ||
// Domain for Emerchantpay's Genesis instance | ||
EMERCHANTPAY("emerchantpay.net"), | ||
|
||
override fun toString(): String { | ||
return endpointName | ||
} | ||
|
||
companion object { | ||
// Domains for Consumer API | ||
RETRIEVE_CONSUMER_EMERCHANTPAY("emerchantpay.net/v1/retrieve_consumer"), | ||
RETRIEVE_CONSUMER_ECOMPROCESSING("e-comprocessing.net/v1/retrieve_consumer"); | ||
|
||
// Domain for E-ComProcessing's Genesis instance | ||
val ECOMPROCESSING = Endpoints("e-comprocessing.net") | ||
|
||
// Domain for Emerchantpay's Genesis instance | ||
val EMERCHANTPAY = Endpoints("emerchantpay.net") | ||
|
||
// Domains for Consumer API | ||
val RETRIEVE_CONSUMER_EMERCHANTPAY = Endpoints("emerchantpay.net/v1/retrieve_consumer") | ||
val RETRIEVE_CONSUMER_ECOMPROCESSING = Endpoints("e-comprocessing.net/v1/retrieve_consumer") | ||
override fun toString(): String { | ||
return endpointName | ||
} | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
GenesisAndroid/src/main/java/com/emerchantpay/gateway/genesisandroid/api/util/WebViewUtil.kt
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.emerchantpay.gateway.genesisandroid.api.util | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import com.emerchantpay.gateway.genesisandroid.api.constants.IntentExtras | ||
import com.emerchantpay.gateway.genesisandroid.api.constants.URLConstants | ||
|
||
class WebViewUtil { | ||
|
||
companion object { | ||
fun getResultIntent(url: String): Pair<Int?, Intent?> { | ||
val returnIntent = Intent() | ||
|
||
when { | ||
url.contains(URLConstants.FAILURE_ENDPOINT, ignoreCase = true) -> { | ||
returnIntent.putExtra(IntentExtras.EXTRA_RESULT, "failure") | ||
return Pair(Activity.RESULT_OK, returnIntent) | ||
} | ||
|
||
url.contains(URLConstants.CANCEL_ENDPOINT, ignoreCase = true) -> { | ||
returnIntent.putExtra("cancel", "cancel") | ||
return Pair(Activity.RESULT_CANCELED, returnIntent) | ||
} | ||
|
||
url.contains(URLConstants.SUCCESS_ENDPOINT, ignoreCase = true) -> { | ||
returnIntent.putExtra("success", "success") | ||
return Pair(Activity.RESULT_OK, returnIntent) | ||
} | ||
} | ||
return Pair(null, null) | ||
} | ||
} | ||
} |
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
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,6 @@ | ||
#Wed Dec 30 14:27:15 EET 2020 | ||
#Mon Apr 15 10:40:33 EEST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip |