KlarnaSourceParams

data class KlarnaSourceParams @JvmOverloads constructor(val purchaseCountry: String, val lineItems: List<KlarnaSourceParams.LineItem>, val customPaymentMethods: Set<KlarnaSourceParams.CustomPaymentMethods> = emptySet(), val billingEmail: String? = null, val billingPhone: String? = null, val billingAddress: Address? = null, val billingFirstName: String? = null, val billingLastName: String? = null, val billingDob: DateOfBirth? = null, val pageOptions: KlarnaSourceParams.PaymentPageOptions? = null) : 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
constructor(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(val itemType: KlarnaSourceParams.LineItem.Type, val itemDescription: String, val totalAmount: Int, val quantity: Int? = null) : Parcelable
Link copied to clipboard
data class PaymentPageOptions(val logoUrl: String? = null, val backgroundImageUrl: String? = null, val pageTitle: String? = null, val purchaseType: KlarnaSourceParams.PaymentPageOptions.PurchaseType? = null) : StripeParamsModel, Parcelable

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

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

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

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

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)