Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 074676e

Browse files
author
WorldlineConnect
committedNov 12, 2024
Release 2.0.2.
1 parent f34a433 commit 074676e

File tree

9 files changed

+69
-52
lines changed

9 files changed

+69
-52
lines changed
 

‎build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
buildscript {
77
ext {
88
core_version = "1.13.1"
9-
appCompat_version = "1.6.1"
9+
appCompat_version = "1.7.0"
1010
material_version = "1.12.0"
11-
lifecycle_version = "2.8.0"
12-
navigation_version = '2.7.7'
13-
compose_version = '1.6.7'
11+
lifecycle_version = "2.8.7"
12+
navigation_version = '2.8.3'
13+
compose_version = '1.7.5'
1414
compose_material_version = '1.6.7'
1515
coroutines_version = '1.8.0'
16-
connectSDK_version = '7.0.2'
17-
googlePay_version = '19.3.0'
16+
connectSDK_version = '7.0.3'
17+
googlePay_version = '19.4.0'
1818
gson_version = '2.10.1'
1919
kotlin_jvm_target = '17'
2020
java_version = JavaVersion.VERSION_17

‎common/src/main/java/com/worldline/connect/android/example/kotlin/common/utils/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package com.worldline.connect.android.example.kotlin.common.utils
77
object Constants {
88

99
/** Application Identifier, used for identifying the application in network calls */
10-
const val APPLICATION_IDENTIFIER = "Android Example Application Kotlin/v2.0.1"
10+
const val APPLICATION_IDENTIFIER = "Android Example Application Kotlin/v2.0.2"
1111

1212
/** GooglePay identifier */
1313
const val GOOGLE_PAY_PRODUCT_ID = "320"

‎common/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<string name="payment_configuration_other_options" translatable="false">Other options</string>
3030
<string name="payment_configuration_recurring_payment" translatable="false">Payment is Recurring</string>
3131
<string name="payment_configuration_recurring_payment_helper_text" translatable="false">Indicates whether the payment product that is used for this payment should support recurring payments. If set to true, products not supporting recurring will be filtered</string>
32+
<string name="payment_configuration_payment_in_installments" translatable="false">Payment is in installments</string>
33+
<string name="payment_configuration_payment_in_installments_helper_text" translatable="false">Use this property to indicate whether the payment will be paid in instalments. This will be taken into account when determining the availability of credit cards when making an IIN details call</string>
3234
<string name="payment_configuration_group_payment_products" translatable="false">Group payment products</string>
3335
<string name="payment_configuration_group_payment_products_helper_text" translatable="false">Enabling this setting will bundle all Credit Card payment products to a single list item (Payment Product Group). The IIN Details service call can be used to determine what card product is actually used by the consumer.</string>
3436
<string name="payment_configuration_configure_google_pay" translatable="false">Configure Google Pay</string>

‎compose/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ dependencies {
8080
implementation "androidx.compose.ui:ui:$compose_version"
8181
implementation "androidx.compose.material:material:$compose_material_version"
8282
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
83-
implementation 'androidx.activity:activity-compose:1.9.0'
83+
implementation 'androidx.activity:activity-compose:1.9.3'
8484
implementation "com.google.accompanist:accompanist-navigation-animation:0.34.0"
8585
implementation "androidx.compose.material:material-icons-extended:$compose_material_version"
8686
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"

‎compose/src/main/java/com/worldline/connect/android/example/kotlin/compose/configuration/ConfigurationScreen.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ fun ConfigurationScreen(
5757
uiState.paymentDetailsFields[2].text),
5858
uiState.paymentDetailsFields[1].text,
5959
uiState.otherOptionsFields[0].isChecked.value,
60-
Locale.getDefault()
60+
Locale.getDefault(),
61+
uiState.otherOptionsFields[1].isChecked.value,
6162
),
62-
uiState.otherOptionsFields[1].isChecked.value
63+
uiState.otherOptionsFields[2].isChecked.value
6364
)
64-
if (uiState.otherOptionsFields[2].isChecked.value) {
65+
if (uiState.otherOptionsFields[3].isChecked.value) {
6566
paymentSharedViewModel.googlePayConfiguration = GooglePayConfiguration(true,
6667
uiState.googlePayFields[0].text,
6768
uiState.googlePayFields[1].text)
@@ -130,8 +131,11 @@ private fun ConfigurationContent(
130131
LabelledCheckbox(checkBoxField = uiState.otherOptionsFields[1], onTrailingIconClicked = {
131132
showBottomSheet(uiState.otherOptionsFields[1].bottomSheetContent)
132133
})
134+
LabelledCheckbox(checkBoxField = uiState.otherOptionsFields[2], onTrailingIconClicked = {
135+
showBottomSheet(uiState.otherOptionsFields[2].bottomSheetContent)
136+
})
133137
GooglePaySection(
134-
checkBoxField = uiState.otherOptionsFields[2],
138+
checkBoxField = uiState.otherOptionsFields[3],
135139
uiState.googlePayFields,
136140
showBottomSheet = { showBottomSheet(it) }
137141
)

‎compose/src/main/java/com/worldline/connect/android/example/kotlin/compose/configuration/ConfigurationViewModel.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ConfigurationViewModel : ViewModel() {
4545

4646
fun validateForm() {
4747
val googlePayFields =
48-
if (uiState.otherOptionsFields[2].isChecked.value) uiState.googlePayFields else emptyList()
48+
if (uiState.otherOptionsFields[3].isChecked.value) uiState.googlePayFields else emptyList()
4949
val inputFields =
5050
concatenate(uiState.sessionDetailFields, uiState.paymentDetailsFields, googlePayFields)
5151
inputFields.forEach { textField ->
@@ -131,6 +131,10 @@ data class ConfigurationUiState(
131131
label = R.string.payment_configuration_recurring_payment,
132132
bottomSheetContent = BottomSheetContent(R.string.payment_configuration_recurring_payment_helper_text)
133133
),
134+
CheckBoxField(
135+
label = R.string.payment_configuration_payment_in_installments,
136+
bottomSheetContent = BottomSheetContent(R.string.payment_configuration_payment_in_installments_helper_text)
137+
),
134138
CheckBoxField(
135139
label = R.string.payment_configuration_group_payment_products,
136140
bottomSheetContent = BottomSheetContent(R.string.payment_configuration_group_payment_products_helper_text)

‎xml/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959
implementation "androidx.appcompat:appcompat:$appCompat_version"
6060
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
6161
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
62-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
62+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
6363
implementation "androidx.cardview:cardview:1.0.0"
6464

6565
// UI

‎xml/src/main/java/com/worldline/connect/android/example/kotlin/xml/PaymentConfigurationFragment.kt

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -121,69 +121,51 @@ class PaymentConfigurationFragment : Fragment() {
121121
private fun initInputFieldsDrawableEndClickListeners() {
122122
binding.apply {
123123
tilPaymentConfigurationClientSessionId.setEndIconOnClickListener {
124-
showInputFieldExplanationTextBottomSheetDialog(
125-
getString(R.string.payment_configuration_client_session_id_helper_text)
126-
)
124+
showBottomSheetDialog(getString(R.string.payment_configuration_client_session_id_helper_text))
127125
}
128126

129127
tilPaymentConfigurationCustomerId.setEndIconOnClickListener {
130-
showInputFieldExplanationTextBottomSheetDialog(
131-
getString(R.string.payment_configuration_customer_id_helper_text)
132-
)
128+
showBottomSheetDialog(getString(R.string.payment_configuration_customer_id_helper_text))
133129
}
134130

135131
tilPaymentConfigurationClientApiUrl.setEndIconOnClickListener {
136-
showInputFieldExplanationTextBottomSheetDialog(
137-
getString(R.string.payment_configuration_clientApiUrl_helper_text)
138-
)
132+
showBottomSheetDialog(getString(R.string.payment_configuration_clientApiUrl_helper_text))
139133
}
140134

141135
tilPaymentConfigurationAssetsUrl.setEndIconOnClickListener {
142-
showInputFieldExplanationTextBottomSheetDialog(
143-
getString(R.string.payment_configuration_assetsUrl_helper_text)
144-
)
136+
showBottomSheetDialog(getString(R.string.payment_configuration_assetsUrl_helper_text))
145137
}
146138

147139
tilPaymentConfigurationAmount.setEndIconOnClickListener {
148-
showInputFieldExplanationTextBottomSheetDialog(
149-
getString(R.string.payment_configuration_amount_helper_text)
150-
)
140+
showBottomSheetDialog(getString(R.string.payment_configuration_amount_helper_text))
151141
}
152142

153143
tilPaymentConfigurationCountryCode.setEndIconOnClickListener {
154-
showInputFieldExplanationTextBottomSheetDialog(
155-
getString(R.string.payment_configuration_country_code_helper_text)
156-
)
144+
showBottomSheetDialog(getString(R.string.payment_configuration_country_code_helper_text))
157145
}
158146

159147
tilPaymentConfigurationCurrencyCode.setEndIconOnClickListener {
160-
showInputFieldExplanationTextBottomSheetDialog(
161-
getString(R.string.payment_configuration_currency_code_helper_text)
162-
)
148+
showBottomSheetDialog(getString(R.string.payment_configuration_currency_code_helper_text))
163149
}
164150

165151
tilPaymentConfigurationMerchantId.setEndIconOnClickListener {
166-
showInputFieldExplanationTextBottomSheetDialog(
167-
getString(R.string.payment_configuration_merchant_name_helper_text)
168-
)
152+
showBottomSheetDialog(getString(R.string.payment_configuration_merchant_name_helper_text))
169153
}
170154

171155
tilPaymentConfigurationMerchantName.setEndIconOnClickListener {
172-
showInputFieldExplanationTextBottomSheetDialog(
173-
getString(R.string.payment_configuration_merchant_name_helper_text)
174-
)
156+
showBottomSheetDialog(getString(R.string.payment_configuration_merchant_name_helper_text))
175157
}
176158

177159
ivPaymentConfigurationRecurringPaymentHelperIcon.setOnClickListener {
178-
showInputFieldExplanationTextBottomSheetDialog(
179-
getString(R.string.payment_configuration_recurring_payment_helper_text)
180-
)
160+
showBottomSheetDialog(getString(R.string.payment_configuration_recurring_payment_helper_text))
161+
}
162+
163+
ivPaymentConfigurationPaymentInInstallmentsIcon.setOnClickListener {
164+
showBottomSheetDialog(getString(R.string.payment_configuration_payment_in_installments_helper_text))
181165
}
182166

183167
ivPaymentConfigurationGroupPaymentProductsHelperIcon.setOnClickListener {
184-
showInputFieldExplanationTextBottomSheetDialog(
185-
getString(R.string.payment_configuration_group_payment_products_helper_text)
186-
)
168+
showBottomSheetDialog(getString(R.string.payment_configuration_group_payment_products_helper_text))
187169
}
188170
}
189171
}
@@ -290,8 +272,9 @@ class PaymentConfigurationFragment : Fragment() {
290272
amount, binding.etPaymentConfigurationCurrencyCode.text.toString()
291273
),
292274
binding.etPaymentConfigurationCountryCode.text.toString(),
293-
false,
294-
context?.getCurrentLocale()
275+
binding.cbPaymentConfigurationRecurringPayment.isChecked,
276+
context?.getCurrentLocale(),
277+
binding.cbPaymentConfigurationPaymentInInstallments.isChecked,
295278
),
296279
binding.cbPaymentConfigurationGroupPaymentProducts.isChecked
297280
)
@@ -355,11 +338,11 @@ class PaymentConfigurationFragment : Fragment() {
355338
}
356339
}
357340

358-
private fun showInputFieldExplanationTextBottomSheetDialog(explanationText: String) {
341+
private fun showBottomSheetDialog(bottomSheetText: String) {
359342
BottomSheetDialog(requireContext()).apply {
360343
setContentView(R.layout.bottomsheet_information)
361344
findViewById<TextView>(R.id.tvInformationText)?.apply {
362-
text = explanationText
345+
text = bottomSheetText
363346
}
364347
}.show()
365348
}

‎xml/src/main/res/layout/fragment_payment_configuration.xml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,38 @@
225225
app:layout_constraintStart_toEndOf="@+id/cbPaymentConfigurationRecurringPayment"
226226
app:layout_constraintTop_toTopOf="@+id/cbPaymentConfigurationRecurringPayment" />
227227

228+
<com.google.android.material.checkbox.MaterialCheckBox
229+
android:id="@+id/cbPaymentConfigurationPaymentInInstallments"
230+
android:layout_width="0dp"
231+
android:layout_height="wrap_content"
232+
android:text="@string/payment_configuration_payment_in_installments"
233+
app:layout_constraintEnd_toStartOf="@+id/ivPaymentConfigurationPaymentInInstallmentsIcon"
234+
app:layout_constraintStart_toStartOf="parent"
235+
app:layout_constraintTop_toBottomOf="@+id/cbPaymentConfigurationRecurringPayment" />
236+
237+
<ImageView
238+
android:id="@+id/ivPaymentConfigurationPaymentInInstallmentsIcon"
239+
android:layout_width="wrap_content"
240+
android:layout_height="wrap_content"
241+
android:layout_marginStart="@dimen/margin_8"
242+
android:layout_marginEnd="@dimen/margin_12"
243+
android:src="@drawable/ic_info"
244+
android:background="?attr/selectableItemBackground"
245+
android:clickable="true"
246+
android:focusable="true"
247+
app:layout_constraintBottom_toBottomOf="@+id/cbPaymentConfigurationPaymentInInstallments"
248+
app:layout_constraintEnd_toEndOf="parent"
249+
app:layout_constraintStart_toEndOf="@+id/cbPaymentConfigurationPaymentInInstallments"
250+
app:layout_constraintTop_toTopOf="@+id/cbPaymentConfigurationPaymentInInstallments" />
251+
228252
<com.google.android.material.checkbox.MaterialCheckBox
229253
android:id="@+id/cbPaymentConfigurationGroupPaymentProducts"
230254
android:layout_width="0dp"
231255
android:layout_height="wrap_content"
232256
android:text="@string/payment_configuration_group_payment_products"
233257
app:layout_constraintEnd_toStartOf="@+id/ivPaymentConfigurationGroupPaymentProductsHelperIcon"
234258
app:layout_constraintStart_toStartOf="parent"
235-
app:layout_constraintTop_toBottomOf="@+id/cbPaymentConfigurationRecurringPayment" />
259+
app:layout_constraintTop_toBottomOf="@+id/cbPaymentConfigurationPaymentInInstallments" />
236260

237261
<ImageView
238262
android:id="@+id/ivPaymentConfigurationGroupPaymentProductsHelperIcon"

0 commit comments

Comments
 (0)
Please sign in to comment.