Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to create basket parameter to show line items in sagepay panel -... #8

Closed
wants to merge 1 commit into from
Closed

Conversation

benjam-es
Copy link
Contributor

... requires tax to be implemented on common itembag

Signed-off-by: Ben James in@benjam.es

…l - requires tax to be implemented on common itembag

Signed-off-by: Ben James <in@benjam.es>
@greydnls
Copy link
Contributor

Hi, this looks great, and many apologies in the delay on reviewing it. Can you write some tests to cover the new functionality? I'll gladly merge after that.

@judgej
Copy link
Member

judgej commented Apr 5, 2015

I notice that $item->getName() does not escape any ":" characters that may be in the name. The colon is a field separator.

Having said that, now we are on protocol v3.00, I would recommend we move straight to the XML basket. That basket format has a lot more flexibility (there are many additional metadata items that can be stored in it, such as shipping details, delivery details, hotel booking details), and does not suffer from field length limits like the old format did. If future versions of OmniPay have support more complete baskets, then this driver will be ready to take advantage of it.

Here is the basket I wrote some time ago on another package, to give you an idea of what it looks like:

https://github.com/academe/SagePay/blob/master/src/Academe/SagePay/Model/BasketAbstract.php

I wonder if the ItemBag of omnipay-common needs a more specific implementation to cater for this additional metadata where required, i.e. basket/cart-level data that is not a cart item? Or maybe each driver can extend the ItemBag to add its own functionality - a merchant site could use that if it wanted to use those features, or just the ItemBag for the lowest-common denominator basket with features that would work across all drivers..

@judgej
Copy link
Member

judgej commented Jan 23, 2016

The XML basket, from Sage Pay v3.00, is a lot more flexible and is one now adopted by this driver since Sage Pay v3.00 became the lowest supported version. Being able to support these additional features (e.g. tax at a minimum) is great, and I would love to see it.

However while methods such as $item->getTax() do not exist in the core OmniPay basket item, and there seems to be no way to add custom fields to it, then I'm not sure how this can work.

@judgej
Copy link
Member

judgej commented Aug 31, 2016

PR #67 now covers this old-style basket. The newer XML basket was added first, and then it was realised the XML basket is great for the front end (shows items to the end user) but does not integrate with Sage accountancy packages like the old style basket. So PR #67 layered the old style basket over the top of that.

I'll close this PR as no longer needed, but if you spot any problems in the current basket implementation - do shout. Thank you.

@judgej judgej closed this Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants