Jump to content

Payment Gateway redirect to blank


BrightO

Recommended Posts

Hi,

 

I just completed building a Payment Gateway module- trying to test this now, but all I get after checking out is a blank page (***my URL****/index.php?_a=gateway)..... I was expecting to be redirected to the Hosted Payment Page as per my 'gateway.class.php'

 

Can you let me know what I am doing wrong or perhaps where I should be looking please- I am using the latest release of CubeCart- I believe 5.2.13)

 

The debbug tool at the backend also indicates....

PHP:

No Errors or Warnings

GET:

'_a'=>'gateway'

SESSION:

.......there is a long list of variables here....

 

Many thanks

Link to comment
Share on other sites

A blank page is either a significant error with a PHP statement(s) or a syntax error in a template statement. With either, it's best to have PHP keep a log of any errors. Also, in admin, Store Settings, Advanced, enable debug mode. You may be able to get some errors listed here.

 

You say, "the debug tool at the backend". In your point of view, where or what is the backend?

Link to comment
Share on other sites

Many thanks bsmither for your response-very much appreciated, by 'the debug tool at the backend"- I was referring to Admin, Store Settings, Advanced, enable debug mode...as you've rightly advised....

 

Below is a snapshot of what I get ( I have masked some of the data):

I will review the module again and revert back to you- Cheers

 

PHP:

No Errors or Warnings

GET:


'_a' => NULL

SESSION:


'__client' =>
'ip_address' => '************'
'useragent' => 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36'
'session_start' => 1411234917
'session_last' => 1411234937
'currency' => 'GBP'
'admin_id' => '1'
'language' => 'en-US'
'__system' =>
'token' => '47c48ce4cf029c58e9a44585cd1822ed'
'__admin_data' =>
'admin_id' => '1'
'customer_id' => ''
'status' => '1'
'name' => 'Kart'
'username' => 'admin'
'new_password' => '1'
'email' => '************'
'verify' => ''
'logins' => '16'
'super_user' => '1'
'notes' => ''
'failLevel' => '0'
'blockTime' => '0'
'lastTime' => '1411234836'
'browser' => 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36'
'ip_address' => '176.251.90.14'
'language' => 'en-GB'
'dashboard_notes' => ''
'order_notify' => '1'
'__admin' =>
'user_language' => 'en-GB'
'version-check' => true
'__recaptcha' =>
'error' => NULL
'confirmed' => false

COOKIE:


'PHPSESSID' => 'f975325d4b5fad558f22d567c80ffde5'

