Difference between revisions of "Payment Processing API Documentation"

From Cloud9 Payment Processing Gateway Documentation
Jump to: navigation, search
(Flow)
(Flow)
Line 15: Line 15:
 
##Open the Connection, specified by Connection Handle<br><code>int nErr = PgcConnect(nConn);</code>
 
##Open the Connection, specified by Connection Handle<br><code>int nErr = PgcConnect(nConn);</code>
 
#Create New Session<br><code>int nSess = PgcNewSess(nConn, 1);</code>
 
#Create New Session<br><code>int nSess = PgcNewSess(nConn, 1);</code>
#Set Session Parameters<br><code>PgcSetStr(nSess, 0, PGC_GWKEY_GMID, "1001396250"); // Gateway merchant ID<br>PgcSetStr(nSess, 0, PGC_GWKEY_GTID, "GT1001396253"); // Gateway terminal ID<br>PgcSetStr(nSess, 0, PGC_GWKEY_GMPW, "123"); // Gateway merchant password</code>
+
#Set Session Parameters
##Set MID/TID/PWD<br><code></code>
+
##Set MID/TID/PWD<br><code>PgcSetStr(nSess, 0, PGC_GWKEY_GMID, "1001396250"); // Gateway merchant ID<br>PgcSetStr(nSess, 0, PGC_GWKEY_GTID, "GT1001396253"); // Gateway terminal ID<br>PgcSetStr(nSess, 0, PGC_GWKEY_GMPW, "123"); // Gateway merchant password</code>
##Set Transaction Type<br><code></code>
+
##Set Transaction Type<br><code>PgcSetStr(nSess, 0, PGC_GWKEY_TXNACT, PGC_GWVAL_TXNACT_AUTH); // Transaction action type -> authorization</code>
##Set Transaction Medium (e.g. Credit Card)<br><code></code>
+
##Set Transaction Medium (e.g. Credit Card)<br><code>PgcSetStr(nSess, 0, PGC_GWKEY_MDM, PGC_GWVAL_MDM_CREDIT); // Payment medium -> credit card</code>
##Set Transaction Parameters (e.g. Amount, Tax, Trace#)<br><code></code>
+
##Set Transaction Parameters (e.g. Amount, Tax, Trace#)<br><code>PgcSetAmt(nSess, 0, PGC_GWKEY_MAINAMT, 123); // Main amount -> $1.23<br>PgcSetAmt(nSess, 0, PGC_GWKEY_INCTAXAMT, 8); // Included tax amount -> $0.08<br>PgcSetStr(nSess, 0, PGC_GWKEY_SRCTRACENUM, "123456"); // Source trace number; will be returned for matching</code>
#Send the Request for this Session<br><code></code>
+
#Send the Request for this Session<br><code>int nErr = PgcRequest(nSess);</code>
#Get Response for the Session<br><code></code>
+
#Get Response and Approval Code for the Session<br><code>PgcGetStr(nSess, 0, PGC_GWKEY_STATUS, sStatus, 256); // Transaction status, indicating if it is successful<br>...<br>PgcGetStr(nSess, 0, PGC_GWKEY_RSPCODE, sRspCode, 256); // Response code returned from the host<br>...<br>PgcGetStr(nSess, 0, PGC_GWKEY_RSPTEXT, sRspText, 256); // Response text returned from the host<br>...<br>PgcGetStr(nSess, 0, PGC_GWKEY_AUTHCODE, sAuthCode, 256); // Auth code</code>
#Close the Session<br><code></code>
+
#Close the Session<br><code>PgcFreeSess(nSess);</code>
 +
#Disconnect from Server<br<code>PgcDisconnect(nConn); // Disconnecting from the controller; will be called automatically upon closing<br>PgcFreeConn(nConn); // Closing connection to the controller; called once per connection</code>
 +
