<?php
// Define the URL and the data
$url = "https://s...content-available-to-author-only...c.in/api/v2/createMerchantToken";
$data = [
'mid' => 'Your Merchant ID', // Replace with your Merchant ID
'password' => 'Your Account Password' // Replace with your Account Password
];
// Initialize cURL
// Set cURL options
'Content-Type: application/json',
]);
// Execute cURL request
// Check for errors
if ($response === false) {
}
// Close cURL session
// Decode the JSON response
// Check the response
if ($responseData['status'] === true) {
echo "Response received: ";
} else {
echo "Error: " . $responseData['msg'];
}
?>
PD9waHAKCi8vIERlZmluZSB0aGUgVVJMIGFuZCB0aGUgZGF0YQokdXJsID0gImh0dHBzOi8vcy4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uYy5pbi9hcGkvdjIvY3JlYXRlTWVyY2hhbnRUb2tlbiI7CiRkYXRhID0gWwogICAgJ21pZCcgPT4gJ1lvdXIgTWVyY2hhbnQgSUQnLCAvLyBSZXBsYWNlIHdpdGggeW91ciBNZXJjaGFudCBJRAogICAgJ3Bhc3N3b3JkJyA9PiAnWW91ciBBY2NvdW50IFBhc3N3b3JkJyAvLyBSZXBsYWNlIHdpdGggeW91ciBBY2NvdW50IFBhc3N3b3JkCl07CgovLyBJbml0aWFsaXplIGNVUkwKJGNoID0gY3VybF9pbml0KCR1cmwpOwoKLy8gU2V0IGNVUkwgb3B0aW9ucwpjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfUE9TVCwgdHJ1ZSk7CmN1cmxfc2V0b3B0KCRjaCwgQ1VSTE9QVF9SRVRVUk5UUkFOU0ZFUiwgdHJ1ZSk7CmN1cmxfc2V0b3B0KCRjaCwgQ1VSTE9QVF9QT1NURklFTERTLCBqc29uX2VuY29kZSgkZGF0YSkpOwpjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfSFRUUEhFQURFUiwgWwogICAgJ0NvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbicsCiAgICAnQ29udGVudC1MZW5ndGg6ICcgLiBzdHJsZW4oanNvbl9lbmNv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