This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Notifications
Matheus B. Nakaya edited this page Jul 5, 2018
·
11 revisions
Do you want to know what's happening with your business and be notified when an order is created, when a payment is authorized or canceled or when other things happen in your account? So, this page may help you! 🙌📢
Index
List events = new ArrayList();
events.add("ORDER.*");
events.add("PAYMENT.AUTHORIZED");
events.add("PAYMENT.CANCELLED");
Map<String, Object> body = new HashMap<>();
body.put("events", events);
body.put("target", "https://my.site.com/test/receive_notifications");
body.put("media", "WEBHOOK");
Map<String, Object> newPreference = notificationPreference.create(body, setup);
Map<String, Object> getResponse = notificationPreference.get("notification_preference_id", setup);
List<Map<String, Object>> listResponse = notificationPreference.list(setup);
Map<String, Object> response = notificationPreference.remove("notification_preference_id", setup);
Index
You should send the ID of the resource that you want to check (order, payment, refund, etc).
Map<String, Object> response = webhook.get("resource_id", setup);
Map<String, Object> response = webhook.list(setup);