Skip to content

Commit 988052e

Browse files
committed
bug fixes and doc update
1 parent 727a5b4 commit 988052e

File tree

7 files changed

+25
-48
lines changed

7 files changed

+25
-48
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
* **Description:** Cybersource, a Visa solution, is the only global, modular payment management platform built on secure Visa infrastructure with the payment reach and fraud insights of a massive $500B+ global processing network. You can find out more about what Cybersource does [here](https://www.cybersource.com/en-gb.html).
55
* **Categories:** Payment Processing, Fraud Detection, Address Validation, Tax Computation
6-
* **Version:** 25.2.0
7-
* **Compatibility:** <span style="color:red">This version of the Cybersource cartridge is not compatible with versions of SFRA higher than Release 7.0.0. </span>
8-
This version can be found on the Master branch of the SFRA repository on May , 2025 <span style="color:red">This version is compatible with Salesforce B2C Commerce 22.2 release. <span>
6+
* **Version:** 25.3.0
7+
* **Compatibility:** <span style="color:red">This version of the Cybersource cartridge is not compatible with versions of SFRA Release 7.0.0. </span>
8+
This version can be found on the Master branch of the SFRA repository on June , 2025 <span style="color:red">This version is compatible with Salesforce B2C Commerce 22.2 release. <span>
99

1010
----
1111

cartridges/int_cybersource_sfra/cartridge/controllers/CYBKlarna.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ server.post('GetSession', csrfProtection.generateToken, function (req, res, next
1818

1919
var returnObject = {};
2020

21-
// Update billing address with posted form values and email param.
22-
klarnaHelper.updateBillingAddress(basket);
23-
2421
// updating Payment Transaction amount for purchase object
2522
COHelpers.calculatePaymentTransaction(basket);
2623

@@ -56,16 +53,16 @@ server.post('GetSession', csrfProtection.generateToken, function (req, res, next
5653
// Handle billing address state and postal code for US and non-US addresses
5754
if (currentLocale.country === 'US') {
5855
// For US addresses, set dummy values if state or postal code is missing. Actual values will be updated later in session update.
59-
billTo.setState(basket.billingAddress.stateCode || 'CA');
60-
billTo.setPostalCode(basket.billingAddress.postalCode || '94043');
56+
billTo.setState((basket.billingAddress && basket.billingAddress.stateCode) || 'CA');
57+
billTo.setPostalCode((basket.billingAddress && basket.billingAddress.postalCode) || '94043');
6158
} else {
6259
// For non-US addresses, use the billing address values directly
63-
billTo.setState(basket.billingAddress.stateCode || '');
64-
billTo.setPostalCode(basket.billingAddress.postalCode || '');
60+
billTo.setState((basket.billingAddress && basket.billingAddress.stateCode) || '');
61+
billTo.setPostalCode((basket.billingAddress && basket.billingAddress.postalCode) || '');
6562
}
6663

6764
// Create billto, shipto, item and purchase total object
68-
if (!empty(basket.billingAddress.address1) || !empty(basket.defaultShipment.shippingAddress)) {
65+
if (!empty(basket.billingAddress && basket.billingAddress.address1) || !empty(basket.defaultShipment && basket.defaultShipment.shippingAddress)) {
6966
var result = CommonHelper.CreateCyberSourceBillToObject(basket, true);
7067
billTo = result.billTo;
7168
}

cartridges/int_cybersource_sfra/cartridge/scripts/helper/CommonHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ function CreateKlarnaItemObject(Basket) {
525525
itemObject.setProductCode('PRICE_ADJUSTMENT');
526526
itemObject.setProductName('PRICE_ADJUSTMENT');
527527
itemObject.setProductSKU('PRICE_ADJUSTMENT');
528-
setKlarnaTaxAmount(itemObject, lineItem.tax.value, locale);
528+
setKlarnaTaxAmount(itemObject, StringUtils.formatNumber(lineItem.tax.value < 0 ? 0 : lineItem.tax.value, '000000.00', locale));
529529
setTotalAmount(processor, itemObject, lineItem.basePrice.value < 0 ? 0 : lineItem.basePrice.value, locale);
530530
itemObject.setId(count);
531531
} else {

cartridges/int_cybersource_sfra/cartridge/scripts/klarna/helper/KlarnaHelper.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,6 @@ var CommonHelper = require('*/cartridge/scripts/helper/CommonHelper');
55
var CybersourceConstants = require('*/cartridge/scripts/utils/CybersourceConstants');
66
var CybersourceHelper = require('*/cartridge/scripts/cybersource/libCybersource').getCybersourceHelper();
77

8-
/**
9-
* function
10-
* @param {*} basket basket
11-
*/
12-
function updateBillingAddress(basket) {
13-
var address1 = session.forms.billing.addressFields.address1.value;
14-
var address2 = session.forms.billing.addressFields.address2.value;
15-
var city = session.forms.billing.addressFields.city.value;
16-
var country = session.forms.billing.addressFields.country.value;
17-
var firstName = session.forms.billing.addressFields.firstName.value;
18-
var lastName = session.forms.billing.addressFields.lastName.value;
19-
var phone = session.forms.billing.addressFields.phone.value;
20-
var postalCode = session.forms.billing.addressFields.postalCode.value;
21-
var state = session.forms.billing.addressFields.states.stateCode.value;
22-
var email = session.forms.billing.klarnaEmail.value;
23-
24-
Transaction.wrap(function () {
25-
var billingAddress = basket.billingAddress;
26-
if (!billingAddress) {
27-
billingAddress = basket.createBillingAddress();
28-
}
29-
billingAddress.setFirstName(firstName);
30-
billingAddress.setLastName(lastName);
31-
billingAddress.setAddress1(address1);
32-
billingAddress.setAddress2(address2);
33-
billingAddress.setCity(city);
34-
billingAddress.setPostalCode(postalCode);
35-
billingAddress.setStateCode(state);
36-
billingAddress.setCountryCode(country);
37-
billingAddress.setPhone(phone);
38-
basket.setCustomerEmail(email);
39-
});
40-
}
41-
428
/**
439
* function
4410
* @param {*} basket basket
@@ -146,7 +112,6 @@ function clearKlarnaSessionVariables() {
146112
}
147113

148114
module.exports = {
149-
updateBillingAddress: updateBillingAddress,
150115
mapKlarnaExpressCheckoutAddress: mapKlarnaExpressCheckoutAddress,
151116
setBillingAddress: setBillingAddress,
152117
convAddressObj: convAddressObj,

documentation/markdown/Configure-payment-method.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ Step 6: Go to **Merchant Tools > Site Preferences > Custom Preferences > Cyberso
510510

511511
| Field | Description |
512512
| -------------------------------- | ---------------------------------- |
513-
| Klarna Decision Manager Required | Enable or Disable Decision Manager |
513+
|enableKlarnaExpressCheckout |Enable or Disable Klarna Express Checkout for Cart and Mini Cart |
514+
|Klarna Decision Manager Required | Enable or Disable Decision Manager |
514515
| Klarna JS API Path | Klarna JS API Library Path |
515516
| klarnaPrivateKeyAlias | Private Key Alias of imported Key in Private Keys and Certificates |
516517

documentation/markdown/Release-history.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## <ins>Release History
22

3+
**Version 25.3.0 (June, 2025)**
4+
Enhancement:
5+
• Added support for Klarna Express Checkout from Mini Cart, Cart and Checkout pages.
6+
• Implemented rate limiter for saving cards during the checkout process.
7+
• Removed "Order-Details" and "Order-Confirm" from the cartridge and enhanced the order model.
8+
9+
Bug Fix:
10+
• Updated the default values for rate limiter fields in custom preferences.
11+
• Added support for sending device information (Device Fingerprint) in the tokenization service call from My Account page.
12+
• Removed the hardcoded email Id sent in the tax service call.
13+
• Addressed dependency issue on payment methods in BM during the alteration and deletion of payment method IDs.
14+
• Fixed transactions failures with coupons when tax disabled.
15+
• Removed the CVV input field for transactions with saved cards during checkout.
16+
317
**Version 25.2.0 (May, 2025)**
418
Enhancement:
519
• Refactored logic from the controller into a helper script and optimized controllers by integrating

0 commit comments

Comments
 (0)