payment gateway integration with emberjs - ember.js

I have build an eCommerce website using emberjs with ember-data-1.8.0.On Api side i am using Hapijs.
I have integrated Payu payment gateway with it,but i am not able to handle response send by payu.After payment payu send a post response to given route of ember, but How will i handle this response and will get all payload so i can send request to my hapi server.
i have no clue how to do it, if there is some doc or example of integrating payment gateway and emberjs, please mention it also.
Thanks

Ember is a client side framework, Payu will not be able to send a "post" request to ember it may perform it on your Hapijs backend however. Then you have many options to check events on your backend from your frontend for example through sockets or via a setInterval which queries a given page every N seconds.

Related

How does Authorize.net work and how to integrate it?

I am a bit confused on how does Authorize.net work and how to integrate it, in my project I am using Angular as frontend and node.js as backend and I have installed Authorize.net via npm install authorizenet also cloned the Node.js sample code and I would like to set Authorize.net like so.
Let's say I have a form on my website where the customer needs to enter their details including the credit card details, my question is when submitting (using HTTP Request Method: POST) does my website need to redirect to Authorize or is there a widget that Authorize uses that I can implement in my website or are the details send directly to Authorize and handled there.
On submitting the details from the website do I simply call let's say the function from the sample codes (modified for my site) charge-credit-card.js ?
After that where do I receive the response, do I need to somehow capture it ?
Do I simply use the Production API Endpoint: https://api.authorize.net/xml/v1/request.apiand use my Api login and transaction key to use Authorize, at least that's the way in the documentation from my understanding - After building the XML object for an API request, submit it to the Authorize.net payment gateway as a standard HTTPS POST to an Authorize.net API endpoint. The exact process for doing this will depend upon the development language that you use.
Thank you in advance.
Your server will never know the customer's credit card details.
when user first time registers in your site then you will create one customer for authorize.net using this code and you will save the customer id returned to your db for future reference.
To Update customer's credit card details:
create one API controller from your node server which will return authenticating token from authorize.net to your frontend. Get token code
Your front end will make call to above created controller's API and get the authorize.net token.
Now, your front end will use this token to get the update details form from authorize.
Then you will use authorize webhook facility to know if user has updated theit payment details or not.
Webhooks to be tracked:
net.authorize.customer.paymentProfile.updated
net.authorize.customer.paymentProfile.created
On receiving below notifications, your node server will perform the whatever task required.
Refer this doc for more details.

Notify Django Channels websocket from Rest Framework action

My app uses Django Rest Framework for the API. I wanted to add live notifications/status to it.
The flow would be
User loads page then makes a get API request to load data
Websocket connects on page load and subscribes to 'notifications' channel that's in ServerNotifConsumer
User clicks a button which sends a POST request to API that does some db stuff that would return success or failure info. Returns status 202 Accepted immediately then processes command.
Return info via websocket to all subscribed clients
Is there a way from within the DRF viewset action to send anything to the websocket consumer? Or would the best way to go about this be to rewrite the API endpoint to only receive via websocket? (rather not do)

make a dialogflow webhook receiver in django

Hi I'm setting up a chatbot using dialogflow, what I want is to integrate dialogflow with django so that a search function in the django server is executed and the result of the research is passed to the chatbot, I made a webhook to the django server in dialogflow using the url "https://0e3c393b.ngrok.io/webhook" but I dont know how make a webhook receiver in django, Any recommendations ?
You should treat it like any other endpoint on django, you will get a request from Dialogflow with a JSON content body, and you will need to reply back with JSON in a specific format. When you want the search behaviour on the chatbot, at that specific intent or flow, have the action be to use a webhook request.
You can find more information here.
https://dialogflow.com/docs/fulfillment/how-it-works

Log http requests in db table with django and tastypie without increase response time

I have android app on which my django server is sending some push notifications using firebase cloud messaging. As soon as client received the notifications, it makes a GET request to my API written using Tastypie.
I want to somehow store this GET request in my Log table so that I can ensure that my android app is working fine and make right requests on receiving notifications from server.
On one of the answers, I read that it can be achieved by overriding the dispatch function for Model Resource in tastypie. Could this logging be achieved without overriding the dispatch because it can potentially increase the response time.

Is there a web service I can use to receive SOAP requests and send REST requests

I wish to create a one way integration between a system that can only send SOAP requests and a system that can only respond to REST requests. I know very little about web services as it is not my specialty. But the source system can be configured to send a SOAP request to any WSDL and the 'destination' system has a REST API and provides me with a simple URL to which I can send requests to 'trigger' an event.
I would have thought it would be simple to find some web service that can receive the SOAP requests from the source system, which would be a simple request to send a REST request to the destination system.
Like some sort of intermediary, not actually converting the requests directly but forming a similar function. Is there anything that can do this?