Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

fbPayment Class Reference

Inheritance diagram for fbPayment:

Inheritance graph
[legend]
List of all members.

Detailed Description

Abstract class for online payment processing.

fbPayment is a virtual class for processing payments through online credit card processors, electronic cash systems, etc.

field keys:

type: Transaction type: FB_PAYMENT_METHOD_TYPE_CREDIT_CARD: Credit Card FB_PAYMENT_METHOD_TYPE_ELECTRONIC_CHECK: Electronic Check FB_PAYMENT_METHOD_TYPE_ACH_TRANSACTION: ACH Transaction (Not all processors support all these transaction types).

card_type: Credit card type: FB_PAYMENT_CREDIT_CARD_VISA: Visa FB_PAYMENT_CREDIT_CARD_MASTERCARD: Mastercard FB_PAYMENT_CREDIT_CARD_AMERICAN_EXPRESS: American Express FB_PAYMENT_CREDIT_CARD_DISCOVER: Discover/Novus FB_PAYMENT_CREDIT_CARD_DINERS_CLUB: Diner's Club FB_PAYMENT_CREDIT_CARD_CARTE_BLANCHE: Carte Blanche FB_PAYMENT_CREDIT_CARD_JAPAN_CARD: Japan Card FB_PAYMENT_CREDIT_CARD_ENROUTE: Enroute (Not all processors support all these card types).

login: Your login name to use for authentication to the online processor.

password: Your password to use for authentication to the online processor.

action: What to do with the transaction: FB_PAYMENT_TRANSACTION_TYPE_SALE: Normal sale/authorization FB_PAYMENT_TRANSACTION_TYPE_AUTHORIZATION: "Pre" authorization FB_PAYMENT_TRANSACTION_TYPE_CREDIT: Credit/Refund FB_PAYMENT_TRANSACTION_TYPE_POST_AUTHORIZATION: "Post" authorization FB_PAYMENT_TRANSACTION_TYPE_VOID: Void FB_PAYMENT_TRANSACTION_TYPE_INQUIRY: Inquiry

card_number: Credit card number (credit card transactions only).

expiration: Credit card expiration (credit card transactions only).

cvv2: The CVV2 code (the 3 or 4 digit number found on the back of the credit card). (credit card transactions only) (Not normally required).

description: A description of the transaction (used by some processors to send information to the client) (Not normally required).

amount: The amount of the transaction, most processors dont want dollar signs and the like, just a floating point number.

first_name: The customer's first name, your processor may not require this.

last_name: The customer's last name, your processor may not require this.

address: The customer's address (your processor may not require this unless you are requiring AVS Verification).

city: The customer's city (your processor may not require this unless you are requiring AVS Verification).

state: The customer's state (your processor may not require this unless you are requiring AVS Verification).

zip: The customer's zip code (your processor may not require this unless you are requiring AVS Verification).

country: Customer's country.

phone: Customer's phone number.

fax: Customer's fax number.

email: Customer's email address.

invoice_number: An invoice number, for your use and not normally required, many processors require this field to be a numeric only field. (Not normally required).

customer_id: A customer identifier. (Not normally required).

check_type: 'E'-Check type (electronic checks or electronic funds transfer only).

account_number: Bank account number (electronic checks or electronic funds transfer only).

routing_code: Bank's ABA routing code (electronic checks or electronic funds transfer only).

bank_name: Bank's name (electronic checks or electronic funds transfer only).

account_name: Bank account name (electronic checks or electronic funds transfer only).

account_type: Bank account type (electronic checks or electronic funds transfer only). C = Checking, S = Savings

micr: Check MICR code (electronic checks or electronic funds transfer only).

check_number: Check Number (electronic checks or electronic funds transfer only).

customer_org: Customer's organization type.

customer_ssn: Customer's Social Security # or Tax ID #.

license_num: Customer's driver's license number.

license_state: Customer's driver's license state.

license_dob: Customer's driver's license date of birth.

auth_code: Authorization code.

merchant_id: Merchant ID (Not normally required) (BofA).

ioc_indicator: IOC indicator (Not normally required) (BofA).

