-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1755 from Adyen/feature/stored-twint
Stored twint
- Loading branch information
Showing
111 changed files
with
4,367 additions
and
747 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
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
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
26 changes: 26 additions & 0 deletions
26
components-core/src/main/java/com/adyen/checkout/components/core/ActionHandlingMethod.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,26 @@ | ||
/* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by oscars on 7/8/2024. | ||
*/ | ||
|
||
package com.adyen.checkout.components.core | ||
|
||
/** | ||
* Used to configure the method used to handle actions. | ||
*/ | ||
enum class ActionHandlingMethod { | ||
/** | ||
* The action will be handled in a native way (e.g. using a SDK). **If** there is no way to handle the action | ||
* natively, then a fallback method will be used (e.g. a web flow). | ||
*/ | ||
PREFER_NATIVE, | ||
|
||
/** | ||
* The action will be handled with a web flow. **If** there is no way to handle the action with a web flow, then | ||
* native method will be used. | ||
*/ | ||
PREFER_WEB, | ||
} |
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
54 changes: 54 additions & 0 deletions
54
...core/src/main/java/com/adyen/checkout/components/core/paymentmethod/TwintPaymentMethod.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,54 @@ | ||
/* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by oscars on 31/7/2024. | ||
*/ | ||
|
||
package com.adyen.checkout.components.core.paymentmethod | ||
|
||
import com.adyen.checkout.core.exception.ModelSerializationException | ||
import com.adyen.checkout.core.internal.data.model.getStringOrNull | ||
import kotlinx.parcelize.Parcelize | ||
import org.json.JSONException | ||
import org.json.JSONObject | ||
|
||
@Parcelize | ||
data class TwintPaymentMethod( | ||
override var type: String?, | ||
override var checkoutAttemptId: String?, | ||
var subtype: String? = null, | ||
var storedPaymentMethodId: String? = null, | ||
) : PaymentMethodDetails() { | ||
|
||
companion object { | ||
private const val SUBTYPE = "subtype" | ||
private const val STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId" | ||
|
||
@JvmField | ||
val SERIALIZER: Serializer<TwintPaymentMethod> = object : Serializer<TwintPaymentMethod> { | ||
override fun serialize(modelObject: TwintPaymentMethod): JSONObject { | ||
return try { | ||
JSONObject().apply { | ||
putOpt(TYPE, modelObject.type) | ||
putOpt(CHECKOUT_ATTEMPT_ID, modelObject.checkoutAttemptId) | ||
putOpt(SUBTYPE, modelObject.subtype) | ||
putOpt(STORED_PAYMENT_METHOD_ID, modelObject.storedPaymentMethodId) | ||
} | ||
} catch (e: JSONException) { | ||
throw ModelSerializationException(BlikPaymentMethod::class.java, e) | ||
} | ||
} | ||
|
||
override fun deserialize(jsonObject: JSONObject): TwintPaymentMethod { | ||
return TwintPaymentMethod( | ||
type = jsonObject.getStringOrNull(TYPE), | ||
checkoutAttemptId = jsonObject.getStringOrNull(CHECKOUT_ATTEMPT_ID), | ||
subtype = jsonObject.getStringOrNull(SUBTYPE), | ||
storedPaymentMethodId = jsonObject.getStringOrNull(STORED_PAYMENT_METHOD_ID), | ||
) | ||
} | ||
} | ||
} | ||
} |
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.