HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
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();
}