KlarnaSourceParams

data class KlarnaSourceParams @JvmOverloads constructor(purchaseCountry: String, lineItems: List<KlarnaSourceParams.LineItem>, customPaymentMethods: Set<KlarnaSourceParams.CustomPaymentMethods>, billingEmail: String?, billingPhone: String?, billingAddress: Address?, billingFirstName: String?, billingLastName: String?, billingDob: DateOfBirth?, pageOptions: KlarnaSourceParams.PaymentPageOptions?) : StripeParamsModel, Parcelable

Model representing parameters for creating a Klarna Source.

See Klarna Payments with Sources

Note: The optional fields billingEmail, billingPhone, billingAddress, billingFirstName, billingLastName, and billingDob can be provided to skip Klarna's customer information form.

If this information is missing, Klarna will prompt the customer for these values during checkout. Be careful with this option: If the provided information is invalid, Klarna may reject the transaction without giving the customer a chance to correct it.

Constructors

Link copied to clipboard
fun KlarnaSourceParams(purchaseCountry: String, lineItems: List<KlarnaSourceParams.LineItem>, customPaymentMethods: Set<KlarnaSourceParams.CustomPaymentMethods> = emptySet(), billingEmail: String? = null, billingPhone: String? = null, billingAddress: Address? = null, billingFirstName: String? = null, billingLastName: String? = null, billingDob: DateOfBirth? = null, pageOptions: KlarnaSourceParams.PaymentPageOptions? = null)

Types

Link copied to clipboard

Required for customers located in the US.

Link copied to clipboard
data class LineItem @JvmOverloads constructor(itemType: KlarnaSourceParams.LineItem.Type, itemDescription: String, totalAmount: Int, quantity: Int?) : Parcelable
Link copied to clipboard
data class PaymentPageOptions(logoUrl: String?, backgroundImageUrl: String?, pageTitle: String?, purchaseType: KlarnaSourceParams.PaymentPageOptions.PurchaseType?) : StripeParamsModel, Parcelable

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
open override fun toParamMap(): Map<String, Any>
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)

Properties

Link copied to clipboard
val billingAddress: Address? = null

An Address for the customer. At a minimum, Address.line1, Address.postalCode, Address.city, and Address.country must be provided.

Link copied to clipboard
val billingDob: DateOfBirth? = null

The customer's date of birth. This will be used by Klarna for a credit check in some EU countries.

Link copied to clipboard
val billingEmail: String? = null

An email address for the customer.

Link copied to clipboard
val billingFirstName: String? = null

The customer's first name.

Link copied to clipboard
val billingLastName: String? = null

The customer's last name.

Link copied to clipboard
val billingPhone: String? = null

A phone number for the customer.

Link copied to clipboard

Required for customers located in the US. This determines whether Pay Later and/or Slice It is offered to a US customer.

Link copied to clipboard
val lineItems: List<KlarnaSourceParams.LineItem>

A list of LineItem. Klarna will present these on the confirmation page. The total amount charged will be a sum of the LineItem.totalAmount of each of these items.

Link copied to clipboard
Link copied to clipboard
val purchaseCountry: String

The URL the customer should be redirected to after they have successfully verified the payment.