Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Installation of X-Payments Connector on X-Cart 4.1.12

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-03-2010, 09:27 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Installation of X-Payments Connector on X-Cart 4.1.12

This is provided to you without any guarantee that it will work for you. As always backup ALL files and data base before beginning.

This is not for the faint at heart. If you have any doubts what-so-ever about how to do it, pay for QTS to do it for you.

***********************************************

From your admin area go to Patch/Upgrade and in the Apply SQL patch, SQL query(ies):
Copy and paste the following then apply it.

Code:
DELETE FROM xcart_modules WHERE module_name='XPayments_Connector'; DELETE FROM xcart_config WHERE name LIKE 'xpc_%'; DELETE FROM xcart_languages WHERE name = 'module_descr_XPayments_Connector'; DELETE FROM xcart_languages WHERE name = 'module_name_XPayments_Connector'; DELETE FROM xcart_languages WHERE name = 'option_title_XPayments_Connector'; DELETE FROM xcart_languages WHERE name LIKE 'opt_xpc_%'; DELETE FROM xcart_languages WHERE name LIKE 'opt_descr_xpc_%'; DELETE FROM xcart_languages WHERE name LIKE 'lbl_xpc_%'; DELETE FROM xcart_languages WHERE name LIKE 'txt_xpc_%'; DELETE FROM xcart_languages WHERE name = 'lbl_aom_order_status_note_13';

From your admin area go to Patch/Upgrade and in the Apply SQL patch, SQL query(ies):
Copy and paste the following then apply it.

Code:
INSERT INTO xcart_modules (module_name, module_descr, active) VALUES ('XPayments_Connector','This module enables an ability to process payments via X-Payments software','Y'); INSERT INTO xcart_config VALUES ('xpc_sep1','X-Payments connection options','','XPayments_Connector',0,'separator','','',''); INSERT INTO xcart_config VALUES ('xpc_sep2','Payments <-> Order statuses compatibility list','','XPayments_Connector',75,'separator','','',''); INSERT INTO xcart_config VALUES ('xpc_shopping_cart_id','Shopping cart ID','','XPayments_Connector',10,'text','','','^[0-9a-f]{32}?$'); INSERT INTO xcart_config VALUES ('xpc_xpayments_url','X-Payments URL','','XPayments_Connector',20,'text','','',''); INSERT INTO xcart_config VALUES ('xpc_public_key','Encryption key','','XPayments_Connector',40,'textarea','','',''); INSERT INTO xcart_config VALUES ('xpc_private_key','Decryption key','','XPayments_Connector',50,'textarea','','',''); INSERT INTO xcart_config VALUES ('xpc_private_key_password','Decryption key password','','XPayments_Connector',60,'text','','',''); INSERT INTO xcart_config VALUES ('xpc_allowed_ip_addresses','IP addresses of X-Payments callbacks','','XPayments_Connector',70,'text','','',''); INSERT INTO xcart_config VALUES ('xpc_currency','Currency','USD','XPayments_Connector',72,'selector','','',''); INSERT INTO xcart_config VALUES ('xpc_status_new','Set order status if payment is in status \'New\' to','I','XPayments_Connector',80,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete',''); INSERT INTO xcart_config VALUES ('xpc_status_auth','Set order status if payment is in status \'Authorized\' to','A','XPayments_Connector',90,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete',''); INSERT INTO xcart_config VALUES ('xpc_status_charged','Set order status if payment is in status \'Charged\' to','P','XPayments_Connector',100,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete',''); INSERT INTO xcart_config VALUES ('xpc_status_declined','Set order status if payment is in status \'Declined\' to','F','XPayments_Connector',110,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete',''); INSERT INTO xcart_config VALUES ('xpc_status_refunded','Set order status if payment is in status \'Refunded\' to','','XPayments_Connector',120,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete',''); INSERT INTO xcart_config VALUES ('xpc_status_part_refunded','Set order status if payment is in status \'Partially Refunded\' to','','XPayments_Connector',120,'selector','',':lbl_xpc_do_not_change\nI:lbl_not_finished\nQ:lbl_queued\nP:lbl_processed\nB:lbl_backordered\nD:lbl_declined\nF:lbl_failed\nC:lbl_complete','');
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #2  
Old 07-03-2010, 09:28 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Installation of X-Payments Connector on X-Cart 4.1.12 (Part 2)

