curl -X PATCH "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/<event_name>/events/<event_id>" \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "5e558e18-c4dc-41e9-b641-64b836ddd71f",
"payment_id": "b75a4182-b3ff-4c13-a08d-b6a5107f9cfb",
"status": "APPROVED"
}'
const response = await fetch(`https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/${event_name}/events/${event_id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"idempotency_key": "5e558e18-c4dc-41e9-b641-64b836ddd71f",
"payment_id": "b75a4182-b3ff-4c13-a08d-b6a5107f9cfb",
"status": "APPROVED"
})
});
const data = await response.json();
import requests
response = requests.request(
"PATCH",
"https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/{event_name}/events/{event_id}",
json={
"idempotency_key": "5e558e18-c4dc-41e9-b641-64b836ddd71f",
"payment_id": "b75a4182-b3ff-4c13-a08d-b6a5107f9cfb",
"status": "APPROVED"
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/<event_name>/events/<event_id>");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"idempotency_key": "5e558e18-c4dc-41e9-b641-64b836ddd71f",
"payment_id": "b75a4182-b3ff-4c13-a08d-b6a5107f9cfb",
"status": "APPROVED"
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("PATCH", "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/<event_name>/events/<event_id>", strings.NewReader(`{
"idempotency_key": "5e558e18-c4dc-41e9-b641-64b836ddd71f",
"payment_id": "b75a4182-b3ff-4c13-a08d-b6a5107f9cfb",
"status": "APPROVED"
}`))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/<event_name>/events/<event_id>"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"idempotency_key\": \"5e558e18-c4dc-41e9-b641-64b836ddd71f\",\n \"payment_id\": \"b75a4182-b3ff-4c13-a08d-b6a5107f9cfb\",\n \"status\": \"APPROVED\"\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions/<event_name>/events/<event_id>")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request.body = "{\n \"idempotency_key\": \"5e558e18-c4dc-41e9-b641-64b836ddd71f\",\n \"payment_id\": \"b75a4182-b3ff-4c13-a08d-b6a5107f9cfb\",\n \"status\": \"APPROVED\"\n}"
response = http.request(request)
puts response.body