-
Notifications
You must be signed in to change notification settings - Fork 30
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 #56 from sailthru/purchase_channel
Add channel, app_id, and device_id to purchases
- Loading branch information
Showing
3 changed files
with
61 additions
and
7 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
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
package com.sailthru.client.params; | ||
|
||
import com.google.gson.reflect.TypeToken; | ||
import com.google.gson.annotations.SerializedName; | ||
import com.google.gson.reflect.TypeToken; | ||
import com.sailthru.client.ApiAction; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.ArrayList; | ||
import java.util.Date; | ||
import java.util.Map; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* | ||
* @author Prajwal Tuladhar <[email protected]> | ||
*/ | ||
public class Purchase extends AbstractApiParams implements ApiParams { | ||
|
||
public enum Channel {app, offline, online} | ||
|
||
protected String email; | ||
protected List<Map<String, Object>> items; | ||
protected Integer incomplete; | ||
|
@@ -40,6 +39,15 @@ public class Purchase extends AbstractApiParams implements ApiParams { | |
@SerializedName("purchase_keys") | ||
protected Map<String, String> purchaseKeys; | ||
|
||
@SerializedName("channel") | ||
protected Channel channel; | ||
|
||
@SerializedName("app_id") | ||
protected String appId; | ||
|
||
@SerializedName("device_id") | ||
protected String deviceId; | ||
|
||
public Purchase setEmail(String email) { | ||
this.email = email; | ||
return this; | ||
|
@@ -118,8 +126,36 @@ public Purchase setPurchaseKeys(Map<String, String> purchaseKeys) { | |
return this; | ||
} | ||
|
||
public Channel getChannel() { | ||
return channel; | ||
} | ||
|
||
public Purchase setChannel(Channel channel) { | ||
this.channel = channel; | ||
return this; | ||
} | ||
|
||
public String getAppId() { | ||
return appId; | ||
} | ||
|
||
public Purchase setAppId(String appId) { | ||
this.appId = appId; | ||
return this; | ||
} | ||
|
||
public String getDeviceId() { | ||
return deviceId; | ||
} | ||
|
||
public Purchase setDeviceId(String deviceId) { | ||
this.deviceId = deviceId; | ||
return this; | ||
} | ||
|
||
@Override | ||
public ApiAction getApiCall() { | ||
return ApiAction.purchase; | ||
} | ||
|
||
} |
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