From your admin area go to Patch/Upgrade and in the Apply SQL patch, SQL query(ies):
Copy and paste the following then apply it. WARNING! The below is for the X-Cart 4.1.12 US English language variables

Code:
replace into xcart_languages values ('US','module_descr_XPayments_Connector','This module enables an ability to process payments via X-Payments software','Modules'); replace into xcart_languages values ('US','module_name_XPayments_Connector','X-Payments Connector','Modules'); replace into xcart_languages values ('US','option_title_XPayments_Connector','X-Payments Connector options','Options'); replace into xcart_languages values ('US','opt_xpc_sep1','Connection options','Options'); replace into xcart_languages values ('US','opt_xpc_sep2','Mapping rules','Options'); replace into xcart_languages values ('US','opt_xpc_shopping_cart_id','Store ID','Options'); replace into xcart_languages values ('US','opt_descr_xpc_shopping_cart_id','Store ID is an unique value generated by X-Payments for this shopping cart. This value should be obtained from this online store details page in X-Payments back-end.','Options'); replace into xcart_languages values ('US','opt_xpc_xpayments_url','X-Payments URL','Options'); replace into xcart_languages values ('US','opt_descr_xpc_xpayments_url','URL of your X-Payments installation (specify the URL beginning with https://). The store will send payment transaction requests to this URL.','Options'); replace into xcart_languages values ('US','opt_xpc_public_key','Public key','Options'); replace into xcart_languages values ('US','opt_descr_xpc_public_key','Public key is used to encrypt requests from the store to your X-Payments installation. This value should be obtained from this online store details page in X-Payments back-end.','Options'); replace into xcart_languages values ('US','opt_xpc_private_key','Private key','Options'); replace into xcart_languages values ('US','opt_descr_xpc_private_key','Private key is used to decrypt responses and callback requests that the store receives from your X-Payments installation. This value should be obtained from this online store details page in X-Payments back-end.','Options'); replace into xcart_languages values ('US','opt_xpc_private_key_password','Private key password','Options'); replace into xcart_languages values ('US','opt_descr_xpc_private_key_password','Private key password is used to decrypt the Private key. This value should be obtained from this online store details page in X-Payments back-end.','Options'); replace into xcart_languages values ('US','opt_xpc_allowed_ip_addresses','IP addresses for X-Payments callbacks','Options'); replace into xcart_languages values ('US','opt_xpc_currency','Payment currency','Options'); replace into xcart_languages values ('US','opt_descr_xpc_currency','All the payments will be made using the currency specified here. ','Options'); replace into xcart_languages values ('US','opt_descr_xpc_allowed_ip_addresses','X-Payments sends callback requests to the store from specific IP addresses. To secure the data transfer and avoid fraudulent requests, specify these IP addresses here as a comma-separated list.','Options'); replace into xcart_languages values ('US','opt_xpc_status_new','Set order status for \'New\' payment to','Options'); replace into xcart_languages values ('US','opt_xpc_status_auth','Set order status for \'Authorized\' payment to','Options'); replace into xcart_languages values ('US','opt_xpc_status_charged','Set order status for \'Charged\' payment to','Options'); replace into xcart_languages values ('US','opt_xpc_status_declined','Set order status for \'Declined\' payment to','Options'); replace into xcart_languages values ('US','opt_xpc_status_refunded','Set order status for \'Refunded\' payment to','Options'); replace into xcart_languages values ('US','opt_xpc_status_part_refunded','Set order status for \'Partially Refunded\' payment to','Options'); replace into xcart_languages values ('US','lbl_xpc_do_not_change','Do not change','Labels'); replace into xcart_languages values ('US','lbl_xpc_test_module','Test module','Labels'); replace into xcart_languages values ('US','lbl_xpc_import_payment_methods','Import payment methods','Labels'); replace into xcart_languages values ('US','txt_xpc_test_module_note','To test module settings and connection with X-Payments click on the button below. If module properly configured, X-Payments response with successful message.','Text'); replace into xcart_languages values ('US','txt_xpc_import_payment_modules_note','To be able use the payment methods defined in X-Payments you should import information about them from X-Payments. Click on the button below and X-Payments return the list of available for this shopping cart payment methods.','Text'); replace into xcart_languages values ('US','lbl_xpc_request_payment_methods','Request payment methods from X-Payments','Labels'); replace into xcart_languages values ('US','txt_xpc_returned_payment_methods','X-Payments returned the following payment methods which are available for using with your shopping cart:','Text'); replace into xcart_languages values ('US','txt_xpc_import_payment_methods_warn','Warning! Payment methods have already been imported from X-Payments early. All of them will be removed from the database if you will select to import payment methods again.','Text'); replace into xcart_languages values ('US','lbl_xpc_recommend_store_cvv2','$store_cvv2 = true. PCI-DSS prohibits storing CVV2 codes. Disable this by setting $store_cvv2 = false (file &lt;xcart_dir&gt;/config.php).','Labels'); replace into xcart_languages values ('US','lbl_xpc_recommend_store_cc','$store_cc = true. To take X-Cart out of PCI-DSS scope you must set $store_cc = false (&lt;xcart_dir&gt;/config.php).','Labels'); replace into xcart_languages values ('US','lbl_xpc_recommend_disable_cc','Option "Do not ask customers to enter CC information while getting registered" is disabled. To take X-Cart out of PCI-DSS scope you must enable this option (General settings / General option).','Labels'); replace into xcart_languages values ('US','lbl_xpc_recommend_subscriptions','Module "Subscriptions" is enabled. Disable the module to take X-Cart out of PCI-DSS scope as the module presumes keeping CC data in the database, which is prohibited.','Labels'); replace into xcart_languages values ('US','lbl_xpc_recommend_payment_methods','Background payment methods are enabled. To take X-Cart out of PCI DSS scope you must disable the following payment methods:','Labels'); replace into xcart_languages values ('US','lbl_xpc_xpayments_methods','X-Payments payment methods','Labels'); replace into xcart_languages values ('US','txt_xpc_pm_config_note','The list below represented the payment methods imported from X-Payments and selected as a payment options available for customer on the checkout process.','Text'); replace into xcart_languages values ('US','txt_xpc_pm_config_note_2','Configuring of the payment methods presented possible in the X-Payments backoffice only. In case of any problems you need to review the X-Payments Connector module settings and if it\'s ok, review payment configurations settings on the X-Payments side.','Text'); replace into xcart_languages values ('US','lbl_xpc_xpayments_connector_settings','X-Payments Connector module settings','Labels'); replace into xcart_languages values ('US','lbl_xpc_go_to_payment_page','Go to X-Payments payment page','Labels');
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #3  
Old 07-03-2010, 09:29 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Installation of X-Payments Connector on X-Cart 4.1.12 (Part 3)

