This is an old revision of the document!
Table of Contents
Database
table cscart_payment_processors
processor_id int processor string processor_script string processor_template string admin_template string callback char default 'N' -- not used type char default 'P'
Codes
Areas: 'C' client 'A' admin notifications: 'C' customer 'A' department 'V' vendor
Addon Development Notes
For each parameter in the callback url, verify that it is correct for the stored order.
// paypal.php
$account_type = fn_validate_email($processor_data['processor_params']['account']) ? 'receiver_email' : 'receiver_id';
if ($_REQUEST[$account_type] != $processor_data['processor_params']['account']) {
$pp_response['order_status'] = $paypal_statuses['denied'];
$pp_response['reason_text'] = __('paypal_security_error');
fn_finish_payment($_REQUEST['order_id'], $pp_response);
exit;
}
Payment Processing Integration Notes
payment_processors table is queried from functions (incomplete list):
app/functions/fn.cart.php fn_get_payment_methods
app/functions/fn.cart.php fn_get_checkout_payment_buttons
creates empty array $checkout_buttons
"include"s each payment processor's processor_script
returns $checkout_buttons
amazon and google payment methods populate $checkout_buttons
definitions
BOOTSTRAP
PAYMENT_NOTIFICATION
variables
$_payment_id
$processor_data['processor_params']
$cart
$checkout_buttons[$_payment_id]
main payment functions
fn_cart_is_empty(cart)
fn_finish_payment(order_id, pp_response)
pp_response - dictionary pp_response['order_status'] - 'P' for placed, 'F' for failed (?) pp_response['reason_text'] - reason for failure
fn_order_placement_routines
other payment functions
fn_check_payment_script
fn_change_order_status
'N' canceled? 'O' open 'I' canceled? 'F'
fn_get_order_info
fn_get_processor_data
fn_get_payment_method_data
other functions
fn_flush()
fn_set_notification()
fn_url()
fn_format_price()