@@ -30,7 +30,7 @@ $client = new Stevenmaguire\Uber\Client(array(
30
30
'access_token' => 'YOUR ACCESS TOKEN',
31
31
'server_token' => 'YOUR SERVER TOKEN',
32
32
'use_sandbox' => true, // optional, default false
33
- 'version' => 'v1', // optional, default 'v1'
33
+ 'version' => 'v1.2 ', // optional, default 'v1.2 '
34
34
'locale' => 'en_US', // optional, default 'en_US'
35
35
));
36
36
```
@@ -104,7 +104,6 @@ $history = $client->getHistory(array(
104
104
```
105
105
106
106
[ https://developer.uber.com/v1/endpoints/#user-activity-v1-1 ] ( https://developer.uber.com/v1/endpoints/#user-activity-v1-1 )
107
- [ https://developer.uber.com/v1/endpoints/#user-activity-v1-2 ] ( https://developer.uber.com/v1/endpoints/#user-activity-v1-2 )
108
107
109
108
### Get User Profile
110
109
@@ -114,6 +113,44 @@ $profile = $client->getProfile();
114
113
115
114
[ https://developer.uber.com/v1/endpoints/#user-profile ] ( https://developer.uber.com/v1/endpoints/#user-profile )
116
115
116
+ ### Update User Profile
117
+
118
+ ``` php
119
+ $attributes = ['applied_promotion_codes' => 'PROMO_CODE'];
120
+ $profileResponse = $client->setProfile($attributes);
121
+ ```
122
+
123
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/me-patch ] ( https://developer.uber.com/docs/riders/references/api/v1.2/me-patch )
124
+
125
+ ### Get Payment Methods
126
+
127
+ ``` php
128
+ $paymentMethods = $client->getPaymentMethods();
129
+ ```
130
+
131
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/payment-methods-get ] ( https://developer.uber.com/docs/riders/references/api/v1.2/payment-methods-get )
132
+
133
+ ### Get Place
134
+
135
+ ``` php
136
+ $placeId = 'home';
137
+
138
+ $place = $client->getPlace($placeId);
139
+ ```
140
+
141
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-get ] ( https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-get )
142
+
143
+ ### Update a Place
144
+
145
+ ``` php
146
+ $placeId = 'home';
147
+ $attributes = ['address' => '685 Market St, San Francisco, CA 94103, USA'];
148
+
149
+ $place = $client->setPlace($placeId, $attributes);
150
+ ```
151
+
152
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-put ] ( https://developer.uber.com/docs/riders/references/api/v1.2/places-place_id-put )
153
+
117
154
### Request A Ride
118
155
119
156
``` php
@@ -148,14 +185,55 @@ try {
148
185
149
186
[ https://developer.uber.com/v1/endpoints/#request ] ( https://developer.uber.com/v1/endpoints/#request )
150
187
188
+ ### Get Current Ride Details
189
+
190
+ ``` php
191
+ $request = $client->getCurrentRequest();
192
+ ```
193
+
194
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-get ] ( https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-get )
195
+
151
196
### Get Ride Details
152
197
153
198
``` php
154
- $request = $client->getRequest($request_id );
199
+ $request = $client->getRequest($requestId );
155
200
```
156
201
157
202
[ https://developer.uber.com/v1/endpoints/#request-details ] ( https://developer.uber.com/v1/endpoints/#request-details )
158
203
204
+ ### Update Current Ride Details
205
+
206
+ ``` php
207
+ $requestDetails = array(
208
+ 'end_address' => '685 Market St, San Francisco, CA 94103, USA',
209
+ 'end_nickname' => 'da crib',
210
+ 'end_place_id' => 'home',
211
+ 'end_latitude' => '41.87499492',
212
+ 'end_longitude' => '-87.67126465'
213
+ );
214
+
215
+ $updateRequest = $client->setCurrentRequest($requestDetails);
216
+ ```
217
+
218
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-patch ] ( https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-patch )
219
+
220
+ ### Update Ride Details
221
+
222
+ ``` php
223
+ $requestId = '4bfc6c57-98c0-424f-a72e-c1e2a1d49939'
224
+ $requestDetails = array(
225
+ 'end_address' => '685 Market St, San Francisco, CA 94103, USA',
226
+ 'end_nickname' => 'da crib',
227
+ 'end_place_id' => 'home',
228
+ 'end_latitude' => '41.87499492',
229
+ 'end_longitude' => '-87.67126465'
230
+ );
231
+
232
+ $updateRequest = $client->setRequest($requestId, $requestDetails);
233
+ ```
234
+
235
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-patch ] ( https://developer.uber.com/docs/riders/references/api/v1.2/requests-request_id-patch )
236
+
159
237
### Get Ride Estimate
160
238
161
239
``` php
@@ -173,41 +251,118 @@ $requestEstimate = $client->getRequestEstimate(array(
173
251
### Get Ride Map
174
252
175
253
``` php
176
- $map = $client->getRequestMap($request_id );
254
+ $map = $client->getRequestMap($requestId );
177
255
```
178
256
179
257
[ https://developer.uber.com/v1/endpoints/#request-map ] ( https://developer.uber.com/v1/endpoints/#request-map )
180
258
181
259
### Get Ride Receipt
182
260
183
261
``` php
184
- $receipt = $client->getRequestReceipt($request_id );
262
+ $receipt = $client->getRequestReceipt($requestId );
185
263
```
186
264
187
265
[ https://developer.uber.com/v1/endpoints/#request-receipt ] ( https://developer.uber.com/v1/endpoints/#request-receipt )
188
266
267
+ ### Cancel Current Ride
268
+
269
+ ``` php
270
+ $request = $client->cancelCurrentRequest();
271
+ ```
272
+
273
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-delete ] ( https://developer.uber.com/docs/riders/references/api/v1.2/requests-current-delete )
274
+
189
275
### Cancel Ride
190
276
191
277
``` php
192
- $request = $client->cancelRequest($request_id );
278
+ $request = $client->cancelRequest($requestId );
193
279
```
194
280
195
281
[ https://developer.uber.com/v1/endpoints/#request-cancel ] ( https://developer.uber.com/v1/endpoints/#request-cancel )
196
282
283
+ ### Create Reminder
284
+
285
+ ``` php
286
+ $attributes = [
287
+ 'reminder_time' => '1429294463',
288
+ 'phone_number' => '555-555-5555',
289
+ 'event' => [
290
+ 'time' => '1429294463',
291
+ 'name' => 'Frisbee with friends',
292
+ 'location' => 'Dolores Park',
293
+ 'latitude' => '37.759773',
294
+ 'longitude' => '-122.427063',
295
+ ],
296
+ 'product_id' => 'a1111c8c-c720-46c3-8534-2fcdd730040d',
297
+ 'trip_branding' => [
298
+ 'link_text' => 'View team roster',
299
+ 'partner_deeplink' => 'partner://team/9383',
300
+ ]
301
+ ];
302
+ $reminder = $client->createReminder($attributes);
303
+ ```
304
+
305
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/reminders-post ] ( https://developer.uber.com/docs/riders/references/api/v1.2/reminders-post )
306
+
307
+ ### Get Reminder
308
+
309
+ ``` php
310
+ $reminderId = '4bfc6c57-98c0-424f-a72e-c1e2a1d49939';
311
+ $reminder = $client->getReminder($reminderId);
312
+ ```
313
+
314
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-get ] ( https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-get )
315
+
316
+ ### Update Reminder
317
+
318
+ ``` php
319
+ $reminderId = '4bfc6c57-98c0-424f-a72e-c1e2a1d49939';
320
+ $attributes = [
321
+ 'reminder_time' => '1429294463',
322
+ 'phone_number' => '555-555-5555',
323
+ 'event' => [
324
+ 'time' => '1429294463',
325
+ 'name' => 'Frisbee with friends',
326
+ 'location' => 'Dolores Park',
327
+ 'latitude' => '37.759773',
328
+ 'longitude' => '-122.427063',
329
+ ],
330
+ 'product_id' => 'a1111c8c-c720-46c3-8534-2fcdd730040d',
331
+ 'trip_branding' => [
332
+ 'link_text' => 'View team roster',
333
+ 'partner_deeplink' => 'partner://team/9383',
334
+ ]
335
+ ];
336
+ $reminder = $client->setReminder($reminderId, $attributes);
337
+ ```
338
+
339
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-patch ] ( https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-patch )
340
+
341
+ ### Cancel Reminder
342
+
343
+ ``` php
344
+ $reminderId = '4bfc6c57-98c0-424f-a72e-c1e2a1d49939';
345
+ $reminder = $client->cancelReminder($reminderId);
346
+ ```
347
+
348
+ [ https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-delete ] ( https://developer.uber.com/docs/riders/references/api/v1.2/reminders-reminder_id-delete )
349
+
197
350
### Rate Limiting
198
351
352
+ > This feature is only supported for ` v1 ` version of the API.
353
+
199
354
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.
200
355
201
356
When consuming the service with this package, your rate limit status will be made available within the client.
202
357
203
358
``` php
204
- $product = $client->getProduct($product_id );
359
+ $product = $client->getProduct($productId );
205
360
206
- $rate_limit = $client->getRateLimit();
361
+ $rateLimit = $client->getRateLimit();
207
362
208
- $rate_limit ->getLimit(); // Rate limit capacity per period
209
- $rate_limit ->getRemaining(); // Requests remaining in current period
210
- $rate_limit ->getReset(); // Timestamp in UTC time when the next period will begin
363
+ $rateLimit ->getLimit(); // Rate limit capacity per period
364
+ $rateLimit ->getRemaining(); // Requests remaining in current period
365
+ $rateLimit ->getReset(); // Timestamp in UTC time when the next period will begin
211
366
```
212
367
These values will update after each request. ` getRateLimit ` will return null after the client is created and before the first successful request.
213
368
@@ -217,6 +372,8 @@ These values will update after each request. `getRateLimit` will return null aft
217
372
218
373
Modify the status of an ongoing sandbox Request.
219
374
375
+ > 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.
376
+
220
377
``` php
221
378
$request = $client->requestRide(array(
222
379
'product_id' => '4bfc6c57-98c0-424f-a72e-c1e2a1d49939',
@@ -226,16 +383,16 @@ $request = $client->requestRide(array(
226
383
'end_longitude' => '-87.67126465'
227
384
));
228
385
229
- $updateRequest = $client->setRequest ($request->request_id, ['status' => 'accepted']);
386
+ $updateRequest = $client->setSandboxRequest ($request->request_id, ['status' => 'accepted']);
230
387
```
231
388
[ https://developer.uber.com/v1/sandbox/#request ] ( https://developer.uber.com/v1/sandbox/#request )
232
389
233
390
Simulate the possible responses the Request endpoint will return when requesting a particular product, such as surge pricing, against the Sandbox.
234
391
235
392
``` php
236
- $product = $client->getProduct($product_id );
393
+ $product = $client->getProduct($productId );
237
394
238
- $updateProduct = $client->setProduct($product_id , ['surge_multiplier' => 2.2, 'drivers_available' => false]);
395
+ $updateProduct = $client->setSandboxProduct($productId , ['surge_multiplier' => 2.2, 'drivers_available' => false]);
239
396
```
240
397
241
398
[ https://developer.uber.com/v1/sandbox/#product-types ] ( https://developer.uber.com/v1/sandbox/#product-types )
0 commit comments