Creation of Paypal encrypted button returns the error 11945 invalid country and locale combination - paypal

I am implementing the creation of encrypted Paypal buttons using their Button Manager API. Despite all my efforts I am facing the error 11945 The button country and language code combination specified is invalid..
First I tried to implement the creation of my own button but while tracing this error, I ended up with their tutorial using curl, which fails for me too with the same error. (Note: I had to change the credentials to mine).
To be specific, this code from their tutorial fails with the error 11945:
curl https://api-3t.sandbox.paypal.com/nvp \
-s \
--insecure \
-d USER=<my-user-name> \
-d PWD=<my-password> \
-d SIGNATURE=<my-signature> \
-d VERSION=51.0 \
-d METHOD=BMCreateButton \
-d BUTTONCODE=ENCRYPTED \
-d BUTTONTYPE=CART \
-d BUTTONSUBTYPE=PRODUCTS \
-d BUTTONCOUNTRY=US \
-d L_BUTTONVAR1=item_name%3Dshoehorn \
-d L_BUTTONVAR2=amount%3D1464.46 \
-d L_BUTTONVAR3=tax=%3D21 \
-d L_BUTTONVAR4=item_number%3D123456
I tried to figure out why is that but I haven't found any relevant sources.
Can anyone explain this issue? The country code is set to US, which should be fine.
All help will be appreciated.
Note: I am using the sandbox right now.
Note: Defining locale through lc attribute does not help. I tried en as well as en_US values.

After a discussion with the Paypal support, there is the conclusion.
Short version: It's a bug.
Long version (by moderator MTS_Ciaran):
Thanks, so this looks like a bug on the sandbox from what I can see.
The issue is that the account is CZ and for some reason we're not
allowing the button creation because of that. It doesnt look to be the
same on the live environment so I would suggest using a US account for
testing and once live the CZ account shouldn't be an issue.
I'll
work internally to get the sandbox corrected for this.

Related

Enable multiple audience in keycloak via kcadm

I have microservice ecosystem and all users interacting with it need to authenticate to a keycloak installation and receive a jwt token.
All is fine, I enabled audience support using this snippet:
/opt/jboss/keycloak/bin/kcadm.sh \
create clients/d3170ee6-7778-413b-8f41-31479bdb2166/protocol-mappers/models -r your-realm \
-s name=audience-mapping \
-s protocol=openid-connect \
-s protocolMapper=oidc-audience-mapper \
-s config.\"included.client.audience\"="your-audience" \
-s config.\"access.token.claim\"="true" \
-s config.\"id.token.claim\"="false"
as described here: Add protocol-mapper to keycloak using kcadm.sh
Which is fine, it works. My problem is, how do I enable multiple values for audience? I mean, I would like to allow the same user to use 2 different services with the same token - each of them should have a different audience.
And the token should look like:
{
"aud": [
"audience-1",
"audience-2"
]
}
Where audience-1 is the audience expected by the first service and audience-2 is the one expected by the 2nd service.
Is it even possible to do that via command line?
I think I may have found the answer. Or at least it worked for me:
kcadm.sh create clients/CLIENT_ID/protocol-mappers/models -r REALM_NAME \
-s name=audience-mapping \
-s prodocol=openid-connect \
-s protocolMapper=oidc-audience-mapper \
-s config.\"included.client.audience\"="audience" \
-s config.\"access.token.claim\"=\"true\" \
-s config.\"id.token.claim\"=\"false\"

How to associate a project with a quality profile in Sonarqube

I am using sonar webapi to associate a project with a quality profile but not able to do it. On every run of sonnar-scanner it is associating default quality profile. Below is the code snippet.
Updated the code snippet
curl -k -X POST --insecure -H “X-Auth-Token:XXX” -d "language=py" -d "qualityProfile=test_profile" -d “project=test_1.0” https://sonartest.xxx.com/api/qualityprofiles/add_project
I am not sure what I am doing wrong. I have administrative access and followed the webapi of Version 6.7.3 (build 38370)
Finally got some help from Soanrqube community. I need to remove X-Auth-Token from code. It should be something like this
curl -u ur_token: -X POST -d language=py -d qualityProfile=test_profile -d projectKey=${params.ProjectName} https://sonar-url.com/api/qualityprofiles/add_project

