Ride request detail API not giving all deatils - uber-api

My app is ready for production but request details API does not return complete data. I already whitelisted my ip from where i am sending ride request
i am using request endoint to find details with below URL
https://sandbox-api.uber.com/v1/requests/3638f4e4-25d7-47f6-8743-9616d4b4a2df
when i send request using curl below response received form Uber
Array
(
[status] => processing
[destination] => Array
(
[latitude] => 25.7616798
[longitude] => -80.1917902
)
[product_id] => 90384182-0269-4564-827d-e3c42c0eb83b
[request_id] => 3638f4e4-25d7-47f6-8743-9616d4b4a2df
[driver] =>
[pickup] => Array
(
[latitude] => 25.790654
[longitude] => -80.1300455
)
[eta] =>
[location] =>
[vehicle] =>
[surge_multiplier] => 1
[shared] => 1
)
Here driver details, eta everything is empty. I am using production account and i have complete access.

The request details for a request with status processing will return null for eta, location, vehicle and driver because the status indicates that Uber tries to match your rider with a driver. As soon as they are matched, the request status changes to accepted. From this point in time, you will get all the details for the request. If you would like to test this behavior, please check out the Sandbox documentation here. You can change the status of a request within the Sandbox by sending a PUT /v1/sandbox/requests/{request_id}. As payload, it requires a JSON object with a status: {"status": "accepted"}.

Related

SolidJS Create Resource - Uncaught Error in Promise

I'm new to SolidJS and I'm having a weird error with resources. Here is my code:
export const authUserResource = createResource(
() => axios.get<AuthUser>('/expense-tracker/api/oauth/user').then((res) => res.data)
);
export const MyComponent = () => {
const [data] = authUserResource;
createEffect(() => console.log('HasChecked', data.loading, data.error, data()));
return (
// ...
)
}
The intent of the API call is to retrieve data on the currently authenticated user, or to return a 401 if the user is not currently authenticated. My intent is to then redirect the user based on their authentication status.
Well, the API is called and it is returning a 401 because the user is not authenticated. All of this is expected. What is not behaving is the SolidJS resource.
If the API returns a 401, I would expect the SolidJS resource data to meet these conditions:
data.loading === false
data.error instanceof Error
data() === undefined
Instead, I am finding that it is still at these conditions, based on the console.log statement in the above code example:
data.loading === true
data.error === undefined
data() === undefined
I also get an "Uncaught Error in Promise" error message in the browser JS console.
I'm hoping to figure out what I am doing wrong here to make the resource correctly handle the error so that I can gracefully handle this in my application.

How to create a Facebook ad post (promotable_posts) using koala gem?

I was trying to create a FB ads post through koala gem:
page_graph.put_connections(page_id,"promotable_posts",params)
where params
params = {
"message" => 'my_message',
"name" => "my_name",
"link" => "www.link.com",
"caption" => "my_caption",
"description" => "This is a longer description",
"picture" => "https://pic.com/1234"
}
The error am getting is
Koala::Facebook::ClientError: type: GraphMethodException, code: 100, error_subcode: 33, message: Unsupported post request. Object with ID '<page_id>' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api, x-fb-trace-id:XXXX [HTTP 400]
I have given all the permissions for creating ads posts(ads_management,ads_read) Also, I am able to get the ads_posts for a page:
page_graph.get_connections(page_id,"promotable_posts" ) but am not able to create one.
How can I debug this?

Silhouette and mobile application

