Skip to main content

Web Component 2.0

Version 2.0.0 of the Straumur web component (straumur-web-component on npm) is released. It changes how failed payments are reported and which language codes setLanguage takes, adds Kortalán, theming and Apple Pay with your own certificate, and fixes 3-D Secure payments that return through a redirect.

Breaking changes​

Two changes need action when you upgrade from 1.x. Neither changes how the component looks.

  1. Failed payments call onPaymentFailed. A Refused, Cancelled or Error result now calls onPaymentFailed({ resultCode }) instead of onPaymentCompleted. In 1.x every result, including refusals, called onPaymentCompleted. If you check resultCode inside onPaymentCompleted, move the failure branches to onPaymentFailed.
  2. setLanguage takes "is" / "en", the same codes as the locale option, instead of "is-IS" / "en-US".

New​

  • Kortalán. Shown when it is enabled for your store and available for the basket amount. Add kortalan to instantPayments to show it as its own Straumur Kortalán button. Kortalán redirects the shopper, so complete the payment on your return page with submitDetails().
  • Theming. A theme option: "light", "dark" or "system", with optional Google Pay and Apple Pay button styles.
  • Choosing and ordering payment methods. allowedPaymentMethods now accepts kortalan, orderPaymentMethods sets the order, and openDefaultPaymentMethod sets the method that is expanded when the component loads.
  • Apple Pay with your own certificate. Merchants with their own Apple Pay merchant identifier validate the Apple Pay session through the new onApplePayValidateMerchant option. Without it, Apple Pay works as before.
  • Diagnostics logging. The component sends Straumur a log of the checkout, without card or shopper details, to help investigate payment problems. Turn it off with enableLogging: false.

Improvements​

  • A loader is shown from the moment the shopper pays until the 3-D Secure challenge appears, and while the result is fetched.
  • A double click on Pay can no longer start a second payment.
  • If a payment request gets no answer within 90 seconds, the shopper is told the payment couldn't be confirmed, instead of that it failed.
  • Accessibility: error text contrast, screen-reader labels for loaders, and keyboard support for the security code hint and the co-badged card brand picker.

Fixes​

  • 3-D Secure payments that return through a redirect could not be completed in 1.1.3 (also fixed in 1.1.7). submitDetails() completes them and calls onPaymentCompleted or onPaymentFailed.
  • A fast click on Pay right after the card details were entered could be ignored.
  • The Google Pay and Apple Pay 3-D Secure challenge is shown at full height.

Installing​

npm install straumur-web-component@^2.0.0

For the script tag, pin the version: https://unpkg.com/straumur-web-component@2.0.0.

See Web Integration for the full configuration and Upgrading from 1.x.