Worldpay offers direct integration utilizzando WebSockets + STOMP protocols. Puoi access a Worldpay API utilizzando sgcWebSockets libreria, solo bisogno a TsgcWebSocketClient e STOMP Protocol client in order a connetti a questo API
Trovi di seguito a esempio codice a connetti a Worldpay utilizzando sgcWebSockets library
Delphi Example
// create websocket client
oClient := TsgcWebSocketClient.Create(nil);
oClient.URL := 'wss://localhost:8080/ipc-app/payment/PAYPOINT1';
// create stomp client e attach to websocket client
oSTOMP := TsgcWSPClient_STOMP.Create(nil);
oSTOMP.OnSTOMPConnected := OnSTOMPConnectedEvent;
oSTOMP.Client := oClient;
// add il tuo autorizzazione chiave to CONNECT header
oSTOMP.ConnectHeaders.Clear;
oSTOMP.ConnectHeaders.Add('x-wp-authorization:xxxxxxxxxxxxxxxxxx');
// connetti to STOMP server
oClient.Active := True;
// dopo client connette successfully to server, subscribe to events
procedure OnSTOMPConnectedEvent(Connection: TsgcWSConnection; Version, server, Session, HeartBeat, RawHeaders: string);
begin
oSTOMP.Subscribe('sub-0', '/reply/v1/error');
oSTOMP.Subscribe('sub-1', '/reply/v1/pos/registration');
oSTOMP.Subscribe('sub-2', '/reply/v1/payment/notification');
end;
