@@ -29,6 +29,7 @@ import com.adyen.checkout.core.common.AdyenLogLevel
2929import com.adyen.checkout.core.common.helper.runCompileOnly
3030import com.adyen.checkout.core.common.internal.helper.adyenLog
3131import com.adyen.checkout.core.common.internal.helper.bufferedChannel
32+ import com.adyen.checkout.core.common.ui.model.ExpiryDate
3233import com.adyen.checkout.core.components.data.PaymentComponentData
3334import com.adyen.checkout.core.components.internal.PaymentComponentEvent
3435import com.adyen.checkout.core.components.internal.ui.PaymentComponent
@@ -162,14 +163,13 @@ internal class CardComponent(
162163// val cvc = outputData.securityCodeState.value
163164// if (cvc.isNotEmpty()) unencryptedCardBuilder.setCvc(cvc)
164165// }
165- // val expiryDateResult = outputData.expiryDateState.value
166- // if (expiryDateResult.isNotBlank()) {
167- // val expiryDate = ExpiryDate.from(expiryDateResult)
168- // unencryptedCardBuilder.setExpiryDate(
169- // expiryMonth = expiryDate.expiryMonth.toString(),
170- // expiryYear = expiryDate.expiryYear.toString(),
171- // )
172- // }
166+ if (expiryDate.text.isNotBlank()) {
167+ val expiryDate = ExpiryDate .from(expiryDate.text)
168+ unencryptedCardBuilder.setExpiryDate(
169+ expiryMonth = expiryDate.expiryMonth.toString(),
170+ expiryYear = expiryDate.expiryYear.toString(),
171+ )
172+ }
173173
174174 cardEncryptor.encryptFields(unencryptedCardBuilder.build(), publicKey)
175175 } catch (_: EncryptionException ) {
@@ -194,8 +194,8 @@ internal class CardComponent(
194194 checkoutAttemptId = analyticsManager.getCheckoutAttemptId(),
195195 ).apply {
196196 encryptedCardNumber = encryptedCard.encryptedCardNumber
197- // encryptedExpiryMonth = encryptedCard.encryptedExpiryMonth
198- // encryptedExpiryYear = encryptedCard.encryptedExpiryYear
197+ encryptedExpiryMonth = encryptedCard.encryptedExpiryMonth
198+ encryptedExpiryYear = encryptedCard.encryptedExpiryYear
199199
200200// if (!isCvcHidden()) {
201201// encryptedSecurityCode = encryptedCard.encryptedSecurityCode
0 commit comments