00001 #include <iostream>
00002
00003
00004 using namespace std;
00005
00006 #include "ocPayflowPro.h"
00007
00008 int main( int argc, char ** argv )
00009 {
00010 int ret=0;
00011 string test = "Test of ocAppend: ";
00012 ocAppend( test, 433 );
00013 ocAppend( test, " Float: " );
00014 ocAppend( test, 6.344 );
00015 cout << test << endl;
00016 ocPayflowPro merchant( "/home/davidmc/development/openMerchant/verisign/payflowpro/linux/certs",
00017
00018 "test-payflow.verisign.com", 443, 10 );
00019 if ( merchant.getRc() )
00020 {
00021 cout << "Error : " << merchant.getError() << endl;
00022 }
00023 else
00024 {
00025 cout << "Well Constructed!" << endl;
00026 cout << "Version: " << merchant.getVersion() << endl;
00027 }
00028 merchant.addParam( "USER", "daltonutilities" );
00029 merchant.addParam( "VENDOR", "daltonutilities" );
00030 merchant.addParam( "PARTNER", "verisign" );
00031 merchant.addParam( "PWD", "dalton777site" );
00032 merchant.addParam( "TRXTYPE", "A" );
00033
00034 merchant.addParam( "TENDER", "C" );
00035 merchant.addParam( "ACCT", "5105105105105100" );
00036 merchant.addParam( "EXPDATE", "1204" );
00037
00038 merchant.addParam( "AMT", "0.01" );
00039
00040 if( merchant.submitTransaction() == false )
00041 {
00042 cout << "Failure!" << endl;
00043 }
00044 else
00045 {
00046 cout << "Success!" << endl;
00047 cout << "Result Code: " << merchant.getResultCode() << endl;
00048 cout << "Transaction Reference Number: " << merchant.getPnRef() << endl;
00049 cout << "Response Message: " << merchant.getResponseMessage() << endl;
00050 cout << "Authorization Code: " << merchant.getAuthorizationCode() << endl;
00051 cout << "Params: " << merchant.getParameters() << endl;
00052 }
00053 cout << merchant.getError() << " : " << merchant.getUnparsedResponse() << endl;
00054 return ret;
00055 }