You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
viewModelScope.launch {
with(ProcessOut.instance.dispatchers.nativeAlternativePaymentMethod) {
// Subscribe for request to provide default values.
defaultValuesRequest.collect { request ->// Default values should be provided as Map<String, String>// where key is PONativeAlternativePaymentMethodParameter.key// and value is a custom default value.val defaultValues = mutableMapOf<String, String>()
// Populate default values map based on request parameters.// It's not mandatory to provide defaults for all parameters.
request.parameters.find {
it.type() ==ParameterType.PHONE
}?.also {
defaultValues[it.key] ="+111122223333"
}
// Provide response which must be constructed from request with default values payload.// Note that once you've subscribed to 'defaultValuesRequest'// it's required to send response back, otherwise the payment flow will not proceed.// If there is no default values to provide it's still required// to call this method with 'emptyMap()'.
provideDefaultValues(request.toResponse(defaultValues))
}
}
}