Add PayPal/gateway line item details #154
I'm working on passing line item details to PayPal (and other gateways which support this - see #32) and looking for feedback on the API.
It currently looks like this:
Similar to the CreditCard object, you can either pass an array and have the ItemBag object instantiated for you, or you can pass the actual item and it will be used.
I can see that in sagepay abstract request that getItemData would need to cycle through the item bag to produce a 'basket' parameter within $data (i think) to match their example:
And that I would need to edit the auth request and complete request files to merge that into the data array..
But In my code I would be unsure where to use it. I.e. I instantiate a serverGateway class, but need to call the setItems method on a request class..
I've just raised a ticket concerning the cart item implementation - I cannot see a way to add custom fields, such as the Net and VAT fields in the SagePay example. Not sure if I've raised it against the right repository, so here it is:
@benjam-es I am trying out the basket like this:
My problem is that the basket can only consist of name/quantity/price and nothing more, which limits it pretty much to just PayPal.
A gateway could override the Item class to add its own setters and getters, but that defeats the object of having a unified API to learn.