$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.tabapay.ir/v1/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('amount' => '10000','callbackURL' => 'https://test.ir','mobile'
=> '09900000000','email' => 'info@test.ir'),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.tabapay.ir/v1/create"
payload = {'amount': '10000',
'callbackURL': 'https://test.ir',
'mobile': '09900000000',
'email': 'info@test.ir'}
files=[
]
headers = {
'Authorization': 'Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.tabapay.ir/v1/create',
'headers': {
'Authorization': 'Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
},
formData: {
'amount': '10000',
'callbackURL': 'https://test.ir',
'mobile': '09900000000',
'email': 'info@test.ir'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post,
"https://api.tabapay.ir/v1/create");
request.Headers.Add("Authorization", "Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
var content = new MultipartFormDataContent();
content.Add(new StringContent("10000"), "amount");
content.Add(new StringContent("https://test.ir"), "callbackURL");
content.Add(new StringContent("09900000000"), "mobile");
content.Add(new StringContent("info@test.ir"), "email");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());