Kbase P133780: 4GL/ABL: How to use the pnpcom.dll COM object in a 4GL/ABL application?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/29/2008 |
|
Status: Unverified
GOAL:
4GL/ABL: How to use the pnpcom.dll COM object in a 4GL/ABL application?
GOAL:
What is the pnpcom.dll COM object?
GOAL:
How to create and instance of the pnpcom object?
GOAL:
How to invoke the doTransaction() method of the pnpcom object?
FACT(s) (Environment):
Windows
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
The pnpcom COM object sends data to a credit card processing payment center and gets the response of the center over an encrypted link. It is used to obtain credit card authorization may by passing a defined set of (name value pairs) to the doTransaction() method that will return a URL encoded text string of (name value pairs). The following procedure shows how to create an instance of this COM object and how to invoke its doTransaction() method:
/* Define variables */
DEFINE VARIABLE hPNPObj AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cString AS CHARACTER NO-UNDO.
DEFINE VARIABLE cResults AS CHARACTER NO-UNDO.
/* Create an instance of the COM object */
CREATE "Pnpcom.main" hPNPObj.
/* Assign the variable to pass as input to the doTransaction() method */
ASSIGN
cString =
"mode=debug&publisher-name=pnpdemo&publisher-email=test@plugnpay.com&card" +
"-namepnptest&card-number=4111111111111111&card-amount=1.00&card-exp=01/01".
/* Invoke the doTransaction() method and get its string value */
ASSIGN
cResults = hPNPObj:doTransaction("",cString,"","").
/* Display the returned string */
MESSAGE cResults
VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* Clean up */
IF VALID-HANDLE(hPNPObj) THEN
RELEASE OBJECT hPNPObj.