Payment via Braintree PayPal always fails iOS - ios

I have opened a ticket about this on Braintree iOS's GITHub. Just hoping to get some help fast. Here goes the issue:
As the title says, my payment (in iOS) always fails. While apparently, the payment in my colleague's work (Android) succeeds.
I followed thoroughly the sample codes and guidelines from here: https://developers.braintreepayments.com/guides/paypal/client-side/ios/v4
In iOS, after all the process (Client Token from our Server --> BT SDK --> PayPal browser --> App --> send nonce to our server), the error I get from our server is always:
PayPal pending payments are not supported.
My backend guy does not know the reason behind this too, he only showed and gave me this log:
{
"errors": {},
"params": {
"transaction": {
"type": "sale",
"amount": "1",
"merchantAccountId": "USD",
"paymentMethodNonce": "80823f63-5ea9-0b8b-67da-0710bd7d9ff1",
"orderId": "333",
"descriptor": {
"name": "company name*myurl.com"
},
"options": {
"submitForSettlement": "true",
"paypal": {
"customField": "custom",
"description": "description"
}
}
}
},
"message": "Unknown or expired payment_method_nonce.",
"creditCardVerification": null,
"transaction": null,
"subscription": null,
"merchantAccount": null,
"verification": null
}
And here's what I do in setting up my SDK:
private func processPayPalClientToken(_ clientToken: String) {
SVProgressHUD.show(withStatus: "Please wait...")
self.braintreeClient = BTAPIClient(authorization: clientToken)
let payPalDriver = BTPayPalDriver(apiClient: self.braintreeClient)
payPalDriver.viewControllerPresentingDelegate = self
payPalDriver.appSwitchDelegate = self
let request = BTPayPalRequest(amount: self.bookingViewModel.getTotalAmount())
payPalDriver.requestOneTimePayment(request) { (nonce, error) in
SVProgressHUD.dismiss(completion: {
if let error = error {
self.showAlert(title: "title...", message: "Error: \(error.localizedDescription).", okayButtonTitle: "OK") { _ in }
return
}
guard let nonce = nonce else { return }
self.processNonceToServer(nonce)
})
}
}
So... any idea what's the reason behind this? Thanks!
EDIT: Additional info that I found a while ago. The SFSafari browser dismisses itself too soon that's why the nonce I get is always invalid. Why is that?

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact
support.
Based on the payment method nonce that you posted in your question, I was able to take a look into our server-side logs to see what the issue is.
Without giving away any specific API Credentials, it appears as if the server responsible for generating a client token in your setup is passing a different Sandbox merchant ID than the server responsible for creating the transaction with that payment method nonce, which is leading to an error.
Your server is responsible for generating a client token, which contains the authorization and configuration details that your client needs to initialize the client SDK. When a payment method nonce is created, it is tied to the merchant ID that is specified in the client token authorization. The merchant ID passed during the Transaction Sale call or other API Calls must match the merchant ID that is tied to that specific payment method nonce, so you will need to fix this discrepancy in your backend code.

For the benefits of the others who are experiencing the same issue, check out my closed ticket I filed on Braintree's Github (link above or this: https://github.com/braintree/braintree_ios/issues/405)
Here's my colleague and I have discovered:
We can pay successfully using this CREDIT UNION payment method.
BUT we can't pay using PAYPAL BALANCE.
The errors like below happens in PayPal Balance option.
PayPal pending payments are not supported
So the answer in this issue would be: make sure that everything in your client is working and you're using correct and same accounts for the clientToken and the PayPal account you're using to pay.

Related

twilio access token grants for voice documentation

