PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Intégration système Pos pour carte
Intégration système Pos pour carte
Débuté par Nicolas, 15 mar. 2021 17:11 - 12 réponses
Membre enregistré
144 messages
Posté le 15 mars 2021 - 17:11
Bonjour,

J'ai développé un système de facturation et intégré un module de caisse pour un magasin.

J'aimerais interfacer le système de carte de paiement
https://www.six-payment-services.com/fr/shared/products/terminals/yomani-xr-pinpad.html

Il y a la possibilité d'utiliser Pepper qui fonctionne avec plusieurs terminaux.
https://www.treibauf.ch/en/solutions/integration/…

Qui a déjà utilisé et programmé ce genre pour des systèmes de caisse ?

En vous remerciant par avance.

Nicolas

--
Nicolas
Posté le 15 avril 2021 - 15:06
Bonjour
Ca m'intéresse aussi, si qqun a une solution. merci d'avance
Membre enregistré
311 messages
Popularité : +3 (5 votes)
Posté le 16 avril 2021 - 14:12
Bonjour ,
Je suis dans le même besoin et j'ai un projet similaire .Donc je cherche un retour d'expérience
bon dév
Membre enregistré
144 messages
Posté le 18 mai 2021 - 10:34
Bonjour
Je remonte le post pour savoir si quelqu'un à trouvé une solution ou une piste ?

--
Nicolas
Membre enregistré
2 574 messages
Popularité : +222 (260 votes)
Posté le 18 mai 2021 - 12:34
Vous avez demandé la doc technique au fabricant ?

--
Cordialement,

Philippe SAINT-BERTIN
Posté le 12 août 2021 - 15:27
Bonjour

J'ai importé un objet .Net et j'ai ce message

PepperDotNet.pepInitialize(pPepcoreLibraryPath,pConfigurationStructure,pLicenseStructure,pRfu1,pRfu2)


Go :>


L'objet <PepperDotNet> est inconnu dans l'assemblage <G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll>.
Vérifier que la version de l'assemblage <G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll> utilisée en exécution est la même que la version utilisée pour la compilation du projet.
L'objet de type <pepperdotnet.PepperDotNet> (assemblage <G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll>) n'a pas pu être créé
L'assemblage <G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll> n'a pas pu être ouvert
Le framework .NET a renvoyé l'erreur suivante :
Impossible de charger le fichier ou l'assembly 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ou une de ses dépendances. L'opération n'est pas prise en charge. (Exception de HRESULT : 0x80131515)
L'assemblage <pepperdotnet> n'a pas pu être ouvert

Pile des appels :
Initialisation de MON_PROJET (), ligne 27

Date : 12/08/2021 15:25:26
Projet : MON_PROJET (25.00Gf)

Informations supplémentaires :
Code erreur : 200007
Module : wd260net4.dll (01F260100j - 26.0.264.0)

Informations de débogage :
System.IO.FileLoadException: Impossible de charger le fichier ou l'assembly 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ou une de ses dépendances. L'opération n'est pas prise en charge. (Exception de HRESULT : 0x80131515)
Nom de fichier : 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ---> System.NotSupportedException: Tentative de chargement d'un assembly à partir d'un emplacement réseau qui aurait entraîné l'utilisation de l'assembly en mode Bac à sable (sandbox) dans les versions antérieures du .NET Framework. Cette version du .NET Framework n'activant pas la stratégie CAS par défaut, ce chargement peut être dangereux. Si ce chargement n'est pas destiné à utiliser l'assembly en mode Bac à sable (sandbox), activez le commutateur loadFromRemoteSources. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/….
à System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
à System.Reflection.Assembly.LoadFrom(String assemblyFile)
à CDotNetLoader.__pclLoadAssembly(CDotNetLoader* , Char* pszFileName, CXError* pclErreur)


EIT_TYPE_WDFILE : <4097>
EIT_IDCODE : <196608>
----- Sous-erreur n°1 -----

L'assemblage <pepperdotnet> n'a pas pu être ouvert
Code erreur : 200003
Module : wd260net4.dll (01F260100j - 26.0.264.0)


----- Sous-erreur n°2 -----

L'assemblage <G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll> n'a pas pu être ouvert
Le framework .NET a renvoyé l'erreur suivante :
Impossible de charger le fichier ou l'assembly 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ou une de ses dépendances. L'opération n'est pas prise en charge. (Exception de HRESULT : 0x80131515)
Code erreur : 200007
Module : wd260net4.dll (01F260100j - 26.0.264.0)

