Skip to content

Instantly share code, notes, and snippets.

@tiagomatos
Last active March 23, 2020 21:16
Show Gist options
  • Save tiagomatos/0dd6ca1dff9f797a4bcdd725d3bb090a to your computer and use it in GitHub Desktop.
Save tiagomatos/0dd6ca1dff9f797a4bcdd725d3bb090a to your computer and use it in GitHub Desktop.
facto_hooks.php
// editar webhook
$data = array("event" => "order_paid",
"url" => "https://conexiondes.facto.cl/conector_jumpseller.php?user=$user&password=$pass",
);
$data_hook = json_encode(array("hook" => $data));
$url = "https://api.jumpseller.com/v1/hooks/".$id.".json";
$ch = curl_init();
$headers = array(
'Content-Type: application/json',
'Authorization: Bearer '.$_REQUEST['access_token']
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_hook);
curl_setopt($ch, CURLOPT_URL, $url);
$result_hook = curl_exec($ch);
curl_close($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment