Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$amount = $_POST['amount']; // this is dynamic
$name = $_POST['name']; // this is dynamic
$number = $_POST['number']; // this is dynamic
$email = $_POST['email']; // this is dynamic
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$mode.'.instamojo.com/api/1.1/payment-requests/');
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array("X-Api-Key:YOUR_API_KEY",
"X-Auth-Token:YOUR_API_SECRET"));
$payload = Array(
'purpose' => 'HackerRahul Product',
'amount' => $amount,
'phone' => $number,
'buyer_name' => $name,
'redirect_url' => $redirect_url,
'send_email' => true,
'webhook' => $webhook_url,
'send_sms' => true,
'email' => $email,
'allow_repeated_payments' => false
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
$response = curl_exec($ch);
curl_close($ch);
print_r($response);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.