Skip to content

Commit

Permalink
Merge pull request #5 from stripe/notifications
Browse files Browse the repository at this point in the history
Add notifications to stripe-java.
  • Loading branch information
anurag committed Jan 26, 2012
2 parents ff0657d + 52e01c1 commit 3f1f379
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
63 changes: 63 additions & 0 deletions src/main/java/com/stripe/model/Notification.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.stripe.model;

import java.util.Map;

import com.stripe.exception.StripeException;
import com.stripe.net.APIResource;

public class Notification extends APIResource {
String id;
String event;
String livemode;
Long created;
Map<String, Object> data;

public static Notification retrieve(String id) throws StripeException {
return request(RequestMethod.GET, instanceURL(Notification.class, id), null, Notification.class);
}

public static NotificationCollection all(Map<String, Object> params) throws StripeException {
return request(RequestMethod.GET, classURL(Notification.class), params, NotificationCollection.class);
}

public Map<String, Object> getData() {
return data;
}

public void setData(Map<String, Object> data) {
this.data = data;
}

public Long getCreated() {
return created;
}

public void setCreated(Long created) {
this.created = created;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getEvent() {
return name;
}

public void setEvent(String name) {
this.event = name;
}

public String getLivemode() {
return livemode;
}

public void setLivemode(String livemode) {
this.livemode = livemode;
}

}
21 changes: 21 additions & 0 deletions src/main/java/com/stripe/model/NotificationCollection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.stripe.model;

import java.util.List;

public class NotificationCollection extends StripeObject {
List<Notification> data;
Integer count;

public List<Notification> getData() {
return data;
}
public void setData(List<Notification> data) {
this.data = data;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
}

0 comments on commit 3f1f379

Please sign in to comment.