List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
ExternalCCProcessor Class Reference

A simple interface for entering credit card transaction information manually. More...

#include <externalccprocessor.h>

Inheritance diagram for ExternalCCProcessor:
CreditCardProcessor QObject

Public Types

enum  CCTransaction {
  Authorize, Reverse, Capture, Charge,
  Credit, Void
}
 
enum  FraudCheck {
  Match, NoMatch, NotAvail, Address,
  PostalCode, Name, NotProcessed, Invalid,
  ServiceUnavailable, IssuerNotCertified, Suspicious, Unsupported
}
 

Public Member Functions

 ExternalCCProcessor ()
 
virtual int authorize (const int pccardid, const QString &pcvv, const double pamount, double ptax, bool ptaxexempt, double pfreight, double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid)
 Processes pre-authorization transactions. More...
 
virtual Q_INVOKABLE int canProcessCCTrans (int pCardId, int pCurrId)
 Checks if all accounting related setup and mapping is valid for a Credit Card and Currency. More...
 
virtual int charge (const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid)
 Processes charge transactions. More...
 
virtual int chargePreauthorized (const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid)
 Processes 'capture' transactions, or charges against a prior preauthorization. More...
 
virtual int credit (const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid)
 Processes credit transactions. More...
 
virtual Q_INVOKABLE int defaultPort (bool=false)
 Return the default port expected by the subclass. More...
 
virtual Q_INVOKABLE QString defaultServer ()
 Return the default server expected by the subclass. More...
 
virtual Q_INVOKABLE bool handlesChecks ()
 Returns whether the subclass handles checks. More...
 
virtual Q_INVOKABLE bool isLive ()
 Returns whether credit card processing is configured in live mode. More...
 
virtual Q_INVOKABLE bool isTest ()
 Returns whether credit card processing is configured in test mode. More...
 
virtual Q_INVOKABLE void reset ()
 Reset error handling internal settings so previous transactions don't interfere with new transactions. More...
 
virtual int reversePreauthorized (const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int prefid)
 Reverse a preauthorization. More...
 
virtual Q_INVOKABLE int testConfiguration ()
 Simplify CreditCardProcessor's implementation - we really don't care about much with the external credit card processor. More...
 
virtual int voidPrevious (int &)
 Processes void transactions. More...
 

Static Public Member Functions

static Q_INVOKABLE ParameterList authorize (const ParameterList &)
 Processes pre-authorization transactions. More...
 
static Q_INVOKABLE bool certificateIsValid (const QSslCertificate *cert)
 
static Q_INVOKABLE ParameterList charge (const ParameterList &)
 Processes charge transactions. More...
 
static Q_INVOKABLE ParameterList chargePreauthorized (const ParameterList &)
 Captures preauthorized transactions. More...
 
static Q_INVOKABLE ParameterList credit (const ParameterList &)
 Processes credit transactions. More...
 
static Q_INVOKABLE QString errorMsg ()
 Returns the most recent error message set by CreditCardProcessor or one of its subclasses. More...
 
static Q_INVOKABLE QString errorMsg (const int)
 Returns the error message associated with the given pcode. More...
 
static Q_INVOKABLE CreditCardProcessorgetProcessor (const QString=QString())
 Get a new instance of a specific CreditCardProcessor subclass. More...
 
static Q_INVOKABLE int printReceipt (const int)
 Print the CCReceipt report for a credit card transaction. More...
 
static Q_INVOKABLE QString typeToCode (CCTransaction ptranstype)
 
static Q_INVOKABLE ParameterList voidPrevious (const ParameterList &)
 Processes void transactions. More...
 

Protected Slots

void sslErrors (const QList< QSslError > &errors)
 

Protected Member Functions

virtual FraudCheckResultavsCodeLookup (QChar pcode)
 
virtual QString buildURL (const QString, const QString, const bool)
 Construct a valid URL from the information in the configuration. More...
 
virtual int checkCreditCard (const int pccid, const QString &pcvv, QString &pccard_x)
 Check if the given credit card is consistent and active. More...
 
virtual int checkCreditCardProcessor ()
 
virtual FraudCheckResultcvvCodeLookup (QChar pcode)
 
