Adyen Web SDK How to log product information? - adyen

So I'm currently using the Adyen Web SDK in conjunction with NodeJS, and was hoping to get some help with something.
Basically I'm building a store that sells digital products, and when users purchase a product, I store that information in my database. However, I'd also like to somehow store it with Adyen so that I can see in the list of transactions in the Adyen control panel what product was purchased for each transaction. (Without manually checking my Database since ideally it would be nice to export this in the reports as well!)
I've dug through the API docs for Adyen but nothing seems to be referenced about doing anything like this other than lineItems (https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v41/paymentSession)
But lineItems seems more for physical businesses I think? + I'm not sure if this information is even viewable in the Adyen Control Panel.
If this isn't possible, then what's the best option? Export the transactions from Adyen and loop through my database and grab the information for each transaction?

I would suggest using metadata. It is an available field in /paymentSession (and most of adyen's API calls). It's a hashmap you can put up to 20 key/value pairs.
You can then have the reports return the metadata in a new column. The metadata will be added as a JSON string. Though you have to reach out to adyen's support to enable returning metadata in reports.

Related

How to refactor route endpoints into ORM structure?

I'm not even sure exactly what constitutes an endpoint and how to turn it into ORM. I'm new to Angular, but from my understanding an endpoint is when you get data from a server, be it an online API or a database query using SQL.
From my research, ORM basically makes the code more high level and gets rid of the need for SQL, but how do you do it? And what if there is no SQL, and it's a request to an online API using a URL?
For clarification, I am working on a website that uses Angular. There is a database, an API, and a UI, and the API pulls data from online APIs and from the database. So my question is about how to refactor both types of endpoints.
ORM is a way to work with objects and let a framework take care of converting the object into a way required for the DB or data from DB to objects. UI has nothing to do with it. It is only a concern of the data layer or data tier of your backend. May be we can go on and say that even the controller part or others of your backend need not be aware of the ORM.
So the abstraction you have is
Irrespective of type of DB you talk in terms of your Model classes
Whether the data comes from DB or from another online API call by backend, finally it will also be a model object and can be sent to UI
The UI layer need not or should not know how your backend is getting the details that is required for UI. so the structure should be based more on Common sense, domain, your requirements etc and not on how backend acquires data.
And the same applies to API endpoints too. Create them in a meaningful way for your application. Example:
// this might be some of the endpoints required for a e commerce site
/product/recommendations // returns recommended products for a user
/product/categories // returns categories of products
/user/getCartItems // returns cart items of user
/orders/cancel // cancel a order
see how the api endpoints are completly unaware of how backend handles / retreives the data

how to configure hyperledger sawtooth permission

newbie for sawtooth here. Currently I am working on a POC for supply chain by using sawtooth as their record storage and there is one use case that i am still trying to sort it out. Here is the usecase, let say there is company A and company B, both companies will upload document to the supply chain system and the file url will store into sawtooth. In this case, may i know what is the best design for the permission control? As those documents able to view by all company A and company B staff. thanks!
Once the file URL is stored in the chain, anyone with access to the node will be able to view it. Only allowing certain people to read from the sawtooth chain can be done, similar to how traditional access restriction is given for APIs or servers. You can put the sawtooth system, behind a proxy and an API and give permissions for the access. That is one way to do it.

Creating individual user profiles

I am working on a project and one of the key components is creating customized user profiles. I already have a schema design for the user data that will generate said profile. But I am lost on how the technology works.
I am mostly front-end so it has been sort of overwhelming. The goal is to allow multiple user profile creations and so far I have only seen that this can be achievable via NodeJs or PHP. I have not found any guides.
I am not sure if I am asking the right questions.
Any help is appreciated. Thank you.
Since you mention you already have schema for the user table, I assume you are going to design your own database and backend node.js API to handle user profiles. You may want to build authentication functionalities in the future. If you are not familiar with Node.js yet, I recommend you to start with https://www.tutorialspoint.com/nodejs/index.htm. It's a good tutorial for beginners.
The whole purpose of a back-end node.js API is building numbers of service with specified route. Once a http request is made to a particular path, it takes parameters and execute some script. In you case the scripts will do something in database containing user profile data, for example, add a row in your data table. This operation is equivalent to creating a new user. Then, the API send response to front-end.
Keep in mind maintaining user profile data is nothing special than regular data. You should be able to pick it up with a couple of days training if you know javascriopt. But if you have to build authentication functionality you need more technologies.

How to chart custom DynaTrace measures and business transactions

I've been experimenting with custom measures and business transactions in DynaTrace 6.1 to retrieve information from a session. I am unable to added these new measures as a chart series.
The custom measure is a Web Request - Session Attribute Value and I've added it as a business transaction Split Results argument. Everything works great, but any time I attempt to add a series to a new or existing chart the only available business transactions are the 'Build-In' ones.
I've created other custom measures that are able to be added to charts, but business transactions appear to behave differently.
Does anyone know how to make a custom business transaction chart-able?
Make sure that the dashboard you add the chart to has the Stored Session set as Data Source. Dashboards always have a primary data source - by default thats most likely your regular System Profile for monitoring your apps. If you want to chart data from a different source (different system profile or stored session) you need to change that source. You can do this via Dashboard -> Properties
Also - check out my video tutorials on Dashboarding Basics and Advanced Dashboarding
If you have further questions also make sure you use our Dynatrace Discussion platform on http://answers.dynatrace.com

Tracking data access

Backstory
I work for a company that has an online site that allows user to text personal information for collection. We collect the data, and make it available online. Users can choose to share the data with other users.
Going Forward
At some point, this may become classified an FDA-governed medical tool. In anticipation, we'd like to have in place a logging system that shows each time someone accesses our users' data, whether it be the user themselves, another authorized user, or a support person.
Current Architecture
We are currently running Ruby/Rails, and using a MySQL database. The personal information is encrypted in the database.
Data Access for Support
Today, support personnel can access data one of three ways:
admin site The admin site is limited to whatever screens we develop. While we don't currently, we could easily add logging to keep an audit trail of who accessed which data using the admin tool.
sql client I use MySQLWorkbench to access production. However, when connected this way, all personal information (user name, cell number, etc), is encrypted.
Ruby Rails console - Finally, support can log into one of the production boxes and use the Ruby/Rails console from command line. Ruby will decrypt the data, so we can do some simple things such as
u=User.find_all_by_state('active')
and it will return the recordset of all users with state='active', and decrypt their personal information in the resultset.
Holy Grail
logging
easy access for support
I'd love to be have a way to allow easy support access (once authenticated) to the data, but would log everything that is accessed (read or updated). That way, if I'm checking out my buddy's ex-wife's data for example, it gets logged to a place where I can't get in and clean it the audit trail. (See Google firing Gmail employee for an example of employees breaching the data policies).
Anyone have ideas, thoughts, experiences, suggestions with this issue?
hey devguy. This was a issue for me a couple months back. We ended up centralizing our mysql queires so that we could start to track all information coming in and out. Unfortunately the class I wrote is in PHP but the idea behind it could make it very easy to start logging.
https://code.google.com/p/php-centralized-mysql-controller/
Try stored procedures. Make all code use the stored procedures for CRUD activities. This defines an API that your developers can use while business rules are global enforced (don't return entire SSN values, but only last 4 digits, etc).
This serves as the basis for an external API as well.
If you want logging/auditing, you put it in the procedure.
This protects you from everyone except the DBAs.