Resurs Bank Checkout Adapter
Overview
Resurs Bank Checkout adapter is a payment adapter for Resurs Bank Checkout. Read more on Resurs Bank Checkout docs
Environments
There are two environments that you can use.
Environment | Address |
---|---|
Test | https://checkout-resursbank-adapter.test.norce.tech |
Production | https://checkout-resursbank-adapter.norce.tech |
Configuration
You start by adding a configuration for the Resurs Bank Checkout adapter in Norce Checkout Admin.
Create payment
To get a Resurs Bank Checkout payment, you start by initializing a Resurs Bank Checkout payment session for an existing Norce order. A Resurs Bank Checkout checkout session will be created and the JSON response will include an Resurs Bank checkout id that will be used when interacting with the Resurs Bank checkout web component.
POST /api/checkout/v1/{order_id}/payments
{
"paymentId": "pSdaoWmjkNEKECZPhuCSJWqEBgT",
"checkoutId": "85bb6ef1-6ae5-445d-9c91-a53badb7e33c",
"locale": "sv-SE",
"style": {},
"webComponentUrl": "https://rco.integration.resurs.com/wc/rco.js"
}
The Resurs Bank Checkout adapter will also update your Norce order with the Resurs Bank payment details. The payments[].id property represents the paymentId from the JSON response received when initializing the Walley Checkout payment session and the payments[].orderId represents the Norce order identifier.
{
...
"payments": [
{
"type": "checkout",
"id": "pOtgkuNSudeVupaHfcFbmxOdska",
"reference": "85bb6ef1-6ae5-445d-9c91-a53badb7e33c",
"amount": 5200.0,
"adapterId": "resursbank_checkout_adapter",
"name": "resursbank_checkout_adapter",
"orderId": "oGRczeZk",
}
]
...
}
Update payment
When a Norce order changes a Cart Changed callback will be triggered in the Resurs Bank Checkout adapter, during which the Resurs Bank Checkout UI will be suspended to avoid any concurrent operations. The Resurs Bank Checkout order will then be updated with the latest information from the Norce order, after which the Resurs Bank Checkout UI will be resumed.
Update customer and shipping option
When the customer updates their customer and/or shipping information in the Resurs Bank Checkout UI this will trigger separate backend callbacks in the Resurs Bank Checkout Adapter to ensure that the Norce order is always up to date with the latest Resurs Bank order information. Update Customer callback will update the Norce order with latest customer information from Resurs Bank and Update Shipping Option callback will update the Norce order with the latest shipping information from Resurs Bank.
Validate payment
When the user clicks on "Completed Purchase" in Resurs Bank Checkout UI a validation callback is triggered in the Resurs Bank Checkout adapter. If the validation is successful Resurs Bank will continue with confirming the payment. At this point the Norce order will go to processing state and the order will be locked to any changes except status update.
If the validation failed a 422 response will be return with a message that will be displayed in the Resurs Bank Checkout UI.
Confirm payment
When the payment has been confirmed Resurs Bank will call the configured Authorization Uri to complete the order, update the payment and then redirects the user to the Success uri of the Resurs Bank checkout adapter.