Class paymentgateway

Description

Payment gateway class to perform the majority merchant gateway communications

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.paymentgateway.inc.php (line 23)


	
			
Variable Summary
mixed $authnet
mixed $bluepay
mixed $card
mixed $cert_file
mixed $curl_path
mixed $currency
mixed $currentTag
mixed $customer
mixed $debug
mixed $error
mixed $eway
mixed $file_log
mixed $gateway
mixed $log
mixed $order
mixed $parser
mixed $plug_n_pay
mixed $psigate
mixed $received
mixed $ship_to
mixed $transnum
mixed $user
mixed $xmlData
Method Summary
paymentgateway paymentgateway ([ $gateway = ''])
void character_data ( $parser,  $cdata)
void element_end ( $parser,  $tag)
void element_start ( $parser,  $tag,  $attributes)
void fetch_gateway_response ([ $data = array()], [ $url = ''], [ $url2 = ''], [ $method = 'POST'], [ $force = ''])
void format_year ([ $yy = ''], [ $yyform = ''])
void get_answer ()
void get_error ()
void get_gateway ()
void get_log ()
void get_log_all ()
void get_order_id ()
void process ()
void save_log ( $file)
void set_ccard ([ $cc_name = ''], [ $cc_type = ''], [ $cc_number = ''], [ $cc_expmm = ''], [ $cc_expyy = ''], [ $cc_cvv = ''], [ $cc_auth = ''])
void set_crt ( $path)
void set_curl ( $path)
void set_currency ([ $currency = ''], [ $symbol = ''])
void set_customer ([ $c_company = ''], [ $c_phone = ''], [ $c_fname = ''], [ $c_lname = ''], [ $c_address = ''], [ $c_city = ''], [ $c_state = ''], [ $c_zip = ''], [ $c_country = ''])
void set_error ( $e_num,  $e_text, [ $e_type = false], [ $gateway_err = ''], [ $gateway_num = ''])
void set_extra ([ $extra = array()])
void set_gateway ()
void set_log ( $text)
void set_order ([ $o_amount = ''], [ $o_orderID = ''], [ $o_description = ''], [ $o_authtype = ''], [ $o_mode = ''], [ $o_authcode = ''], [ $o_transnum = ''], [ $v_currency = ''], [ $v_currency_symbol = ''])
void set_ship_to ([ $fname = ''], [ $lname = ''], [ $address = ''], [ $city = ''], [ $state = ''], [ $zip = ''], [ $country = ''], [ $phone = ''], [ $fax = ''])
void set_user ([ $u_user = ''], [ $u_password = ''], [ $u_key = ''], [ $u_email = ''])
Variables
mixed $authnet = array(
'name' => 'authnet',
'page' => 'https://secure.authorize.net/gateway/transact.dll',
'testpage' => 'https://secure.authorize.net/gateway/transact.dll',
'method' => 'POST',
'force_method' => 'fsockopen',
'u_user' => 'x_login',
'u_password' => 'x_password',
'u_key' => 'x_tran_key',
'u_userid' => 'x_cust_id',
'o_amount' => 'x_amount',
'o_orderID' => 'x_invoice_num',
'o_description' => 'x_description',
'o_authtype' => 'x_type',
'o_mode' => 'x_trans_id',
'o_authcode' => '',
'o_transnum' => '',
'v_currency' => '',
'v_currency_symbol' => '',
'c_company' => 'x_company',
'c_fname' => 'x_first_name',
'c_lname' => 'x_last_name',
'c_address' => 'x_address',
'c_city' => 'x_city',
'c_state' => 'x_state',
'c_zip' => 'x_zip',
'c_country' => 'x_country',
'c_phone' => 'x_phone',
'c_fax' => 'x_fax',
'c_ip' => 'x_customer_ip',
'c_email' => '',
's_fname' => 'x_ship_to_first_name',
's_lname' => 'x_ship_to_last_name',
's_address' => 'x_ship_to_address',
's_city' => 'x_ship_to_city',
's_state' => 'x_ship_to_state',
's_zip' => 'x_ship_to_zip',
's_country' => 'x_ship_to_country',
's_phone' => '',
's_fax' => '',
'cc_name' => '',
'cc_type' => '',
'cc_number' => 'x_card_num',
'cc_expmm' => '',
'cc_expyy' => '',
'cc_exp' => 'x_exp_date',
'cc_cvv' => 'x_card_code',
'cc_auth' => '',
'cc_expyyform' => 'yyyy',
'cc_expform' => 'my',
'extra' => array(
'x_version' => '3.1',
'x_delim_data' => 'TRUE',
'x_echo_data' => '',
'x_delim_char' => ',',
'x_encap_char' => '',
'x_method' => 'CC', // CC or ECHECK
'x_customer_ip' => '',
'x_test_request' => 'FALSE',
'x_ADC_URL' => '',
'x_relay_response' => 'FALSE'
))
(line 120)