From your admin area go to Patch/Upgrade and in the Apply SQL patch, SQL query(ies):
Copy and paste the following then apply it. WARNING! The below is for the X-Cart 4.1.12 US English language variables

Code:
replace into xcart_languages values ('US','lbl_xpc_auth','Auth','Labels'); replace into xcart_languages values ('US','lbl_xpc_capture','Capture','Labels'); replace into xcart_languages values ('US','lbl_xpc_void','Void','Labels'); replace into xcart_languages values ('US','lbl_xpc_refund','Refund','Labels'); replace into xcart_languages values ('US','lbl_xpc_pm_id','X-Payments configuration ID','Labels'); replace into xcart_languages values ('US','lbl_xpc_recommendations','Failed to meet PCI-DSS requirements','Labels'); replace into xcart_languages values ('US','txt_xpc_msg_import_request_failed','Error had occured during the requesting of payment methods from X-Payments. See log files for details.','Text'); replace into xcart_languages values ('US','txt_xpc_msg_import_request_empty','There are no payment configurations for this store.','Text'); replace into xcart_languages values ('US','txt_xpc_msg_import_success','Payment methods have been successfully imported','Text'); replace into xcart_languages values ('US','txt_xpc_msg_import_failed','Error had occured during the importing of payment methods to the database','Text'); replace into xcart_languages values ('US','txt_xpc_msg_import_no_pm','There are no payment methods to import','Text'); replace into xcart_languages values ('US','txt_xpc_msg_test_success','Test transaction successfully complete.','Text'); replace into xcart_languages values ('US','txt_xpc_msg_test_failed','Test transaction failed. Please check the X-Payment Connector settings and try again. If all options is ok review your X-Payments settings and make sure you have properly defined shopping cart properties.','Text'); replace into xcart_languages values ('US','txt_xpc_requirements_failed','Failed to meet environment requirements','Text'); replace into xcart_languages values ('US','txt_xpc_sys_check_failed','Configuration problems','Text'); replace into xcart_languages values ('US','txt_xpc_paypal_dp_equals_option','Cardholder data must be collected in X-Payments','Text'); replace into xcart_languages values ('US','txt_xpc_paypal_dp_equals_list','Select payment method configured on X-Payments side','Text'); replace into xcart_languages values ('US','txt_xpc_paypal_dp_note','To collect cardholder data in X-Payments, the payment method must be configured exactly the same in X-Cart as it is in X-Payments.','Text'); replace into xcart_languages values ('US','txt_xpc_paypal_dp_empty_warning','The payment method is not configured in X-Cart, so it is impossible to define whether integration configuration is identical in X-Cart and in X-Payments.','Text'); replace into xcart_languages values ('US','txt_xpc_paypal_dp_equal_warning','The payment method in X-Cart is configured in a different way or using different parameters, than in X-Payments. The modules must be configured exactly the same for the integration to work correctly.','Text'); replace into xcart_languages values ('US','txt_xpc_reqerr_curl','PHP extension cURL is not installed on your server.','Text'); replace into xcart_languages values ('US','txt_xpc_reqerr_openssl','PHP extension OpenSSL is not installed on your server.','Text'); replace into xcart_languages values ('US','txt_xpc_reqerr_dom','PHP extension DOM is not installed on your server.','Text'); replace into xcart_languages values ('US','txt_xpc_syserr_cartid','Store ID is empty or has an incorrect value.','Text'); replace into xcart_languages values ('US','txt_xpc_syserr_url','X-Payments URL is empty or has an incorrect value.','Text'); replace into xcart_languages values ('US','txt_xpc_syserr_pubkey','Public key is empty','Text'); replace into xcart_languages values ('US','txt_xpc_syserr_privkey','Private key is empty','Text'); replace into xcart_languages values ('US','txt_xpc_syserr_privkeypass','Private key password is empty','Text'); replace into xcart_languages values ('US','lbl_aom_order_status_note_13','Status was changed automatically according to the response of X-Payments.','Text'); replace into xcart_languages values ('US','txt_xpc_payment_info','Payment information','Text'); replace into xcart_languages values ('US','txt_xpc_view_payment_info','View payment information','Text'); replace into xcart_languages values ('US','txt_xpc_transaction_list','Transaction list','Text'); replace into xcart_languages values ('US','txt_xpc_date_time','Date, time','Text'); replace into xcart_languages values ('US','txt_xpc_result_payment_status','Result payment status','Text'); replace into xcart_languages values ('US','txt_xpc_transaction_result','Transaction result','Text'); replace into xcart_languages values ('US','txt_xpc_other_info','Additional info','Text'); replace into xcart_languages values ('US','txt_xpc_type','Type','Text'); replace into xcart_languages values ('US','txt_xpc_message','Message','Text'); replace into xcart_languages values ('US','lbl_xpc_config_description','The values of Store ID, Public key, Private key and Private key password fields should be copied from this online store details page in X-Payments back-end.','Labels'); replace into xcart_languages values ('US','txt_xpc_txnid','Transaction ID','Text');
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #4  
Old 07-03-2010, 09:31 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Installation of X-Payments Connector on X-Cart 4.1.12 (Part 4)

