Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Notifications

Matheus B. Nakaya edited this page Jul 11, 2018 · 11 revisions

Introduction

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! 🙌📢

Notification Preference

Dependencies

TO DO

Features

Index

Create notification preference

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 = Moip.API.notificationPreferences().create(body, setup);

Get notification preference

Map<String, Object> getResponse = Moip.API.notificationPreferences().get("notification_preference_id", setup);

List notification preferences

List<Map<String, Object>> listResponse = Moip.API.notificationPreferences().list(setup);

Remove notification preference

Map<String, Object> response = Moip.API.notificationPreferences().remove("notification_preference_id", setup);

Webhooks

Dependencies

TO DO

Features

Index

Get webhook

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);

List webhooks

Map<String, Object> response = Moip.API.webhooks().list(setup);
Clone this wiki locally