Informations de débogage :
System.IO.FileLoadException: Impossible de charger le fichier ou l'assembly 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ou une de ses dépendances. L'opération n'est pas prise en charge. (Exception de HRESULT : 0x80131515)
Nom de fichier : 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ---> System.NotSupportedException: Tentative de chargement d'un assembly à partir d'un emplacement réseau qui aurait entraîné l'utilisation de l'assembly en mode Bac à sable (sandbox) dans les versions antérieures du .NET Framework. Cette version du .NET Framework n'activant pas la stratégie CAS par défaut, ce chargement peut être dangereux. Si ce chargement n'est pas destiné à utiliser l'assembly en mode Bac à sable (sandbox), activez le commutateur loadFromRemoteSources. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/….
à System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
à System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
à System.Reflection.Assembly.LoadFrom(String assemblyFile)
à CDotNetLoader.__pclLoadAssemblyWithFullPath(CDotNetLoader* , Char* pszFileName, CXError* pclErreur)




----- Sous-erreur n°3 -----

L'assemblage <pepperdotnet> n'a pas pu être ouvert
Code erreur : 200003
Module : wd260net4.dll (01F260100j - 26.0.264.0)
Membre enregistré
962 messages
Popularité : +183 (185 votes)
Posté le 12 août 2021 - 16:28
hello,
Nicolas a écrit :
Bonjour

J'ai importé un objet .Net et j'ai ce message


> Nom de fichier : 'file:///G:\WDPROJETS\MON_PROJET\Exe\MON_PROJET\pepperdotnet.dll' ---> System.NotSupportedException: Tentative de chargement d'un assembly à partir d'un emplacement réseau qui aurait entraîné l'utilisation de l'assembly en mode Bac à sable (sandbox) dans les versions antérieures du .NET Framework. Cette version du .NET Framework n'activant pas la stratégie CAS par défaut, ce chargement peut être dangereux.

Le lecteur G est-il un lecteur réseau ?

--
Ami calmant, J.P
Membre enregistré
144 messages
Posté le 13 août 2021 - 13:18
Hello
Merci pour ta réponse.
J'ai avancé un peu.


L'invocation de la méthode <pepInitialize(System.String,System.String,System.String,System.String,System.String)> du type <OptionList> a échoué
Le framework .NET a renvoyé l'erreur suivante :
Failed to initialize the PEPPER Pos Library

Pile des appels :
Initialisation de MonAppliTest(), ligne 14

Date : 13/08/2021 13:16:43
Projet : MonAppliTest(25.00Gf)

Informations supplémentaires :
Code erreur : 200002
Module : wd260net4.dll (01F260100j - 26.0.264.0)

Informations de débogage :
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> pepperdotnet.PepperException: Failed to initialize the PEPPER Pos Library
à pepperdotnet.PepperDotNet.pepInitialize(String p_strPathToPepperLibrary, String p_strConfigurationStructure, String p_strLicenseStructure, String p_strReservedForFuture1, String p_strReservedForFuture2)
--- Fin de la trace de la pile d'exception interne ---
à System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
à System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
à CDotNetMethod.bInvoke(Char* pszTypeName, Char* pszMethodName, Char* pszParameters, MethodInfo gcMethod, Object gcObj, CSLevel* pclPile, Int32 nNbParamPile, Int32 bValeurRetour, STOperationDotNet* pstOperation)
EIT_EXCEPTIONDOTNET
EIT_TYPE_WDFILE : <4097>
EIT_IDCODE : <196608>

--
Nicolas
Membre enregistré
144 messages
Posté le 16 août 2021 - 11:39
Bonjour

Je bloque toujours sur un truc. Voici le code qui se trouve dans la fonction pepInitialize de mon assemblage .Net

// // pepInitialize
// //
// // Paramètres :
// // p_strPathToPepperLibrary : chaîne UNICODE
// // p_strConfigurationStructure : chaîne UNICODE
// // p_strLicenseStructure : chaîne UNICODE
// // p_strReservedForFuture1 : chaîne UNICODE
// // p_strReservedForFuture2 : chaîne UNICODE
// // Valeur de retour :
// // OptionList
//
// [ <Résultat> = ] pepInitialize (LOCAL p_strPathToPepperLibrary est un(e) chaîne UNICODE, LOCAL p_strConfigurationStructure est un(e) chaîne UNICODE, LOCAL p_strLicenseStructure est un(e) chaîne UNICODE, LOCAL p_strReservedForFuture1 est un(e) chaîne UNICODE, LOCAL p_strReservedForFuture2 est un(e) chaîne UNICODE)