card_owner: The credit card's "owner". (Not normally required) (Beanstream).

issue: The issue (Not normally required) (Cardstream).

partner: The partner (Not normally required) (PayflowPro).

quantity: The quantity of the item of the order (Not normally required) (SurePay).

sku_number: The SKU of the item (Not normally required) (SurePay).

tax_rate: The tax rate of the item (Not normally required) (SurePay).

American Express

INVNUM Merchant invoice number. (Also referred to as Supplier Reference Num- ber). This generated reference number appears on merchant's bank reconcili- ation statement. Acquirer decides if this information will appear on the state- ment. PNREF numeric digits are the default. Required: No Numeric 9

SHIPTOZIP Ship to Zip code. Required: No (but provides best rate when used) Alphanumeric 6 SWIPE Allows Track 1 and Track 2 data to be passed to enable a card-present transaction. Required: No Alphanumeric 80

TAXAMT Tax Amount. Do not include comma separators. Use 1199.95 instead of 1,199.95. Required: No (but provides best rate when used). Currency 10

po_number

description

description1

description2

description3

description4

City Cardholder?s billing city No Alpha 20 Comment1 User-defined field for reporting and auditing purposes (VeriSign field only) No Alphanumeric 128

Comment2 User-defined field for reporting and auditing purposes (Verisign field only) No Alphanumeric 128

CompanyName Cardholder?s company No Alphanumeric 30

Country Cardholder?s billing country code No Alphanumeric 3

CUSTCODE Customer code No Alphanumeric 30

DUTYAMT Duty amount No Alphanumeric 10

Email Cardholder?s e-mail address No Alphanumeric 64

FirstName Cardholder?s first name No Alpha 15

FREIGHTAMT Freight amount No Currency 10

LastName Cardholder?s last name No Alpha 15

Name Cardholder?s name No Alphanumeric 15

PONUM Purchase Order Number No Alphanumeric 15

ShipToCity Shipping city No Alphanumeric 30

ShipToFirstName First name in the shipping address No Alphanumeric 30

ShipToLastName Last name in the shipping address No Alphanumeric 30

ShipToState Shipping state. US = 2-letter state code. Outside US, use full name. No Alphanumeric 10

ShipToStreet Shipping street address No Alphanumeric 30

ShipToZip Shipping Zip code No Alphanumeric 9

State Cardholder?s billing state code No Alphanumeric 2

Street Cardholder?s billing street address (used for AVS and reporting) No Alphanumeric 30

TAXAMT Tax amount No Currency 10

Zip Cardholder?s billing zip code (used for AVS and reporting). Can be 5 to 9 digits; do not include spaces or non-numeric characters. No Numeric 9

Definition at line 336 of file Payment.php.

Public Member Functions

 fbPayment ()
 Constructor.

 getFields ()
 getFields - Retrieve the hash of the submission key/value pairs.

 addFields ($fields)
 addFields - Adds a hash to the hash of the submission key/value pairs.

 setFields ($fields)
 setFields - Sets the hash of the submission key/value pairs.

 getServer ()
 getServer - Retrieve the processor submission server address.

 setServer ($server)
 setServer - Set the processor submission server address (CHANGE AT YOUR OWN RISK).

 getPort ()
 getPort - Get the processor submission port

 setPort ($port)
 setPort - Set the processor submission port (CHANGE AT YOUR OWN RISK).

 getPath ()
 getPath - Get the processor submission path.

 setPath ($path)
 setPath - Set the processor submission path (CHANGE AT YOUR OWN RISK).

 setTestMode ($test_mode=true)
 setTestMode - Most processors provide a test mode, where submitted transactions will not actually be charged or added to your batch, calling this function with a true argument will turn that mode on if the processor supports it, or generate a fatal error if the processor does not support a test mode (which is probably better than accidentally making real charges).

 setTestMethodType ($method_type)
 setTestMethod -

 setTestCardType ($card_type)
 setTestCardType -

 setTestResponseType ($response_type)
 setTestResponseType -

 setTestTransactionType ($transaction_type=FB_PAYMENT_TRANSACTION_TYPE_SALE)
 setTestTransactionType -

 setRequireAVS ($require_avs=true)
 setRequireAVS - Providing a true argument to this module will turn on address verification (if the processor supports it).

 submit ()
 submit - Submit the transaction to the processor for completion.

 isApproved ()
 isApproved - Returns true if the transaction was approved, false if was not (or undefined if it has not been submitted yet).

 isDeclined ()
 isDeclined - Returns true if the transaction was declined, false if was not declined (or undefined if it has not been submitted yet).

 getResultCode ()
 getResultCode - Returns the precise result code that the processor returned, these are normally one letter codes that don't mean much unless you understand the protocol they speak, you probably don't need this, but it's there just in case.

 getResultMessage ()
 getResultMessage - If the transaction has been submitted but was not accepted, this function will return the provided error message (if any) that the processor returned.

 getAuthorization ()
 getAuthorization - If the transaction has been submitted and accepted, this function will provide you with the authorization code that the processor returned.

 getAVSAddress ()
 getAVSAddress -

 getAVSZip ()
 getAVSZip -

 getResponse ()
 getResponse -

 getTransactionID ()
 getTransactionID - Return the transaction ID, if any, returned from the credit card processor.

 printResults ()
 printResults

 getCreditCardType ($credit_card)