MySQLi
Queries (41):
[1] SELECT SQL_CALC_FOUND_ROWS * FROM `a4745185_CubeCart_sessions` WHERE a4745185_CubeCart_sessions.session_id = 'f975325d4b5fad558f22d567c80ffde5' LIMIT 1; -- (0.000448942184448 sec)
[2] SELECT FOUND_ROWS() as Count; -- (0.000194072723389 sec)
[3] SELECT * FROM `a4745185_CubeCart_lang_strings` WHERE a4745185_CubeCart_lang_strings.language = 'en-US' ; -- (0.000362157821655 sec) [CACHED]
[4] SELECT * FROM `a4745185_CubeCart_hooks` WHERE a4745185_CubeCart_hooks.enabled = '1' ORDER BY priority ASC ; -- (0.00026798248291 sec) [CACHED]
[5] SELECT `php_code`, `unique_id`, `description`, `hook_trigger` FROM `a4745185_CubeCart_code_snippet` WHERE a4745185_CubeCart_code_snippet.enabled = '1' ORDER BY `priority` ASC ; -- (0.000197172164917 sec) [CACHED]
[6] SELECT `cat_id`, `cat_name`, `cat_parent_id` FROM `a4745185_CubeCart_category` ORDER BY `cat_id` DESC ; -- (0.000231027603149 sec) [CACHED]
[7] SELECT `cat_id`, `cat_name` FROM `a4745185_CubeCart_category_language` WHERE a4745185_CubeCart_category_language.language = 'en-US' ; -- (0.000580072402954 sec) [CACHED]
[8] SELECT SQL_CALC_FOUND_ROWS `array` FROM `a4745185_CubeCart_config` WHERE a4745185_CubeCart_config.name = 'logos' LIMIT 1; -- (0.000509023666382 sec) [CACHED]
[9] SELECT FOUND_ROWS() as Count; -- (0.000282049179077 sec)
[10] SELECT SQL_CALC_FOUND_ROWS `status`, `countries` FROM `a4745185_CubeCart_modules` WHERE a4745185_CubeCart_modules.folder = 'logos' LIMIT 1; -- (0.0065450668335 sec) [CACHED]
[11] SELECT `folder` FROM `a4745185_CubeCart_modules` WHERE a4745185_CubeCart_modules.module = 'livehelp' AND a4745185_CubeCart_modules.status = '1' ; -- (0.00274300575256 sec) [CACHED]
[12] SELECT * FROM `a4745185_CubeCart_currency` WHERE a4745185_CubeCart_currency.code = 'GBP' ; -- (0.000365018844604 sec) [CACHED]
[13] SELECT SQL_CALC_FOUND_ROWS `customer_id` FROM `a4745185_CubeCart_sessions` WHERE a4745185_CubeCart_sessions.session_id = 'f975325d4b5fad558f22d567c80ffde5' LIMIT 1; -- (0.103111028671 sec)
[14] SELECT FOUND_ROWS() as Count; -- (0.0141019821167 sec)
[15] SELECT `doc_id`, `doc_name`, `doc_content`, `doc_lang`, `seo_meta_title`, `seo_meta_description`, `seo_meta_keywords`, `doc_parent_id` FROM `a4745185_CubeCart_documents` WHERE a4745185_CubeCart_documents.doc_home = '1' AND a4745185_CubeCart_documents.doc_status = '1' ; -- (0.00120806694031 sec) [CACHED]
[16] SELECT `doc_name`, `doc_content`, `seo_meta_title`, `seo_meta_description`, `seo_meta_keywords` FROM `a4745185_CubeCart_documents` WHERE a4745185_CubeCart_documents.doc_parent_id = '1' AND a4745185_CubeCart_documents.doc_lang = 'en-US' ; -- (0.000382900238037 sec) [CACHED]
[17] SELECT `doc_name`, `doc_content`, `seo_meta_title`, `seo_meta_description`, `seo_meta_keywords` FROM `a4745185_CubeCart_documents` WHERE a4745185_CubeCart_documents.doc_parent_id = '1' AND a4745185_CubeCart_documents.doc_lang = 'en-US' ; -- (0.000242948532104 sec) [CACHED]
[18] SELECT SQL_CALC_FOUND_ROWS * FROM `a4745185_CubeCart_inventory` WHERE a4745185_CubeCart_inventory.status = '1' AND a4745185_CubeCart_inventory.featured = '1' ORDER BY `date_added` DESC, `product_id` DESC LIMIT 8; -- (0.000847816467285 sec) [CACHED]
[19] SELECT FOUND_ROWS() as Count; -- (0.000232934951782 sec)
[20] SELECT CI.* , C.status FROM `a4745185_CubeCart_category_index` AS CI, `a4745185_CubeCart_category` AS C WHERE CI.product_id = '2' AND CI.cat_id = C.cat_id ORDER BY CI.product_id -- (0.0313258171082 sec) [CACHED]
[21] SELECT CI.* , C.status FROM `a4745185_CubeCart_category_index` AS CI, `a4745185_CubeCart_category` AS C WHERE CI.product_id = '1' AND CI.cat_id = C.cat_id ORDER BY CI.product_id -- (0.0141060352325 sec) [CACHED]
[22] SELECT SQL_CALC_FOUND_ROWS * FROM `a4745185_CubeCart_image_index` WHERE a4745185_CubeCart_image_index.product_id = '1' ORDER BY `main_img` DESC LIMIT 1; -- (0.000453948974609 sec) [CACHED]
[23] SELECT `quantity`, `price` FROM `a4745185_CubeCart_pricing_quantity` WHERE a4745185_CubeCart_pricing_quantity.product_id = '1' AND a4745185_CubeCart_pricing_quantity.group_id = '0' ORDER BY `quantity` ASC, `price` ASC ; -- (0.00033712387085 sec) [CACHED]
[24] SELECT SUM(`rating`) AS Score, COUNT(`id`) as Count FROM `a4745185_CubeCart_reviews` WHERE a4745185_CubeCart_reviews.approved = '1' AND a4745185_CubeCart_reviews.product_id = '1' ; -- (0.000333070755005 sec) [CACHED]
[25] SELECT SQL_CALC_FOUND_ROWS `array` FROM `a4745185_CubeCart_config` WHERE a4745185_CubeCart_config.name = 'languages' LIMIT 1; -- (0.00157999992371 sec) [CACHED]
[26] SELECT * FROM `a4745185_CubeCart_currency` WHERE a4745185_CubeCart_currency.active = '1' ; -- (0.00163292884827 sec) [CACHED]
[27] SELECT `cat_parent_id`, `cat_id`, `cat_name` FROM `a4745185_CubeCart_category` WHERE a4745185_CubeCart_category.cat_parent_id = '0' AND a4745185_CubeCart_category.status = '1' AND a4745185_CubeCart_category.hide = '0' ORDER BY priority, cat_name ASC ; -- (0.00302505493164 sec) [CACHED]
[28] SELECT `cat_id`, `cat_name` FROM `a4745185_CubeCart_category_language` WHERE a4745185_CubeCart_category_language.language = 'en-US' ; -- (0.00146698951721 sec) [CACHED]
[29] SELECT `id` FROM `a4745185_CubeCart_category_index` AS C INNER JOIN `a4745185_CubeCart_inventory` AS I ON I.`product_id` = C.`product_id` WHERE C.cat_id = 1 AND I.status = 1 -- (0.00155186653137 sec) [CACHED]
[30] SELECT COUNT(cat_id) AS Count FROM `a4745185_CubeCart_category` WHERE a4745185_CubeCart_category.cat_parent_id = '1' AND a4745185_CubeCart_category.status = '1'; -- (0.00179409980774 sec) [CACHED]
[31] SELECT `cat_parent_id`, `cat_id`, `cat_name` FROM `a4745185_CubeCart_category` WHERE a4745185_CubeCart_category.cat_parent_id = '1' AND a4745185_CubeCart_category.status = '1' AND a4745185_CubeCart_category.hide = '0' ORDER BY priority, cat_name ASC ; -- (0.00147390365601 sec) [CACHED]
[32] SELECT SQL_CALC_FOUND_ROWS `array` FROM `a4745185_CubeCart_config` WHERE a4745185_CubeCart_config.name = 'gift_certs' LIMIT 1; -- (0.00146985054016 sec) [CACHED]
[33] SELECT * FROM `a4745185_CubeCart_documents` WHERE a4745185_CubeCart_documents.doc_parent_id = '0' AND a4745185_CubeCart_documents.doc_status = '1' AND a4745185_CubeCart_documents.navigation_link = '1' ORDER BY `doc_order` ASC ; -- (0.00124096870422 sec) [CACHED]
[34] SELECT SQL_CALC_FOUND_ROWS `array` FROM `a4745185_CubeCart_config` WHERE a4745185_CubeCart_config.name = 'Contact_Form' LIMIT 1; -- (0.000710010528564 sec) [CACHED]
[35] SELECT * FROM `a4745185_CubeCart_inventory` JOIN (SELECT CEIL(RAND() * (SELECT MAX(`product_id`) FROM `a4745185_CubeCart_inventory`)) AS `product_id`) AS `r` USING (`product_id`) WHERE a4745185_CubeCart_inventory.status = '1' -- (0.000834941864014 sec)
[36] SELECT CI.* , C.status FROM `a4745185_CubeCart_category_index` AS CI, `a4745185_CubeCart_category` AS C WHERE CI.product_id = '2' AND CI.cat_id = C.cat_id ORDER BY CI.product_id -- (0.000224828720093 sec) [CACHED]
[37] SELECT * FROM `a4745185_CubeCart_inventory` JOIN (SELECT CEIL(RAND() * (SELECT MAX(`product_id`) FROM `a4745185_CubeCart_inventory`)) AS `product_id`) AS `r` USING (`product_id`) WHERE a4745185_CubeCart_inventory.status = '1' -- (0.000572204589844 sec)
[38] SELECT CI.* , C.status FROM `a4745185_CubeCart_category_index` AS CI, `a4745185_CubeCart_category` AS C WHERE CI.product_id = '2' AND CI.cat_id = C.cat_id ORDER BY CI.product_id -- (0.000253915786743 sec) [CACHED]
[39] SELECT * FROM `a4745185_CubeCart_inventory` JOIN (SELECT CEIL(RAND() * (SELECT MAX(`product_id`) FROM `a4745185_CubeCart_inventory`)) AS `product_id`) AS `r` USING (`product_id`) WHERE a4745185_CubeCart_inventory.status = '1' -- (0.000524997711182 sec)
[40] SELECT `quantity`, `price` FROM `a4745185_CubeCart_pricing_quantity` WHERE a4745185_CubeCart_pricing_quantity.product_id = '1' AND a4745185_CubeCart_pricing_quantity.group_id = '0' ORDER BY `quantity` ASC, `price` ASC ; -- (0.000207901000977 sec) [CACHED]
[41] SELECT `oi`.`product_id` AS product_id, `i`.`name`, SUM(`oi`.`quantity`) as `quantity` FROM `a4745185_CubeCart_order_inventory` as `oi` JOIN `a4745185_CubeCart_inventory` as `i` WHERE `oi`.`product_id` = `i`.`product_id` AND `i`.`status` = 1 GROUP BY `product_id` ORDER BY `quantity` DESC LIMIT 10; -- (0.0221569538116 sec) [CACHED]
Errors:
No Errors

Memory: Peak Usage / Max (%):
28.18MB / 128M (22.02%)

Cache (File):
Used: 834.43 KB [Clear Cache]

Page Load Time:
0.253143 seconds

Link to comment
Share on other sites

The '_a' => NULL is a problem and is not a problem.

 

Somewhere, some code is trying to send CubeCart to perform an activity and display the page associated with that activity, such as _a=account, or _a=checkout. But that code is not formulating the activity name correctly, or is not using the CubeCart function calls correctly.

 

CubeCart, if it cannot recognize the name of an activity, will still show the header and sidebars. That is, _a=whoopdeedoo will show what you normally see, but with an empty main-content area. When _a=<empty space>, CubeCart shows the Homepage.

 

In your debug report, '_a' => NULL is strange because NULL is not quoted.

Link to comment
Share on other sites

I have now made some progress and connecting into the Hosted Payment Gateway Server ok.

 

Now, it may seem my calculated hash is not matching with what the host's Payment Gateway is expecting.I have simulated this on my own local machine using Javascript and have a feeling the culprit may be the 'date and time' I am using to calculate the hash (this is required by the Gateway as part of the hash calculation)...

 

I am now familiarising myself with the CubeCart suite (only about a week now) so bear with me if this may come across as a silly question; just wondering if there was a quick and simple way/debug tool to step into the file 'gateway.class.php' for debugging purpose?

 