virtual int doAuthorize (const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int doCharge (const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int doChargePreauthorized (const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int doCredit (const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int doReversePreauthorized (const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int doTestConfiguration ()
 Placeholder for subclasses to override. More...
 
virtual int doVoidPrevious (const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pnweorder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams)
 Placeholder for subclasses to override. More...
 
virtual int fraudChecks ()
 Handle fraud checking as determined by the system configuration. More...
 
virtual bool handlesCreditCards ()
 Returns whether the subclass handles credit cards. More...
 
virtual int handleTrans (const int pccardid, const QString &ptype, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams)
 
virtual int sendViaHTTP (const QString &, QString &)
 Send an HTTP request to the configured credit card service and wait for its response. More...
 
virtual int updateCCPay (int &, ParameterList &)
 Insert into or update the ccpay table based on parameters extracted from the credit card processing service' response to a transaction request. More...
 
virtual bool waitForHTTP ()
 Wait for the HTTP request sent by _manager to finish. Added for Qt5. More...
 

Static Protected Member Functions

static double currToCurr (const int, const int, const double, int *=0)
 Convert between two currencies. More...
 

Protected Attributes

QList< FraudCheckResult * > _avsCodes
 
QString _company
 
QList< FraudCheckResult * > _cvvCodes
 
int _defaultLivePort
 
QString _defaultLiveServer
 
int _defaultTestPort
 
QString _defaultTestServer
 
QList< QPair< QString, QString > > _extraHeaders
 
QHttp * _http
 
bool _ignoreSslErrors
 
bool _passedAvs
 
bool _passedCvv
 
QString _pemfile
 
QString _plogin
 
QString _ppassword
 
QString _pport
 
QString _pserver
 

Static Protected Attributes

static QString _errorMsg
 
static QHash< int, QString > _msgHash
 

Detailed Description

A simple interface for entering credit card transaction information manually.

Member Enumeration Documentation

◆ CCTransaction

Enumerator
Authorize 
Reverse 
Capture 
Charge 
Credit 
Void 

◆ FraudCheck

Enumerator
Match 
NoMatch 
NotAvail 
Address 
PostalCode 
Name 
NotProcessed 
Invalid 
ServiceUnavailable 
IssuerNotCertified 
Suspicious 
Unsupported 

Constructor & Destructor Documentation

◆ ExternalCCProcessor()

ExternalCCProcessor::ExternalCCProcessor ( )

Member Function Documentation

◆ authorize() [1/2]

int CreditCardProcessor::authorize ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
double  ptax,
bool  ptaxexempt,
double  pfreight,
double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
QString  preftype,
int &  prefid 
)
virtualinherited

Processes pre-authorization transactions.

This method performs application-level error checking and all of the database work required to handle a pre-authorization transaction. It calls doAuthorize to handle the direct communication with the service.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doAuthorize method of the service' subclass.
Parameters
[in]pccardidThe internal id of the credit card to preauthorize
[in]pcvvThe CVV/CCV code of the credit card to preauthorize
[in]pamountThe total amount to preauthorize. If the credit card processor does not preauthorize the full amount requested, the database will store the actual amount that was authorized If this occurs, the application will display an error if the amount authorized is 0 or a warning if the amount authorized is greater than 0.
[in]ptaxThe subportion of the total which is tax
[in]ptaxexemptWhether or not this transaction is tax exempt
[in]pfreightThe subportion of the total which is freight
[in]pdutyThe subportion of the total which is customs duty
[in]pcurridThe currency of the amount to preauthorize
[in,out]pneworderThe order number associated with this preauthorization
[out]preforderThe reference number associated with this preauthorization (may be required to 'capture' the preauthorization)
[out]pccpayidThe ccpay_id of the record created by this transaction
[in]preftypeEither cohead or cashrcpt or blank
[in,out]prefidThe cashrcpt_id or cohead_id associated with this transaction
Returns
An index into _errMsg; 0 indicates success

◆ authorize() [2/2]

ParameterList CreditCardProcessor::authorize ( const ParameterList &  pinput)
staticinherited

Processes pre-authorization transactions.

This version of authorize is intended for use by scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to authorize(const int pccardid, const int pcvv, const double pamount, double ptax, bool ptaxexempt, double pfreight, double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid):

var params = new Object;
params.ccard_id = _ccardid;
params.cvv = _cvv.text;
...
var processor = toolbox.getProcessor();
var result = processor.authorize(params);
if (result.returnVal < 0)
// handle errors
else if (result.returnVal > 0)
// handle warnings
...
Parameters
pinputThe parameter list to unpack and use to call authorize
Returns
A parameter list containing the output parameters, plus one called returnVal holding the return value of authorize

◆ avsCodeLookup()

CreditCardProcessor::FraudCheckResult * CreditCardProcessor::avsCodeLookup ( QChar  pcode)
protectedvirtualinherited

◆ buildURL()

QString CreditCardProcessor::buildURL ( const QString  pserver,
const QString  pport,
const bool  pinclport 
)
protectedvirtualinherited

Construct a valid URL from the information in the configuration.

Handle the case where someone leaves off a piece of the URL when entering the basic configuration. Note that a lot of people are used to typing in web browsers, which fill in some parts for them.

If the user did not enter values for the server or the port on the configuration, use the defaults provided by the service' subclass.

Parameters
pserverUse this server, or the defaultServer if blank
pportUse this port, or the defaultPort if blank
pinclportFlag whether the port should be part of the constructed URL or not
See also
defaultServer
defaultPort

◆ canProcessCCTrans()

int CreditCardProcessor::canProcessCCTrans ( int  pCardId,
int  pCurrId 
)
virtualinherited

Checks if all accounting related setup and mapping is valid for a Credit Card and Currency.

Calls the database stored procedure, canProcessPaymentGatewayTransaction() to check if setup is valid.

◆ certificateIsValid()

bool CreditCardProcessor::certificateIsValid ( const QSslCertificate *  cert)
staticinherited

◆ charge() [1/2]

int CreditCardProcessor::charge ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const double  ptax,
const bool  ptaxexempt,
const double  pfreight,
const double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
QString  preftype,
int &  prefid 
)
virtualinherited

Processes charge transactions.

This method performs application-level error checking and all of the database work required to handle a credit card charge transaction. It calls doCharge to handle the direct communication with the service.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doCharge method of the service' subclass.
Parameters
[in]pccardidThe internal id of the credit card to charge
[in]pcvvThe CVV/CCV code of the credit card to charge
[in]pamountThe total amount to charge
[in]ptaxThe subportion of the total which is tax
[in]ptaxexemptWhether or not this transaction is tax exempt
[in]pfreightThe subportion of the total which is freight
[in]pdutyThe subportion of the total which is customs duty
[in]pcurridThe currency of the amount to charge
[in,out]pneworderThe order number associated with this charge
[out]preforderThe reference number associated with this charge
[out]pccpayidThe ccpay_id of the record created by this transaction
[in]preftypeEither cohead or cashrcpt or blank
[in,out]prefidThe cashrcpt_id or cohead_id associated with this transaction
Returns
An index into _errMsg; 0 indicates success

◆ charge() [2/2]

ParameterList CreditCardProcessor::charge ( const ParameterList &  pinput)
staticinherited

Processes charge transactions.

This version of charge is intended for use by scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to charge.

Parameters
pinputThe parameter list to unpack and use to call charge
Returns
A parameter list containing the output parameters, plus one called returnVal holding the return value of charge
See also
authorize(const ParameterList &pinput)

◆ chargePreauthorized() [1/2]

ParameterList CreditCardProcessor::chargePreauthorized ( const ParameterList &  pinput)
staticinherited

Captures preauthorized transactions.

This version of chargePreauthorized is intended for use by scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to chargePreauthorized.

Parameters
pinputThe parameter list to unpack and use to call chargePreauthorized
Returns
A parameter list containing the output parameters, plus one called returnVal holding the return value of chargePreauthorized
See also
authorize(const ParameterList &pinput)

◆ chargePreauthorized() [2/2]

int CreditCardProcessor::chargePreauthorized ( const QString &  pcvv,
const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid 
)
virtualinherited

Processes 'capture' transactions, or charges against a prior preauthorization.

This method performs application-level error checking and all of the database work required to 'capture' or complete the charge against a prior preauthorization. It calls doChargePreauthorized to handle the direct communication with the service.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doChargePreauthorized method of the service' subclass.
Parameters
[in]pcvvThe CVV/CCV code of the credit card to charge
[in]pamountThe total amount to charge
[in]pcurridThe currency of the amount to charge
[in,out]pneworderThe order number associated with this charge
[in,out]preforderThe reference number (preforder) generated by the preauthorization transaction
[in,out]pccpayidWhen calling the method, pccpayid should be the ccpay_id of the preauthorization record. On return, this is the ccpay_id of the charge record, which may be the same as the preauthorization record.
Returns
An index into _errMsg; 0 indicates success

◆ checkCreditCard()

int CreditCardProcessor::checkCreditCard ( const int  pccid,
const QString &  pcvv,
QString &  pccard_x 
)
protectedvirtualinherited

Check if the given credit card is consistent and active.

This consistency check is used in a number of places before executing a credit card transaction. It confirms that the given card is marked as active in the system and has not expired. If the card has expired based on the expiration month and year, then it is marked as expired in the database. It also makes sure that the CVV has been entered if the system is configured to require it.

Parameters
pccidThe ccard_id of the credit card to check
pcvvThe CVV from the card holder, -1 if not known, -2 if the caller knows it is not required or available (such as for void transactions).
[out]pccard_xThe credit card number, with most of the digits replaced with X. Used for reporting errors.

◆ checkCreditCardProcessor()

virtual int CreditCardProcessor::checkCreditCardProcessor ( )
inlineprotectedvirtualinherited

◆ credit() [1/2]

int CreditCardProcessor::credit ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const double  ptax,
const bool  ptaxexempt,
const double  pfreight,
const double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
QString  preftype,
int &  prefid 
)
virtualinherited

Processes credit transactions.

This method performs application-level error checking and all of the database work required to credit a prior charge. It calls doCredit to handle the direct communication with the service.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doCredit method of the service' subclass.
Parameters
[in]pccardidThe internal id of the credit card to credit
[in]pcvvThe CVV/CCV code of the credit card to credit
[in]pamountThe total amount to credit
[in]ptaxThe subportion of the total which is tax
[in]ptaxexemptWhether or not this transaction is tax exempt
[in]pfreightThe subportion of the total which is freight
[in]pdutyThe subportion of the total which is customs duty
[in]pcurridThe currency of the amount to credit
[in,out]pneworderThe order number associated with this credit
[in,out]preforderThe reference number (preforder) generated by the charge transaction
[in,out]pccpayidWhen calling the method, pccpayid should be the ccpay_id of the original charge record. On return, this is the ccpay_id of the credit record.
[in]preftypeEither cohead or cashrcpt or blank
[in,out]prefidThe cashrcpt_id or cohead_id associated with this transaction
Returns
An index into _errMsg; 0 indicates success

◆ credit() [2/2]

ParameterList CreditCardProcessor::credit ( const ParameterList &  pinput)
staticinherited

Processes credit transactions.

This version of credit is intended for use by scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to credit.

Parameters
pinputThe parameter list to unpack and use to call credit
Returns
A parameter list containing the output parameters, plus one called returnVal holding the return value of credit
See also
authorize(const ParameterList &pinput)

◆ currToCurr()

double CreditCardProcessor::currToCurr ( const int  pfrom,
const int  pto,
const double  pamount,
int *  perror = 0 
)
staticprotectedinherited

Convert between two currencies.

This is slightly different than the version in the CurrDisplay widget because credit card processing has special error reporting needs.

Parameters
pfromThe source currency
ptoThe destination currency
pamountThe value of the transaction in the source currency
[out]perrorThe CreditCardProcessor error code for a failed conversion
Returns
The value of the transaction in the destination currency

◆ cvvCodeLookup()

CreditCardProcessor::FraudCheckResult * CreditCardProcessor::cvvCodeLookup ( QChar  pcode)
protectedvirtualinherited

◆ defaultPort()

int CreditCardProcessor::defaultPort ( bool  ptestmode = false)
virtualinherited

Return the default port expected by the subclass.

This can differ depending on whether running in live or test mode. It is the subclass' responsibility to set both default ports.

◆ defaultServer()

QString CreditCardProcessor::defaultServer ( )
virtualinherited

Return the default server expected by the subclass.

This can differ depending on whether running in live or test mode. It is the subclass' responsibility to set both default servers.

◆ doAuthorize()

int ExternalCCProcessor::doAuthorize ( const int  pccardid,
const QString &  pcvv,
double &  pamount,
const double  ptax,
const bool  ptaxexempt,
const double  pfreight,
const double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
ParameterList &  pParams 
)
protectedvirtual

Placeholder for subclasses to override.

See also
authorize

Reimplemented from CreditCardProcessor.

◆ doCharge()

int ExternalCCProcessor::doCharge ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const double  ptax,
const bool  ptaxexempt,
const double  pfreight,
const double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
ParameterList &  pParams 
)
protectedvirtual

Placeholder for subclasses to override.

See also
charge

Reimplemented from CreditCardProcessor.

◆ doChargePreauthorized()

int ExternalCCProcessor::doChargePreauthorized ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
ParameterList &  pParams 
)
protectedvirtual

