Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Intraweb server handler webhook from payment gateway
#1
Lightbulb 
Hello,

I neet to use IntraWeb Web Application to support customer payments through the website. By use the Payment Gateway service by connecting via API(JSON) which has a sequence diagram as shown in the picture.

[Image: sequence-diagram-of-payment.jpg]
There will be 2 steps where the Payment Gateway will respond to create payment (charge.create) and finalize payment (charge.complete) with a Webhook (with POST requests) to the Server (from the picture that has been highlighted in yellow color).

1. I would like to know how to make this WebApp Server developed with IntraWeb able to accept this Webhook. The Webhook must be set up on the Payment Gateway side, such as url path of my site https://mydomain.com/handlerwebhook.

2. And if we assume that the payment has arrived chage.complete This will be a success or a failure. Now in the Client Browser, the customer may or may not close the Browser tab. which if it is not closed yet. How can I send the payment status to that client?(Server send communicate to specific client) For example, it may show a message box that the payment has been completed or the payment failed due to...

Thank you
Reply
#2
I think you should take a look at ContentHandlers in the Intraweb demos:

https://github.com/Atozed/IntraWeb/tree/...ntHandlers
Reply
#3
Thank you iaon for the suggestion and sample link.

์Now.

Quote:1. I would like to know how to make this WebApp Server developed with IntraWeb able to accept this Webhook. The Webhook must be set up on the Payment Gateway side, such as url path of my site https://mydomain.com/handlerwebhook.

I got the idea from the link you gave and I found 2 other very useful examples that I can apply to my case as well:
PostDataDemo
DynContentHandler

----------------------

But in this case  -->

Quote:2. And if we assume that the payment has arrived chage.complete This will be a success or a failure. Now in the Client Browser, the customer may or may not close the Browser tab. which if it is not closed yet. How can I send the payment status to that client?(Server send communicate to specific client) For example, it may show a message box that the payment has been completed or the payment failed due to...

Let me explain for example.

The customer is on the payment page and presses the payment button, such as using a credit card or scanning the QRCode shown on the payment page.

But. How can I notify back(and some data) to Cleint (Web broswer) if the server side has already received the customer's payment results via Webhook?
Is there any way to do it where the server side initiates the sending first and goes to the right client(session) as well?

Thanks
Reply
#4
For 

Quote:2. And if we assume that the payment has arrived chage.complete This will be a success or a failure. Now in the Client Browser, the customer may or may not close the Browser tab. which if it is not closed yet. How can I send the payment status to that client?(Server send communicate to specific client) For example, it may show a message box that the payment has been completed or the payment failed due to...


I found the guidelines that I expected to adapt here from the example.
- IWMonitor_SendMessage
IWMonitor-SessionNotification

But from what Alexandre explained in this forum thread : thread-1890-post-6574

So I thought that, I just might have to adjust for sending to boardcase sessions, but send a specified session instead.

Code:
      gSessions.Execute( 'IWAppID',
        procedure(aSession: TObject)
        var
          lSession: TIWApplication absolute aSession;
        begin
          lSession.Status.Value := 100;

          TIWUserSession(lSession.Data).yourvaronusersession := 'test value';
        end
      );

by 
'IWAppID' is AppID of session which to notify
- variable 'yourvaronusersession' is declare in UsersessionUnit

If I don't understand correctly or have a better way, please help advise me.

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)