//Here is a snapshot of my hash within public function fixedVariables() ......

 

$dateTime = date("Y:m:d-H:i:s"); 
 
$storeHash = "sharedsecret=".$this->_module['sharedsecret'];
$storeHash .= "&storeid=".$this->_module['store_number'];
$storeHash .= "&chargetotal=".$this->basket['total'];
$storeHash .= "&currency=" .$TransactionCurrency;
$storeHash .= "&txndatetime=".$dateTime;
$myBinToHexCopy = bin2hex($storeHash);
 
//now passing this in param hash to the Gateway as part of the hidden array
 
$hidden = array(
 
//other param......
'hash' => sha1($myBinToHexCopy),
'txndatetime' => $dateTime,
//and more param.....

);

Link to comment
Share on other sites

"Is there a quick and simple way/debug tool to step into the file 'gateway.class.php' for debugging purposes?"

 

No, unless you have one or more of a few PHP helpers: XDebug, FirePHP, or some other mechanism in a PHP developer's IDE.

 

For myself, I wrote a function that will log the arguments specified in the call to the function. The function's arguments are typically the values of variables I am monitoring. (I can send you a copy of the function.)

Link to comment
Share on other sites

That's ok bsmither, I have managed to fixed it, it's all working okay now- beautiful!

 

Just out of curiosity, will you guys be coming to the eCommerce Expo 2014? I may pop round your stand to say hi and show my appreciation.

 

I am sure my bosses may also want to have a quick chat with you...

 

See you soon (i.e. if you are coming).

 

Many thanks,

 

Bright

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...