Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

Features/add cart modify #138

Merged
merged 1 commit into from
Feb 16, 2017
Merged

Features/add cart modify #138

merged 1 commit into from
Feb 16, 2017

Conversation

pocketrocket
Copy link
Contributor

@Exeu
Copy link
Owner

Exeu commented Feb 13, 2017

The sort was already merged. This PR will integrate it as well. can you rebase your branch to the latest master version? Then please take a look on the changeset that the SORT on search is out.

Thanks

@Exeu Exeu self-requested a review February 13, 2017 18:18
Copy link
Owner

@Exeu Exeu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase your PR to the current master to avoid collision with the already merged search sorting.

@pocketrocket
Copy link
Contributor Author

@Exeu done, somehow messed up in a squashing nightmare :) sorry for that - now should be clean again

$subTotal2 = $domDoc->documentElement->getElementsByTagName('Amount')->item(0)->nodeValue;
$size = $domDoc->documentElement->getElementsByTagName('CartItem')->length;

$cartAdd = new CartAdd();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about passing $cartId and $hmac in the constructor as both are mandatory?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be a BC Break at least for all existing Cart Operations. Would prefer to avoid this and put it on the list for version 2.

Copy link

@daFish daFish Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach to maintain BC could be a named constructor like CartAdd::withCartIdAndHmac($cartId, $hmac).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for @Exeu - right now this is a plain simple wrapper for the API Operations I guess?

Ideally speaking, IMHO CartCreate Operation (c/w)ould return a instance of a CartModel holding parsed Cart(Response) attributes like HMAC, CartID etc. (or add complex ResponseTransformer?)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operation itself cannot return any response. It just returns parameters needed for a request that another component can build any request with it.
So the only thing you can do is to add a responsetransformer. But i think this beyond the topic here :) @daFish had a valid point. But i will create a task for it for the next version since i don't want to start with named constructors right now or factories for something which is anyway mandatory in those operations (my bad to put it optional in the class design).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Exeu so any idea if you wanna still merge it or not? :)

@Exeu Exeu merged commit cb05650 into Exeu:master Feb 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants