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()
}
}

Java Compatibility

If you need Java compatibility, use the callback-based PaymentIntentProvider interface instead.

Properties

Link copied to clipboard
abstract val amount: BigDecimal

Payment amount. This is the order amount you would like to charge your customer. Required for payment session creation.

Link copied to clipboard
abstract val currency: String

Amount currency. Required for payment session creation.

Functions

Link copied to clipboard
abstract suspend fun getPaymentIntent(): PaymentIntent

Retrieves a PaymentIntent using suspend functions. This method should perform any necessary API calls or business logic to create and return a PaymentIntent.