<?php 

function customAssociateOrder($data){
		$header = array(
			'Content-Type: application/json'
		);

		$curl = curl_init();
		curl_setopt($curl, CURLOPT_URL, "https://sandbox.gateway.quadpay.com/orders/associate");
		curl_setopt($curl, CURLOPT_POST, 1);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
		curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
$status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); //Get status
		$result = curl_exec($curl);
		print_r($status_code);
		print_r($result);
		$curlResult = json_decode($result,true);
		$curlError = curl_error($curl);
		curl_close($curl);

		if($curlError){
			print_r( $curlError );	
		}else{
			print_r( $curlResult );
		}
	}

    $merchant_platform_id = "103";
    $order_id = "d8d48a47-34d5-4004-bfbd-af4c22a95db5";
    $associate_data = array();
    $associate_data["orderId"] = $order_id;
    $associate_data["merchantPlatformId"] = $merchant_platform_id;
    echo json_encode($associate_data);
    // customAssociateOrder($associate_data);

?>