@@ -24,6 +24,7 @@ import com.adyen.checkout.core.analytics.internal.AnalyticsManager
2424import com.adyen.checkout.core.analytics.internal.ErrorEvent
2525import com.adyen.checkout.core.analytics.internal.GenericEvents
2626import com.adyen.checkout.core.common.internal.helper.bufferedChannel
27+ import com.adyen.checkout.core.common.ui.model.ExpiryDate
2728import com.adyen.checkout.core.components.data.PaymentComponentData
2829import com.adyen.checkout.core.components.internal.PaymentComponentEvent
2930import com.adyen.checkout.core.components.internal.ui.PaymentComponent
@@ -151,14 +152,13 @@ internal class CardComponent(
151152// val cvc = outputData.securityCodeState.value
152153// if (cvc.isNotEmpty()) unencryptedCardBuilder.setCvc(cvc)
153154// }
154- // val expiryDateResult = outputData.expiryDateState.value
155- // if (expiryDateResult.isNotBlank()) {
156- // val expiryDate = ExpiryDate.from(expiryDateResult)
157- // unencryptedCardBuilder.setExpiryDate(
158- // expiryMonth = expiryDate.expiryMonth.toString(),
159- // expiryYear = expiryDate.expiryYear.toString(),
160- // )
161- // }
155+ if (expiryDate.text.isNotBlank()) {
156+ val expiryDate = ExpiryDate .from(expiryDate.text)
157+ unencryptedCardBuilder.setExpiryDate(
158+ expiryMonth = expiryDate.expiryMonth.toString(),
159+ expiryYear = expiryDate.expiryYear.toString(),
160+ )
161+ }
162162
163163 cardEncryptor.encryptFields(unencryptedCardBuilder.build(), componentParams.publicKey)
164164 } catch (_: EncryptionException ) {
@@ -183,8 +183,8 @@ internal class CardComponent(
183183 checkoutAttemptId = analyticsManager.getCheckoutAttemptId(),
184184 ).apply {
185185 encryptedCardNumber = encryptedCard.encryptedCardNumber
186- // encryptedExpiryMonth = encryptedCard.encryptedExpiryMonth
187- // encryptedExpiryYear = encryptedCard.encryptedExpiryYear
186+ encryptedExpiryMonth = encryptedCard.encryptedExpiryMonth
187+ encryptedExpiryYear = encryptedCard.encryptedExpiryYear
188188
189189// if (!isCvcHidden()) {
190190// encryptedSecurityCode = encryptedCard.encryptedSecurityCode
0 commit comments