My Profile_


Open Totals

NEW!   We now have our Interactive tool for this section.

Returns the details about the currently open batch.

This transaction is similar to the Batch Close. The difference is that it does not close the batch for settlement.

Canada Code Sample

require "../../mpgClasses.php";


$store_id='store5';
$api_token='yesguy';
$ecr_number='66013455';

## step 1) create transaction array ###
$txnArray=array('type'=>'opentotals',
         		'ecr_number'=>$ecr_number
           	   );

$mpgTxn = new mpgTransaction($txnArray);

## step 2) create mpgRequest object ###
$mpgReq= new mpgRequest($mpgTxn);
$mpgReq->setTestMode(true); //false or comment out this line for production transactions

## step 3) create mpgHttpsPost object which does an https post ##
$mpgHttpPost=new mpgHttpsPost($store_id,$api_token,$mpgReq);

## step 4) get an mpgResponse object ##
$mpgResponse=$mpgHttpPost->getMpgResponse();


##step 5) get array of all credit cards
$creditCards = $mpgResponse->getCreditCards($ecr_number);

## step 6) loop through the array of credit cards and get information

for($i=0; $i < count($creditCards); $i++)
 {
  print "\nCard Type = $creditCards[$i]";


  print "\nPurchase Count = "
        . $mpgResponse->getPurchaseCount($ecr_number,$creditCards[$i]);


  print "\nPurchase Amount = "
        . $mpgResponse->getPurchaseAmount($ecr_number,$creditCards[$i]);


  print "\nRefund Count = "
        . $mpgResponse->getRefundCount($ecr_number,$creditCards[$i]);


  print "\nRefund Amount = "
        . $mpgResponse->getRefundAmount($ecr_number,$creditCards[$i]);


  print "\nCorrection Count = "
        . $mpgResponse->getCorrectionCount($ecr_number,$creditCards[$i]);


  print "\nCorrection Amount = "
        . $mpgResponse->getCorrectionAmount($ecr_number,$creditCards[$i]);
 }



?>


                

Transaction Values

$txnArray=array('type'=>'opentotals',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);

Open Totals transaction object mandatory values

Value Type Limits Set method Description
ECR (electronic cash register) number String No limit (value provided by Moneris) 'ecr_number' Electronic cash register number.

Open Totals transaction object optional values

None.