Skip to content

Commit

Permalink
1.3.91
Browse files Browse the repository at this point in the history
  • Loading branch information
plpt88 committed Jun 23, 2023
1 parent 4e2032e commit b52858f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GenesisAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'kotlin-kapt'

ext {
PUBLISH_GROUP_ID = 'com.emerchantpay.gateway'
PUBLISH_VERSION = '1.3.9'
PUBLISH_VERSION = '1.3.91'
PUBLISH_ARTIFACT_ID = 'genesis-android'
PUBLISH_DESCRIPTION = 'Genesis Android SDK'
PUBLISH_URL = 'https://github.com/GenesisGateway/android_sdk'
Expand All @@ -27,7 +27,7 @@ android {
minSdkVersion 19
targetSdkVersion 33
versionCode 1
versionName "1.3.9"
versionName "1.3.91"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ enum class WPFTransactionTypes(val value: String) {
// 3D-Secure Sale
SALE3D("sale3d"),

// Standard initial recurring
INIT_RECURRING_SALE("init_recurring_sale"),

// 3D-based initial recurring
INIT_RECURRING_SALE3D("init_recurring_sale3d"),

// Card verification without any financial impact
// Payment using credit or debit cards connected to a consumer's Google account
GOOGLE_PAY("google_pay"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,7 @@ open class PaymentRequest : Request, PaymentAttributes, CustomerInfoAttributes,
paymentRequestBuilder?.addElement("threeds_v2_params", buildThreeDsV2Attributes().toXML())
}

if (transactionTypesList.contains("authorize")
|| transactionTypesList.contains("authorize3d")
|| transactionTypesList.contains("sale")
|| transactionTypesList.contains("sale3d")) {
if (isRecurringEnabled(transactionTypesList)) {
recurringType?.let {
paymentRequestBuilder?.addElement("recurring_type", it)
}
Expand Down Expand Up @@ -548,6 +545,15 @@ open class PaymentRequest : Request, PaymentAttributes, CustomerInfoAttributes,
return "wpf_payment"
}

private fun isRecurringEnabled(transactionTypesList: List<String>): Boolean {
return (transactionTypesList.contains(WPFTransactionTypes.AUTHORIZE.value)
|| transactionTypesList.contains(WPFTransactionTypes.AUTHORIZE3D.value)
|| transactionTypesList.contains(WPFTransactionTypes.SALE.value)
|| transactionTypesList.contains(WPFTransactionTypes.SALE3D.value)
|| transactionTypesList.contains(WPFTransactionTypes.INIT_RECURRING_SALE.value)
|| transactionTypesList.contains(WPFTransactionTypes.INIT_RECURRING_SALE3D.value))
}

companion object {
fun getAmount(paymentRequest: PaymentRequest): BigDecimal? {
return paymentRequest.amount
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cd GenesisAndroid
* Add the dependency in your build.gradle:
```
dependencies {
implementation 'com.emerchantpay.gateway:genesis-android:1.3.9'
implementation 'com.emerchantpay.gateway:genesis-android:1.3.91'
}
```

Expand Down

0 comments on commit b52858f

Please sign in to comment.