Checkout v2

Checkin Events

Possible events during Checkin.

Edit "Checkin Events" on GitHub

Checkin Events

The Checkin Seamless View can inform about events that occur during Checkin through JavaScript event callbacks which can be implemented in the configuration object passed to the payex.hostedView.consumer(configuration) object.

sequenceDiagram
  participant Consumer
  participant Merchant
  participant SwedbankPay as Swedbank Pay
  Consumer ->> Merchant: visit
  Merchant ->> Merchant: Prepare, Embed ClientScript
  Merchant ->> SwedbankPay: payex.hostedView.consumer().open()
  alt Configuration validation failure
    SwedbankPay -->> Merchant: onError
  end
  alt Identified consumer
      SwedbankPay->>Merchant: onConsumerIdentified
      alt Depending on backend response
        SwedbankPay->>Merchant: onShippingDetailsAvailable
        SwedbankPay->>Merchant: onBillingDetailsAvailable
      end
  end
  alt Change shipping address
    Consumer->>SwedbankPay: Click change shipping address button
    SwedbankPay->>Merchant: OnShippingDetailsAvailable
  end

onConsumerIdentified

This event triggers when a consumer has performed Checkin and is identified, if the Payment Menu is not loaded and in the DOM. The onConsumerIdentified event is raised with the following event argument object:

onConsumerIdentified event object

1
2
3
4
{
  "actionType": "OnConsumerIdentified",
  "consumerProfileRef": "5a17c24e-d459-4567-bbad-aa0f17a76119"
}

onShippingDetailsAvailable

Triggered when a consumer has been identified or shipping address has been updated.

info

The Checkin must be completed before any shipping details are finalized, as the Checkin component provides shipping address via the onShippingDetailsAvailable event.

onShippingDetailsAvailable event object

1
2
3
4
{
  "actionType": "OnShippingDetailsAvailable",
  "url": "/psp/consumers/5a17c24e-d459-4567-bbad-aa0f17a76119/shipping-details"
}

onBillingDetailsAvailable

Triggered when a consumer has been identified.

onBillingDetailsAvailable event object

1
2
3
4
{
  "actionType": "OnBillingDetailsAvailable",
  "url":"/psp/consumers/5a17c24e-d459-4567-bbad-aa0f17a76119/billing-details"
}