-
Notifications
You must be signed in to change notification settings - Fork 21
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
37 changed files
with
404 additions
and
208 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
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
6 changes: 4 additions & 2 deletions
6
...form/src/main/java/com/mercadolibre/android/cardform/data/model/response/CardResultDto.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,12 +1,14 @@ | ||
package com.mercadolibre.android.cardform.data.model.response | ||
|
||
import android.os.Parcelable | ||
import com.mercadopago.android.px.addons.tokenization.TokenizationResponse | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
@Parcelize | ||
data class CardResultDto( | ||
val cardId: String, | ||
val bin: String, | ||
val paymentType: String, | ||
val lastFourDigits: String | ||
) : Parcelable | ||
val lastFourDigits: String, | ||
val tokenizationResponse: TokenizationResponse? = null | ||
) : Parcelable |
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
9 changes: 0 additions & 9 deletions
9
.../main/java/com/mercadolibre/android/cardform/data/repository/CardAssociationRepository.kt
This file was deleted.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
.../main/java/com/mercadolibre/android/cardform/data/repository/TokenDeviceRepositoryImpl.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,21 @@ | ||
package com.mercadolibre.android.cardform.data.repository | ||
|
||
import com.mercadolibre.android.cardform.base.Response | ||
import com.mercadolibre.android.cardform.base.ResponseCallback | ||
import com.mercadolibre.android.cardform.domain.TokenDeviceRepository | ||
import com.mercadopago.android.px.addons.TokenDeviceBehaviour | ||
import com.mercadopago.android.px.addons.tokenization.Tokenize | ||
|
||
internal class TokenDeviceRepositoryImpl( | ||
private val flowId: String, | ||
private val sessionId: String, | ||
private val tokenDeviceBehaviour: TokenDeviceBehaviour | ||
) : TokenDeviceRepository { | ||
|
||
override val isFeatureAvailable: Boolean | ||
get() = tokenDeviceBehaviour.isFeatureAvailable | ||
|
||
override fun get(cardId: String): ResponseCallback<Tokenize> { | ||
return Response.Success(tokenDeviceBehaviour.getTokenize(flowId, cardId).sessionId(sessionId)) | ||
} | ||
} |
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
7 changes: 3 additions & 4 deletions
7
cardform/src/main/java/com/mercadolibre/android/cardform/data/service/TokenizeService.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,15 +1,14 @@ | ||
package com.mercadolibre.android.cardform.data.service | ||
|
||
import com.mercadolibre.android.cardform.data.model.body.CardInfoBody | ||
import com.mercadolibre.android.cardform.data.model.response.CardToken | ||
import com.mercadolibre.android.cardform.data.model.response.CardTokenDM | ||
import retrofit2.Response | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
import retrofit2.http.Query | ||
|
||
internal interface TokenizeService { | ||
@POST("/v1/card_tokens") | ||
suspend fun createTokenAsync( | ||
@Body cardInfoBody: CardInfoBody | ||
): Response<CardToken> | ||
} | ||
): Response<CardTokenDM> | ||
} |
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
Oops, something went wrong.