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

Non-existent VAT values returned from iZettle API causing issues #33

Open
DMCTowns opened this issue Apr 9, 2019 · 1 comment
Open
Assignees
Labels
Milestone

Comments

@DMCTowns
Copy link

DMCTowns commented Apr 9, 2019

Fatal error: Uncaught TypeError: Argument 7 passed to LauLamanApps\IzettleApi\API\Purchase\Product::__construct() must be of the type float, null given

This seems to be caused by VAT values not being present in the Purchase data block returned from the iZettle API:

        {
            "amount": 1699,
            "country": "GB",
            "currency": "GBP",
            "discounts": [],
            "gpsCoordinates": {
                "accuracyMeters": 11.0,
                "latitude": 51.60504687,
                "longitude": -0.59811193
            },
            "groupedVatAmounts": {},
            "organizationId": 00000000,
            "payments": [
                {
                    "amount": 1699,
                    "attributes": {
                        "applicationIdentifier": "XXXXXXXXXXX",
                        "cardIssuingBank": "LLOYDS BANK PLC",
                        "cardPaymentEntryMode": "CONTACTLESS_EMV",
                        "cardType": "VISA",
                        "maskedPan": "XXXXXXXXXXXXXXX",
                        "referenceNumber": "XXXXXXXXXXX",
                        "terminalVerificationResults": "0000000000"
                    },
                    "type": "IZETTLE_CARD",
                    "uuid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX"
                }
            ],
            "products": [
                {
                    "autoGenerated": false,
                    "barcode": "978-0-241-39863-0",
                    "description": "",
                    "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX",
                    "libraryProduct": true,
                    "name": "The Art of Statistics - David Spiegelhalter",
                    "productUuid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX",
                    "quantity": "1",
                    "rowTaxableAmount": 1699,
                    "unitPrice": 1699,
                    "variantName": "The Art of Statistics - David Spiegelhalter",
                    "variantUuid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX"
                }
            ],
            "published": true,
            "purchaseNumber": 261,
            "purchaseUUID": "XXXXXXXXXXXX",
            "purchaseUUID1": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX",
            "receiptCopyAllowed": true,
            "refund": false,
            "refunded": false,
            "source": "POS",
            "timestamp": "2019-04-03T19:24:17.088+0000",
            "userDisplayName": "XXXXXX XXXXXXXX",
            "userId": 0000000
        }

I have a branch that fixes this, if you would like to take a look at it?

@LauLaman LauLaman self-assigned this Apr 15, 2019
@LauLaman LauLaman added the Bug label Apr 15, 2019
@LauLaman LauLaman added this to the Version 1.0 milestone Apr 15, 2019
@LauLaman
Copy link
Member

@DMCTowns Feel free to open an PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants