Uber API to create Payment method - uber-api

I have 2 questions:
a. The Uber create payment API says I can only create payment methods of type alipay, baidu_wallet,or braintree_grant. I want to use this API (or any other) to upload a card.... is this possible or will the user need to load the card manually into uber and then use the Payment Method API to choose the correct payment Id?
b. When the user makes a ride request from my app, I want associate the trip with a specific card. How can I do this programmatically? In other words, I am looking for some API in RideParameters which will allow me to choose a payment method upfront.

a) There is no API method available that will create new payment methods or upload cards. As you mentioned in your question "user need to load the card manually into uber and then use the Payment Method API to choose the correct payment Id".
b) You can list all available payment methods by using: "GET /payment-methods" endpoint. In the response, you will get a list of available payment methods. Please use only known types - so if user account has some payment methods that are not recognized by Uber - they will be with type="unknown". Sample response looks like:
`Status-Code: 200 OK`
{
"payment_methods": [
{
"payment_method_id": "5f384f7d-8323-4207-a297-51c571234a8c",
"type": "baidu_wallet",
"description": "***53",
},
{
"payment_method_id": "f33847de-8113-4587-c307-51c2d13a823c",
"type": "alipay",
"description": "ga***#uber.com",
},
{
"payment_method_id": "f43847de-8113-4587-c307-51c2d13a823c",
"type": "visa",
"description": "***23"
},
{
"payment_method_id": "517a6c29-3a2b-45cb-94a3-35d679909a71",
"type": "american_express",
"description": "***05"
},
{
"payment_method_id": "f53847de-8113-4587-c307-51c2d13a823c",
"type": "business_account",
"description": "Late Night Ride"
}
],
"last_used": "f53847de-8113-4587-c307-51c2d13a823c"
}

Related

How to place an order as guest in eBay Sandbox

Hi I'm trying to place an order on the Sandbox environment as a guest assuming that no Paypal account would be needed to be added for the guest. I'm using the below REST APIs in that order to get this done.
I have a Listing (published offer) with the id 1xxxxxxxxxx4 in sandbox
I called the Order API -> initiateGuestCheckoutSession (Item ID : v1|1xxxxxxxxxx4|0)
I called the Order API -> initiateGuestPayment with below request body
{
"paymentMethodType": "WALLET",
"paymentMethodBrandType": "PAYPAL_CHECKOUT"
}
Got this as part of the response
"providedPaymentInstrument": {
"paymentMethodType": "WALLET",
"paymentInstrumentReference": {
"externalReferenceId": "2QG41254DS871200X"
}
I called Order API -> placeGuestOrder (Session Id : v1|1xxxxxxxxxx4|123365312 )
{ "marketingTerms": [
{"marketingTermsAccepted": false,
"marketingTypes": [ "OFFER", "SURVEY", "PROMOTION" ],
"marketingChannels": [ "EMAIL" ] } ]
}
I'm getting below for response 400 Bad request
{
"errors": [
{
"errorId": 15004,
"domain": "API_ORDER",
"category": "REQUEST",
"message": "If this is a eBay member checkout, this error indicates that the buyer does not have a PayPal account linked to their eBay account. If this is a guest checkout, this indicates that the buyer's credit card information is missing. In both cases, submit the buyer's credit card information."
}
]
}
So I have these questions in mind.
Am I calling the right APIs, in the correct order? or am I missing
something?
How do I add credit card information to this guest buyer?
If I'm to add credit card information to this guest buyer, are there
any TEST Credit cards that could be used for this purpose?
If linking a TEST Paypal to this scenario how should it be done?
To avoid all this can't we set "Cash On Delivery" option for orders?
if so how do you set that?
Thanks in advance, appreciate any help I could get on this matter guys.

Does Facebook have a webhook that an app can subscribe to to detect when a Facebook event is added to a page?

Does Facebook have a webhook that an app can subscribe to to detect when a Facebook event is added to a page? Or do apps that are interested in this information just have to repeatedly poll /[page-id]?fields=events ?
For example if you have a page that creates some event, as long as you subscribe to feeds, Facebook Realtime API will send you json payload that looks similar to this:
{
"entry": [
{
"changes": [
{
"field": "feed",
"value": {
"story": "Some page added an event.",
"item": "event",
"event_id": "2277580782468248",
"post_id": "1442694315844896_2277580782468248",
"verb": "add",
"created_time": 1511651353,
"message": "test event"
}
}
],
"id": "1442694315844895",
"time": 1511651355
}
],
"object": "page"
}
Then you probably would like to pull the Graph API for additional informations about your event_id
The product you are trying to find is Facebook Webhooks https://developers.facebook.com/docs/graph-api/webhooks/. It allows you to subscribe to changes on the Facebook page and get alert only when change occures. You don't need to have regular calls with Graph API to see whether there are changes.
First you need to create facebook app, and then to add webhooks on that Facebook app. Next step is to subscribe that webhook to page you want and select "feed" as subscription. You will be informed about any change on your page.

How to deploy rich formatted link for facebook messenger bot in api.ai?

In api.ai,
Rich formatting is supported for skype pretty fine. Here's an example:-
Here's the code of custom payload of api.ai:-
{
"skype": {
"text": "OCAS means Online Credit Approval System.\n Click [here] (http://www.erainfotechbd.com/product/ocas-online-credit-approval-system/) for more information. ",
"attachments": [
{
"contentType": "image/png",
"contentUrl": "http://weknowyourdreams.com/images/smile/smile-07.jpg",
"name": "Profile-picture.png"
}
]
}
}
Now, I wanna do something like this in facebook messenger also. But in the api.ai doc, only audio, video and file is supported.
Is there any other way to do so for url also in messenger ?
Generally webhook responses can deliver any custom payload to most platforms that API.AI supports, so any feature supported by Facebook Messenger, Skype, Google Assistant, etc. can be utilized through API.AI. Unfortunately Facebook doesn't seem to support hyperlinked text. The closest analog I could find is a what Facebook calls a URL Button. Below is an example of how you could create a API.AI response that has a Facebook URL Button with Facebook's Button template:
{
"speech": "OCAS means Online Credit Approval System. Check your phone for more information.",
"displayText": "OCAS means Online Credit Approval System. Click here for more information: http://www.erainfotechbd.com/product/ocas-online-credit-approval-system/",
"data": {
"facebook": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "OCAS means Online Credit Approval System",
"buttons": [
{
"type": "web_url",
"url": "http://www.erainfotechbd.com/product/ocas-online-credit-approval-system/",
"title": "Click here for more information"
}
]
}
}
}
}
}
You can use also use any other Facebook Messenger APIs by including any JSON inside the "message" attribute that you see from Facebook's Messenger documentation and it will be passed along to Facebook by API.AI
PS - the code above should produce a message that looks something like this:

