Skip to content

Commit

Permalink
Merge pull request #8 from klarna/release_24.3.0
Browse files Browse the repository at this point in the history
release_24.3.0
  • Loading branch information
marcosjgutierrez committed May 23, 2024
2 parents b9aaab2 + 8345cdd commit 6a7ca29
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# CHANGELOG
## 24.3.0
* Update of Klarna Express Checkout configuration. The display of Klarna Express Checkout buttons is now customizable by selecting preferred placements. By default none is selected.
* Documentation update – new section added Klarna Display Conditions and Authorization Handling.
## 24.2.0
* Update of OSM functionality that is more aligned with current web standards, provides a consistent identifier system as used in KEC, and offers enhanced customization options to our merchants. This will not only improve the user experience but also reinforce Klarna’s commitment to providing versatile and state-of-the-art e-commerce solutions. CSS customizations are available only in the new library version.
* Documentation update - new section added for cartridge upgrade process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,28 @@ var KlarnaOSM = {
isKlarnExpressCheckoutEnabled: function () {
return currentSite.getCustomPreferenceValue('kpECEnabled') || false;
},
showExpressCheckoutButton: function () {
var showECButton = currentSite.getCustomPreferenceValue('kec_placement');
var showECButtonObj = {
cart: false,
pdp: false,
miniCart: false
};
if (showECButton && showECButton.length) {
showECButton.forEach(function (item) {
if (item.value === 'pdp') {
showECButtonObj.pdp = true;
}
if (item.value === 'cart') {
showECButtonObj.cart = true;
}
if (item.value === 'minicart') {
showECButtonObj.miniCart = true;
}
});
}
return showECButtonObj;
},
getKlarnExpressCheckoutClientKey: function () {
var localeObject = this.getKlarnaCountriesObject();
return localeObject.custom.expressCheckoutClientKey || null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var KLARNA_JS_CONSTANTS = {
KEC_ERROR_WAITTIME: 100
};

var SERVICE_HEADER = 'SFCC SG Version: ' + dw.web.Resource.msg('revisioninfo.revisionnumber', 'revisioninfo', 'Not found') + ' | Klarna Payments 24.2.0';
var SERVICE_HEADER = 'SFCC SG Version: ' + dw.web.Resource.msg('revisioninfo.revisionnumber', 'revisioninfo', 'Not found') + ' | Klarna Payments 24.3.0';

module.exports.FRAUD_STATUS = FRAUD_STATUS;
module.exports.PAYMENT_METHOD = PAYMENT_METHOD;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<isset name="contId" value="${!empty(pdict.container_id) ? pdict.container_id : 'klarnaExpressCheckout'}"
scope="page" />

<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled()}">
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled() && KlarnaOSM.showExpressCheckoutButton().cart}">
<div class="kec-cart">
<div id="${contId}" class="klarna-express-checkout-cart"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--- TEMPLATENAME: klarnapayments/kec/buttoncart.isml --->
<isset name="KlarnaOSM" value="${require('*/cartridge/scripts/marketing/klarnaOSM')}" scope="page" />

<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled()}">
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled() && KlarnaOSM.showExpressCheckoutButton().pdp}">
<div class="">
<div id="klarnaExpressCheckoutPDP" class="klarna-express-checkout-pdp"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var KLARNA_JS_CONSTANTS = {
FORM_VALIDATION_NUM_RETRIES: 3
};

var SERVICE_HEADER = 'SFCC SFRA Version: ' + dw.web.Resource.msg('global.version.number', 'version', 'Not found') + ' | Klarna Payments 24.2.0';
var SERVICE_HEADER = 'SFCC SFRA Version: ' + dw.web.Resource.msg('global.version.number', 'version', 'Not found') + ' | Klarna Payments 24.3.0';

module.exports.FRAUD_STATUS = FRAUD_STATUS;
module.exports.NOTIFY_EVENT_TYPES = NOTIFY_EVENT_TYPES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
</div>
<isset name="KlarnaOSM" value="${require('*/cartridge/scripts/marketing/klarnaOSM')}" scope="page" />
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled()}">
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled() && KlarnaOSM.showExpressCheckoutButton().miniCart}">
<div class="row kec-cart ${pdict.hasSubscriptionOnlyProduct ? 'd-none' : ''}">
<div class="col-12 mb-sm-3" id="slotMiniCartKEC"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--- TEMPLATENAME: klarnapayments/kec/buttoncart.isml --->
<isset name="KlarnaOSM" value="${require('*/cartridge/scripts/marketing/klarnaOSM')}" scope="page" />

