Seamless View Events
During operation in the Seamless View, several events can occur. They are described below.
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 behavior 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
,
Cancel
etc). 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/vipps/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/vipps/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/vippspayments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"redirectUrl": "https://example.com/cancelled"
}
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 cancelled 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/vipps/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": "vipps",
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"details": "English descriptive text of the error"
}
Field | Type | Description |
---|---|---|
origin |
string |
vipps , identifies the system that originated the error. |
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. |
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. |