braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 99 forks source link

Is there a way of creating webhook endpoints programmatically via the API, like in Stripe? #107

Closed Osiris-Team closed 2 years ago

Osiris-Team commented 2 years ago

In stripe you can create webhook endpoints like this:

Stripe.apiKey = "sk_test_51JrnW1IX00iKYn4i6QHP00cJJWn9gd2w4zKqi5AT2i9wodAQl0rfSx8oDwTdmzNPYFvLM9SkWQtT9ofUcqCEiXQ300ndCI9rVZ";

List<Object> enabledEvents = new ArrayList<>();
enabledEvents.add("charge.failed");
enabledEvents.add("charge.succeeded");
Map<String, Object> params = new HashMap<>();
params.put(
  "url",
  "https://example.com/my/webhook/endpoint"
);
params.put("enabled_events", enabledEvents);

WebhookEndpoint webhookEndpoint =
  WebhookEndpoint.create(params);

Example taken from here: https://stripe.com/docs/api/webhook_endpoints/create Is it possible to do something similar with this java braintree api, or the braintree graphQL api?

Osiris-Team commented 2 years ago

Also related: Is it possible to list the registered webhook endpoints/urls of a Braintree account?

DPoplin commented 2 years ago

Hey @Osiris-Team currently the only way of creating webhooks is via the Braintree Control Panel. That said, we will be forwarding this onto the appropriate engineering team for their review.

Similarly to the above, you can view the registered webhook URLs within the Control Panel. Available webhook kinds are shown in our webhook documentation.