createSession

suspend fun createSession(sessionModel: SessionModel, configuration: Configuration, order: Order? = null): CheckoutSessionResult

Allows creating a CheckoutSession from the response of the /sessions endpoint. This is a suspend function that executes a network call on the IO thread.

Return

The result of the API call.

Parameters

sessionModel

The deserialized JSON response of the /sessions API call. You can use SessionModel.SERIALIZER to deserialize this JSON.

configuration

A Configuration to initialize the session. You can use the same configuration required to initialize Drop-in or a component.

order

An Order in case of an ongoing partial payment flow.


suspend fun createSession(sessionModel: SessionModel, environment: Environment, clientKey: String, order: Order? = null): CheckoutSessionResult

Allows creating a CheckoutSession from the response of the /sessions endpoint. This is a suspend function that executes a network call on the IO thread.

Return

The result of the API call.

Parameters

sessionModel

The deserialized JSON response of the /sessions API call. You can use SessionModel.SERIALIZER to deserialize this JSON.

environment

The Environment to be used for internal network calls from the SDK to Adyen.

clientKey

Your Client Key used for internal network calls from the SDK to Adyen.

order

An Order in case of an ongoing partial payment flow.


suspend fun createSession(sessionPaymentResult: SessionPaymentResult, configuration: Configuration): CheckoutSessionResult

Only to be used for initializing a component for partial payment flow.

Allows creating a CheckoutSession from the response of the /sessions endpoint. This is a suspend function that executes a network call on the IO thread.

Return

The result of the API call.

Parameters

sessionPaymentResult

The SessionPaymentResult object to initialize the session. You will get this object via com.adyen.checkout.giftcard.SessionsGiftCardComponentCallback.onPartialPayment callback after a partial payment has been done.

configuration

A Configuration to initialize the session. You can use the same configuration required to initialize Drop-in or a component.


suspend fun createSession(sessionPaymentResult: SessionPaymentResult, environment: Environment, clientKey: String): CheckoutSessionResult

Only to be used for initializing a component for partial payment flow.

Allows creating a CheckoutSession from the response of the /sessions endpoint. This is a suspend function that executes a network call on the IO thread.

Return

The result of the API call.

Parameters

sessionPaymentResult

The SessionPaymentResult object to initialize the session. You will get this object via com.adyen.checkout.giftcard.SessionsGiftCardComponentCallback.onPartialPayment callback after a partial payment has been done.

environment

The Environment to be used for internal network calls from the SDK to Adyen.

clientKey

Your Client Key used for internal network calls from the SDK to Adyen.