hold detailed gateway information for authorize.net

possible force_method: fsockopen, curl_ext, curl, curl_xml

mixed $authorization = '' (line 97)
mixed $bluepay = array(
'name' => 'bluepay',
'page' => 'https://secure.bluepay.com/interfaces/a.net',
'testpage' => 'https://secure.bluepay.com/interfaces/a.net',
'method' => 'POST',
'force_method' => 'fsockopen',
'u_user' => 'x_login',
'u_password' => 'x_password',
'u_key' => 'x_tran_key',
'u_userid' => 'x_cust_id',
'o_amount' => 'x_amount',
'o_orderID' => 'x_invoice_num',
'o_description' => 'x_description',
'o_authtype' => 'x_type',
'o_mode' => 'x_trans_id',
'o_authcode' => '',
'o_transnum' => '',
'v_currency' => '',
'v_currency_symbol' => '',
'c_company' => 'x_company',
'c_fname' => 'x_first_name',
'c_lname' => 'x_last_name',
'c_address' => 'x_address',
'c_city' => 'x_city',
'c_state' => 'x_state',
'c_zip' => 'x_zip',
'c_country' => 'x_country',
'c_phone' => 'x_phone',
'c_fax' => 'x_fax',
'c_ip' => 'x_customer_ip',
'c_email' => '',
's_fname' => 'x_ship_to_first_name',
's_lname' => 'x_ship_to_last_name',
's_address' => 'x_ship_to_address',
's_city' => 'x_ship_to_city',
's_state' => 'x_ship_to_state',
's_zip' => 'x_ship_to_zip',
's_country' => 'x_ship_to_country',
's_phone' => '',
's_fax' => '',
'cc_name' => '',
'cc_type' => '',
'cc_number' => 'x_card_num',
'cc_expmm' => '',
'cc_expyy' => '',
'cc_exp' => 'x_exp_date',
'cc_cvv' => 'x_card_code',
'cc_auth' => '',
'cc_expyyform' => 'yyyy',
'cc_expform' => 'my',
'extra' => array(
'x_version' => '3.1',
'x_delim_data' => 'TRUE',
'x_echo_data' => '',
'x_delim_char' => ',',
'x_encap_char' => '',
'x_method' => 'CC', // CC or ECHECK
'x_customer_ip' => '',
'x_test_request' => 'FALSE',
'x_ADC_URL' => '',
'x_relay_response' => 'FALSE',
))
(line 188)

hold detailed gateway information for bluepay

possible force_method: fsockopen, curl_ext, curl, curl_xml

mixed $card = array() (line 55)

hold the credit card details

mixed $cert_file = CURLCERT (line 107)
mixed $convert_to_cents = array('eway') (line 39)

hold the gateways that require amounts to be converted into cents: 13.20 = 1320

mixed $curl_path = CURLPATH (line 106)

hold the curl module details

if you have the crt file, it can specified here also

mixed $currency = array() (line 80)

hold the currency details of the marketplace

mixed $currentTag (line 112)

hold the parser and xml data

mixed $customer = array() (line 65)

hold the customer (payer) details

mixed $debug = false (line 45)

hold value if debug is enabled or disabled

this will also set the test urls for gateways to enabled

mixed $error = array() (line 85)

hold any error output

mixed $eway = array(
'name' => 'eway',
'page' => 'https://www.eway.com.au/gateway/xmlpayment.asp',
'testpage' => 'https://www.eway.com.au/gateway/xmltest/TestPage.asp',
'method' => 'POST',
'force_method' => 'curl_xml',
'u_user' => 'ewayCustomerID',
'u_password' => '',
'u_key' => '',
'u_email' => 'ewayCustomerEmail',
'o_amount' => 'ewayTotalAmount',
'o_orderID' => 'ewayTrxnNumber',
'o_description' => 'ewayCustomerInvoiceDescription',
'o_mode' => '',
'o_authtype' => '',
'o_authcode' => '',
'o_transnum' => 'ewayCustomerInvoiceRef',
'v_currency' => '',
'v_currency_symbol' => '',
'c_fname' => 'ewayCustomerFirstName',
'c_lname' => 'ewayCustomerLastName',
'c_address' => 'ewayCustomerAddress',
'c_city' => '',
'c_state' => '',
'c_zip' => 'ewayCustomerPostcode',
'c_country' => '',
'c_phone' => '',
'c_fax' => '',
'c_ip' => '',
'c_email' => 'ewayCustomerEmail',
's_fname' => '',
's_lname' => '',
's_address' => '',
's_city' => '',
's_state' => '',
's_zip' => '',
's_country' => '',
's_phone' => '',
's_fax' => '',
'cc_name' => 'ewayCardHoldersName',
'cc_type' => '',
'cc_number' => 'ewayCardNumber',
'cc_expmm' => 'ewayCardExpiryMonth',
'cc_expyy' => 'ewayCardExpiryYear',
'cc_exp' => '',
'cc_cvv' => 'ewayCVN',
'cc_auth' => 'ewayAuthCode',
'cc_expyyform' => '',
'cc_expform' => '',
'extra' => array())
(line 317)

