General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only