PHP code example of versa / maxipago

1. Go to this page and download the library: Download versa/maxipago library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

versa / maxipago example snippets



$maxiPago = new maxiPago;

$maxiPago->setCredentials("100", "merchant_key");
$maxiPago->setEnvironment("TEST");

    $maxiPago->setLogger(dirname(__FILE__).'/logs','INFO');

	$maxiPago->setDebug(true);

	$data = array(
		"processorID" => "1",
		"referenceNum" => "ORDER2937283",
		"chargeTotal" => "10.00",
		"number" => "4111111111111111",
		"expMonth" => "07",
		"expYear" => "2017",
		"cvvNumber" => "123"
	);
	
	$maxiPago->creditCardAuth($data);

  /lib/  
  |-- maxiPago.php  
  |-- maxipago  
    |-- maxiPagoRequest.php  
    |-- maxiPagoRequestBase.php  
    |-- maxiPagoResponseBase.php  
    |-- maxiPagoServiceBase.php  
    |-- maxiPagoTransaction.php  
    |-- maxiPagoXmlHandler.php