Download the connector from your file area at QT and unarchive it.
Make the following changes to the files you unarchived.

In \modules\XPayments_Connector\xpc_func.php

1) Remove:
Code:
'has_preauth' => getTranTypeFlag($tranTypes, XPC_TRAN_TYPE_AUTH), 'preauth_expire' => $authCaptureInfo['authExp'], 'capture_min_limit' => ($authCaptureInfo['captMinLimit'] * 100) . '%', 'capture_max_limit' => ($authCaptureInfo['captMaxLimit'] * 100 - 100) . '%',

2) Remove:
Code:
'language' => $shop_language

3) Replace:
Code:
global $config, $sql_tbl, $active_modules, $login;

With
Code:
global $config, $sql_tbl, $active_modules;

4) Replace:
Code:
'login' => $user_info['login'],

With
Code:
'login' => $user_info['login'] . ' (User ID #' . $user_info['id'] . ')',

5) Replace:
Code:
$address_fields = array('firstname', 'lastname', 'address', 'city', 'state', 'country', 'zipcode');

With
Code:
$address_fields = array('firstname', 'lastname', 'address', 'city', 'state', 'country', 'zipcode', 'phone', 'fax');

6) Replace:
Code:
foreach (array('company', 'email', 'phone', 'fax') as $field) {

With
Code:
foreach (array('company', 'email') as $field) {

7) Replace:
Code:
$admin_email = func_query_first_cell("SELECT email FROM $sql_tbl[customers] WHERE usertype IN ('" . implode("', '", $usertypes). "') AND status = 'Y' AND email != '' LIMIT 1");

With
Code:
$admin_email = func_query_first_cell("SELECT email FROM $sql_tbl[customers] WHERE usertype IN ('" . implode("', '", $usertypes). "') AND status = 'Y' AND email != ''");

8 ) Replace:
Code:
srand(time());

