超级乘坐请求返回422错误,代码为“ upfront_fare_required”,并显示消息“ title”:“要求有效的fare_id才能请求使用此产品旅行。” 。所使用的费用是从行驶估算api返回的费用。 这在沙盒中很好用。问题只在生产中。
收费终止的时间戳也不是问题。例如,在getestimate api中返回的fareid expires_at字段为1563436992,而乘车请求api在1563436873901之前早已返回
估计api负载
{"start_latitude":18.7036779,"start_longitude":73.7884219,"end_latitude":18.657941,"end_longitude":73.804304,"product_id":"3d67403a-afdc-41a1-9ea9-df68a3f4a835"}
估计api响应
{"fare":{"breakdown":[{"type":"base_fare","name":"Base Fare","value":112.0}],"value":112.0,"fare_id":"db03241dcde0c06337a1ec4e521b0c2840099adc207e289352e5e04504a99a64","expires_at":1563436992,"display":"\u20b9112.00","currency_code":"INR"},"trip":{"distance_unit":"mile","duration_estimate":1020,"distance_estimate":4.53},"pickup_estimate":2}
请求api有效负载
{"start_latitude":18.7036779,"start_longitude":73.7884219,"end_latitude":18.657941,"end_longitude":73.804304,"product_id":"3d67403a-afdc-41a1-9ea9-df68a3f4a835","fair_id":"db03241dcde0c06337a1ec4e521b0c2840099adc207e289352e5e04504a99a64"}
请求api响应
{"meta":{},"errors":[{"status":422,"code":"upfront_fare_required","title":"A valid fare_id is required to request a trip with this product."}]}
不知道票价为何无效。它在有效期内,即从估算api返回的值。