showing results for - "zeamster examples react node"
Bastien
08 Jan 2017
1
2$curl = curl_init();
3$url = 'https://test.url/v2/transactions';
4curl_setopt_array($curl, array(
5    CURLOPT_URL => $url,
6    CURLOPT_RETURNTRANSFER => true,
7    CURLOPT_ENCODING => "",
8    CURLOPT_MAXREDIRS => 10,
9    CURLOPT_TIMEOUT => 30,
10    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11    CURLOPT_CUSTOMREQUEST => "POST",
12    CURLOPT_POSTFIELDS => "{\n
13    \"transaction\": {\n
14            \"transaction_amount\": \"10\",\n
15            \"location_id\": \"1111111111\",\n
16            \"action\": \"sale\"\n
17       }\n}",
18    CURLOPT_HTTPHEADER => array(
19        "content-type: application/json",
20        "developer-id: dev-1234",
21        "user-api-key: 2222222222222222",
22        "user-id: 111111111111111"
23    ),
24));
25
26$response = curl_exec($curl);
27$err = curl_error($curl);
28
29curl_close($curl);
30
31if ($err) {
32    echo "cURL Error #:" . $err;
33} else {
34    echo $response;
35}  
Giada
25 Jun 2019
1{
2    "transaction": {
3        "action": "authonly",
4        "payment_method": "cc",
5        "cvv": "999",
6        "exp_date": "0525",
7        "transaction_amount": "3935.784",
8        "location_id": "11e642cdbf2b816ea0491742",
9        "contact_id": "11e642d0c941b5949679c85e"
10    }
11}