will hold detailed gateway information for psigate dev test: requires: 4646464646464646 as card and 87654321 as ewayCustomerID additional dev notes: all amounts are to be passed in cents (ie 1050 = $10.50) with no decimal points, dollar signs, etc.

possible force_method: fsockopen, curl_ext, curl, curl_xml

mixed $file_log = PAYMENTGATEWAYLOG (line 91)
mixed $gateway (line 50)

hold the preferred gateway module to use

mixed $gateway_accepted = array(
'authnet',
'plug_n_pay',
'psigate',
'eway',
'bluepay'
)
(line 28)

hold the gateways currently supported

mixed $log = array() (line 90)

hold the log details

mixed $order = array() (line 75)

hold the order details

mixed $parser (line 113)
mixed $plug_n_pay = array(
'name' => 'plug_n_pay',
'page' => 'https://pay1.plugnpay.com/payment/pnpremote.cgi',
'testpage' => 'https://pay1.plugnpay.com/payment/pnpremote.cgi',
'method' => 'POST',
'force_method' => 'fsockopen',
'u_user' => 'publisher-name',
'u_password' => 'publisher-password',
'u_key' => '',
'u_email' => 'publisher-email',
'o_amount' => 'card-amount',
'o_orderID' => 'orderID',
'o_description' => '',
'o_mode' => 'mode',
'o_authtype' => 'authtype',
'o_authcode' => '',
'o_transnum' => '',
'v_currency' => 'currency',
'v_currency_symbol' => 'currency_symbol',
'c_fname' => 'card_name',
'c_lname' => '',
'c_address' => 'card-address1',
'c_city' => 'card-city',
'c_state' => 'card-state',
'c_zip' => 'card-zip',
'c_country' => 'card-country',
'c_phone' => '',
'c_fax' => '',
'c_ip' => 'ipaddress',
'c_email' => 'email',
's_fname' => 'shipname',
's_lname' => '',
's_address' => 'address1',
's_city' => 'city',
's_state' => 'state',
's_zip' => 'zip',
's_country' => 'country',
's_phone' => '',
's_fax' => '',
'cc_name' => 'card-name',
'cc_type' => 'card-type',
'cc_number' => 'card-number',
'cc_expmm' => '',
'cc_expyy' => '',
'cc_exp' => 'card-exp',
'cc_cvv' => 'card-cvv',
'cc_auth' => '',
'cc_expyyform' => 'yy',
'cc_expform' => 'm/y',
'extra' => array(
'shipinfo' => '1',
'easycart' => '1',
'dontsndmail' => 'no',
))
(line 373)

will hold detailed gateway information for plug n pay

possible force_method: fsockopen, curl_ext, curl, curl_xml

mixed $psigate = array(
'name' => 'psigate',
'page' => 'https://secure.psigate.com:7934/Messenger/XMLMessenger',
'testpage' => 'https://dev.psigate.com:7989/Messenger/XMLMessenger',
'method' => 'POST',
'force_method' => 'curl_xml',
'u_user' => 'StoreID',
'u_password' => 'Passphrase',
'u_key' => '',
'u_email' => '',
'o_amount' => 'Subtotal',
'o_orderID' => 'OrderID',
'o_description' => 'ItemDescription',
'o_mode' => '',
'o_authtype' => 'CardAction',
'o_authcode' => '',
'o_transnum' => '',
'v_currency' => '',
'v_currency_symbol' => '',
'c_fname' => 'Bname',
'c_lname' => '',
'c_address' => 'Baddress1',
'c_city' => 'Bcity',
'c_state' => 'Bprovince',
'c_zip' => 'Bpostalcode',
'c_country' => 'Bcountry',
'c_phone' => 'Phone',
'c_fax' => 'Fax',
'c_ip' => 'CustomerIP',
'c_email' => 'Email',
's_fname' => 'Sname',
's_lname' => '',
's_address' => 'Saddress1',
's_city' => 'Scity',
's_state' => 'Sprovince',
's_zip' => 'Spostalcode',
's_country' => 'Scountry',
's_phone' => 'Phone',
's_fax' => 'Fax',
'cc_name' => 'Bname',
'cc_type' => '',
'cc_number' => 'CardNumber',
'cc_expmm' => 'CardExpMonth',
'cc_expyy' => 'CardExpYear',
'cc_exp' => '',
'cc_cvv' => 'CardIDNumber',
'cc_auth' => '',
'cc_expyyform' => '',
'cc_expform' => '',
'extra' => array(
'PaymentType' => 'CC'
))
(line 256)