Public Attributes

 $sslVersion
 $sslCert
 $sslCertPasswd
 $userAgent
 $header = 1
 $verbose = 0
 $progress = 0
 $mute = 1
 $follow_location = 0
 $timeout
 $return_transfer = 1
 $type
 $cookies
 $post_fields
 $proxy
 $proxy_port
 $proxy_user
 $proxy_password
 $_fields = array()
 $_server = false
 $_port = 443
 $_path = false
 $_test_mode = false
 $_test_method_type = false
 $_test_card_type = false
 $_test_response_type = false
 $_test_transaction_type
 $_require_avs = false
 $_approved
 $_declined
 $_result_code
 $_result_message
 $_authorization
 $_avs_address
 $_avs_zip
 $_response
 $_transaction_id


Constructor & Destructor Documentation

fbPayment::fbPayment  ) 
 

Constructor.

Definition at line 493 of file Payment.php.


Member Function Documentation

fbPayment::addFields fields  ) 
 

addFields - Adds a hash to the hash of the submission key/value pairs.

Parameters:
$fields 
Returns:
void

Definition at line 520 of file Payment.php.

fbPayment::getAuthorization  ) 
 

getAuthorization - If the transaction has been submitted and accepted, this function will provide you with the authorization code that the processor returned.

Definition at line 786 of file Payment.php.

Referenced by printResults().

fbPayment::getAVSAddress  ) 
 

getAVSAddress -

Definition at line 797 of file Payment.php.

Referenced by printResults().

fbPayment::getAVSZip  ) 
 

getAVSZip -

Definition at line 808 of file Payment.php.

Referenced by printResults().

fbPayment::getCreditCardType credit_card  ) 
 

Todo:
support FB_PAYMENT_CREDIT_CARD_TYPE_DINERS_CLUB

support FB_PAYMENT_CREDIT_CARD_TYPE_CARTE_BLANCHE

support FB_PAYMENT_CREDIT_CARD_TYPE_JAPAN_CARD

support FB_PAYMENT_CREDIT_CARD_TYPE_ENROUTE

Definition at line 865 of file Payment.php.

fbPayment::getFields  ) 
 

getFields - Retrieve the hash of the submission key/value pairs.

Returns:
hash Hash of the submission key/value pairs.

Definition at line 510 of file Payment.php.

fbPayment::getPath  ) 
 

getPath - Get the processor submission path.

Returns:
string

Definition at line 586 of file Payment.php.

fbPayment::getPort  ) 
 

getPort - Get the processor submission port

Returns:
int

Definition at line 564 of file Payment.php.

fbPayment::getResponse  ) 
 

getResponse -

Definition at line 819 of file Payment.php.

fbPayment::getResultCode  ) 
 

