Skip to content

Support XML Basket

Choose a tag to compare

@judgej judgej released this 13 Jan 11:34
· 311 commits to master since this release

The optional XML Basket is supported through the Omnipay\Common\Item and Omnipay\Common\ItemBag classes. Negative prices are put into the basket as fixed discount items.

The basket was not supported at all previously, so the minor version has been raised, as sites using the ItemBag generically against all its drivers will now find they are sending the basket contents to SagePay.

Note that the OmniPay Item does not support tax, so prices are assumed to be gross and tax is set to zero. The OmniPay Item also does not support a separate shipping/delivery item, so that will not be used.

Note also that the basket totals (sum of gross amounts minus sum of discounts) MUST add up to the amount sent in the transaction, otherwise the transaction will fail. The Sage Pay test API does not enforce that rule at present, but the live API does.

Issue #44
PR #50
PR #51