davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

Post-Order:getCancellation - Unknown property exception #107

Closed kingsaj closed 7 years ago

kingsaj commented 7 years ago

I guess ebay really need to improve their docs.

DTS\eBaySDK\Exceptions\UnknownPropertyException with message 'Unknown property cancelState'
{
  "cancelDetail": {
    "cancelId": "xxxxxxxxxxx",
    "marketplaceId": "EBAY_GB",
    "legacyOrderId": "xxxxxxxxxx-xxxxxxxxxxxxxxxx",
    "requestorType": "SELLER",
    "cancelReason": "BUYER_CANCEL_OR_ADDRESS_ISSUE",
    "cancelState": "CONFIRM_REFUND_PENDING",
    "cancelStatus": "CANCEL_PENDING",
    "buyerResponseDueDate": {
      "value": "2017-06-11T22:00:00.000Z",
      "formattedValue": "2017-06-11T22:00:00.000Z"
    },
    "paymentStatus": "UNKNOWN",
    "requestRefundAmount": {
      "value": 4.99,
      "currency": "GBP"
    },
    "cancelRequestDate": {
      "value": "2017-06-01T15:13:07.000Z",
      "formattedValue": "2017-06-01T15:13:07.000Z"
    },
    "activityHistories": [
      {
        "activityType": "SELLER_CREATE_CANCEL",
        "activityParty": "SELLER",
        "actionDate": {
          "value": "2017-06-01T15:13:07.000Z",
          "formattedValue": "2017-06-01T15:13:07.000Z"
        },
        "cancelStateFrom": "INITIAL",
        "cancelStatetateTo": "CONFIRM_REFUND_PENDING"
      }
    ]
  }
}
kingsaj commented 7 years ago

Looking at ebays example, there may be a couple more.

{
  "cancelDetail": {
    "cancelId": "5000001071",
    "marketplaceId": "EBAY_US",
    "legacyOrderId": "170006494376-8756205007",
    "requestorType": "SELLER",
    "cancelReason": "BUYER_CANCEL_OR_ADDRESS_ISSUE",
    **"cancelState"**: "REFUND_PENDING",
    **"cancelStatus"**: "CANCEL_PENDING",
    "paymentStatus": "PAYPAL_PAID",
    "requestRefundAmount": {
      "value": 2.46,
      "currency": "USD"
    },
    "cancelRequestDate": {
      "value": "2014-08-22T23:29:11.000Z",
    },
    "lineItems": [
      {
        "itemId": "170006494376",
        "transactionId": "8756205007"
      }
    ],
    "activityHistories": [
      {
        "activityType": "SELLER_CREATE_CANCEL",
        "activityParty": "SELLER",
        "actionDate": {
          "value": "2014-08-22T23:29:07.000Z",
        },
        **"cancelStateFrom"**: "INITIAL",
        **"cancelStatetateTo"**: "REFUND_PENDING"   _Type here in the responce returned from ebay_
      }
    ]
  }
}
davidtsadler commented 7 years ago

Just need to check that cancelStatetateTo is a typo or if that is actually what the API is returning. I can easily add both cancelStateTo and cancelStatetateTo if needed.

kingsaj commented 7 years ago

It's a typo in the actual response I'm getting back from the ebay

davidtsadler commented 7 years ago

lol. I'll add both cancelStateTo and cancelStatetateTo just to be on the safe side then.

kingsaj commented 7 years ago

Thanks David, maybe you can go work for ebay and teach them a thing or two