Je donne bien les paramètres en définissant les variables Chaine UNICODE

Je n'arrive pas à obtenir la valeur de retour.

Savez-vous à quoi correspond le type OptionList
J'ai essayé avec des variants, des tableaux etc... mais j'ai souvent l'erreur de ce genre :

Types incompatibles durant une affectation.

Une idée ?

--
Nicolas
Membre enregistré
962 messages
Popularité : +183 (185 votes)
Posté le 16 août 2021 - 11:53
hello,
le souci c'est que ton assemblage n'a pas l'air public et donc on ne peux pas le consulter. Dans la documentation tu devrais trouver la réponse. OptionList est peut être une classe dans ce cas tu peux essayer :
MyOptionList est une OptionList dynamique = .....

--
Ami calmant, J.P
Posté le 25 août 2021 - 15:23
Bonjour
J'ai intégré mon assemblage .Net dans windev et j'ai le code suivant:

ITerminalType est un entier
gnClNPiInstance est entier système

gpclClOption est une OptionList dynamique
gpclClOption = PepperDotNet.pepInitialize(gsPPepcoreLibraryPath,gsPConfigurationStructure,gsPLicenseStructure,gsPRfu1,gsPRfu2)

gnClNPiInstance = SysInstance("pepcore.dll")

ITerminalType = 108

gpclTestInstance est un objet Instance dynamique
gpclTestInstance <- PepperDotNet.pepCreateInstance(ITerminalType,gnClNPiInstance)


clConfig est OptionList
clConfig <- PepperDotNet.pepOptionListAddStringElement(gnClNPiInstance,"iLanguageValue","FR")
clConfig <- PepperDotNet.pepOptionListAddIntElement(gnClNPiInstance,"iTicketWidthValue",40)
clConfig <- PepperDotNet.pepOptionListAddStringElement(gnClNPiInstance,"sHostName","192.168.1.57")
clConfig <- PepperDotNet.pepOptionListAddStringElement(gnClNPiInstance,"sPosIdentificationString","1234")



PepperDotNet.pepConfigure(gnClNPiInstance,gpclTestInstance,clConfig)


//

1. J'initialise, tout OK
2. Création de l'instance mais là je ne sais pas de quoi il s'agit.

La doc me dit ceci :

PEPHandle
PEPHandle is the datatype that represents resources in the pepper library.
You may know the concept of a handle from file handling.
This is the (slightly simplified) specification of Posix file handling functions:

FILE* fopen( ... pathname, ... mode);
size fread( ... databuffer, ... size_to_read, FILE* handle);

As you see, when opening a file with the fopen() function you receive something thats a "FILE*".
This is exactly the handle you need to provide to fread() when reading data from the file.
Pepper uses the same concept with the data type PEPHandle for handles.
In most cases such a handle represents an option list that contains input or output data.


Comment traduire en Windev le Code C ci-desous.
Si quelqu'un peut m'aider, c'est volontiers que je le rétribue ;)



Voici un code en C qui m'a été fourni. Le problème est que je ne connais pas trop ...


using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using pepperdotnet;

