PHP code example of payprocessing / multicarta-sdk

1. Go to this page and download the library: Download payprocessing/multicarta-sdk 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/ */

    

payprocessing / multicarta-sdk example snippets


const URL = 'multicarta url';
const CERTIFICATE_PATH = 'absolute path to certificate';
const PRIVATE_KEY_PATH = 'absolute path to private key';
const MERCHANT = 'your merchant id';
const TDS_VENDOR_MER_ID = 'vendor merchant id';
const TDS_VENDOR_NAME = 'vendor merchant name';
const PAN = 'test card pan';
const EXP_DATE = 'test card date';


$url = '';
$certificatePath = '';
$privateKeyPath = '';
$Merchant = '';
$Amount = '';
$Description = '';
$TDSVendorMerID = '';
$TDSVendorName = '';

$builder = Platron\multicarta\mpi\CreateOrderRequestBuilder(
	$Merchant,
	$Amount,
	$Description,
	$TDSVendorMerID,
	$TDSVendorName
);
$request = $builder->getRequest();
$client = new Platron\multicarta\mpi\Client($certificatePath, $privateKeyPath);
$response = $client->sendRequest($url, $request);
$parser = new Platron\multicarta\mpi\CreateOrderResponseParser($response);

echo $parser->isValid();
echo $parser->isSuccess();
echo $parser->getOrderID();
echo $parser->getSessionID();