With
Code:
srand(XC_TIME);

In \payment\cc_xpc.php

1) Replace:
Code:
$bill_output['billmes'] = $bill_output['code'] == 1 ? $response['message'] : $response['lastMessage'];

With
Code:
$bill_output['billmes'] = ($bill_output['code'] == 1) ? $response['message'] . "\n" . '(last 4 card numbers: ' . @$_POST['last_4_cc_num'] . ');' . "\n" . '(card type: ' . @$_POST['card_type'] . ');' : $response['lastMessage'];

2) Replace:
Code:
func_is_preauth_force_enabled($secure_oid)

With
Code:
false

Now your ready to upload the files

Ignore the file in admin - do not upload it
Ignore sql folder - These have already been applied
Ignore Install files - You won't be using them

upload files in modules, payment, and skin1_original taking care to maintain structure.
Upload files from skin1_original into skin 1 also taking care to maintain structure.
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #5  
Old 07-03-2010, 09:34 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Installation of X-Payments Connector on X-Cart 4.1.12 (Part 5)

Edit or Download and edit the following existing files on your X-Cart 4.1.12 install:

In cart_directory/top.inc.php

1) ADD
Code:
define('XC_TIME', time()); define('X_PAYMENT_TRANS_ALREADY_CAPTURED', 1); define('X_PAYMENT_TRANS_ALREADY_VOIDED', 2); define('X_PAYMENT_TRANS_ALREADY_REFUNDED', 4); define('X_PAYMENT_TRANS_ALREADY_ACCEPTED', 8); define('X_PAYMENT_TRANS_ALREADY_DECLINED', 16); define('PAYMENT_NEW_STATUS', 1); define('PAYMENT_AUTH_STATUS', 2); define('PAYMENT_DECLINED_STATUS', 3); define('PAYMENT_CHARGED_STATUS', 4); define('X_USE_PAYPAL_FLOW', true);

After
Code:
$xcart_fs_default_permissions = array( "dir" => array( "nonprivileged" => 0777, "privileged" => 0711 ), "file" => array( "nonprivileged" => 0644, "privileged" => 0644 ), "phpfile" => array( "nonprivileged" => 0644, "privileged" => 0600 ) );
(NOTE: Yes this is before })


In cart_directory/admin/cc_processing.php

1) ADD
Code:
if (!empty($active_modules['XPayments_Connector'])) { func_xpay_func_load(); }

After
Code:
x_load('backoffice','crypt','tests');

2) REPLACE
Code:
$tmp = func_query_first("SELECT * FROM $sql_tbl[ccprocessors] WHERE processor='".$processor."'");

With
Code:
$where_query = ''; if (preg_match("/cc_xpc\.php_([0-9]+)/", $processor, $match)) { $pm_id = intval($match[1]); $processor = "cc_xpc.php"; $where_query = ' AND param01=\'' . $pm_id . '\''; } $tmp = func_query_first("SELECT * FROM $sql_tbl[ccprocessors] WHERE processor='".$processor."'" . $where_query);