Paypal adaptive payment method for Paypal account verification

Any one can help for Paypal adaptive payment method for Paypal account verification. When we go to live mode and generate Live APP Id it is showing error:
{
"responseEnvelope": {
"timestamp": "2015-09-18T02:23:23.202-07:00",
"ack": "Failure",
"correlationId": "4321940d358d5",
"build": "18018453"
},
"error": [
{
"errorId": "560022",
"domain": "PLATFORM",
"subdomain": "Application",
"severity": "Error",
"category": "Application",
"message": "The X-PAYPAL-APPLICATION-ID header contains an invalid value",
"parameter": [
"X-PAYPAL-APPLICATION-ID"
]
}
]
}
I have found answer of Paypal adaptive payment and check paypal valid email or not.
When create an App, need to fill complete information of APP and if you want to check only Paypal email exist or not. Deselect 'Chained Payments' within your App Submission.
Paypal can allow you to use GrtVerifiedStatus. However, please ensure to set the 'matchCriteria' parameter to 'NAME' as the permission to use 'NONE' is highly restricted.

setting event organizer with Outlook Calendar REST API

I am using the Outlook REST API for creating events and sending its invitations, based on this documentation
I authenticate the logged in user, and send its Bearer token through the Authorization header of the request, and the json-formatted event on its content.
If I set the "Organizer" to another user rather than the authenticated one, as well as the "IsOrganizer" property to "false", it gets totally ignored and sets the current logged in user as the organizer.
Any clues of what could be happening?
Is there another way of doing this?
Thank you!
I'm posting this in case someone else finds and needs an answer for this scenario...
You (Account A) can create a calendar event as someone else (Account B) through Office365 REST APIs as long as the account has permission to send as the other user account.
Here are the steps:
1) Call the Office365 REST API as follows,where {{{user2email}}} is the user you want the event to be created as (Account B's email address):
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendar
This should return Account B's user's calendar ID.
2) Pass in your JSON - the following is an example of what I used during unit testing:
{
"Subject": "Test - Created using Office365 Calendar REST API should be from Technology Notice",
"IsOrganizer": "False",
"Body": {
"ContentType": "HTML",
"Content": "This is where body copy goes HTML supported"
},
"Start": "2015-12-11T19:00:00Z",
"End": "2015-12-11T20:00:00Z",
"Attendees": [
{
"EmailAddress": {
"Address": "attendee1#yourcompany.com",
"Name": "Attendee One"
},
"Type": "Required"
}
],
"Organizer": {
"EmailAddress": {
"Address": "tnotice#yourcompany.com",
"Name": "Technology Notice"
}
}
}
'Technology Notice' will be who the calendar invite is from.
3) Use the ID from step 2 in your POST request, for example:
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendars/{{{ID}}}/events
Note: Make sure you're sending the POST request as the authenticated user account (Account A) who's account the mailbox/calendar it actually belongs to.
If everything is right you should be able to send a calendar invite and have it show up as originating from Account B instead of Account A.
Hope this helps someone out.
This is the correct behavior. You cannot create an event on User A's calendar but set the organizer to User B.