I've used as example play-silhouette-angular-seed.
Authorization via Satellizer works fine.
When I try to authorize via iOs app I got next error:
com.mohiva.play.silhouette.impl.exceptions.UnexpectedResponseException:
[Silhouette][facebook] Cannot build OAuth2Info because of invalid response format:
List((/access_token,List(ValidationError(List(error.path.missing),WrappedArray()))))
I got an error 400 in this function from OAuth2Provider.scala :
protected def getAccessToken(code: String)(implicit request: RequestHeader): Future[OAuth2Info] = {
httpLayer.url(settings.accessTokenURL).withHeaders(headers: _*).post(Map(
ClientID -> Seq(settings.clientID),
ClientSecret -> Seq(settings.clientSecret),
GrantType -> Seq(AuthorizationCode),
Code -> Seq(code),
RedirectURI -> Seq(resolveCallbackURL(settings.redirectURL))) ++ settings.accessTokenParams.mapValues(Seq(_))).flatMap { response =>
logger.debug("[Silhouette][%s] Access token response: [%s]".format(id, response.body))
Future.from(buildInfo(response))
}
}
This error has been risen because Satellizer for authentication via Facebook send to server an 'authentication code' and Silhouette server use this code to get Facebook 'access token' and create user.
Facebook iOs SDK, instead, obtained 'Access token' and I've tried to send it to server in Json in field 'code' like 'Satellizer.
To resolve this issue I send an 'access token' in Json field named 'access_token' and use next code to authenticate mobile application:
class MobileSocialAuthController #Inject() (
val messagesApi: MessagesApi,
userService: UserService,
authInfoRepository: AuthInfoRepository,
socialProviderRegistry: SocialProviderRegistry,
val env: Environment[User, JWTAuthenticator])
extends Silhouette[User, JWTAuthenticator]
{
def authenticate(provider: String) = UserAwareAction.async(parse.json) {
implicit request =>
provider match {
case "facebook" =>
request.body.asOpt[OAuth2Info] match {
case Some(authInfo) =>
(socialProviderRegistry.get[FacebookProvider](provider) match {
case Some(p: FacebookProvider) =>
for {
profile <-p.retrieveProfile(authInfo)
user <- userService.save(profile)
authInfo <- authInfoRepository.save(profile.loginInfo, authInfo)
authenticator <- env.authenticatorService.create(profile.loginInfo)
token <- env.authenticatorService.init(authenticator)
} yield {
env.eventBus.publish(LoginEvent(user, request, request2Messages))
Ok(Json.obj("token" -> token))
}
case _ => Future.failed(new ProviderException(s"Cannot authenticate with unexpected social provider $provider"))
}).recover {
case e: ProviderException =>
logger.error("Unexpected provider error", e)
Unauthorized(Json.obj("message" -> Messages("could.not.authenticate")))
}
case _ =>
Future(BadRequest(Json.obj(
"message" -> "Bad OAuth2 json.")))
}
case _ =>
Future(BadRequest(Json.obj(
"message" -> "You can use only Facebook account for authentication.")))
}
}
}
As a result, I have a token which I use in ios application to obtain resources.
This happens when the OAuth2Provider gets a response it can't parse, which is, any non-success response. So there can be many reasons for this error, for instance the authorization code is invalid or expired, or you haven't configured the redirect_uri properly (check your Facebook app configuration on the Facebook dev site to set the redirect_uri).
Silhouette does log the response it gets from Facebook which should help you debug what the actual issue is, the log line to look for is in the snippet you provided:
logger.debug("[Silhouette][%s] Access token response:...
So check your logs, there you should see the response from Facebook, likely with an error indicating why they couldn't give you an access_token.

Paypal Sandbox API Test

I have created a test API on Paypal
Do you know what i have to put in this function to make it work ?
// Creates a configuration array containing credentials and other required configuration parameters.
public static function getAcctAndConfig()
{
$config = array(
// Signature Credential
"acct1.UserName" => "",
"acct1.Password" => "",
"acct1.Signature" => "",
// Subject is optional and is required only in case of third party authorization
//"acct1.Subject" => "",
// Sample Certificate Credential
// "acct1.UserName" => "certuser_biz_api1.paypal.com",
// "acct1.Password" => "D6JNKKULHN3G5B8A",
// Certificate path relative to config folder or absolute path in file system
// "acct1.CertPath" => "cert_key.pem",
// "acct1.AppId" => "APP-80W284485P519543T"
);
return array_merge($config, self::getConfig());;
}
Thanks for your help...
Username is your email address
Password is likely the ClientID
Signature is likely the Secret
You should log into your Sandbox (the actual PayPal Sandbox site, not just Developer) account and verify that is the case

Keep getting 403 response from Intuit AggCat API

I keep getting 403 from Intuit AggCat API in response to all requests except getInstitutions and getInstitutionDetails (they return correct data). Has anyone else experienced that?
Ruby code excerpt:
IntuitIdsAggcat.config(:issuer_id => "...")
IntuitIdsAggcat.config(:oauth_consumer_key => "...")
IntuitIdsAggcat.config(:oauth_consumer_secret => "...")
IntuitIdsAggcat.config(:certificate_path => "...")
IntuitIdsAggcat::Client::Services.delete_customer '1'
IntuitIdsAggcat::Client::Services.discover_and_add_accounts_with_credentials 14007, 1, { "onlineID" => "...", "passcode" => "..." }
IntuitIdsAggcat::Client::Services.get_customer_accounts 1
Response:
{:challenge_session_id=>nil, :challenge_node_id=>nil, :response_code=>"403", :response_xml=><UNDEFINED> ... </>}`
I am using https://github.com/rewardsummit/intuit_ids_aggcat
The documentation for that response code is located [here]: https://ipp.developer.intuit.com/index.php?title=0010_Intuit_Partner_Platform/0020_Aggregation_%26_Categorization_Apps/AggCat_API/0700_Error_Codes
It looks like the users credentials either changed or they are locked.
regards,
Jarred