Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e5a9c93
ConfigurationCache
vitalii-vanziak-cko Sep 16, 2025
6da9164
RedirectConfiguration
vitalii-vanziak-cko Sep 30, 2025
9b32941
Apply RedirectConfiguration to main constructor and usages
vitalii-vanziak-cko Sep 30, 2025
ef1e418
Update example app
vitalii-vanziak-cko Sep 30, 2025
06568d6
Pass callback to launcher
vitalii-vanziak-cko Oct 1, 2025
5d10c4c
Pass services to launcher
vitalii-vanziak-cko Oct 1, 2025
4aff5ed
Init customTabLauncher
vitalii-vanziak-cko Oct 1, 2025
1a2d433
launchHeadlessMode()
vitalii-vanziak-cko Oct 1, 2025
aeab894
launchActivity()
vitalii-vanziak-cko Oct 1, 2025
6c66497
completeHeadlessMode()
vitalii-vanziak-cko Oct 1, 2025
a307fd1
Fetch payment details
vitalii-vanziak-cko Oct 1, 2025
4fea2f4
Add 'initialResponse' to Flow configuration
vitalii-vanziak-cko Oct 2, 2025
1148b5e
Use 'initialResponse' in interactor when its non-null in configuration
vitalii-vanziak-cko Oct 6, 2025
ac38499
Set 'initialResponse' in configuration during headless mode
vitalii-vanziak-cko Oct 6, 2025
580a833
Handle UNKNOWN state
vitalii-vanziak-cko Oct 6, 2025
35dbdcc
Handle SUCCESS state
vitalii-vanziak-cko Oct 6, 2025
b659d26
Handle PENDING state
vitalii-vanziak-cko Oct 6, 2025
ff77a7c
Code fix
vitalii-vanziak-cko Oct 6, 2025
7d34bf1
handleNextStep()
vitalii-vanziak-cko Oct 6, 2025
c34c1f9
Rename methods
vitalii-vanziak-cko Oct 6, 2025
a43f9e6
handleRedirect()
vitalii-vanziak-cko Oct 6, 2025
dec8215
Complete when configuration is not cached
vitalii-vanziak-cko Oct 8, 2025
81ad87c
Log
vitalii-vanziak-cko Oct 8, 2025
0e8d312
Dispatch DidFail event
vitalii-vanziak-cko Oct 8, 2025
fae4d3a
LogAttributes
vitalii-vanziak-cko Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ class NativeApmFragment : BaseFragment<FragmentNativeApmBinding>(
gatewayConfigurationId = uiModel.gatewayConfigurationId
),
cancelButton = CancelButton(),
returnUrl = Constants.RETURN_URL,
redirect = RedirectConfiguration(
returnUrl = Constants.RETURN_URL
),
paymentConfirmation = PaymentConfirmationConfiguration(
confirmButton = Button(),
cancelButton = CancelButton(disabledForSeconds = 3)
Expand All @@ -134,11 +136,15 @@ class NativeApmFragment : BaseFragment<FragmentNativeApmBinding>(
customerTokenId = uiModel.customerTokenId
),
cancelButton = CancelButton(),
returnUrl = Constants.RETURN_URL,
redirect = RedirectConfiguration(
returnUrl = Constants.RETURN_URL,
enableHeadlessMode = true
),
paymentConfirmation = PaymentConfirmationConfiguration(
confirmButton = Button(),
cancelButton = CancelButton(disabledForSeconds = 3)
)
),
success = null
)
)
AUTHORIZE_LEGACY -> launcherLegacy.launch(
Expand All @@ -155,7 +161,9 @@ class NativeApmFragment : BaseFragment<FragmentNativeApmBinding>(
gatewayConfigurationId = uiModel.gatewayConfigurationId
),
cancelButton = CancelButton(),
returnUrl = Constants.RETURN_URL,
redirect = RedirectConfiguration(
returnUrl = Constants.RETURN_URL
),
paymentConfirmation = PaymentConfirmationConfiguration(
confirmButton = Button(),
cancelButton = CancelButton(disabledForSeconds = 3)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
package com.processout.sdk.api.model.response

import android.os.Parcelable
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.Parcelize

/**
* Image resource for light/dark themes.
*
* @param[lightUrl] URL to image for light theme.
* @param[darkUrl] URL to image for dark theme.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class POImageResource(
@Json(name = "light_url")
val lightUrl: ResourceUrl,
@Json(name = "dark_url")
val darkUrl: ResourceUrl?
) {
) : Parcelable {

/**
* Image resource URL.
*
* @param[raster] URL to raster image.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class ResourceUrl(
val raster: String
)
) : Parcelable
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.processout.sdk.api.model.response.napm.v2

import android.os.Parcelable
import com.processout.sdk.api.model.response.napm.v2.PONativeAlternativePaymentAuthorizationResponse.Invoice
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.Parcelize

/**
* Specifies details of native alternative payment.
Expand All @@ -13,25 +15,27 @@ import com.squareup.moshi.JsonClass
* @param[elements] An ordered list of elements that needs to be rendered on the UI during native alternative payment flow.
* @param[redirect] Indicates required redirect.
*/
@Parcelize
data class PONativeAlternativePaymentAuthorizationResponse(
val state: PONativeAlternativePaymentState,
val invoice: Invoice,
val paymentMethod: PONativeAlternativePaymentMethodDetails,
val elements: List<PONativeAlternativePaymentElement>?,
val redirect: PONativeAlternativePaymentRedirect?
) {
) : Parcelable {

/**
* Invoice details.
*
* @param[amount] Invoice amount.
* @param[currency] Invoice currency.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Invoice(
val amount: String,
val currency: String
)
) : Parcelable
}

@JsonClass(generateAdapter = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
package com.processout.sdk.api.model.response.napm.v2

import android.os.Parcelable
import com.processout.sdk.api.model.response.POBarcode
import com.processout.sdk.api.model.response.POImageResource
import com.processout.sdk.core.annotation.ProcessOutInternalApi
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.Parcelize

/**
* Specifies instruction for the customer, providing additional information and/or describing required actions.
*/
sealed class PONativeAlternativePaymentCustomerInstruction {
sealed class PONativeAlternativePaymentCustomerInstruction : Parcelable {

/**
* Customer instruction provided as a markdown text.
*
* @param[label] Optional label.
* @param[value] Markdown text.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Message(
val label: String?,
Expand All @@ -28,6 +31,7 @@ sealed class PONativeAlternativePaymentCustomerInstruction {
*
* @param[value] Image resource.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Image(
val value: POImageResource
Expand All @@ -39,6 +43,7 @@ sealed class PONativeAlternativePaymentCustomerInstruction {
* @param[rawSubtype] Raw barcode subtype.
* @param[rawValue] Base64 encoded value.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Barcode(
@Json(name = "subtype")
Expand All @@ -59,6 +64,7 @@ sealed class PONativeAlternativePaymentCustomerInstruction {
* Placeholder that allows adding additional cases while staying backward compatible.
* __Warning:__ Do not match this case directly, use _when-else_ instead.
*/
@Parcelize
@ProcessOutInternalApi
data object Unknown : PONativeAlternativePaymentCustomerInstruction()
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
package com.processout.sdk.api.model.response.napm.v2

import android.os.Parcelable
import com.processout.sdk.api.model.response.napm.v2.PONativeAlternativePaymentElement.Form.Parameter
import com.processout.sdk.core.annotation.ProcessOutInternalApi
import com.processout.sdk.core.util.findBy
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize

/**
* Specifies an element that needs to be rendered on the UI during native alternative payment flow.
*/
sealed class PONativeAlternativePaymentElement {
sealed class PONativeAlternativePaymentElement : Parcelable {

/**
* A form element with the specified [parameterDefinitions].
*/
@Parcelize
data class Form(
val parameterDefinitions: List<Parameter>
) : PONativeAlternativePaymentElement() {

/**
* Payment parameter definition.
*/
sealed class Parameter {
sealed class Parameter : Parcelable {

/** Parameter key. */
abstract val key: String
Expand All @@ -41,6 +45,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[minLength] Optional minimum length.
* @param[maxLength] Optional maximum length.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Text(
override val key: String,
Expand All @@ -60,6 +65,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[required] Indicates whether the parameter is required.
* @param[availableValues] Available values.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class SingleSelect(
override val key: String,
Expand All @@ -80,12 +86,13 @@ sealed class PONativeAlternativePaymentElement {
* @param[label] Value display label.
* @param[preselected] Indicates whether the value should be preselected by default.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class AvailableValue(
val value: String,
val label: String,
val preselected: Boolean
)
) : Parcelable
}

/**
Expand All @@ -95,6 +102,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[label] Parameter display label.
* @param[required] Indicates whether the parameter is required.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Bool(
override val key: String,
Expand All @@ -111,6 +119,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[minLength] Optional minimum length.
* @param[maxLength] Optional maximum length.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Digits(
override val key: String,
Expand All @@ -130,6 +139,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[required] Indicates whether the parameter is required.
* @param[dialingCodes] Supported international dialing codes.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class PhoneNumber(
override val key: String,
Expand All @@ -146,12 +156,13 @@ sealed class PONativeAlternativePaymentElement {
* Corresponds to a two-letter ISO 3166-1 alpha-2 country code.
* @param[value] Dialing code value.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class DialingCode(
@Json(name = "region_code")
val regionCode: String,
val value: String
)
) : Parcelable
}

/**
Expand All @@ -161,6 +172,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[label] Parameter display label.
* @param[required] Indicates whether the parameter is required.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Email(
override val key: String,
Expand All @@ -177,6 +189,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[minLength] Optional minimum length.
* @param[maxLength] Optional maximum length.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Card(
override val key: String,
Expand All @@ -198,6 +211,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[minLength] Optional minimum length.
* @param[maxLength] Optional maximum length.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class Otp(
override val key: String,
Expand Down Expand Up @@ -238,10 +252,16 @@ sealed class PONativeAlternativePaymentElement {
* Placeholder that allows adding additional cases while staying backward compatible.
* __Warning:__ Do not match this case directly, use _when-else_ instead.
*/
@Parcelize
@ProcessOutInternalApi
data object Unknown : Parameter() {
@IgnoredOnParcel
override val key = String()

@IgnoredOnParcel
override val label = String()

@IgnoredOnParcel
override val required = false
}
}
Expand All @@ -250,6 +270,7 @@ sealed class PONativeAlternativePaymentElement {
/**
* Specifies instruction for the customer, providing additional information and/or describing required actions.
*/
@Parcelize
data class CustomerInstruction(
val instruction: PONativeAlternativePaymentCustomerInstruction
) : PONativeAlternativePaymentElement()
Expand All @@ -260,6 +281,7 @@ sealed class PONativeAlternativePaymentElement {
* @param[label] Optional group display label.
* @param[instructions] Grouped instructions for the customer that provide additional information and/or describe required actions.
*/
@Parcelize
data class CustomerInstructionGroup(
val label: String?,
val instructions: List<PONativeAlternativePaymentCustomerInstruction>
Expand All @@ -269,6 +291,7 @@ sealed class PONativeAlternativePaymentElement {
* Placeholder that allows adding additional cases while staying backward compatible.
* __Warning:__ Do not match this case directly, use _when-else_ instead.
*/
@Parcelize
@ProcessOutInternalApi
data object Unknown : PONativeAlternativePaymentElement()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.processout.sdk.api.model.response.napm.v2

import android.os.Parcelable
import com.processout.sdk.api.model.response.POImageResource
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.Parcelize

/**
* Specifies payment method details.
*
* @param[displayName] Payment method display name.
* @param[logo] Image resource for light/dark themes.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class PONativeAlternativePaymentMethodDetails(
@Json(name = "display_name")
val displayName: String,
val logo: POImageResource
)
) : Parcelable
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.processout.sdk.api.model.response.napm.v2

import android.os.Parcelable
import com.squareup.moshi.JsonClass
import kotlinx.parcelize.Parcelize

/**
* Specifies native alternative payment redirect parameters.
*
* @param[url] Redirect URL.
* @param[hint] A hint or description associated with the redirect URL.
*/
@Parcelize
@JsonClass(generateAdapter = true)
data class PONativeAlternativePaymentRedirect(
val url: String,
val hint: String
)
) : Parcelable
Loading