We are setup to use the REST APIs using the PayPal Core SDK in .Net.
Moving from the SANDBOX to the LIVE environment, we're using the clientID and clientSecret provided in the LIVE tab.
It correctly shows the PayPal account that we expect to receive funds and we also get LIVE transactions shown in the developer console clicking on a transaction we get the transaction details the following is a snippet of a response showing LIVE PayPal URLs.
{
"status": 201,
"duration_time": 403,
"body": {
"links": [
{
"href": "[url]api.paypal.com/v1/payments/payment/PAY-2UM007466X5580429KYMULWY",
"method": "GET",
"rel": "self"
},
{
"href": "[url]www.paypal.com/cgi-bin/webscr?cmd\\u003d_express-checkout\\u0026token\\u003dEC-13U694454H027590M",
"method": "REDIRECT",
"rel": "approval_url"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-2UM007466X5580429KYMULWY/execute",
"method": "POST",
"rel": "execute"
}
],
"payer": {
"payment_method": "paypal"
}
The issue is that funds aren't hitting the LIVE PayPal account and no notifications are being sent to either the payer or payee. How do we determine if funds are being received and if they are, where they are being directed to.
Please note I've put [url] as a placeholder for https:// so that this question can be posted.
The issue has been resolved. The resolution was that the LIVE transactions only represented payment approvals and not payment executions and therefore funds would not have been transferred and no notifications sent.
Related
I'm implementing a DirectLine client for connecting WhatsApp via Twilio and the BotFramework. I've been able to:
Create conversations
Listen to the conversation's websocket
Send activities to the bot
For the life of me I cannot figure out how I can send an activity to the DirectLine client, so it can forward it to the user. In other words, how can I get some activity to pop-up on the DL client's websocket?
On the bot side, what I'm doing is:
Ask the client to create a conversation in DirectLine between the bot and the user (I'm using phone numbers as recipient/from IDs)
Use the new conversation and its serviceUrl to post an activity from the bot to the user
I've tried a bunch of different auth tokens to do this, the closest I've gotten was using the conversation's DirectLine token as a bearer auth:
POST https://directline.botframework.com/v3/directline/conversations/CONVERSATION_ID/activities
{
"type": "message",
"text": "message",
"from": { "id": "whatsapp:BOT_PHONE_NUMBER" },
"recipient": { "id": "whatsapp:USER_PHONE_NUMBER" }
}
Which results in this activity popping up in the websocket:
{
"channelId": "directline",
"conversation": {"id": "CONVERSATION_ID"},
"from": {"id": "whatsapp:BOT_PHONE_NUMBER"},
"id": "CONVERSATION_ID|0000006",
"recipient": {
"id": "BOT_ID#something",
"name": "Bot"
},
"serviceUrl": "https://directline.botframework.com/",
"text": "pls",
"timestamp": "2019-08-26T23:14:13.3099739Z",
"type": "message"
}
Which is obviously useless because the user's phone number is missing?! Instead the "recipient" was overwritten to the bot's.
My question is: What exactly is the canonical way to achieve this?
I can just bypass the BF altogether, call my client and have it send a message to the user. This means, however, that the implementation for this channel is different from all others. If this is the way to go, what's the point of the websockets then?
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"
}
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:
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.
Is there a way to skip the 2 step confirmation process using the PayPal REST Api?
I've successfully implemented the standard process using the PayPal REST api, which takes the user to the PayPal site where they enter their credentials and then get presented with the order summary with the option to "continue" With the text - "youre almost done. You will confirm your payment on xxxx store".
Is there a way we can skip this step - so not returning the user to my site where they then again have to review the order and select "make payment", but rather display the "pay now" button at PayPal, which will execute payment?
I've searched, and the classic API seems to handle this by adding the url parameter, useraction commit. If only I could find an equivalent for the REST api.
I had the same problem and I got an answer from the PayPal support.
TL;DR: Just append &useraction=commit to the approval_url.
They told me the REST API redirection URL is a regular Express Checkout redirection URL and therefore you can use the same parameter.
If you do a payment API call like:
curl -v https://api.sandbox.paypal.com/v1/payments/payment
-H "Content-Type:application/json"
-H "Authorization:Bearer ACCESS_TOKEN_HERE"
-d '{
"transactions": [{
"amount": {
"currency":"USD",
"total":"12"
},
"description":"creating a payment"
}],
"payer": {
"payment_method":"paypal"
},
"intent":"sale",
"redirect_urls": {
"cancel_url":"https://devtools-paypal.com/guide/pay_paypal/curl?cancel=true",
"return_url":"https://devtools-paypal.com/guide/pay_paypal/curl?success=true"
}
}'
You will get the following response:
{
"id":"PAY-XYZ",
"create_time":"2015-02-26T15:14:27Z",
"update_time":"2015-02-26T15:14:28Z",
"state":"created",
"intent":"sale",
"payer":{
"payment_method":"paypal",
"payer_info":{
"shipping_address":{
}
}
},
"transactions":[
{
"amount":{
"total":"12.00",
"currency":"USD",
"details":{
"subtotal":"12.00"
}
},
"description":"creating a payment",
"related_resources":[
]
}
],
"links":[
{
"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-XYZ",
"rel":"self",
"method":"GET"
},
{
"href":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-FOOBAR",
"rel":"approval_url",
"method":"REDIRECT"
},
{
"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-XYZ/execute",
"rel":"execute",
"method":"POST"
}
]
}
In this response you get the approval url
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-FOOBAR
and you just have to programmatically extend it with the parameter &useraction=commit.
So you redirect your user to
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-FOOBAR&useraction=commit
Examples are from the PayPal Developer Tools.
This use case does exist on the REST side of things, but currently only available via the Mobile SDKs. For more details look into https://developer.paypal.com/docs/integration/mobile/make-future-payment/
When users are paying with PayPal in web, redirection to PayPal is still necessary in the REST ecosystem.