File: /www/exchange2/cmws/samples/client-transaction-merge.php
<?php
/* required includes */
require_once("../../exchange/Bin/constants.php");
require_once("../../exchange/Bin/init.php");
require_once(ROOT_FOLDER."Bin/Security.php");
require_once(ROOT_FOLDER."admin/classes/Model/base_actions.php");
require_once(ROOT_FOLDER."admin/classes/Model/CMSync.php");
/* SAMPLE DATA for d-ETR Receipt TTE Transaction Merge */
$tteArray = array(
"merge_transactions" => array("1720917601", "17209176"),
"merged_transaction" => array(
"role_id" => CM_SYNC_ORG_ROLE_DEBTOR,
"entity_type" => CM_SYNC_ENTITY_ORG,
"entity_id" => "20211213007584",
"related_entity_type" => CM_SYNC_ENTITY_ORG,
"related_entity_id" => "12112001983",
"related_role_id" => CM_SYNC_ORG_ROLE_ORIGINATOR,
"type_field_mapping_id" => CM_SYNC_TTETRANS_DETR_RECEIPT,
"currency_id" => "eur",
"face_value" => "1233.6",
"status_id" => "Posted",
"tax_settings_id" => "Tax Exempt",
"posted_on" => "2021-12-17",
"traded_on" => "2021-12-17",
"exchange_ref_id" => "1720917603",
"fx_rate" => "1.0",
"exchange_transaction_type" => INBOUND_DEBTOR_PAYMENT));
$cmSync = new CMSync();
if (!$cmSync->cmSyncTransactionEnable) {
exit;
}
/* Test Adding New Organisation */
$cmSync->setTransactionData($tteArray, CM_SYNC_TTETRANS_DETR_RECEIPT, CM_SYNC_TTETRANS_MERGE);
$stat = $cmSync->doTransactionMerge();
if ($stat) {
$cmSync->printResponse();
}
else {
echo $cmSync->getErrorMessage();
}