3 ) ADD
Code:
if ($processor == 'cc_xpc.php') { $insert_params['protocol'] = 'https'; }

After
Code:
$insert_params = array ( 'payment_method' => $cc_processor, 'payment_script' => 'payment_cc.php', 'payment_template' => $template, 'active' => 'N', 'orderby' => '999', 'processor_file' => $processor );

4) REPLACE
Code:
db_query("UPDATE $sql_tbl[ccprocessors] SET paymentid='".$paymentid."' WHERE processor='".$processor."'");

With
Code:
db_query("UPDATE $sql_tbl[ccprocessors] SET paymentid='".$paymentid."' WHERE processor='".$processor."'" . $where_query);

5) ADD
Code:
} elseif ($cc_processor == 'cc_xpc.php') { $cc_processors = func_query("SELECT * FROM $sql_tbl[ccprocessors] WHERE paymentid>0 AND processor='cc_xpc.php'"); $smarty->assign('cc_processors', $cc_processors); $cc_processing_module['module_name'] = 'X-Payments payment methods';

After
Code:
$conf_data[$pkey] = $cc_processing_module; $conf_data[$akey] = func_query_first("SELECT $sql_tbl[ccprocessors].* FROM $sql_tbl[ccprocessors] WHERE $sql_tbl[ccprocessors].processor = '$asearch'"); $smarty->assign('conf_data', $conf_data);
(NOTE: Yes this is before })[/code]


In cart_directory/admin/configuration.php

1) REPLACE
Code:
$trusted_post_variables = array("gpg_key", "pgp_key");

With
Code:
$trusted_post_variables = array("gpg_key", "pgp_key", "xpc_private_key_password", "xpc_private_key", "xpc_public_key");

2) ADD
Code:
if ($option == 'XPayments_Connector') { include $xcart_dir . '/modules/XPayments_Connector/xpc_admin.php'; }

After
Code:
if ($REQUEST_METHOD=="POST") { require $xcart_dir."/include/safe_mode.php"; }

3) ADD
Code:
} elseif ($option == "XML_Site_Map") { include "./xml_sitemap.php";

After
Code:
if ($option == "User_Profiles") { include "./user_profiles.php";
(NOTE: Yes this is before })[/code]

In cart_directory/admin/payment_methods.php

1) ADD
Code:
if (!empty($active_modules['XPayments_Connector'])) { func_xpay_func_load(); }

After
Code:
define("IS_MULTILANGUAGE", 1); require "./auth.php"; require $xcart_dir."/include/security.php"; x_load('backoffice','tests');

2) REPLACE
Code:
$payment_methods = func_query("SELECT pm.*,cc.module_name,cc.processor,cc.type FROM $sql_tbl[payment_methods] AS pm LEFT JOIN $sql_tbl[ccprocessors] AS cc ON (pm.paymentid=cc.paymentid OR pm.paymentid<>cc.paymentid AND pm.processor_file=cc.processor) ORDER BY pm.orderby, pm.paymentid");

With
Code:
$payment_methods = func_query("SELECT pm.*, cc.module_name, cc.processor, cc.type, cc.param01 FROM $sql_tbl[payment_methods] AS pm LEFT JOIN $sql_tbl[ccprocessors] AS cc ON (pm.paymentid=cc.paymentid OR pm.paymentid<>cc.paymentid AND pm.processor_file=cc.processor AND cc.processor != 'cc_xpc.php') ORDER BY pm.active DESC, pm.orderby, pm.paymentid");

3) ADD
Code:
if (!empty($active_modules['XPayments_Connector'])) { foreach ($cc_module_files as $key => $value) { if ($value['processor'] == 'cc_xpc.php') { $cc_module_files[$key]['processor'] .= '_' . $value['param01']; } } }

After
Code:
$cc_module_files = func_query("select * from $sql_tbl[ccprocessors] where paymentid='0' and processor<>'ps_paypal_pro.php' order by type,module_name"); $sb_module_files = func_query("select * from $sql_tbl[ccprocessors] where type='C' and background='Y' order by module_name");


One .tpl file to edit.
In cart_directory/skin1/admin/configuration.tpl

