从uber获取带有400个状态代码的invalid_payment响应;使用rest API

时间:2019-04-05 13:58:39

标签: uber-api

我正在使用REST API通过https://api.uber.com/v1.2/requests预订和乘车。 它不适用于现金以外的付款方式。 我的代码是400:invalid_payment 有人可以帮我吗?

  1. 我可以使用现金和Paytm在印度的地点付款。
  2. 我无法在美国使用现金付款。
  3. 我无法使用印度和美国地区的卡付款。
  4. 当我通过Uber应用添加新卡并尝试使用可使用的卡在uber预订出租车时,当我尝试通过我的应用程序使用同一张卡时,显示错误。之后,当我尝试使用uber应用程序预订出租车时;它不起作用。

这是我从优步得到的答复:

{
  "data": {
    "meta": {},
    "errors": [
      {
        "status": 400,
        "code": "invalid_payment",
        "title": "The rider's payment method is invalid and they must update their billing info."
      }
    ]
  },
  "status": 400,
  "headers": {
    "server": "nginx",
    "strict-transport-security": "max-age=604800",
    "x-frame-options": "SAMEORIGIN",
    "content-type": "application/json",
    "content-geo-system": "wgs-84",
    "date": "Fri, 05 Apr 2019 06:28:50 GMT",
    "x-content-type-options": "nosniff",
    "content-length": "151",
    "cache-control": "max-age=0",
    "connection": "keep-alive",
    "x-xss-protection": "1; mode=block"
  },
  "config": {
    "transformRequest": {},
    "transformResponse": {},
    "timeout": 180000,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "headers": {
      "Accept": "application/json, text/plain, /*",
      "Content-Type": "application/json",
      "authorization": "Bearer JA.ZWU",
      "Accept-Language": "en_US"
    },
    "method": "post",
    "url": "https://api.uber.com/v1.2/requests",
    "data": "{\"start_latitude\":40.8037381,\"start_longitude\":-73.9577813,\"end_latitude\":40.68780810000001,\"end_longitude\":-73.8057292,\"fare_id\":\"7636a3afa24d7648656aabbcc695bf094d4eed6d9323f3b10a5a5868a47c\",\"product_id\":\"b64-5de2-4539-a35a-986d6e58f186\",\"payment_method_id\":\"0xxxx-90ce-4c1d-a8c4-af7b1a00c3cf\"}"
  },
  "request": {
    "UNSENT": 0,
    "OPENED": 1,
    "HEADERS_RECEIVED": 2,
    "LOADING": 3,
    "DONE": 4,
    "readyState": 4,
    "status": 400,
    "timeout": 180000,
    "withCredentials": true,
    "upload": {},
    "_aborted": false,
    "_hasError": false,
    "_method": "POST",
    "_response": "{\"meta\":{},\"errors\":[{\"status\":400,\"code\":\"invalid_payment\",\"title\":\"The rider's payment method is invalid and they must update their billing info.\"}]}",
    "_url": "https://api.uber.com/v1.2/requests",
    "_timedOut": false,
    "_trackingName": "unknown",
    "_incrementalEvents": false,
    "responseHeaders": {
      "Server": "nginx",
      "Strict-Transport-Security": "max-age=604800",
      "X-Frame-Options": "SAMEORIGIN",
      "Content-Type": "application/json",
      "Content-Geo-System": "wgs-84",
      "Date": "Fri, 05 Apr 2019 06:28:50 GMT",
      "X-Content-Type-Options": "nosniff",
      "Content-Length": "151",
      "Cache-Control": "max-age=0",
      "Connection": "keep-alive",
      "X-XSS-Protection": "1; mode=block"
    },
    "_requestId": null,
    "_headers": {
      "accept": "application/json, text/plain, /*",
      "content-type": "application/json",
      "authorization": "Bearer JA.VUNU",
      "accept-language": "en_US"
    },
    "_responseType": "",
    "_sent": true,
    "_lowerCaseResponseHeaders": {
      "server": "nginx",
      "strict-transport-security": "max-age=604800",
      "x-frame-options": "SAMEORIGIN",
      "content-type": "application/json",
      "content-geo-system": "wgs-84",
      "date": "Fri, 05 Apr 2019 06:28:50 GMT",
      "x-content-type-options": "nosniff",
      "content-length": "151",
      "cache-control": "max-age=0",
      "connection": "keep-alive",
      "x-xss-protection": "1; mode=block"
    },
    "_subscriptions": [],
    "responseURL": "https://api.uber.com/v1.2/requests"
  }
}

实际结果应接受乘车请求。

0 个答案:

没有答案