sdk pro code link 2
subscription2.php > link name
<?php
$r=$_POST['rno'];
$otp=$_POST['otp'];
// Request data
$requestData = array(
"applicationId" => "APP_111807",
"password" => "42c778a3c667cd851603784441f71245",
"referenceNo" => $r,
"otp" => $otp
);
// Convert request data to JSON
$requestJson = json_encode($requestData);
// cURL options
$url = "https://developer.bdapps.com/subscription/otp/verify";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestJson);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Content-Length: " . strlen($requestJson)
));
// Send cURL request and get response
$responseJson = curl_exec($ch);
// Check for errors
if ($responseJson === false) {
echo "cURL error: " . curl_error($ch);
} else {
// Decode JSON response
$response = json_decode($responseJson, true);
// Handle response
if ($response === null) {
echo "Invalid JSON in response: " . $responseJson;
} else {
/*
echo "Status code: " . $response["statusCode"] . "\n";
echo "Status detail: " . $response["statusDetail"] . "\n";
echo "Subscriber ID: " . $response["subscriberId"] . "\n";
echo "Subscription status: " . $response["subscriptionStatus"] . "\n";
echo "Version: " . $response["version"] . "\n";
*/
$requestData = array(
"statusCode" => $response["statusCode"],
"statusDetail" => $response["statusDetail"],
"statusDetail" => $response["subscriberId"],
"referenceNo" => $response["referenceNo"]
);
echo json_encode($requestData);
}
}
// Close cURL session
curl_close($ch);
?>
No comments