Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C+ to VFP 5.0
Message
From
06/05/2002 16:34:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
C+ to VFP 5.0
Miscellaneous
Thread ID:
00653255
Message ID:
00653255
Views:
50
I have a example source code for a call to a .dll to process credit cards. But I cannot figure out how to do the same thing in VFP.
#include
#include "cnclient.h"

void main()
{
cnclient_init();
int sessionId = cnclient_start_session("90655454", "1");
cnclient_set_retries(3);
cnclient_set_timeout(2000);

char resultBuf[200];
int result = cnclient_auth(sessionId,
SALE_REQUEST,
"5544044490909090",
"0505",
NULL,
100,
1,
resultBuf,
200);
printf("Authorization Result: %s\n", resultBuf);

cnclient_set_field(sessionId, "customerNum", "123");
result = cnclient_auth(sessionId,
SALE_REQUEST,
"5544044490909090",
"0505",
NULL,
200,
1,
resultBuf,
200);
cnclient_clear_fields(sessionId);
printf("Authorization Result: %s\n", resultBuf);

cnclient_set_batchnum(sessionId, 99);
cnclient_add_batch_rec(sessionId,
1, // trans id
"5544044490909090", // card num
"0505", // exp date
100, // amount (in pennies)
"123456"); // approval code
cnclient_add_batch_rec(sessionId,
2, // trans id
"5544044490909090", // card num
"0505", // exp date
1000, // amount (in pennies)
"123456"); // approval code

cnclient_send_batch(sessionId);
printf("Settlement complete\n");

cnclient_end_session(sessionId);
cnclient_cleanup();
}

Help Please
Next
Reply
Map
View

Click here to load this message in the networking platform