<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled()}">
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled() && KlarnaOSM.showExpressCheckoutButton().cart}">
<div id="klarnaExpressCheckout" class="klarna-express-checkout-cart"></div>
</isif>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
assets.addJs('/js/klarnaExpressCheckoutPDP.js');
</isscript>

<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled()}">
<isif condition="${KlarnaOSM.isKlarnExpressCheckoutEnabled() && KlarnaOSM.showExpressCheckoutButton().pdp}">
<div class="col-sm-12 col-xl-8">
<div id="klarnaExpressCheckoutPDP" data-subscriptiononly="${product.isSubscriptionOnly}"
class="klarna-express-checkout-pdp" ${(!product.readyToOrder || !product.available) ? "disabled" : ""}>
Expand Down
Binary file modified documentation/Klarna Payments Integration Guide.pdf
Binary file not shown.
Binary file modified documentation/Klarna Payments SFRA Integration Guide.pdf
Binary file not shown.
Binary file modified metadata/site-template.zip
Binary file not shown.
24 changes: 23 additions & 1 deletion metadata/site-template/meta/system-objecttype-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,27 @@
<externally-managed-flag>false</externally-managed-flag>
<default-value>false</default-value>
</attribute-definition>
<attribute-definition attribute-id="kec_placement">
<display-name xml:lang="x-default">Placement</display-name>
<type>enum-of-string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
<select-multiple-flag>true</select-multiple-flag>
<value-definitions>
<value-definition>
<display xml:lang="x-default">Cart</display>
<value>cart</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">PDP</display>
<value>pdp</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">Mini cart</display>
<value>minicart</value>
</value-definition>
</value-definitions>
</attribute-definition>
<attribute-definition attribute-id="kpECCollectShippingAddress">
<display-name xml:lang="x-default">Klarna Express Checkout Collect Shipping Address</display-name>
<type>boolean</type>
Expand Down Expand Up @@ -445,13 +466,14 @@
<attribute attribute-id="kpRecurringRetryFrequency"/>
</attribute-group>
<attribute-group group-id="Klarna_ExpressCheckout">
<display-name xml:lang="x-default">Klarna Express Checkout</display-name>
<display-name xml:lang="x-default">Klarna Express checkout</display-name>
<attribute attribute-id="kpECEnabled"/>
<attribute attribute-id="kpECLibraryURL"/>
<attribute attribute-id="kpECCollectShippingAddress"/>
<attribute attribute-id="kpECButtonTheme"/>
<attribute attribute-id="kpECButtonShape"/>
<attribute attribute-id="kpECPaymentCategoryContent"/>
<attribute attribute-id="kec_placement"/>
</attribute-group>
</group-definitions>
</type-extension>
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"init": [],
"name": "klarna",
"version": "24.2.0",
"version": "24.3.0",
"description": "Salesforce Commerce Cloud | Klarna Payment Integration",
"main": "Gruntfile.js",
"dependencies": {
Expand Down Expand Up @@ -56,6 +56,10 @@
{
"name": "Tihomir Ivanov",
"email": "Tihomir.Ivanov@tryzens.com"
},
{
"name": "Rumyana Topalska",
"email": "Rumyana.Topalska@tryzens.com"
}
],
"license": "",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Klarna Payments 2017-2023 Salesforce Commerce Cloud Cartridge

## The latest version
The latest version of this cartridge is 24.2.0.
The latest version of this cartridge is 24.3.0.

This version includes upgrade of Klarna OSM functionality: OSM update that is more aligned with current web standards, provides a consistent identifier system as used in KEC, and offers enhanced customization options to our merchants. This will not only improve the user experience but also reinforce Klarna’s commitment to providing versatile and state-of-the-art e-commerce solutions. CSS customizations are available only in the new library version. Documentation update - new section added for cartridge upgrade process.
This version includes upgrade of Klarna Express Checkout configuration. The display of Klarna Express Checkout buttons is now customizable by selecting preferred placements. By default none is selected. Documentation update new section added Klarna Display Conditions and Authorization Handling.

## Company Overview
Klarna Bank AB (publ) is the leading global payments and shopping service, providing smarter and more flexible shopping and purchase experiences to 90 million active consumers across more than 250,000 merchants in 17 countries. Klarna offers direct payments, pay after delivery options and instalment plans in a smooth one-click purchase experience that lets consumers pay when and how they prefer to. Klarna is active in Europe, North America and Oceania, driven by 3500 employees. Read more here: https://www.klarna.com/international/about-us/corporate-governance/
Expand Down

0 comments on commit 6a7ca29

Please sign in to comment.