Polymer RESTful CRUD app - polymer

I have a Users resource that consumes and produces JSON.
I want to make RESTful calls (GET,POST,PUT,DELETE) in Polymer.
Any example app or link to resources.

I made this Polymer app for an Open Source domotic project:
https://github.com/NikZar/nautes-freedomotic-dashboard
You can take a look at my: fd-rest-element-service.html and see how it gets used in the application.
I hope this helps :)

Related

React Native API usage

I want to display some data from our Solarpanels within an RN App. I have no experience with fetching the data from an json api like this, and the tutorials I found online is not working in this case for some reason.
Is there anyone who can take a look at this link, and point me in the right direction?
https://www.solaredge.com/sites/default/files/se_monitoring_api.pdf
When I open the API link with our API Key, I get something like this in the browser:
{"overview":{
"lastUpdateTime":"2022-02-14 13:57:00",
"lifeTimeData":{"energy":1.7024576E8},
"lastYearData":{"energy":8955.0},
"lastMonthData":{"energy":489.0},
"lastDayData":{"energy":0.0},
"currentPower":{"power":0.0},
"measuredBy":"INVERTER"}
}
I am using Ignite by Inifite Red as a boilerplate in this app, and there some builtin APISauce function I'm not familiar with if that makes it easier.
Check import you are using of dependency which is not installed and package.json so that you have installed correctly the dependencies.

How to do shopping cart payment option in angular 8

I have created one shoppping cart application.I do not know how to redirect payment option after filled all details.If anyone know please help me to find the solution.
src/app/directives/billing.dir.ts:
send(){
if(this.billingForm.valid){
this.storage.set({
customerInfo:this.billingForm.value
})
this.router.navigate(['/checkout']);
}
}
Demo: https://stackblitz.com/edit/angular-selvam-ecommerce-task-cnstaj?file=src%2Fapp%2Fdirectives%2Fbilling.dir.ts
If you are using only angular for payment then you have to implement any payment_gateway (paytm or paypal etc) in angular then send that information to that gateway.
OR
If you are using backed like Node.js then you can send that data to the server and implement that gateway on server-side
Then after sending that data to the gateway, it will return you the URL. then you have to redirect on that URL and made your payment.
You can ask for any help If you need.
You have to choose payment which you want to start with it.
After they will provide you integration kit for supported language mostly all payment gateway support JavaScript SDK.
Then you have to convert or use as it library inside angular project like importing library.
Before start payment integration get clarity on below article :
https://www.quora.com/How-do-payment-gateways-work-technically
https://www.quora.com/What-is-the-process-of-transaction-in-payment-gateway
https://www.quora.com/What-is-the-procedure-to-get-a-payment-gateway
https://www.quora.com/What-is-the-procedure-to-get-a-payment-gateway-for-my-website-in-India
They will provide Kit like this :
https://razorpay.com/integrations/
Demo Paytm Account you can follow this :
https://developer.paytm.com/docs/v1/payment-gateway/ and for going live
sign up here : https://business.paytm.com/payment-gateway

Integrating Apple Pay JS Into A Website

I'm looking into integrating Apple Pay into a website using the new Apple Pay JS SDK. The documentation is currently pretty minimal, concerning just the API declarations and how to instantiate a new ApplePaySession object.
Is there any example code available yet, or has anyone actually implemented this themselves yet, showing the typical API integration flow for a web application?
The only examples I've been able to find anything for all appear to be for third-party payment providers' own SDK integrations of Apple Pay.
I've published end-to-end ApplePayJS example code on github here
https://github.com/norfolkmustard/ApplePayJS
It uses PHP for the server-side part, needed for the initial vendor validation to begin the transaction. The rest is in javascript.
ApplePayJS != cash in the bank, just a means of getting a tokenised credit card from a customer. You hand that card number off to a third-party payment processor like stripe.com, braintreepayments.com, authorize.net
Cheers
The stable release will be available this fall probably.
First thing you want to do is to ensure that API is available in your browser:
if(ApplePaySession)
ApplePaySession.canMakePayments()
Then the transaction itself:
var request = {
countryCode: 'US',
currencyCode: 'USD',
supportedNetworks: ['visa', 'masterCard'],
merchantCapabilities: ['supports3DS'],
total: { label: 'Your Label', amount: '10.00' },
}
var session = new ApplePaySession(1, request);
This is from official website how to get it started: https://developer.apple.com/reference/applepayjs/applepaysession
After you have the session, you can control it:
And you can listen to events, and change your flow based on it:
I'm working on the integration between Apple Pay JS and Stripe API right now, so I'll release draft version to GitHub this summer.
The integration I've been working on has now finally been released, and there's a blog post I've written to go along with it as well as a GitHub project with an example integration using ASP.NET Core.
I hope others doing an Apple Pay JS integration themselves find it useful.

