Checkout v2

Payment Menu Events

schedule 5 min read

Possible events during Payment Menu payments.

Edit "Payment Menu Events" on GitHub

Seamless View Events

During operation in the Seamless View, several events can occur. They are described below.

info

Event Overrides

Adding an event handler to one of the following events overrides the default event handler, meaning your custom event handler will have to do what the default event handler did. If you don’t, the behaviour of the event is going to be undefined. Just adding an event handler for logging purposes is therefore not possible, the event handler will have to perform some functionality similar to the event handler you are overriding.

onPaymentPending

This events triggers when a payment enters a paying state ( Sale, Authorize, Canceletc). The onPaymentPending event will be followed by either onPaymentPaid, onPaymentFailed or onPaymentTransactionFailed based on the result of the payment. Read more about these events below.

onPaymentPending event object

1
2
3
{
    "id": "/psp/checkout/v2/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1"
}
Field Type Description
id string The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution.

onPaymentPaid

This event triggers when a payment has completed successfully. The onPaymentPaid event is raised with the following event argument object:

onPaymentPaid event object

1
2
3
4
{
    "id": "/psp/checkout/v2/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
    "redirectUrl": "https://example.com/complete"
}
Field Type Description
id string The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution.
redirectUrl string The URL the user will be redirect to after a completed payment.

onPaymentAborted

This event triggers when the user cancels the payment. The onPaymentAborted event is raised with the following event argument object:

onPaymentAborted event object

1
2
3
4
{
    "id": "/psp/checkout/v2payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
    "redirectUrl": "https://example.com/canceled"
}
Field Type Description
id string The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution.
redirectUrl string The URL the user will be redirect to after a canceled payment.

onPaymentFailed

This event triggers when a payment has failed, disabling further attempts to perform a payment. The onPaymentFailed event is raised with the following event argument object:

onPaymentFailed event object

1
2
3
4
{
    "id": "/psp/checkout/v2/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
    "redirectUrl": "https://example.com/failed"
}
Field Type Description
id string The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution.
redirectUrl string The URL the user will be redirect to after a failed payment.

onTermsOfServiceRequested

This event triggers when the user clicks on the “Display terms and conditions” link. The onTermsOfServiceRequested event is raised with the following event argument object:

onTermsOfServiceRequested event object

1
2
3
4
{
    "origin": "owner",
    "openUrl": "https://example.com/terms-of-service"
}
Field Type Description
origin string owner, merchant. The value is always merchant unless Swedbank Pay hosts the view.
openUrl string The URL containing Terms of Service and conditions.

onError

This event triggers during terminal errors or if the configuration fails validation. The onError event will be raised with the following event argument object:

onError event object

1
2
3
4
5
{
    "origin": "checkout/v2",
    "messageId": "ec2a9b09-601a-42ae-8e33-a5737e1cf177",
    "details": "Descriptive text of the error"
}
Field Type Description
origin string checkout/v2, identifies the system that originated the error.
messageId string A unique identifier for the message.
details string A human readable and descriptive text of the error.
     

onBillingDetailsAvailable

This event triggers when a consumer has been identified. The onBillingDetailsAvailable event will be raised with the following event argument object:

onBillingDetailsAvailable event object

1
2
3
4
{
    "actionType": "OnBillingDetailsAvailable",
    "url": "/psp/consumers//billing-details",
}
Field Type Description
actionType string The type of event that was raised.
url string The URL containing billing details.

onShippingDetailsAvailable

This event triggers when a consumer has been identified or their shipping address has been updated. The onShippingDetailsAvailable event will be raised with the following event argument object:

onShippingDetailsAvailable event object

1
2
3
4
{
    "actionType": "OnShippingDetailsAvailable",
    "url": "/psp/consumers//shipping-details",
}
Field Type Description
actionType string The type of event that was raised.
url string The URL containing shipping details.