PGClient
Payment Gateway Client Library
|
Go to the source code of this file.
Classes | |
class | PgcHelper |
Helper. More... | |
Macros | |
MacroGetSec | |
Getter Macros section | |
#define | PGC_DBLGET_STR(fnGetStr, fnAssignStr, pVal, nSize, sVal) |
#define | PGC_SHTGET_STR(fnGetStr, fnAssignStr, pVal, nSize, sVal) |
MacroWinCnvSec | |
Windows string converter Macros section | |
#define | PGC_CT2A(tstr) (CT2A((tstr), CP_UTF8)) |
#define | PGC_CA2T(str) (CA2T(str)) |
#define | PGC_CS2T(str) (PGC_CA2T((str).c_str())) |
#define | PGC_CW2A(wstr) (CW2A((wstr), CP_UTF8)) |
#define | PGC_CA2W(str) (CA2W(str)) |
#define | PGC_CB2A(bstr) (PGC_CW2A(CComBSTR(bstr))) |
#define | PGC_CA2B(str) (CComBSTR(str)) |
MacroCnvSec | |
Converter Macros section | |
#define | PGC_TOSTR(nVal) (std::to_string(nVal)) |
#define | PGC_TOCSTR(nVal) (PGC_TOSTR(nVal).c_str()) |
#define | PGC_NTOAMT(nVal) ((long)((nVal) * 100 + 0.5)) |
#define | PGC_ATOAMT(sVal) PGC_NTOAMT(std::atof(sVal)) |
#define | PGC_ATOINT(sVal) (std::atoi(sVal)) |
#define | PGC_STOINT(sVal) PGC_ATOINT((sVal).c_str()) |
#define | PGC_ATOBOOL(sVal) (_stricmp((sVal), PGC_GENVAL_TRUE) == 0) |
#define | PGC_STOBOOL(sVal) PGC_ATOBOOL((sVal).c_str()) |
#define | PGC_BOOLTOA(bVal) ((bVal) ? PGC_GENVAL_TRUE : PGC_GENVAL_FALSE) |
Payment Gateway Client Helper
Strings are all in UTF-8 encoding
#define PGC_DBLGET_STR | ( | fnGetStr, | |
fnAssignStr, | |||
pVal, | |||
nSize, | |||
sVal | |||
) |
Double-get string value
[in] | fnGetStr | Function to get the value |
[in] | fnAssignStr | Function to assign the value |
[in] | pVal | Buffer parameter in the function |
[in] | nSize | Size parameter in the function |
[in] | sVal | Variable to receive the value |
#define PGC_SHTGET_STR | ( | fnGetStr, | |
fnAssignStr, | |||
pVal, | |||
nSize, | |||
sVal | |||
) |
Short-get string value (size < 256)
[in] | fnGetStr | Function to get the value |
[in] | fnAssignStr | Function to assign the value |
[in] | pVal | Buffer parameter in the function |
[in] | nSize | Size parameter in the function |
[in] | sVal | Variable to receive the value |
#define PGC_CT2A | ( | tstr | ) | (CT2A((tstr), CP_UTF8)) |
Convert from VC TCHAR string to UTF-8 Unicode C string
[in] | tstr | VC TCHAR string |
#define PGC_CA2T | ( | str | ) | (CA2T(str)) |
Convert from UTF-8 Unicode C string to VC TCHAR string
[in] | str | UTF-8 Unicode C string |
#define PGC_CS2T | ( | str | ) | (PGC_CA2T((str).c_str())) |
Convert from UTF-8 Unicode C++ std::string to VC TCHAR string
[in] | str | UTF-8 Unicode C++ std::string |
#define PGC_CW2A | ( | wstr | ) | (CW2A((wstr), CP_UTF8)) |
Convert from Windows wide char string to UTF-8 Unicode string
[in] | wstr | Windows wide char string |
#define PGC_CA2W | ( | str | ) | (CA2W(str)) |
Convert from UTF-8 Unicode string to Windows wide char string
[in] | str | UTF-8 Unicode string |
#define PGC_CB2A | ( | bstr | ) | (PGC_CW2A(CComBSTR(bstr))) |
Convert from Windows system string (BSTR) to UTF-8 Unicode string
[in] | bstr | Windows system string |
#define PGC_CA2B | ( | str | ) | (CComBSTR(str)) |
Convert from UTF-8 Unicode string to Windows system string
[in] | str | UTF-8 Unicode string |
#define PGC_TOSTR | ( | nVal | ) | (std::to_string(nVal)) |
Convert from a number value to string
[in] | nVal | Number value |
#define PGC_TOCSTR | ( | nVal | ) | (PGC_TOSTR(nVal).c_str()) |
Convert from a number value to string
[in] | nVal | Number value |
#define PGC_NTOAMT | ( | nVal | ) | ((long)((nVal) * 100 + 0.5)) |
Convert number to amount (fixed 2 decimal places)
[in] | nVal | Number value |
#define PGC_ATOAMT | ( | sVal | ) | PGC_NTOAMT(std::atof(sVal)) |
Convert string to amount (fixed 2 decimal places)
[in] | sVal | String value |
#define PGC_ATOINT | ( | sVal | ) | (std::atoi(sVal)) |
Convert string to integer
[in] | sVal | C string value |
#define PGC_STOINT | ( | sVal | ) | PGC_ATOINT((sVal).c_str()) |
Convert string to integer
[in] | sVal | String value |
#define PGC_ATOBOOL | ( | sVal | ) | (_stricmp((sVal), PGC_GENVAL_TRUE) == 0) |
Convert string to boolean
[in] | sVal | C string value |
#define PGC_STOBOOL | ( | sVal | ) | PGC_ATOBOOL((sVal).c_str()) |
Convert string to boolean
[in] | sVal | String value |
#define PGC_BOOLTOA | ( | bVal | ) | ((bVal) ? PGC_GENVAL_TRUE : PGC_GENVAL_FALSE) |
Convert boolean to string
[in] | bVal | Boolean value |