How do I get access from a client app by using PhoneGap to OpenHAB?

I'm developing a hybrid app (using PhoneGap) for openHAB. At the moment I'm struggling to build a connection from my hybrid to the OpenHAB runtime. Any suggestions?
The intended way to connect to the openHAB runtime is the REST API which is described in detail in the wiki (see https://github.com/openhab/openhab/wiki/REST-API).
You could also have a look at the implementations of the native Android client (see https://github.com/openhab/openhab.android) or the greenT HTML5 application based on Sencha Touch (see https://github.com/openhab/openhab/tree/master/distribution/openhabhome/webapps/greent).
Hope this helps,
Thomas E.-E.
The openhab has a REST API implemented as a bundle. this can be accessed via the URL "http://openhabip:8080/rest/".
If you want to access the items and implemet your own UI you can use "http://openhabip:8080/rest/items" with HTTP GET, POST ,PUT.
Otherwise you can use the "http://:8080/rest/sitemaps" and use the openhab provided sitemaps.
The details are in https://github.com/openhab/openhab/wiki/REST-API

How to do Chart on Windows Phone Universal App

I'm new Windows Phone Universal App, I need to implement bar/pie chart.
Tried many dll, Metro UI, WinRtXamlToolKit and WinRtXamlToolKit.Controls.DataVisualization
These dll are not working.
Give me good idea to do this on Windows Phone Universal App. How to do chart programmatically.
Thanks
I believe the Telerik has some Chart libraries that cost money ( can't link though as stackoverflow only permits me to post 2 links ( less than 10 rep) ). I have not used it and it is in Beta version at the moment. Google "Rad Chart windows universal apps" and you can read about it.
When I have needed charts for universal apps i have used the Google Chart Tools. You can use https://developers.google.com/chart/image/ even though Google is not developing on it anymore. It is is freakingly easy to use if you do not want to spend time drawing your own Charts. With the API you can request a chart just through a http request. You can setup almost everything and it's really easy to use thanks to the well documented API.
Here is an example of a bar chart i made using the API.
http://chart.googleapis.com/chart?chtt=Karakterfordeling&cht=bvg&chof=png&chs=300x300&chxt=x,y&chco=0076A3&chf=bg,s,65432100&hxr=0,0,50&chxl=0:|2|4|7|10|12&chxr=1,0,20&chbh=40,0,10&chd=t:2,60,70,10,90
All the arguments are passed through the http request and you can set your Chart up using the Live Chart Playground:
These are the arguments for the http request posted above. You can use the Live Chart Playground to set up parameters like below.
chtt=Karakterfordeling
cht=bvg
chof=png
chs=300x300
chxt=x,y
chco=0076A3
chf=bg,s,65432100
hxr=0,0,50
chxl=0:
2
4
7
10
12
chxr=1,0,20
chbh=40,0,10
chd=t:2,60,70,10,90
In code you set the http string as your ImageSource. You can manipulate the http string in your code and adapt the chart parameters/data if needed. I would recommend using a Converter that you bind to from you XAML. Pass your data to the converter and let it return a ImageSource with the http request. If you are new to Converters you can probably find a few posts about it here on stackoverflow.
Don't use DLLs grab the files into your project.
Add WinRTXamlToolkit.Controls.DataVisualization.csproj to your solution and reference it in the main project and add this to your page.
xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting"
xmlns:datavis="using:WinRTXamlToolkit.Controls.DataVisualization"
Look at the samples project http://winrtxamltoolkit.codeplex.com
Unfortunately, winrtxamltoolkit is only for WinRT; VS 2013 doesn't allow adding of project references of that kind to WinPhone projects.