Placeholder for subclasses to override.

See also
chargePreauthorized

Reimplemented from CreditCardProcessor.

◆ doCredit()

int ExternalCCProcessor::doCredit ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const double  ptax,
const bool  ptaxexempt,
const double  pfreight,
const double  pduty,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
ParameterList &  pParams 
)
protectedvirtual

Placeholder for subclasses to override.

See also
credit

Reimplemented from CreditCardProcessor.

◆ doReversePreauthorized()

int CreditCardProcessor::doReversePreauthorized ( const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int  pccpayid,
ParameterList &  pparams 
)
protectedvirtualinherited

Placeholder for subclasses to override.

See also
reversePreauthorized

◆ doTestConfiguration()

int CreditCardProcessor::doTestConfiguration ( )
protectedvirtualinherited

Placeholder for subclasses to override.

See also
testConfiguration

Reimplemented in CyberSourceProcessor, AuthorizeDotNetProcessor, PaymentechProcessor, and VerisignProcessor.

◆ doVoidPrevious()

int ExternalCCProcessor::doVoidPrevious ( const int  pccardid,
const QString &  pcvv,
const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
QString &  papproval,
int &  pccpayid,
ParameterList &  pParams 
)
protectedvirtual

Placeholder for subclasses to override.

See also
voidPrevious