#Un-Initialize<br><code>PgcUninit("PgcSample"); // Uninitializing library; called once per application upon exit</code>
  
 
&rarr; '''Online Documentation:''' [http://cloud9paymentgateway.com/docs/API/ Payment Gateway Client Library ver 17.08.14 documentation]
 
&rarr; '''Online Documentation:''' [http://cloud9paymentgateway.com/docs/API/ Payment Gateway Client Library ver 17.08.14 documentation]

Revision as of 06:42, 20 August 2017




Cloud9 Payment Gateway Documentation. This site can also be reached at http://docs.cloud9paymentgateway.com

Step One

Please, review the Developer Guide to determine the best integration approach, before diving into the API Documentation below.

API Documentation

Overview

The following document will give a good idea of how to use our Payment Gateway Client API (PGCApi), which have wrappers for other languages (VB, JS, etc) This is a simpler value pair operation library

Flow

  1. Initialize the library
    PgcInit("PgcSample");
  2. Connect to the Payment Web Controller (PWC - direct Cloud9 Server connection) or local Payment Device Controller (PDC) Server
    1. Create Connection Handle
      int nConn = PgcNewConn(PGC_SVC_C9PG_PDC, "Name", "Token", PGC_TIMEO_TXN_UI, "PgcSample", ""); //USE PGC_SVC_C9PG_PWE_TEST for PWE
    2. Open the Connection, specified by Connection Handle
      int nErr = PgcConnect(nConn);
  3. Create New Session
    int nSess = PgcNewSess(nConn, 1);
  4. Set Session Parameters
    1. Set MID/TID/PWD
      PgcSetStr(nSess, 0, PGC_GWKEY_GMID, "1001396250"); // Gateway merchant ID
      PgcSetStr(nSess, 0, PGC_GWKEY_GTID, "GT1001396253"); // Gateway terminal ID
      PgcSetStr(nSess, 0, PGC_GWKEY_GMPW, "123"); // Gateway merchant password
    2. Set Transaction Type
      PgcSetStr(nSess, 0, PGC_GWKEY_TXNACT, PGC_GWVAL_TXNACT_AUTH); // Transaction action type -> authorization
    3. Set Transaction Medium (e.g. Credit Card)
      PgcSetStr(nSess, 0, PGC_GWKEY_MDM, PGC_GWVAL_MDM_CREDIT); // Payment medium -> credit card
    4. Set Transaction Parameters (e.g. Amount, Tax, Trace#)
      PgcSetAmt(nSess, 0, PGC_GWKEY_MAINAMT, 123); // Main amount -> $1.23
      PgcSetAmt(nSess, 0, PGC_GWKEY_INCTAXAMT, 8); // Included tax amount -> $0.08
      PgcSetStr(nSess, 0, PGC_GWKEY_SRCTRACENUM, "123456"); // Source trace number; will be returned for matching
  5. Send the Request for this Session
    int nErr = PgcRequest(nSess);
  6. Get Response and Approval Code for the Session
    PgcGetStr(nSess, 0, PGC_GWKEY_STATUS, sStatus, 256); // Transaction status, indicating if it is successful
    ...
    PgcGetStr(nSess, 0, PGC_GWKEY_RSPCODE, sRspCode, 256); // Response code returned from the host
    ...
    PgcGetStr(nSess, 0, PGC_GWKEY_RSPTEXT, sRspText, 256); // Response text returned from the host
    ...
    PgcGetStr(nSess, 0, PGC_GWKEY_AUTHCODE, sAuthCode, 256); // Auth code
  7. Close the Session
    PgcFreeSess(nSess);
  8. Disconnect from Server<brPgcDisconnect(nConn); // Disconnecting from the controller; will be called automatically upon closing
    PgcFreeConn(nConn); // Closing connection to the controller; called once per connection
  9. Un-Initialize
    PgcUninit("PgcSample"); // Uninitializing library; called once per application upon exit

Online Documentation: Payment Gateway Client Library ver 17.08.14 documentation

Samples

Web Browser Samples

Web Browser Integration Samples

RESTFul JSON/SOAP

JSON API Documentation

MS Windows Samples

Windows Integration Samples

iOS Integration Samples

iOS Integration Samples

Android Integration Samples

Android Integration Samples





From the makers of Cloud9 Payment Processing Gateway and Creditline Credit Card Processing Software