Correct two documented claims that measurement contradicts - #19
Open
sveneberth wants to merge 1 commit into
Open
Correct two documented claims that measurement contradicts#19sveneberth wants to merge 1 commit into
sveneberth wants to merge 1 commit into
Conversation
Two claims corrected by measurement. **Klarna.** "These types cannot be exercised server-side" was too absolute. Measured: `createPaymentType(Klarna())` with an empty body, an `authorize` with `customerId`, `basketId` and a `returnUrl`, and the customer confirming on the page the returned `redirectUrl` leads to, ends with the payment reporting `authorize: success` for the full amount -- no `COR.800.400.160`. The empty resource is filled in by the redirect step; what fails is skipping that step, not creating the type. The other affected types were not re-measured, so the claim is now marked unverified for them instead of stated as fact. **Rounding.** The note that `BasketItem.serialize` does not round (#18) read as a theoretical hazard. It is not: a three-unit line with `amountVat=15.97 * 3` is enough, and the API refuses the whole basket with `API.600.200.133 "Amount 47.910000000000004 has more than 4 positions after the decimal point."`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two statements in
AGENTS.mddid not survive being measured. Both are documentation-onlychanges.
Klarna does work server-side
AGENTS.mdstated flatly that the client-side payment types "cannot be exercisedserver-side", and that creating one "yields an empty resource that the provider rejects
further down the flow — Klarna answers
COR.800.400.160".Measured against the sandbox, following the flow to the end:
createPaymentType(Klarna())— empty body, as the file describesauthorizewithcustomerId,basketIdand a publicreturnUrl→pending, plus aredirectUrltest number, any 6-digit OTP except
999999)No
COR.800.400.160. So the empty resource is filled in by the redirect step, and whatfails is skipping that step — not creating the type server-side.
The other affected types (Card, PayPal, Apple Pay, Google Pay, iDEAL, Click to Pay) were
not re-measured. The claim is therefore marked unverified for them rather than turned
around wholesale. The sandbox suite still does not drive Klarna, for the reason the file
now gives: the redirect step needs a browser and would place a real order on every run.
The item-rounding hazard is not theoretical
The note that
BasketItem.serializedoes not round whileBasket.serializedoes (#18)read like a corner case about float residue. It is reachable with ordinary arithmetic: a
three-unit line with
amountVat=15.97 * 3produces47.910000000000004, and the APIrefuses the whole basket with
That error code appeared nowhere in the repository. Until #18 is fixed, a caller has to
round every item amount itself — worth knowing at the point where the rounding rule is
documented.
Verification
pytest— 291 passed, 31 deselectedpycodestyle --diff— cleanAGENTS.mdand one test module docstring only.