I have a browser based twilio phone app that works well, but for better security we are integrating access tokens now. But we can't find ANY documentation on grants anywhere. We are constructing everything ourselves in our backend, so we are specifically looking for the variables we need to put in our JSON for that, for receiving calls and sending calls.
I have asked Twilio, but it's sunday. When they return a response, if that comes first, and if it works, I'll put it here to help others who might be looking for this as we are.
ie. here is the JSON payload:
{"sub":"AC*****","nbf":1578251940,"iss":"SK*****","exp":1578338340,"iat":1578252060,"grants":{"identity":"ID_whatever","voice":{"service_sid":"AP*****"}},"jti":"SK*****"}
Any help is appreciated.
Twilio have responded with a working payload template, here it is in case anyone else needs it.
{
// API key SID concatenated with current timestamp
"jti": "SK...-1578329486",
// API key SID
"iss": "SK...",
// account SID
"sub": "AC...",
// expiration timesetamp
"exp": 1578333086,
"grants": {
// Client name
"identity": "alice",
"voice": {
"incoming": {
// if incoming connections are allowed
"allow": true
},
"outgoing": {
// if outgoing connections are allowed, the application SID
"application_sid": "AP..."
}
}
}

Authentication fails on google home (oauth2)

I'm trying to connect to google home using OAuth2.0 mechanism. However, hitting with an issue where I'm not able to retrieve success message.
The failing request is - https://oauthintegrations.googleapis.com/v1/token:getForService
with the response payload as redirectState. I know about redirect but what is redirectState? I tried to search a bit over this one, but failed.
Any help would be appreciated.
Note:I have followed all the necessary steps mentioned in doc, I can receive authorisation code, but not able to make token request to desired endpoint.
The docs are https://developers.google.com/actions/identity/oauth2-code-flow and https://developers.google.com/actions/identity/account-linking.
In configuration settings we have Linking type as Oauth -> Authorization Code.
In dialog flow in Integration -> Integration Settings we have checked in for 'Sign in required' for Default Welcome Intent and have the firebase function as
app.intent('Default Welcome Intent', (conv) => {
conv.ask(new SignIn());
});
according to https://developers.google.com/actions/identity/account-linking document and I am currently using API version V2.
After the auth code is received as mentioned it does not call token url, we receive this screen :
Bad response from IdP in Auth Code Exchange & what is redirect_state
The https://gala-demo.appspot.com/app#redirect_state=XXX&state=yyy&service=abc when inspected fails at https://oauthintegrations.googleapis.com/v1/token:getForService as mentioned by #rajesh with status code 400, but when this request is made through postman it return the response. Here is the body and response for the request.
Body :
{
"credential" : {
"redirectState": "XXX"
},
"scopes": [],
"gdiState": "APP_AUTH",
"serviceId": "tapclicks-integration-adac2_dev"
}
RESPONSE :
{
"serviceInfo": {
"authUrl": "https://-domain-/authorization",
"name": "tapclicks dashboard",
"logoUrl": "https://placeholder.com/",
"clientId": "zdqexVMaVvxIMQ7Frjwa",
"tokenUrl": "https://-domian-/token_url",
"privacyPolicyUrl": "https://placeholder.com/",
"tosUrl": "https://placeholder.com/",
"id": "tapclicks-integration-adac2_dev"
},
"completionInfo": {
"appauthInfo": {
"appauthRedirectUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy",
"appauthRedirectState": "abcxxx"
},
"oauthAuthorizationUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy"
},
"gdiState": "APP_AUTH",
"header": {}
}
Can you please tell if i might be making any configuration mistake or any other info you need.
Authorization Url : https://kprb95tye7.execute-api.us-east-1.amazonaws.com/authorization/
Token Url : https://9343j46f16.execute-api.us-east-1.amazonaws.com/token_url/
Thanks

Jira Api Error when creating issue

On my website I have a contact form which when submitted, creates a new service desk ticket. It makes the following rest api call:
https://jira-housters.atlassian.net/rest/servicedeskapi/request (with appropriate Accept and Authorization request headers)
{
"serviceDeskId": "1",
"requestTypeId": "1",
"requestFieldValues": {
"summary": "Housters Contact from Justin Test (Web)",
"description": "test message"
},
"raiseOnBehalfOf": "myemail#mydomain.com"
}
Before this worked completely fine, however a few days ago it started erroring:
{"errorMessage":"Your request could not be created. Please check the fields have been correctly filled in. Please provide a valid value for field 'Raise this request on behalf of'","i18nErrorMessage":{"i18nKey":"sd.validation.request.creation.failure.required.field","parameters":["Please provide a valid value for field 'Raise this request on behalf of'"]}}
This makes no sense, as it's complaining about the raise request on behalf of field when I clearly have it specified. What gives?
raiseOnBehalfOf should have the customers accountId not email.
You can create a customer using:-
-> https://your-domain.atlassian.net/rest/servicedeskapi/customer
-> Get the accountId from the response.

Check if twitter account has been deactivated?

I'm using the twitter4j API and I want to see if, given the ID of a user's account, if that account has been deactivated.
You need to use users/show. It will give you an error code if the user has been suspended.
For example
https://api.twitter.com/1.1/users/show.json?screen_name=nero
Returns
{
"errors": [
{
"code": 63,
"message": "User has been suspended."
}
]
}
If you only have the ID, you can make a similar call - https://api.twitter.com/1.1/users/show.json?user_id=.....
With Twitter4J you use showUser and pass it either the string of the username, or the int of the user ID.
As far as I know there is no dedicated method to do this but using users/lookup (in your case this method) with the user ids you are getting back the the active users only. So if some id is missing from the response those users are the suspended ones.

Get Recommendation from LinkedIn API returns empty map [:] as response

I have created a web application from which I am trying to get recommendations of a user from his/her LinkedIn Profile using URL
String url="https://api.linkedin.com/v1/people/~:(recommendations-received:(id,recommendation-type,recommendation-text,recommender))?format=json"
When I am using this URL in the
Api Explorer it works fine. And gives output:-
{ "recommendationsReceived": {
"_total": 2,
"values": [
{
"id": 558598601,
"recommendationText": "xxx is among the best team players I ever worked with. He has handled client effectively with smooth operations. I had always seen him as person with solution mindset and always look for solution rather than thinking about the problem. ",
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXX"
}
},
{
"id": ZZZZ,
"recommendationText": "XXX is one of the most dedicated person at work.I always him with a flexible attitude and ready to adapt himself in all situation.I have seen him work all night to catch up all the deadlines and deliver on time ."
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXXX"
}
}
] } }
The problem comes, when I am using this URL in my Developer app.It doesn't give any error just simple return an empty map [:] as output in response
Irrespective of these recommendation fields, I successfully get the user basic profile data such as email, id, image,firstName,lastName.Means my code is working for other fields well but not for these recommendation fields*
To find the solution, I did some internet surfing and find a link of Linked API docs
Linked API Docs
As per Docs following selection of profile fields are only available
to applications that have applied and been approved for the Apply with
LinkedIn program:
Recommendation Fields
I already created a LinkedIn Developer account to get key & Secret
So how do I apply and get approval for Apply with LinkedIn Recommendation Fields.
I already have seen the LinkedIn support but can't find the way to ask question to the Linked Developer help support
Please suggest me the right way.
After a long internet surfing,I have found something fruitful that, I have to fill up a form to get these fields.Here is the form
along with its procedural details
You can use just recommendations-received keyword. Try the following link. I am getting all recommendations details with this link.
https://api.linkedin.com/v1/people/~:(recommendations-received)?format=json

Resources