Reimplemented from CreditCardProcessor.

◆ errorMsg() [1/2]

QString CreditCardProcessor::errorMsg ( )
staticinherited

Returns the most recent error message set by CreditCardProcessor or one of its subclasses.

◆ errorMsg() [2/2]

QString CreditCardProcessor::errorMsg ( const int  pcode)
staticinherited

Returns the error message associated with the given pcode.

◆ fraudChecks()

int CreditCardProcessor::fraudChecks ( )
protectedvirtualinherited

Handle fraud checking as determined by the system configuration.

◆ getProcessor()

CreditCardProcessor * CreditCardProcessor::getProcessor ( const QString  pcompany = QString())
staticinherited

Get a new instance of a specific CreditCardProcessor subclass.

This method is used to retrieve a CreditCardProcessor for actual use by the application, rather than calling CreditCardProcessor::CreditCardProcessor.

getProcessor retrieves the right subclass for the current configuration.

Parameters
pcompanyThis causes the method to instantiate the subclass for the named service, rather than the configured service. pcompany should be an empty string except when checking for errors in configCC
Returns
An instance of a CreditCardProcessor subclass
See also
configCC

◆ handlesChecks()

bool CreditCardProcessor::handlesChecks ( )
virtualinherited

Returns whether the subclass handles checks.

