NET API
HSM Dinamo
Loading...
Looking for...
No entries found
post_put_get_delete_pix.cs

Example of the use of HTTP POST, PUT, GET and DELETE operations for submissions in the PIX standard defined in the SPI (Instant Payment System).

See Note on examples.
using Dinamo.Hsm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PostGetDeletePIX
{
class Program
{
private static String strAddr = "10.0.0.1";
private static String strUsrId = "usuario";
private static String strPwd = "password";
static void Main(string[] args)
{
byte[] pbMsgIn = Encoding.ASCII.GetBytes("<?xml version=\"1.0\" encoding=\"UTF - 8\" standalone=\"no\"?><xml>teste</xml>");
api.Connect(strAddr, strUsrId, strPwd); // connects
String strKey = "key";
String strKeyCert = "key_cert";
String strPIXChain = "pix_chain";
String strUrl = "https://127.0.0.1:8000";
String []pstrHeaderContents = { "Content-Type: application/xml; charset=utf-8" };
byte[] pbRequestData = Encoding.ASCII.GetBytes("<?xml version=\"1.0\" encoding=\"UTF - 8\" standalone=\"no\"?><xml>teste</xml>");
PIXResponse pixRexponse = api.postPIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
pbRequestData,
0,
0);
Console.Out.WriteLine("POST Header: " + Encoding.ASCII.GetString(pixRexponse.Header));
Console.Out.WriteLine("POST Body: " + Encoding.ASCII.GetString(pixRexponse.Body));
/*
* Optional recall of operation details.
* */
Console.Out.WriteLine("Total time (ms): " + details. uiTotalTime);
Console.Out.WriteLine("HTTP response: " + details. lHttpResponseCode);
pixRexponse = api.putPIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
pbRequestData,
0,
0);
Console.Out.WriteLine("PUT Header: " + Encoding.ASCII.GetString(pixRexponse.Header));
Console.Out.WriteLine("PUT Body: " + Encoding.ASCII.GetString(pixRexponse.Body));
/*
* Optional recall of operation details.
* */
details = api.getPIXHTTPReqDetails();
Console.Out.WriteLine("Total time (ms): " + details.uiTotalTime);
Console.Out.WriteLine("HTTP response: " + details.lHttpResponseCode);
pixRexponse = api.getPIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
0,
0);
Console.Out.WriteLine("GET Header: " + Encoding.ASCII.GetString(pixRexponse.Header));
Console.Out.WriteLine("GET Body: " + Encoding.ASCII.GetString(pixRexponse.Body));
pixRexponse = api.deletePIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
0,
0);
Console.Out.WriteLine("DELETE Header: " + Encoding.ASCII.GetString(pixRexponse.Header));
Console.Out.WriteLine("DELETE Body: " + Encoding.ASCII.GetString(pixRexponse.Body));
api.Disconnect();
}
}
}
API class for accessing HSM functionalities Dinamo. In this class you can program using...
Definition DinamoClient.cs:93
Class that encapsulates the response to a standard SPI (Instant Payment System) HTTP PIX...
Definition DinamoClient.cs:36
byte[] Header
Definition DinamoClient.cs:37
byte[] Body
Definition DinamoClient.cs:38
PIXResponse putPIX(string KeyId, string CertId, string PIXCertChainId, string URL, string[] RequestHeaderList, byte[] RequestData, Int32 TimeOut, bool UseGzip, bool VerifyHostName)
It makes a secure HTTP PUT request following the PIX standard defined in SPI (Instant Payment...
Definition DinamoClient.cs:5427
PIXResponse getPIX(string KeyId, string CertId, string PIXCertChainId, string URL, string[] RequestHeaderList, Int32 TimeOut, bool UseGzip, bool VerifyHostName)
It makes a secure HTTP GET request following the PIX standard defined in the SPI (Instant Payment System)...
Definition DinamoClient.cs:5518
DinamoApi.PIXHTTPReqDetails getPIXHTTPReqDetails()
Retrieves the details of the last PIX HTTP request (POST, GET...) made in this session....
Definition DinamoClient.cs:5725
PIXResponse postPIX(string KeyId, string CertId, string PIXCertChainId, string URL, string[] RequestHeaderList, byte[] RequestData, Int32 TimeOut, bool UseGzip, bool VerifyHostName)
It makes a secure HTTP POST request following the PIX standard defined in the SPI (Payment System Inst...
Definition DinamoClient.cs:5335
PIXResponse deletePIX(string KeyId, string CertId, string PIXCertChainId, string URL, string[] RequestHeaderList, Int32 TimeOut, bool UseGzip, bool VerifyHostName)
It makes a secure HTTP DELETE request following the PIX standard defined in the SPI (Integrated Payment...
Definition DinamoClient.cs:5629
void Connect(string User, string Password)
Establishes an encrypted connection to the HSM using the load balance settings.
Definition DinamoClient.cs:562
void Disconnect(bool flagClose)
Terminates the connection to the HSM.
Definition DinamoClient.cs:814
Namespace denoting a set of functions for accessing the HSM Dinamo and their respective exceptions.
Definition DinamoClient.cs:12
Definition DinamoApi.cs:1501
Int64 uiTotalTime
Definition DinamoApi.cs:1507
Int64 lHttpResponseCode
Definition DinamoApi.cs:1521