will hold detailed gateway information for psigate

possible force_method: fsockopen, curl_ext, curl, curl_xml

mixed $received = array() (line 96)

hold the information received from the gateway

mixed $ship_to = array() (line 70)

hold the ship to details

mixed $transact_code = '' (line 99)
mixed $transact_code2 = '' (line 100)
mixed $transnum = '' (line 98)
mixed $user = array() (line 60)

hold the ilance owner details

mixed $xmlData (line 114)
Methods
Constructor paymentgateway (line 436)
paymentgateway paymentgateway ([ $gateway = ''])
  • $gateway
character_data (line 1394)
void character_data ( $parser,  $cdata)
  • $parser
  • $cdata
element_end (line 1381)
void element_end ( $parser,  $tag)
  • $parser
  • $tag
element_start (line 1368)
void element_start ( $parser,  $tag,  $attributes)
  • $parser
  • $tag
  • $attributes
fetch_gateway_response (line 1410)
void fetch_gateway_response ([ $data = array()], [ $url = ''], [ $url2 = ''], [ $method = 'POST'], [ $force = ''])
  • $data
  • $url
  • $url2
  • $method
  • $force
format_year (line 647)
void format_year ([ $yy = ''], [ $yyform = ''])
  • $yy
  • $yyform
get_answer (line 1275)
void get_answer ()
get_authorization (line 1263)
void get_authorization ()
get_error (line 1285)
void get_error ()
get_gateway (line 658)
void get_gateway ()
get_log (line 1175)
void get_log ()
get_log_all (line 1186)
void get_log_all ()
get_order_id (line 1225)
void get_order_id ()
get_response_message (line 1249)
void get_response_message ()
get_transactionnum (line 1213)
void get_transactionnum ()
get_transact_code (line 1237)
void get_transact_code ()
process (line 912)
void process ()
save_log (line 1297)
void save_log ( $file)
  • $file
set_ccard (line 498)
void set_ccard ([ $cc_name = ''], [ $cc_type = ''], [ $cc_number = ''], [ $cc_expmm = ''], [ $cc_expyy = ''], [ $cc_cvv = ''], [ $cc_auth = ''])
  • $cc_name
  • $cc_type
  • $cc_number
  • $cc_expmm
  • $cc_expyy
  • $cc_cvv
  • $cc_auth
set_crt (line 1354)
void set_crt ( $path)
  • $path
set_curl (line 1342)
void set_curl ( $path)
  • $path
set_currency (line 479)
void set_currency ([ $currency = ''], [ $symbol = ''])
  • $currency
  • $symbol
set_customer (line 529)
void set_customer ([ $c_company = ''], [ $c_phone = ''], [ $c_fname = ''], [ $c_lname = ''], [ $c_address = ''], [ $c_city = ''], [ $c_state = ''], [ $c_zip = ''], [ $c_country = ''])
  • $c_company
  • $c_phone
  • $c_fname
  • $c_lname
  • $c_address
  • $c_city
  • $c_state
  • $c_zip
  • $c_country
set_error (line 1129)
void set_error ( $e_num,  $e_text, [ $e_type = false], [ $gateway_err = ''], [ $gateway_num = ''])
  • $e_num
  • $e_text
  • $e_type
  • $gateway_err
  • $gateway_num
set_extra (line 627)
void set_extra ([ $extra = array()])
  • $extra
set_gateway (line 672)
void set_gateway ()
set_log (line 1145)
void set_log ( $text)
  • $text
set_order (line 585)
void set_order ([ $o_amount = ''], [ $o_orderID = ''], [ $o_description = ''], [ $o_authtype = ''], [ $o_mode = ''], [ $o_authcode = ''], [ $o_transnum = ''], [ $v_currency = ''], [ $v_currency_symbol = ''])
  • $o_amount
  • $o_orderID
  • $o_description
  • $o_authtype
  • $o_mode
  • $o_authcode
  • $o_transnum
  • $v_currency
  • $v_currency_symbol
set_ship_to (line 557)
void set_ship_to ([ $fname = ''], [ $lname = ''], [ $address = ''], [ $city = ''], [ $state = ''], [ $zip = ''], [ $country = ''], [ $phone = ''], [ $fax = ''])
  • $fname
  • $lname
  • $address
  • $city
  • $state
  • $zip
  • $country
  • $phone
  • $fax
set_user (line 462)
void set_user ([ $u_user = ''], [ $u_password = ''], [ $u_key = ''], [ $u_email = ''])
  • $u_user
  • $u_password
  • $u_key
  • $u_email

Documentation generated on Mon, 08 Aug 2011 17:40:55 +0200 by phpDocumentor 1.4.1