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
somentelucas edited this page Sep 3, 2018
·
11 revisions
It's the best way to sync status from Moip with your system. 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! 🙌📢
import static br.com.moip.helpers.PayloadFactory.payloadFactory;
import static br.com.moip.helpers.PayloadFactory.value;
Index
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
List events = new ArrayList();
events.add("ORDER.*");
events.add("PAYMENT.AUTHORIZED");
events.add("PAYMENT.CANCELLED");
Map<String, Object> body = payloadFactory(
value("events", events),
value("target", "https://my.site.com/test/receive_notifications"),
value("media", "WEBHOOK")
);
Map<String, Object> newPreference = Moip.API.notificationPreferences().create(body, setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> getResponse = Moip.API.notificationPreferences().get("notification_preference_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
List<Map<String, Object>> listResponse = Moip.API.notificationPreferences().list(setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> response = Moip.API.notificationPreferences().remove("notification_preference_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
You should send the ID of the resource that you want to check (order, payment, refund, etc).
Map<String, Object> response = Moip.API.webhooks().get("resource_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> response = Moip.API.webhooks().list(setup);