Integrating payment gateway with wso2 api manager - wso2

I'm trying to integrate payment gateway with wso2 api manager.I'm following wso2 documentation. According to this documentation "If you need to redirect back to the API Manager, call the workflow call back service to complete the workflow. To invoke this service, set the callback URL and the workflow reference ID in the additional parameters"
what exactly is the call back url here. and how to make subscription complete after payment is successfull. i.e to call complete method??

Callback URL is a link which will be invoked by API method after its work is done. Here callback url is the additional parameter according to the API documentation. You need to set this field with the page where you want to redirect your client after payment.

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.

Instagram API Webhook URL not receiving test updates

I have a Business App in dev mode and would like to test the handling of a test updates to my webhook for Instagam, but none of my test updates seem to go through.
I'm trying to use a Firebase HTTP Cloud Function to handle the verification and notification updates. Upon setting up the HTTP cloud function to respond appropriately if it's invoked with a GET or a POST request, I deployed my function to Firebase Cloud Functions.
I followed the steps in the getting started pages of using Webhooks, including configuring the Webhook Product, enabling page subscriptions, I have access to the Instagram Account and Facebook Page with admin access, but none of my test updates are going through to the webhook url, which I specified as a url to my Firebase Cloud Function.
My firebase cloud function url is
https://us-xxxx-xxxx-xxxxx.cloudfunctions.net/webhooks with the "xxxx" covering my project id details. When I first specify my url Webhook URL using "Instagram" and subscribing to "messages" I see that my function get's one GET request, but that's it. No test updates, or subscribing updates go through.
What the function currently does is respond with the hub.challenge if the request to the cloud function is a GET request, and if it's a POST request to the cloud function, I'll send 200 OK HTTPS. I have print messages along the way so I would know in my cloud function logs that something is being triggered. Any ideas?
Any suggestions on what to do to get the test webhooks to show up would be great. Thanks

DialogFlow, modify user request

for my dialogflow project I would like to intercept the user request before the dialogflow responds with the appropriated intent.
My goal:
-The user sends a request with an input message
-I access this message, I transform it (I apply a function to it) and then it is delivered to the dialogflow (so dialog.
I'm using a webhook linked to an specific intent. I'm using cloud functions to handle the webhook.
I would like to access the request using this webhook, modify the original request and allow dialogflow to respond according to this new modified request.
I hope I've made myself clear.
Thank you very much in advance!
I think it is not possible using a webhook, I suggest you to take a look at the Dialogflow fulfillment documentation. As you can see in the architecture representation, your webhook is behind of the intent matched, so the user request has been processed by Dialogflow and the fulfillment will perform actions based on the matched intent, so you only be able to modify the task on the service that you defined within the fulfillment and its response.
You could be able to do this according to your use-case, if you're using a custom development to make calls to the Dialogflow API, you can add an additional step between End-User and Dialogflow where you could intercept the user request, modify it and then send it to the Dialogflow API.
If you’re using any integrations such as Action on Google or Dialogflow Hangouts, this will not be possible since these services are the ones that manage the calls to the Dialogflow API.

Get the name of the Application that triggers a call from WSO2 API Manager

Is it possible to get the name of the Application that triggered the API call on WSO2 API Manager and pass it on to the call as a header?
Any can help how to do this please.
Yes, application name is part of the JWT token that you get with the calls. Here's documentation.
JWT tokens are enabled by default in WSO2 API Cloud (the public hosted service from WSO2). So if you are using it - everything just works.
If you are deploying API Manager yourself, you need to configure JWT yourself as explained here.
One option would be to implement an custom handler. See Writing Custom Handlers
APIMgtUsageHandler is one of the handlers in API manager which collects the application name (to collect usage data). So you can refer it as a sample handler on how to get the application name. see APIMgtUsageHandler.java

How to send the post request in wso2 api manager?

How to send the post request in wso2 api manager? What would be the content type, parameters etc.
I am publishing Rest APIs in WSO2 API Manager , I would like to intercept my own API input field validations for each API like input parameter format and value etc. If validation success then API Manager should allow the request to invoke back-end , else reject the request with error message.
You can create a custom handler or custom sequence and deploy it for that api. You can implement the validation logic inside that.
see following product documentation
https://docs.wso2.com/display/AM1100/Writing+Custom+Handlers
https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions