Example of using HTTP POST, PUT, GET and DELETE operations for submissions in the PIX standard defined in SPI (Instant Payment System) with basic abstractions.
using System;
using System.Collections.Generic;
using System.Text;
namespace PostGetDeletePIX
{
class Program
{
private static String strAddr = "10.0.0.1";
private static String strUsrId = "master";
private static String strPwd = "12345678";
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);
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>");
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
pbRequestData,
0,
true,
false);
Console.Out.WriteLine(
"POST Header: " + Encoding.ASCII.GetString(pixRexponse.
Header));
Console.Out.WriteLine(
"POST Body: " + Encoding.ASCII.GetString(pixRexponse.
Body));
pixRexponse = api.
putPIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
pbRequestData,
0,
true,
false);
Console.Out.WriteLine(
"PUT Header: " + Encoding.ASCII.GetString(pixRexponse
.Header));
Console.Out.WriteLine(
"PUT Body: " + Encoding.ASCII.GetString(pixRexponse
.Body));
pixRexponse = api.
getPIX(strKey,
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
0,
true,
false);
Console.Out.WriteLine(
"GET Header: " + Encoding.ASCII.GetString(pixRexponse
.Header));
Console.Out.WriteLine(
"GET Body: " + Encoding.ASCII.GetString(pixRexponse
.Body));
strKeyCert,
strPIXChain,
strUrl,
pstrHeaderContents,
0,
true,
false);
Console.Out.WriteLine(
"DELETE Header: " + Encoding.ASCII.GetString(pixRexponse
.Header));
Console.Out.WriteLine(
"DELETE Body: " + Encoding.ASCII.GetString(pixRexponse
.Body));
}
}
}
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
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