Download the PHP package stevenmaguire/uber-php without Composer
On this page you can find all versions of the php package stevenmaguire/uber-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stevenmaguire/uber-php
More information about stevenmaguire/uber-php
Files in stevenmaguire/uber-php
Package uber-php
Short Description A php client for consumer Uber API
License MIT
Homepage http://github.com/stevenmaguire/uber-php
Informations about the package uber-php
Uber PHP Client
A PHP client for authenticating with Uber using OAuth 2.0 and consuming the API.
This package is intended to be used for communicating with the Uber API after you've secured an access token from your users. To authenticate users and retrieve access tokens, use stevenmaguire/oauth2-uber.
Install
Via Composer
Note that the required version of PHP is 5.5. If you want use library with PHP 5.4 you should use 1.2.0 version.
Usage
Create client
Please review the Sandbox documentation on how to develop and test against these endpoints without making real-world Requests and being charged.
Get Products
By location:
https://developer.uber.com/docs/riders/references/api/v1.2/products-get
By Id:
https://developer.uber.com/docs/riders/references/api/v1.2/products-product_id-get
Get Price Estimates
https://developer.uber.com/docs/riders/references/api/v1.2/estimates-price-get
Get Time Estimates
https://developer.uber.com/docs/riders/references/api/v1.2/estimates-time-get
Get Promotions
https://developer.uber.com/docs/riders/ride-promotions/introduction
Get User Activity
This feature is only available since version 1.1
.
https://developer.uber.com/docs/riders/references/api/v1.2/history-get
Get User Profile
https://developer.uber.com/docs/riders/references/api/v1.2/me-get
Update User Profile
https://developer.uber.com/docs/riders/references/api/v1.2/me-patch
Get Payment Methods
https://developer.uber.com/docs/riders/references/api/v1.2/payment-methods-get
Get Place
https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-get
Update a Place
https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-put
Request A Ride
Upfront Fares
Upfront fares means the total fare is known before the ride is taken.
- An end location is required
- There is no surge confirmation flow
- The user should specify a fare_id to confirm consent to the upfront fare
- The user should specify the number of seats that are required for shared products (like UberPOOL)
- In the products endpoint
GET /products
, products will have theupfront_fare_enabled
field set totrue
. - Use the ride request estimate endpoint
POST /requests/estimate
with theproduct_id
to get afare_id
. Thefare_id
can be used to lock down an upfront fare and arrival time for a trip. Thefare_id
expires after two minutes. If thefare_id
is expired or not valid, we return a 422 error. - Request the ride using the ride request endpoint
POST /requests
with thefare_id
returned in the previous step.
https://developer.uber.com/docs/riders/ride-requests/tutorials/api/best-practices#upfront-fares
Surge Confirmation Flow
If the ride request is using a product that has a surge multiplier, the API wrapper will throw an Exception and provide a response body that includes a surge confirmation ID.
https://developer.uber.com/docs/riders/ride-requests/tutorials/api/best-practices#handling-surge-pricing
Get Current Ride Details
https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-get
Get Ride Details
https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-get
Update Current Ride Details
https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-patch
Update Ride Details
https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-patch
Get Ride Estimate
https://developer.uber.com/docs/riders/references/api/v1.2/requests-estimate-post
Get Ride Map
https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-map-get
Get Ride Receipt
https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-receipt-get
Cancel Current Ride
https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-delete
Cancel Ride
https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-delete
Create Reminder
https://developer.uber.com/docs/riders/references/api/v1.2/reminders-post
Get Reminder
https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-get
Update Reminder
https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-patch
Cancel Reminder
https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-delete
Get Driver Profile
https://developer.uber.com/docs/drivers/references/api/v1/partners-me-get
Get Driver Payments
https://developer.uber.com/docs/drivers/references/api/v1/partners-payments-get
Get Driver Trips
https://developer.uber.com/docs/drivers/references/api/v1/partners-trips-get
Rate Limiting
This feature is only supported for
v1
version of the API.
Rate limiting is implemented on the basis of a specific client's secret token. By default, 1,000 requests per hour can be made per secret token.
When consuming the service with this package, your rate limit status will be made available within the client.
These values will update after each request. getRateLimit
will return null after the client is created and before the first successful request.
https://developer.uber.com/v1/api-reference/#rate-limiting
Using the Sandbox
Modify the status of an ongoing sandbox Request.
These methods will throw
Stevenmaguire\Uber\Exception
when invoked while the client is not in sandbox mode. The underlying API endpoints have no effect unless you are using the sandbox environment.
https://developer.uber.com/v1/sandbox/#request
Simulate the possible responses the Request endpoint will return when requesting a particular product, such as surge pricing, against the Sandbox.
https://developer.uber.com/v1/sandbox/#product-types
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.