Twilio flow execution shows multiple errors

I took this code directly from Twilio's website to use for triggering a flow i designed in studio to send an sms message. I would normally avoid asking such a question so quickly but we are hurriedly building this Twilio app to facilitate communication during a labor dispute and I think its capabilities will help us greatly.It isn't even close to working. Please help me get this simple thing operational on my windows machine using command prompt.
I spent three hours watching videos but have been unsuccessful.
curl -X POST "https://studio.twilio.com/v1/Flows/FWc786af1999122b6bfb9cd72ceb00b56c/Executions" \
--data-urlencode "To=+15712351969" \
--data-urlencode "From=+12028043219" \
-u "deleted for privacy:deleted for privacy"
See resulting errors from CMD
C:\Users\Mark>curl -X POST "https://studio.twilio.com/v1/Flows/FWc786af1999122b6bfb9cd72ceb00b56c/Executions" \
{"code": 20003, "detail": "Your AccountSid or AuthToken was incorrect.", "message": "Authentication Error - No credentials provided", "more_info": "https://www.twilio.com/docs/errors/20003", "status": 401}curl: (6) Could not resolve host: \
C:\Users\Mark>--data-urlencode "To=+15712351969" \
'--data-urlencode' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Mark>--data-urlencode "From=+12028043219" \
'--data-urlencode' is not recognized as an internal or external command,
operable program or batch file.
Twilio developer evangelist here.
It looks like, from your error, that the backslashes aren't continuing the line for you.
For a start, I'd try running the command all on one line in the terminal. Like:
curl -X POST "https://studio.twilio.com/v1/Flows/FWc786af1999122b6bfb9cd72ceb00b56c/Executions" --data-urlencode "To=+15712351969" --data-urlencode "From=+12028043219" -u "deleted for privacy:deleted for privacy"
See how that goes and let me know if it helps.

How to delete my follower at github?

Is it possible to do?
If yes, could you please provide a curl example?
Removing a follower on Github in fact is possible with this workaround:
Block the user who watches you, as described in the github help.
Then unblock him again.
After that he will not be blocked anymore and he will also no longer follow you.
Wrote to Github support:
Is there any way to delete followers? I know about "Block User" option but it's not exactly what I want. Github API methods are also suitable.
They answered:
No, this isn't currently possible.
So, there is no way for now. Only "Block User".
Manually: go to user profile - in the right corner there is Follow user and right next to it menu with Block user/Report user.
By clicking on Block user, he was removed from my followers.
Here is Github manual to do that.
Could not find an api alternative.
These would be the curl commands, you were looking for:
Block a user1
$ curl \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/user/blocks/USERNAME
Unblock a user2
$ curl \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/user/blocks/USERNAME
1 https://docs.github.com/en/rest/users/blocking#block-a-user
2 https://docs.github.com/en/rest/users/blocking#unblock-a-user

Graph API bug - posting links, missing description

When posting a link on a page using the Graph API, the description is missing.
Might be related to this bug http://bugs.developers.facebook.net/show_bug.cgi?id=14782.
Is this going to be fixed? Now I'm posting as feed/ instead, here the description is shown - but then there is no "share" button.
Any known workaround?
I'm not sure why this is, and really it doesn't make much intuitive sense, but I've had success posting to the PAGE_ID/links feed, rather than identifying the page ID independently and then just posting to graph.facebook.com/links
Thus, I'm posting using:
curl -F 'access_token=ACCESS_TOKEN' \
-F 'link=LINK' \
-F 'name=TITLE' \
-F 'description=DESCRIPTION' \
https://graph.facebook.com/PAGE_ID/links
Rather than:
curl -F 'access_token=ACCESS_TOKEN' \
-F 'link=LINK' \
-F 'name=TITLE' \
-F 'description=DESCRIPTION' \
-F 'id=PAGE_ID' \
https://graph.facebook.com/links
In my testing, the former allows proper formatting of each of the elements, while the latter does not. Both surface the share link. I do not know why this is, but it works.
Hope this helps.