intuit / QuickBooks-V3-PHP-SDK

Official PHP SDK for QuickBooks REST API v3.0: https://developer.intuit.com/
Apache License 2.0
244 stars 246 forks source link

How to get EntityRef details specially for Checks #336

Open onlinecheckwriter-zz opened 4 years ago

onlinecheckwriter-zz commented 4 years ago

We have recently moved to new SDK. Now when we are calling select *from purchase where id =... we are getting value but we are no longer getting EntityRef type. Is there any way to get it too?

onlinecheckwriter-zz commented 4 years ago

While we have tested using postman it is coming, but while used sdk it is not coming. Could you please update your sdk?? last time we fixed by manually changing schema

{ "Purchase": { "AccountRef": { "value": "224", "name": "Cash on hand" }, "PaymentType": "Check", "EntityRef": { "value": "694", "name": "Customer",

"type": "Customer" (Missing while calling using SDK but coming while called using postman)

    },
    "TotalAmt": 100.00,
    "PrintStatus": "NotSet",
    "PurchaseEx": {
        "any": [
            {
                "name": "{http://schema.intuit.com/finance/v3}NameValue",
                "declaredType": "com.intuit.schema.finance.v3.NameValue",
                "scope": "javax.xml.bind.JAXBElement$GlobalScope",
                "value": {
                    "Name": "TxnType",
                    "Value": "3"
                },
                "nil": false,
                "globalScope": true,
                "typeSubstituted": false
            }
        ]
    },
    "domain": "QBO",
    "sparse": false,
    "Id": "654",
    "SyncToken": "0",
    "MetaData": {
        "CreateTime": "2020-06-26T15:58:08-07:00",
        "LastUpdatedTime": "2020-06-26T15:58:08-07:00"
    },
    "CustomField": [],
    "DocNumber": "2",
    "TxnDate": "2020-06-26",
    "CurrencyRef": {
        "value": "USD",
        "name": "United States Dollar"
    },
    "Line": [
        {
            "Id": "1",
            "Description": "1",
            "Amount": 100.00,
            "DetailType": "AccountBasedExpenseLineDetail",
            "AccountBasedExpenseLineDetail": {
                "CustomerRef": {
                    "value": "694",
                    "name": "Customer"
                },
                "AccountRef": {
                    "value": "190",
                    "name": "Bank Charges"
                },
                "BillableStatus": "NotBillable",
                "TaxCodeRef": {
                    "value": "NON"
                }
            }
        }
    ]
},
"time": "2020-06-27T06:00:43.222-07:00"

}

bsivalingam commented 4 years ago

@onlinecheckwriter this seems to be an error when converting XML to an object. simplexml_load_string is ignoring the attributes that EntityRef has. I'll need to dig deeper for fixing this, meanwhile feel free to send a PR.

onlinecheckwriter-zz commented 4 years ago

Anyway, We have fixed using directly calling the API. in this particular case, we are not using Intuit SDK.

abisalehalliprasan commented 4 years ago

Opening up our SDK for hacktoberfest contributions.

What is it? Hacktoberfest is underway right now and we would love for you to contribute 🚀 . More information on #hacktoberfest is here

Develop-with-Intuit for Hacktoberfest

exintrovert commented 11 months ago

The XSD defines "Type" as an element, but it is being received as an attribute in the XML Response.