-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from stripe/notifications
Add notifications to stripe-java.
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
src/main/java/com/stripe/model/NotificationCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |