Describe the bug
When customers apply multiple gift cards to large orders, the SFCC session quota api.session.maxStringLength (warn: 1200, limit: 2000) first is thrown then later on it is exceeded, causing order to fail. Error originates from the Adyen-PartialPaymentsOrder pipeline at least for release we have.
Adyen cartridge stores increasingly large JSON-serialized data in session.privacy fields during the gift card / partial payments flow. Each time a gift card is added, cumulative data stored grows. With multiple gift cards, the serialized strings exceed the SFCC session string length limits.
The code even has an acknowledging comment at line 75 of partialPayment.js:
session.privacy.giftCardResponse = JSON.stringify({
...response.order, // <-- spreads ordarData
...response.amount, // <-- spreads value
paymentMethod: response.paymentMethod,
brand: giftCardBrand,
}); // entire response exceeds string length <-- Acknowledging the issue
To Reproduce
Steps to reproduce the behavior:
- Add lots of different products to the order
- Go to checkout
- Add multiple gift cards (usually 4+)
- Order silently fails
Expected behavior
To be able to pay with lots of gift cards
Additional context
It would be nice if we got this fixed from Adyen side as this needs an architectural fix. There are several ways to fix it, either spliting the data when it's over the warning or creating a custom attribute on basket level that is going to store this data which would give 2 times more space for this.
This again might be broken if customer addeds a large amount of giftcards lets say there order is 500 euros and they have 30 gift cards of 5 euro each. It might again break. Might be good to also block adding new giftcards when we are close to the limit to indicate they have to choose another paymnet method.
Either way the way it should be fixed is up to you but it needs a structural fix.
Describe the bug
When customers apply multiple gift cards to large orders, the SFCC session quota
api.session.maxStringLength(warn: 1200, limit: 2000) first is thrown then later on it is exceeded, causing order to fail. Error originates from theAdyen-PartialPaymentsOrderpipeline at least for release we have.Adyen cartridge stores increasingly large JSON-serialized data in
session.privacyfields during the gift card / partial payments flow. Each time a gift card is added, cumulative data stored grows. With multiple gift cards, the serialized strings exceed the SFCC session string length limits.The code even has an acknowledging comment at line 75 of
partialPayment.js:To Reproduce
Steps to reproduce the behavior:
Expected behavior
To be able to pay with lots of gift cards
Additional context
It would be nice if we got this fixed from Adyen side as this needs an architectural fix. There are several ways to fix it, either spliting the data when it's over the warning or creating a custom attribute on basket level that is going to store this data which would give 2 times more space for this.
This again might be broken if customer addeds a large amount of giftcards lets say there order is 500 euros and they have 30 gift cards of 5 euro each. It might again break. Might be good to also block adding new giftcards when we are close to the limit to indicate they have to choose another paymnet method.
Either way the way it should be fixed is up to you but it needs a structural fix.