public class TestInstance : Instance
{
//dh ctor, dtor
public TestInstance( int p_iImplementation, int p_iInstanceId ) : base( p_iImplementation, p_iInstanceId )
{
}

//dh ----------------------------------------------------------
//dh ---- BEGINN -- CONFIGURATION BLOCK FOR THE TESTCLIENT ----
//dh ----------------------------------------------------------

//dh some attributes
/*
* IMPORTANT:
* The following configuration section defines only the library specific parameters
* to make a first test possible. Please see the official PEPPER Pos Library documentation for other
* mandatory and optional settings
*/

/*
* The path where the PEPPER Pos Library "pepcore" can be found. It is recommended to use absolute paths.
* Examples:
* - (Windows) : Something like "E:\MyEcr\Pepper\pepcore.dll"
*/
private static string DOTNET_TESTCLIENT_PEPPER_LIBRARY_PATH = "E:\\projekte\\chili\\build\\DEFAULT\\SHARED\\DEBUG\\lib\\DEBUG\\pepcore.dll";

//dh -------------------------------------------------------
//dh ---- END -- CONFIGURATION BLOCK FOR THE TESTCLIENT ----
//dh -------------------------------------------------------

//dh methods
public override void callback( int p_iCallbackEvent, int p_iCallbackOption, OptionList p_cOutputOptions, OptionList p_cInputOptions )
{
try
{
//dh dump the options
dumpOptions( "CALLBACK:" + p_iCallbackEvent + "|" + p_iCallbackOption + "|Output Options|", p_cOutputOptions );
}
catch ( PepperException )
{
//dh silently ignore this
}

//dh test, check for a selection list input
if ( ( Instance.PEP_CALLBACKEVENT_INPUT == p_iCallbackEvent ) && ( Instance.PEP_CALLBACKOPTION_SELECTIONLIST == p_iCallbackOption ) )
{
//dh example on how to fill up the response
p_cInputOptions.Add( "iCallbackEventValue", new Option(Instance.PEP_CALLBACKEVENT_INPUT));
p_cInputOptions.Add( "iCallbackOptionValue", new Option(Instance.PEP_CALLBACKOPTION_SELECTIONLIST));
p_cInputOptions.Add( "iSelectionListValue", new Option(0));
}
}

private static void _doRecovery( TestInstance p_cInstance )
{
{
//dh prepare recovery
Future cFuture = p_cInstance.pepPrepareOperation( (int) PEP_OPERATION_RECOVERY, new OptionList() );

//dh dump the output options
dumpOptions( "Prepare Recovery Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
{
//dh start recovery
Future cFuture = p_cInstance.pepStartOperation((int) PEP_OPERATION_RECOVERY, new OptionList());

//dh dump the output options
dumpOptions("Start Recovery Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh execute recovery
Future cFuture = p_cInstance.pepExecuteOperation((int) PEP_OPERATION_RECOVERY, new OptionList());

//dh dump the output options
dumpOptions("Execute Recovery Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh finalize recovery
Future cFuture = p_cInstance.pepFinalizeOperation( (int) PEP_OPERATION_RECOVERY, new OptionList());

//dh dump the output options
dumpOptions( "Finalize Recovery Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
}

private static void _doOpen( TestInstance p_cInstance )
{
{
//dh create an option list with options
OptionList cOpenInputOptions = new OptionList();

//dh add some options
cOpenInputOptions.Add( "sOperatorIdentificationString", new Option( "1234" ) );

//dh prepare open
Future cFuture = p_cInstance.pepPrepareOperation( (int) PEP_OPERATION_OPEN, cOpenInputOptions);

//dh alternative approach: asynchronously check if ready
// boolean bReady = cFuture.isReady();

//dh alternative approach: explicitely wait until done
// cFuture.waitCompletion();

//dh dump the output options (Notice: cFuture.get() will block until the operation is done and the result can be obtained)
dumpOptions( "Prepare Open Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
{
//dh start open
Future cFuture = p_cInstance.pepStartOperation((int) PEP_OPERATION_OPEN, new OptionList());

//dh dump the output options
dumpOptions("Start Open Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh execute open
Future cFuture = p_cInstance.pepExecuteOperation((int) PEP_OPERATION_OPEN, new OptionList());

//dh dump the output options
dumpOptions("Execute Open Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh finalize open
Future cFuture = p_cInstance.pepFinalizeOperation( (int) PEP_OPERATION_OPEN, new OptionList());

//dh dump the output options
dumpOptions( "Finalize Open Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
}

private static void _doTransaction( TestInstance p_cInstance )
{
{
//dh create an option list with options
OptionList cTransactionInputOptions = new OptionList();

//dh add some options
cTransactionInputOptions.Add( "iTransactionTypeValue", new Option( PEP_TRANSACTIONTYPE_GOODSPAYMENT ) );

//dh prepare transaction
Future cFuture = p_cInstance.pepPrepareOperation( (int) PEP_OPERATION_TRANSACTION, cTransactionInputOptions );

//dh dump the output options
dumpOptions( "Prepare Transaction Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
{
//dh start transaction
Future cFuture = p_cInstance.pepStartOperation((int) PEP_OPERATION_TRANSACTION, new OptionList());

//dh dump the output options
dumpOptions("Start Transaction Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh create an option list with options
OptionList cTransactionInputOptions = new OptionList();

//dh add some options
cTransactionInputOptions.Add( "iAmount", new Option( 420100 ) );
cTransactionInputOptions.Add( "iCurrencyValue", new Option( PEP_CURRENCY_SWISSFRANC ) );

//dh execute transaction
Future cFuture = p_cInstance.pepExecuteOperation( (int) PEP_OPERATION_TRANSACTION, cTransactionInputOptions );

//dh dump the output options
dumpOptions( "Execute Transaction Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
{
//dh finalize transaction
Future cFuture = p_cInstance.pepFinalizeOperation( (int) PEP_OPERATION_TRANSACTION, new OptionList() );

//dh dump the output options
dumpOptions( "Finalize Transaction Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
}

private static void _doClose( TestInstance p_cInstance )
{
{
//dh prepare close
Future cFuture = p_cInstance.pepPrepareOperation( (int) PEP_OPERATION_CLOSE, new OptionList() );

//dh dump the output options
dumpOptions( "Prepare Close Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
{
//dh start close
Future cFuture = p_cInstance.pepStartOperation((int) PEP_OPERATION_CLOSE, new OptionList());

//dh dump the output options
dumpOptions("Start Close Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh execute close
Future cFuture = p_cInstance.pepExecuteOperation((int) PEP_OPERATION_CLOSE, new OptionList());

//dh dump the output options
dumpOptions("Execute Close Output Options", cFuture.get());

//mp write current state
writeState( p_cInstance );
}
{
//dh finalize close
Future cFuture = p_cInstance.pepFinalizeOperation( (int) PEP_OPERATION_CLOSE, new OptionList() );

//dh dump the output options
dumpOptions( "Finalize Close Output Options", cFuture.get() );

//mp write current state
writeState( p_cInstance );
}
}

private static void _doSettlement(TestInstance p_cInstance)
{
{
//dh prepare end of day
Future cFuture = p_cInstance.pepPrepareOperation((int)PEP_OPERATION_SETTLEMENT, new OptionList());

//dh dump the output options
dumpOptions("Prepare Settlement Output Options", cFuture.get());

//mp write current state
writeState(p_cInstance);
}
{
//dh start end of day
Future cFuture = p_cInstance.pepStartOperation((int)PEP_OPERATION_SETTLEMENT, new OptionList());

//dh dump the output options
dumpOptions("Start Settlement Output Options", cFuture.get());

//mp write current state
writeState(p_cInstance);
}
{
//dh execute end of day
Future cFuture = p_cInstance.pepExecuteOperation((int)PEP_OPERATION_SETTLEMENT, new OptionList());

//dh dump the output options
dumpOptions("Execute Settlement Output Options", cFuture.get());

//mp write current state
writeState(p_cInstance);
}
{
//dh finalize end of day
Future cFuture = p_cInstance.pepFinalizeOperation((int)PEP_OPERATION_SETTLEMENT, new OptionList());

//dh dump the output options
dumpOptions("Finalize Settlement Output Options", cFuture.get());

//mp write current state
writeState(p_cInstance);
}
}

private static void _doAuxiliary(TestInstance p_cInstance)
{
{
//dh create an option list with options
OptionList cAuxiliaryInputOptions = new OptionList();

//dh add some options
cAuxiliaryInputOptions.Add("iAuxiliaryCodeValue", new Option( 1 /* PrintData */ ));

//dh prepare Auxiliary
Future cFuture = p_cInstance.pepAuxiliary(cAuxiliaryInputOptions);

//dh dump the output options
dumpOptions("Prepare Auxiliary Output Options", cFuture.get());

//mp write current state
writeState(p_cInstance);
}
}


public static void dumpOptions( string p_strTitle, OptionList p_cOptions )
{
//dh write start line
Console.WriteLine( "-----------------------------------------------------------------------------------------------" );

//dh write the title
Console.WriteLine( p_strTitle );

//dh call helper
_dumpOptionsHelper( p_cOptions, "" );

//dh write end line
Console.WriteLine("-----------------------------------------------------------------------------------------------");
}

private static void _dumpOptionsHelper( OptionList p_cOptions, string p_strIndent )
{
//dh iterate over the list
foreach( KeyValuePair< string, Option > cEntry in p_cOptions )
{
//dh get option
Option cOption = cEntry.Value;

//dh determine by type
switch ( cOption.getiType() )
{
case Option.STRING:
{
//dh output
Console.WriteLine( p_strIndent + cEntry.Key + " : " + cOption.getString() );

//dh done
break;
}
case Option.INT:
{
//dh output
Console.WriteLine( p_strIndent + cEntry.Key + " : " + cOption.getInt() );

//dh done
break;
}
case Option.LIST:
{
//dh output
Console.WriteLine( p_strIndent + cEntry.Key + " : - list -" );

//dh call recursively
_dumpOptionsHelper( cOption.getList(), p_strIndent + " " );

//dh done
break;
}
}
}
}

private static void writeState( TestInstance p_cInstance )
{
//mp create option list
OptionList cInputOption = new OptionList();
//mp add utilily code
cInputOption.Add( "iUtilityCodeValue", new Option( PEP_UTILITYCODE_GETSTATE ) );
//mp execute
OptionList cOutputOption = p_cInstance.pepUtility( cInputOption );
//mp dump the output options
dumpOptions( "Current state", cOutputOption );
}



static void Main(string[] args)
{
try
{
//dh initialize the library
OptionList cInitializationResult = PepperDotNet.pepInitialize( DOTNET_TESTCLIENT_PEPPER_LIBRARY_PATH, "", "", "", "" );

//dh dump this list
dumpOptions( "Initialize Output Options", cInitializationResult );

//dh get version information
VersionInformation cVersion = PepperDotNet.pepVersion();

//dh write this out
Console.Write( "Pepcore Version: " );
Console.Write( cVersion.getMajor() );
Console.Write( ", " );
Console.Write( cVersion.getMinor() );
Console.Write( ", " );
Console.Write( cVersion.getService() );
Console.Write( ", " );
Console.Write( cVersion.getRevision() );
Console.Write( ", " );
Console.Write( cVersion.getOsArchitecture() );
Console.Write( ", " );
Console.Write( cVersion.getReleaseType() );
Console.Write( ", " );
Console.WriteLine( cVersion.getConfigurationType() );

//dh create and configure the instance
TestInstance cInstance = new TestInstance( 999, 1 );

//dh create an option list with configure options
OptionList cConfigureInputOptions = new OptionList();

//dh callback event bit masks
long lCallbackEventBitMask = PEP_CALLBACKEVENT_INPUT | PEP_CALLBACKEVENT_OUTPUT;

//dh callback option bit masks
int lCallbackOptionBitMask =
(int) Instance.PEP_CALLBACKOPTION_INTERMEDIATESTATUS |
(int) Instance.PEP_CALLBACKOPTION_OPERATIONFINISHED |
(int) Instance.PEP_CALLBACKOPTION_INTERMEDIATETICKET |
(int) Instance.PEP_CALLBACKOPTION_SELECTIONLIST |
(int) Instance.PEP_CALLBACKOPTION_NUMERICALINPUT |
(int) Instance.PEP_CALLBACKOPTION_ALPHANUMERICALINPUT;

//dh add some options
cConfigureInputOptions.Add( "iLanguageValue", new Option( PEP_LANGUAGE_ENGLISH ) );
cConfigureInputOptions.Add( "iTicketWidthValue", new Option( 40 ) );
cConfigureInputOptions.Add( "sHostName", new Option( "127.0.0.1:1" ) );
cConfigureInputOptions.Add( "sPosIdentificationString", new Option( "1234" ) );
cConfigureInputOptions.Add( "iCallbackEventValue", new Option( lCallbackEventBitMask ) );
cConfigureInputOptions.Add( "iCallbackOptionValue", new Option( lCallbackOptionBitMask ) );

//dk configure instance
OptionList cConfigureOutputOptions = cInstance.pepConfigure( cConfigureInputOptions );

//dh dump the configure options
dumpOptions( "Configure Output Options", cConfigureOutputOptions );

//dh we can rely on the fact that there will always be an iRecoveryFlag option
if ( 0 != cConfigureOutputOptions[ "iRecoveryFlag" ].getInt() )
{
//dh recovery situation!
_doRecovery( cInstance );
}

//dh do the open
_doOpen( cInstance );

//dh do a transaction
_doTransaction( cInstance );

//dh do the close
_doSettlement( cInstance );

//dh do the close
_doClose(cInstance);

//dh do an auxiliary call
_doAuxiliary(cInstance);

//dh clean up
cInstance.pepFreeInstance();

//dh ensure all your instances are deleted before executing this call
//dh finalize and clean up the library
PepperDotNet.pepFinalize();
}
catch (PepperException e)
{
Console.WriteLine( e.ToString() + " " + e.getFunctionResult() );
}
catch (Exception e)
{
Console.WriteLine( e.ToString() );
}
}
}
Posté le 26 août 2021 - 11:23
Hello
Personne pour m'aider contre rémunération dans cette intégration ?

Je ne suis pas très au point avec la programmation C et les différents concepts...
Membre enregistré
144 messages
Posté le 31 août 2021 - 11:04
Bonjour
Je suis toujours coincé pour "traduire" ce code C en windev...

--
Nicolas