1) ADD
Code:
{elseif $option eq "XML_Site_Map"} {include file="admin/main/xml_sitemap.tpl"}

After
Code:
{elseif $option eq "Search_products"} {include file="admin/main/search_products_form.tpl"}
(NOTE: Yes this is before {else})


2) ADD
Code:
{if $option eq "XPayments_Connector"} {include file="modules/XPayments_Connector/config_recommends.tpl"} {/if}

After
Code:
{if $option eq "Google_Analytics"} {$lng.google_analytics_info} <br /> <br /> {/if}

3) ADD
Code:
{elseif $option eq "XPayments_Connector"} {include file="modules/XPayments_Connector/config_bottom.tpl"}

After
Code:
<h3>{$lng.lbl_test_data_encryption}</h3> <a href="test_pgp.php">{$lng.lbl_test_data_encryption_link}</a>
(NOTE: Yes this is before {/if})


YOU ARE DONE!!!!

In your X-Cart under modules click configure for X-Payments Connector

Store ID: < This is the store ID that was assigned when you set up the store in X-Payments >

X-Payments URL: https://domain where X-Payments is/X-Payments Directory (NO Trailing /)(must be https)

Public key: < This is the public key that was assigned when you set up the store in X-Payments >

Private key: < This is the private key that was assigned when you set up the store in X-Payments >

Private key password: < This is the private key password that was assigned when you set up the store in X-Payments >

IP addresses for X-Payments callbacks: IP of server hosting X-Payments
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote

The following user thanks DogByteMan for this useful post:
Asiaplay (07-05-2010)
  #6  
Old 07-04-2010, 04:33 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Installation of X-Payments Connector on X-Cart 4.1.12

I have posted some tips on how to install X-Payments here
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #7  
Old 07-04-2010, 06:01 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,189
 

Default Re: Installation of X-Payments Connector on X-Cart 4.1.12

Thanks for posting this, sure there will be users to benefit. In post #4 in the beginning is missing in which file changes go (it is modules/XPayments_Connector/xpc_func.php). Also I think you should mention which payment gateway you are using. I won't be suprised if some changes are specific to the payment gateway (they shouldn't be but who knows...). I am trying to work out one for 4.2.x
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 07-04-2010, 06:32 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Installation of X-Payments Connector on X-Cart 4.1.12

Quote:
Originally Posted by cflsystems
Thanks for posting this, sure there will be users to benefit. In post #4 in the beginning is missing in which file changes go (it is modules/XPayments_Connector/xpc_func.php). Also I think you should mention which payment gateway you are using. I won't be suprised if some changes are specific to the payment gateway (they shouldn't be but who knows...). I am trying to work out one for 4.2.x

Fixed the missing filename. No payment gateways are needed in X-Cart any longer if using X-Payment Connector. The payment gateway is contained in X-Payments and imported into X-Cart, via X-Payment Connector, as a payment method.
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #9  
Old 07-04-2010, 06:43 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Installation of X-Payments Connector on X-Cart 4.1.12

Quote:
Originally Posted by cflsystems
Thanks for posting this, sure there will be users to benefit. In post #4 in the beginning is missing in which file changes go (it is modules/XPayments_Connector/xpc_func.php). Also I think you should mention which payment gateway you are using. I won't be suprised if some changes are specific to the payment gateway (they shouldn't be but who knows...). I am trying to work out one for 4.2.x

Look in the the xpayments/var/log folder for clues.

In my installation, using FirstData, there is a problem.

ERROR [2010-03-07 00:01:34]
User: unknown; IP: xx.xxx.xx.xxx
Zone: Transport
Code: GATEWAY_RESPONSE_CODE_WRONG_FORMAT (139)
Response code returned by payment module contains unallowed characters - "1603518937562682:YYYM:"

Clearly the "1603518937562682:YYYM:" is valid, X-Payments handler for FirstData has a problem. I have submitted a ticket.

Funny, a declined transaction works correctly. Only the successful ones have the problem.
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #10  
Old 07-04-2010, 06:51 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Installation of X-Payments Connector on X-Cart 4.1.12

Excellent post Dog...thanks for sharing! Oh this is going to be such a fun week...
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:46 AM.

   

 
X-Cart forums © 2001-2020