◆ handlesCreditCards()

bool ExternalCCProcessor::handlesCreditCards ( )
protectedvirtual

Returns whether the subclass handles credit cards.

Reimplemented from CreditCardProcessor.

◆ handleTrans()

int ExternalCCProcessor::handleTrans ( const int  pccardid,
const QString &  ptype,
const QString &  pcvv,
const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
ParameterList &  pparams 
)
protectedvirtual

◆ isLive()

bool CreditCardProcessor::isLive ( )
virtualinherited

Returns whether credit card processing is configured in live mode.

◆ isTest()

bool CreditCardProcessor::isTest ( )
virtualinherited

Returns whether credit card processing is configured in test mode.

◆ printReceipt()

int CreditCardProcessor::printReceipt ( const int  pccpayid)
staticinherited

Print the CCReceipt report for a credit card transaction.

Parameters
pccpayidThe internal id of the transaction for which to print the receipt

◆ reset()

void CreditCardProcessor::reset ( )
virtualinherited

Reset error handling internal settings so previous transactions don't interfere with new transactions.

◆ reversePreauthorized()

int CreditCardProcessor::reversePreauthorized ( const double  pamount,
const int  pcurrid,
QString &  pneworder,
QString &  preforder,
int &  pccpayid,
QString  preftype,
int  prefid 
)
virtualinherited

Reverse a preauthorization.

This method performs application-level error checking and all of the database work required to reverse a prior preauthorization. This makes available to the card holder the funds that have been reserved by that preauthorization.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doReversePreauthorized method of the service' subclass.
Parameters
pamountThe amount to be reversed, not necessarily the same as the amount originally authorized.
pcurridThe currency of the amount.
pneworderThe order number associated with the preauthorization
preforderThe reference number (preforder) generated by the preauthorization transaction
pccpayidThe internal id of the preauthorization transaction
preftypeEither cohead or cashrcpt or blank
prefidThe cashrcpt_id or cohead_id associated with the preauthorization transaction
Returns
An index into _errMsg; 0 indicates success

◆ sendViaHTTP()

int CreditCardProcessor::sendViaHTTP ( const QString &  prequest,
QString &  presponse 
)
protectedvirtualinherited

