View Issue Details

IDProjectCategoryView StatusLast Update
0007723module UnzerGeneralpublic2024-09-26 13:08
ReporterSpritje Assigned To 
PrioritynormalSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version1.1.3 
Fixed in Version1.2.0 / 2.2.0 
Summary0007723: Payment methods cannot be used if in basic settings -> Enter item prices net is activated
DescriptionIf "Enter item prices net" is activated in the basic settings, an error may occur in the Unzer module due to the different rounding of the shopping basket items in the shop and Unzer module (e.g. if you have an item in the shopping basket more than once).

https://github.com/OXID-eSales/unzer-module/blob/2e09b71fd11bdd28feadddf2ab41d43ae43b57ea/src/Service/Unzer.php#L347

From this line on, the price of the basket items is calculated differently than in the shop for the shopping basket and this leads to problems when transferring to Unzer, so that the user cannot use the payment methods.
Steps To Reproduce0. Basic settings -> enter net article prices
1. Create articles as follows: Article A 8.57 Net, Article B 190.89 Net
2. Add 7 x article A and 1 x article B to the shopping basket
3. select payment method and click on Button "Pay Now"
4. -> Error Message "an error occurred. Please contact us for more information."
Additional Information- es -

‘amountTotalGross":190.88
and if you use
(amountPerUnitGross - amountDiscountPerUnitGross) * quantity.
((8.57 - 0) * 7 ) + ( ( 130.9 - 0) * 1 ) = (7 times article at 8.57 + 1 time article at 130.9 = 190.89)
If you do the maths, you get 190.89 => So we pass the prices here with a difference of 1 cent
Unzer compares these values (although Unzer does not seem to use the individual price items at all).

This is sent to Unzer and then there is this response:
Response: (400) {‘id’: ‘p-err-047fa8f4f33643f5b43b48468ca’, ‘isSuccess’:false, ‘isPending’:false, ‘isResumed’:false, ‘isError’:true, ‘url’: ‘https://api. unzer.com/v2/baskets‘,’timestamp‘:’2024-09-18 15:27:15‘,’traceId‘:’83db5fd94d252022ae45337ce400d4a9‘,’errors‘:[{’code‘:’API.600 .410.062‘, “merchantMessage”: “Basket ”’totalValueGross‘’ does not equals sum of (amountPerUnitGross - amountDiscountPerUnitGross) * quantity.’, “customerMessage”: ’An error occurred. Please contact us for more information."}]}
TagsNo tags attached.

Activities

QA

2024-09-20 09:26

administrator   ~0017564

unzer_1.jpg (162,138 bytes)   
unzer_1.jpg (162,138 bytes)   
unzer_2.jpg (203,849 bytes)   
unzer_2.jpg (203,849 bytes)   
unzer_3.jpg (126,067 bytes)   
unzer_3.jpg (126,067 bytes)