CubeCart - FreeForums For All

CubeCart 5 => Developer's Kit => Topic started by: Chief! on February 19, 2012, 03:23:28 PM



Title: Transaction Workflow
Post by: Chief! on February 19, 2012, 03:23:28 PM
The following is a line-by-line analysis of what happens when a customer selects a payment gateway and clicks Continue...

I chose to use Goober's (www.ccmodder.com) Payment Test Gateway.

0170 public function loadPage() ## from /index.php?_a=gateway and $_POST['gateway']="PTG"
0172 False
0231 True
0233 False
0237 switch 'gateway'
0339 default:
0340 $method = '_gateway'
0341 True
0342 $this->{$method}()
------------------------------------------------------------
 1613 private function _gateway()
 1614 False
 1620 $gateway = "PTG"
 1621 $this->_displayGateways($gateway);
------------------------------------------------------------
  1419 private function _displayGateways($name = "PTG")
  1420 $where = array('module' => 'gateway', 'status' => '1')
  1421 $this->_basket =& $GLOBALS['cart']->basket
  1422 True
  1423 $where['folder'] = $name
  1425 Update Cubecart_order_summary
  1427 $gateways[0] = array('module_id'=>"22",'module'=>"gateway",'folder'=>"PTG",'status'=>"1",'default'=>"0",'countries'=>null)
  1431 True
  1432 True
  1433 False
  1437 $module = array('description'=>"Testing Gateway",'ReturnStatus'=>"Processing",'countries'=>null)
  1439 False
  1442 $folder = 'gateway'
  1443 $class_path = CC_ROOT_DIR."\modules\gateway\PTG\gateway.class.php"
  1445 True
  1446 include $class_path
  1447 $gateway = new Gateway($module, $this->_basket);
------------------------------------------------------------
   gateway.class.php
   0008 public function __construct($module = false, $basket = false)
   0009 $this->_module = $module;
   0010 $this->_basket =& $GLOBALS['cart']->basket;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1448 True
  1449 $transfer = $gateway->transfer()
------------------------------------------------------------
   gateway.class.php
   0021 return array('method'=>'post','target'=>'_self','submit'=>'auto',
            'action'=>$GLOBALS['storeURL'].'/modules/gateway/PTG/gateway/gateway.php')
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1449 $transfer = array('action=>URL,'method'=>'post','target'=>'_self','submit'=>'auto')
  1450 switch 'auto'
  1461 auto:
  1463 $transfer['mode'] = "automatic"
  1464 Smarty->assign("Proceed")
  1465 $build_hidden_vars = true
  1479 True
  1480 $methods = array('fixedVariables','repeatVariables')
  1481 foreach $methods 'fixedVariables'
  1482 True
------------------------------------------------------------
   gateway.class.php
   0030 return array('cartId'=>basket['cart_order_id'],'status'=>module['ReturnStatus'],'amount'=>basket['total'],
            'responseURL'=>$GLOBALS['storeURL'].'/index.php?_g=rm&mod_type=gateway&cmd=process&module=PTG')
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1483 $variables = array('cartId'=>basket['cart_order_id'],'status'=>module['ReturnStatus'],'amount'=>basket['total'],'responseURL'=>URL
  1484 True
  1485 $form_vars = $variables
  1481 foreach $methods 'repeatVariables'
  1482 True
------------------------------------------------------------
   gateway.class.php
   0026 return false
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1483 $variables = false
  1484 False
  1493 True
  1494 Smarty->assign("Form_Vars")
  1501 Smarty->assign("Transfer")
  1543 return
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1622 $this->_checkoutProcess('gateway');
------------------------------------------------------------
  0950 private function _checkoutProcess($section = null)
  0951 switch 'gateway'
  0955 case 'gateway: status=2
  ....
  0994 $url = "?_a=gateway"
  ....
  1006 Smarty->assign("CHECKOUT_PROGRESS")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1626 Smarty->assign("Page_Content")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0351 exit

Javascript auto-submit
/index.php?_g=rm&mod_type=gateway&cmd=process&module=PTG'