Send an HTTP request to the configured credit card service and wait for its response.

This method is intended to be called by subclasses of CreditCardProcessor. It sends a message to the service using HTTP or HTTPS, as set by the configuration, and waits for a response. If necessary it applies a local certificate for bidirectional encryption.

It is the caller's responsibility to format an appropriate message and decode the response.

Parameters
[in]prequestThe string to send via HTTP
[out]presponseThe string returned by the service

◆ sslErrors

void CreditCardProcessor::sslErrors ( const QList< QSslError > &  errors)
protectedslotinherited

◆ testConfiguration()

int ExternalCCProcessor::testConfiguration ( )
virtual

Simplify CreditCardProcessor's implementation - we really don't care about much with the external credit card processor.

Reimplemented from CreditCardProcessor.

◆ typeToCode()

QString CreditCardProcessor::typeToCode ( CCTransaction  ptranstype)
staticinherited

◆ updateCCPay()

int CreditCardProcessor::updateCCPay ( int &  pccpayid,
ParameterList &  pparams 
)
protectedvirtualinherited

Insert into or update the ccpay table based on parameters extracted from the credit card processing service' response to a transaction request.

Todo:
document the parameter names and expected values to help subclassers

◆ voidPrevious() [1/2]

ParameterList CreditCardProcessor::voidPrevious ( const ParameterList &  pinput)
staticinherited

Processes void transactions.

This version of voidPrevious is intended for use by scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to voidPrevious.

Parameters
pinputThe parameter list to unpack and use to call voidPrevious
Returns
A parameter list containing the output parameters, plus one called returnVal holding the return value of voidPrevious
See also
authorize(const ParameterList &pinput)

◆ voidPrevious() [2/2]

int CreditCardProcessor::voidPrevious ( int &  pccpayid)
virtualinherited

Processes void transactions.

This method performs application-level error checking and all of the database work required to void a prior transaction. It calls doVoid to handle the direct communication with the service.

Warning
This method should never be overridden. Service-specific functionality should be implemented in the doVoid method of the service' subclass.
Parameters
pccpayidThis should be the ccpay_id of the original transaction record.
Returns
An index into _errMsg; 0 indicates success

◆ waitForHTTP()

bool CreditCardProcessor::waitForHTTP ( )
protectedvirtualinherited

Wait for the HTTP request sent by _manager to finish. Added for Qt5.

Todo:
Add a timeout parameter and return false if it is exceeded.

Member Data Documentation

◆ _avsCodes

QList<FraudCheckResult*> CreditCardProcessor::_avsCodes
protectedinherited

◆ _company

QString CreditCardProcessor::_company
protectedinherited

◆ _cvvCodes

QList<FraudCheckResult*> CreditCardProcessor::_cvvCodes
protectedinherited

◆ _defaultLivePort

int CreditCardProcessor::_defaultLivePort
protectedinherited

◆ _defaultLiveServer

QString CreditCardProcessor::_defaultLiveServer
protectedinherited

◆ _defaultTestPort

int CreditCardProcessor::_defaultTestPort
protectedinherited

◆ _defaultTestServer

QString CreditCardProcessor::_defaultTestServer
protectedinherited

◆ _errorMsg

QString CreditCardProcessor::_errorMsg
staticprotectedinherited

◆ _extraHeaders

QList<QPair<QString, QString> > CreditCardProcessor::_extraHeaders
protectedinherited

◆ _http

QHttp* CreditCardProcessor::_http
protectedinherited

◆ _ignoreSslErrors

bool CreditCardProcessor::_ignoreSslErrors
protectedinherited

◆ _msgHash

QHash< int, QString > CreditCardProcessor::_msgHash
staticprotectedinherited

◆ _passedAvs

bool CreditCardProcessor::_passedAvs
protectedinherited

◆ _passedCvv

bool CreditCardProcessor::_passedCvv
protectedinherited

◆ _pemfile

QString CreditCardProcessor::_pemfile
protectedinherited

◆ _plogin

QString CreditCardProcessor::_plogin
protectedinherited

◆ _ppassword

QString CreditCardProcessor::_ppassword
protectedinherited

◆ _pport

QString CreditCardProcessor::_pport
protectedinherited

◆ _pserver

QString CreditCardProcessor::_pserver
protectedinherited

The documentation for this class was generated from the following files:

Generated on Fri Apr 9 2021 xTuple ERP Programmer Reference, Version 5.1.0 doxygen 1.8.17