PaymentIntentSource
interface PaymentIntentSource
Modern suspend-based interface for providing PaymentIntent objects. This is the preferred interface for Kotlin consumers as it provides cleaner async handling.
Kotlin Implementation Example
class MyPaymentIntentSource(private val apiService: ApiService) : PaymentIntentSource {
override suspend fun getPaymentIntent(): PaymentIntent {
return apiService.createPaymentIntent()
}
}Content copied to clipboard
Java Compatibility
If you need Java compatibility, use the callback-based PaymentIntentProvider interface instead.