How to setup Adyen acquirer account - api

I have a problem with testing MB WAY for API only payment method on Adyen https://docs.adyen.com/payment-methods/mb-way/api-only
After I send request as described here https://docs.adyen.com/payment-methods/mb-way/api-only#make-payment
curl https://checkout-test.adyen.com/v68/payments \
-H 'x-api-key: YOUR_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YourCompanyECOM",
"reference": "My first Adyen test payment",
"amount": {
"value": 1000,
"currency": "EUR"
},
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber": "test_4111111111111111",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCode": "test_737"
}
}'
I receive this response
{
"status": 500,
"errorCode": "905_1",
"message": "Could not find an acquirer account for the provided txvariant (mbway), currency (EUR), and action (AUTH).",
"errorType": "configuration",
"pspReference": "GBSGRNJVSBLZNN82"
}
I did not found a way to set up an acquirer account on Adyen dashboard so far. Is that option there, or I need to do something else to make it work?

This kind of error can have as origin one of the following reasons:
The currency is not configured or supported
The minimum amount is set too low
The payment method is not configured on your account
The payment type (shopperInteraction) is not supported.
The full documentation of this error is here

Related

xero-api Not able to create bank transaction. Error with the account code

We are trying to create a bank transaction through the Xero API:
Here is the curl statement:
curl --location --request POST 'https://api.xero.com/api.xro/2.0/BankTransactions' \
--header 'Authorization: Bearer ' \
--header 'Xero-Tenant-Id: ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Cookie: ' \
--data-raw '{
"bankTransactions":[
{
"type":"RECEIVE",
"contact":{
"contactID":"1db8660c-387a-45e9-943e-269a0fa9f6b39"
},
"lineItems":[
{
"description":"Foobar",
"TaxType":"NONE",
"quantity":1.0,
"unitAmount":20.0,
"accountCode":"4567"
}
],
"bankAccount":{
"code":"4567"
}
}
]
}'
We get an account by calling Get Account API and we get a response:
{
"AccountID": "5aef5a57-f9f7-401f9-a627-30708840fb2",
"Code": "4567",
"Name": "Xero Integration",
"Status": "ACTIVE",
"Type": "BANK",
"TaxType": "NONE",
"Class": "ASSET",
"EnablePaymentsToAccount": false,
"ShowInExpenseClaims": false,
"BankAccountNumber": "456789",
"BankAccountType": "BANK",
"CurrencyCode": "USD",
"ReportingCode": "ASS.CUR.CAS.CAS",
"ReportingCodeName": "Cash on hand",
"HasAttachments": false,
"UpdatedDateUTC": "/Date(1670594412700+0000)/",
"AddToWatchlist": false
},
We get the validation error:
"Account code '4567' is not a valid code for this document."
I have checked the account code multiple times and everything looks good to me. Let us know what are we doing wrong.
API call by changing the account code and bank account code
The line item in the bank transaction needs to be a different account, you can't post a line item to a bank account.
Usually, for a receive money transaction, it would be a revenue account eg 200 Sales.

Keep getting "There was a problem with the request" when using hubspot search api

I am doing a search on contacts and I keep getting a response of
{
"status": "error",
"message": "There was a problem with the request.",
"correlationId": "32073a19-9272-4955-a756-e3b6a4671738"
}
the correlation id keeps changing.
This type of error response does not help determine what is going wrong.
I am just making a simply search reguest
curl --location --request POST 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=MY_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"filterGroups": [
{
"filters": [
{
"value": "Spam (Auto Deletes Contact)",
"propertyName": "Contact Type",
"operator": "EQ"
}
]
}
],
"limit": 10,
"after": 0
}'
Where can I go to get some help?
The problem was the name of the property I was trying to find.
'Contact Type' (as shown on the HubSpot website) is actually 'contact_type' when being used in an API call.
**IF the error message had said something like 'Unknown Property' this would have helped diagnose my error **

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
This is the request I'm using:
curl -X POST \
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
-H 'Authorization: Basic <b64string>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\\custompath\\",
"name": "<pipelinename>"
}
I keep getting the same error:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
It seems an issue with my payload, but documentation isn't very helpful about it
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?
I'm able to reproduce your issue on my side, and have reported this issue at website below:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."

How can assign permission to user for specific folder in nuxeo using rest api

I upload many files to Nuxeo server using rest API. Now I need to add permission to users. I use http://localhost:8080/nuxeo/api/v1/id/file-id/#acl endpoint with payload:
{
"username": "username",
"permission": "ReadWrite"
}
But it is not working. The error is:
{
"entity-type": "exception",
"status": 405,
"message": "javax.ws.rs.WebApplicationException"
}
How can I do it? Is there any endpoint for that?
Permission can be added by the Document.AddPermission operation available on the http://localhost:8080/nuxeo/api/v1/automation/Document.AddPermission endpoint.
Here is a curl example call used to add ReadWrite permission for editor user to the document with ID 2d28e87f-0753-4cfc-9f9b-b17d424aa6a7:
curl -X POST -u Administrator:Administrator \
http://localhost:8080/nuxeo/api/v1/automation/Document.AddPermission \
-H "Content-Type: application/json" \
-d '{"params":{"users":["editor"],"permission":"ReadWrite"},"input":"2d28e87f-0753-4cfc-9f9b-b17d424aa6a7"}'
And here is an example payload when you want to add permission for external user:
{
"params": {
"users":[],
"email": "some-external#user.com",
"permission": "Read",
"begin": "2020-06-01T00:00:00+02:00",
"end": "2020-06-30T00:00:00+02:00",
"notify": true,
"comment": "notify#me.com"},
"context": {},
"input": "2d28e87f-0753-4cfc-9f9b-b17d424aa6a7"
}

GitHub API File Update : "Not Found"

I am attempting to update a file in one of my repos via the API.
Here is my get of that file (works nicely):
curl -XGET 'https://git.fake.local/api/v3/repos/jsmith/repo_version/contents/version.html?ref=gh-pages'
{
"name": "version.html",
"path": "version.html",
"sha": "b1b716105590454bfc4c0247f193a04088f39c7f",
"size": 5,
"url": "https://git.fake.local/api/v3/repos/jsmith/post_version/contents/version.html?ref=gh-pages",
"html_url": "https://git.fake.local/jsmith/post_version/blob/gh-pages/version.html",
"git_url": "https://git.fake.local/api/v3/repos/jsmith/post_version/git/blobs/b1b716105590454bfc4c0247f193a04088f39c7f",
"type": "file",
"content": "aW5pdAo=\n",
"encoding": "base64",
"_links": {
...
}
}
Here is my attempt to update that file via PUT:
curl -XPUT 'https://git.fake.local/api/v3/repos/jsmith/repo_version/contents/version.html?ref=gh-pages' -d '{
"message": "update from api",
"committer": {
"name": "Joe Smith",
"email": "jsmith#fake.com"
},
"content": "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz",
"sha": "b1b716105590454bfc4c0247f193a04088f39c7f"
}'
RESULT:
{
"message": "Not Found"
}
Okay... I think I got it.
From the github doco:
Authentication
There are three ways to authenticate through GitHub API v3. Requests
that require authentication will return 404 Not Found, instead
of 403 Forbidden, in some places. This is to prevent the
accidental leakage of private repositories to unauthorized users.
I was expecting a 403 if Auth was a problem but they are throwing a 404, so basically I probably need to make sure I am auth'd correctly and all will be well.
SOLVED:
I created a personal oauth token (under settings/applications) and add to curl request in header and it all works great.
curl -XPUT -H "Authorization: token MYSECRETTOKEN"