I'm experimenting with Iroha and Iroha-helpers (a js library to communicate with the network). I'm having issues to process a "TransferAssets" transaction, it gives me a 'STATEFUL_VALIDATION_FAILED' error message, but nothing else about why it's failing.
This happens when I tried to make an asset transfer between 'userA#test' and 'userB#test' . I do not get the same issues IF I perform this transaction with the sender being 'admin#test'. All accounts have a balance of the asset that I'm trying to transfer, and they all have the same role 'user' which has the 'can_transfer' 'can_receive' roles.
This issue only happens when 'admin#test' is not the sender. otherwise it works just fine. Does anyone have an idea on how can I solve this error ?
I figured the solution and it was a silly mistake I was making.
My understanding of 'CreatorAccountId' was that you always pass the accountId of the domain creator, in my case it was 'admin#test'. However is supposed to be the creator of the transaction. So to solve my issue I just need to pass the accountId of the person/account that was making the transaction, in my case I just needed to pass usera#test as creatorAccountId as well as the the private key of usera#test for signing.
Related
I've stumbled upon a problem whilst working on a weather app. I have 401 error popping up every time i'm trying to fetch API from openweathermap.com. I've tried everything so far to fix this problem like waiting some days until my API key would work for me. I also tried to create a new API key and use it but failed at it again. Finally i tried to create another account on openweathermap.com but still have this error. Can anyone help me to find out what is the problem?
P.S. i used a valid API for checking a basic weather info that is available for free subscribtion.
401 Error screenshot
Your API Key is provided as a value to query parameter: appid is wrapped in {}. Remove those braces and perform the request again.
Very often, you will find the usage of {} in the documents, they represent placeholders in a string and are not meant to be part of the final string.
Weathermap Docs: How to make an API Call?
Also, please, make sure that you DO NOT share any essential API Keys in a public forum.
{} should be removed inside the url. It should be
let api = `https://api/openweathermap.org/data/2.5/weather?q=${city}&appid=e2850163218373000f889c28107ac0cf`
Have anyone encountered this Error message, when trying to connect to ArangoDB from a React application [See first attached photo]? It seemed like, it could be an issue related to authentication... but I've tried using "_system" and my own databases, with booth "root" as username and with "root" as password as well as setting the password to "null". I've tried to create new users and tried to connect to the database... Nothing works... (what am I doing wrong? - I've gone through the documentation a billion times at this point). I will attach a photo of my code as well.
Image of error,
Image of my code
Here is a link to the list of error codes. Unfortunately, "error 0" is extremely unhelpful. However, I see two potential issues.
First is with your use of HTTPS - normally, you use would use HTTP to connect to port 8529. One caveat would be TLS (like --server.endpoint "http+tcp://127.0.0.1:8529" with arangosh), but that's not the same as HTTPS.
Second, your AQL query seems to be attempting to return an entire collection, which is not how AQL works. Try returning a static like RETURN 'yes' or use the format:
FOR doc IN collection
RETURN doc
I needed to submit an approved-account access to Unsplash API, so as to access certain links for access approval. Given that the replies from the support team has taken more than a few days, I would just like to seek out additional help to resolve in retrieving the access_token for new requests-submissions via GET / POST methods.
The original website was working perfectly, till when I had wanted to get ready for submission for production stage and had wanted to prepare potential increases in requests to the Unsplash API.
However, the approval process entailed certain setup criterial, which I totally missed during my development phase and sought to iron out as soon as possible. One of the key component is to resolve your UTM links, which you may find here as the ideal reference: https://help.unsplash.com/en/articles/2511315-guideline-attribution.
My challenge then was that I had attempted to use the official javascript API, Unsplash-Javascript-API (https://github.com/unsplash/unsplash-js#authorization), in an effort to make the authentication / request processes simpler for my webapp to call.
Though most GET requests do work, given that a specific URL of links via "download_location" (https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download), has to be used instead, it will then require an authenticated request per new submission request by the webapp.
The final challenge then is that apparently it is not clear how the official Unsplash-Javascript-API actually pulls the "authenticated" request, as I was unable to find it on the website, so that I may retrieve the current-access_token for requests' usage.
The basic codes I am using via the API is the following, however I am confused what is the actual maximum request I may pull per page, I am hoping to get 100 returned images' details, but only gotten a maximum of 30 per time. Anyone can also help to confirm is there a workaround to increase this 30 to 100?
Retrieving a Collection of Photos
unsplash.collections.getCollectionPhotos(urlAPI, 1, 100, "Popular")
.then(toJson)
.then(jsonData => {
console.log("jsonData", jsonData);
});
So, currently my website is unable to launch for nearly 1 week plus, as I am just awaiting the final confirmation or additional help from the customer support end of the official Unsplash Team.
Hopeful that someone may help to assist me in clarifying the codes so that at least I can get one step closer to sorting this "official authenticated" process out, and take away one lesser step to getting my approval access for production ready.
Thank you in advance!
Given multiple tries. I wasn't able to retrieve the Access_Token reply, given that there is a pre-authorization step that I wasn't able to find any working solution to.
The current and clear limitations to the API are:
Maximum of 30 images request per GET request.
The official javascript API, Unsplash-Javascript-API (https://github.com/unsplash/unsplash-js#authorization) works but there is not clear or easy way to retrieve the "Access_Token" for a session usage.
Multiple async AXIOS / FETCH requests may not be "compiled successfully" when using ReactJS ContextProvider function prior to the first render. Therefore, an empty array will be shown instead on the final initial render.
Ultimately, my chosen solution is current to break down the images list to the most priority, with the limitation of only 30 images on retrieval, and still store into the original collection and retrieve it.
The other alternative is to actually download and load the images to your own server to load it, which may also be a faster route.
Sadly enough, the Unsplash API team doesn't response as frequently to assistance and my last contact was roughly 1 month ago, though I have attempted to update to their requirements but there were no feedback thereafter.
Thus, it will tentatively be better for you to just build an alternative solution than to rely on the team for a feedback, unless you are a paying client.
Good luck to the others on this! Cheers!
I have read almost everything there is on the Internet (almost no examples) and studied the (very limited and confusing) documentation.
I have a client were I am integrating payone, and I am not getting any further.
So I used the API client documentation and integrated the iframe client api example with creditcardcheck on page 35 (chapter 3.1.5.5). This works fine I receive the answer and a pseudocardpan.
As explained in the quick start guide, I then start the "preauthorization", using the server api with the pseudocardpan. I send all the necessary parameters again, and I end up on the server payone with status = approved .
I assume this is then successfull. However, what or how should I proceed? What is the transactionUrl for? Maybe someone has experience with payone.
sorry to hear you're having a tough time implementing a Payone interface. We are currently working on providing more insightful examples. Please bear with us for a little longer.
Meanwhile, I'll gladly help you with continuing your integration. After the successful preauthorization, you'll need to store the txid for further reference to this transaction. To collect the money from the creditcard, you'll need to send a capture request with the amount you wish to collect and the txid as a reference (see the docs for a full list of required parameters).
If you don't want to send a capture request afterwards (for instance if you want to collect the entire amount immediately after the customer completed their order) you can send an authorization request instead of the preauthorization and leave out the capture part.
The transaction status URL is used to asynchronously inform your application about status changes in Payone transactions. For instance in a prepayment setting we'll send a PAID notification as soon as the customer paid the amount to your bank account.
Best,
Florian (Technical Partner Manager # Payone)
I understand that once the response comes back that it has been approved, then it is approved - all the details were correct and authorisation was successful.
If you are doing a preauthorization then you will need to follow that with a capture to actually take the payment. In some legislative environments, for example many US states, you cannot capture the payment until you finally ship the goods from an online shop.
If that is not a problem (e.g. paying invoices, running an online shop in the UK), then use authorization, which does a preauthorization and capture all in one step. Apart from the name of the request, the details of the message you send is identical.
I am trying to implement a stripe checkout process in one of my express.js routes. To do this, I have:
Official Node.js Stripe module
Official client-side Stripe module
A json logger I use to log things like javascript errors, incoming requests and responses from external services like stripe, mongodb, etc…
An Order model defined using mongoose - a MongoDB ODM
My steps are as follows:
Client:
Submit order details which include a stripe payment token
Server:
Create an unpaid order and save to database (order.status is created)
Use stripe client to charge user's credit/debit card
Update order and save to database (order.status is accepted or failed depending on response from Stripe)
Question: If payment is successful after step 2 but an error occurs updating the order in step 3 (due to database server error, outage or similar), what are some appropriate ways to handle this failure scenario and potentially recover from it?
With payment systems, you always need a consolidation process (hourly, daily, monthly) based on sane accounting principles that will check that every money flow is matched.
In your case, I suggest that every external async call logs the sent parameters and the received response. If you do not have a response within a certain time, you know that something has gone wrong on the external system (Stripe, in your case) or on the way back from the external system (you mention a database failure on your side)
Basically, for each async "transaction" that you spawn, you know when you start it and have to decide of a reasonable amount of time before it ends. Thus you have an expected_end_ts in the database.
If you have not received an answer after expected_end_ts, you know that something is wrong. Then you could ask for the status to Stripe or another PSP. Hopefully the API will give you a sane answer as to whether the payment went through or not.
Also note that you should add a step between 1. and 2 : re-read the database. You want to make sure that every payment request you make is really in the database, stored exactly as you are going to send it.