getResultCode - Returns the precise result code that the processor returned, these are normally one letter codes that don't mean much unless you understand the protocol they speak, you probably don't need this, but it's there just in case.

Definition at line 764 of file Payment.php.

Referenced by printResults().

fbPayment::getResultMessage  ) 
 

getResultMessage - If the transaction has been submitted but was not accepted, this function will return the provided error message (if any) that the processor returned.

Definition at line 775 of file Payment.php.

Referenced by printResults().

fbPayment::getServer  ) 
 

getServer - Retrieve the processor submission server address.

Returns:
string

Definition at line 542 of file Payment.php.

fbPayment::getTransactionID  ) 
 

getTransactionID - Return the transaction ID, if any, returned from the credit card processor.

Definition at line 830 of file Payment.php.

Referenced by printResults().

fbPayment::isApproved  ) 
 

isApproved - Returns true if the transaction was approved, false if was not (or undefined if it has not been submitted yet).

If both isApproved() and isDeclined() return false, then it is some other error.

Definition at line 738 of file Payment.php.

fbPayment::isDeclined  ) 
 

isDeclined - Returns true if the transaction was declined, false if was not declined (or undefined if it has not been submitted yet).

If both isApproved() and isDeclined() return false, then it is some other error.

Definition at line 753 of file Payment.php.

Referenced by printResults().

fbPayment::printResults  ) 
 

printResults

Definition at line 837 of file Payment.php.

References getAuthorization(), getAVSAddress(), getAVSZip(), getResultCode(), getResultMessage(), getTransactionID(), and isDeclined().

fbPayment::setFields fields  ) 
 

setFields - Sets the hash of the submission key/value pairs.

Parameters:
$fields 
Returns:
void

Definition at line 531 of file Payment.php.

fbPayment::setPath path  ) 
 

setPath - Set the processor submission path (CHANGE AT YOUR OWN RISK).

Parameters:
$path 
Returns:
void

Definition at line 596 of file Payment.php.

fbPayment::setPort port  ) 
 

setPort - Set the processor submission port (CHANGE AT YOUR OWN RISK).

Parameters:
$port int
Returns:
void

Definition at line 573 of file Payment.php.

fbPayment::setRequireAVS require_avs = true  ) 
 

setRequireAVS - Providing a true argument to this module will turn on address verification (if the processor supports it).

Returns:
void

Definition at line 717 of file Payment.php.

fbPayment::setServer server  ) 
 

setServer - Set the processor submission server address (CHANGE AT YOUR OWN RISK).

Parameters:
$server 
Returns:
void

Definition at line 553 of file Payment.php.

fbPayment::setTestCardType card_type  ) 
 

setTestCardType -

Parameters:
$card_type 
Returns:
void

Definition at line 654 of file Payment.php.

fbPayment::setTestMethodType method_type  ) 
 

setTestMethod -

Parameters:
$method_type 
Returns:
void

Definition at line 634 of file Payment.php.

fbPayment::setTestMode test_mode = true  ) 
 

setTestMode - Most processors provide a test mode, where submitted transactions will not actually be charged or added to your batch, calling this function with a true argument will turn that mode on if the processor supports it, or generate a fatal error if the processor does not support a test mode (which is probably better than accidentally making real charges).

Parameters:
$test_mode 
Returns:
void

Reimplemented in fbPayment_AuthorizeNet, and fbPayment_PayflowPro.

Definition at line 610 of file Payment.php.

fbPayment::setTestResponseType response_type  ) 
 

setTestResponseType -

Returns:
void

Definition at line 677 of file Payment.php.

fbPayment::setTestTransactionType transaction_type = FB_PAYMENT_TRANSACTION_TYPE_SALE  ) 
 

setTestTransactionType -

Returns:
void

Definition at line 696 of file Payment.php.

fbPayment::submit  ) 
 

submit - Submit the transaction to the processor for completion.

Reimplemented in fbPayment_AuthorizeNet, and fbPayment_PayflowPro.

Definition at line 724 of file Payment.php.


The documentation for this class was generated from the following file:
Generated on Fri Mar 19 12:52:32 2004 for Freebeer by doxygen 1.3.6-20040222