Skip to content

Commit

Permalink
https://api.playfab.com/releaseNotes/#160919
Browse files Browse the repository at this point in the history
  • Loading branch information
pgilmorepf committed Sep 19, 2016
2 parents a391cfe + 35c4639 commit 1a34464
Show file tree
Hide file tree
Showing 14 changed files with 1,728 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.36.160912";
public static String SdkVersion = "0.37.160919";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.36.160912";
public static String SdkVersionString = "JavaSDK-0.37.160919";

public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
public static ErrorCallback GlobalErrorHandler;
Expand Down
4 changes: 2 additions & 2 deletions PlayFabClientSDK/src/com/playfab/PlayFabSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.36.160912";
public static String SdkVersion = "0.37.160919";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.36.160912";
public static String SdkVersionString = "JavaSDK-0.37.160919";

public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
public static ErrorCallback GlobalErrorHandler;
Expand Down
116 changes: 116 additions & 0 deletions PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,64 @@ private static PlayFabResult<IncrementPlayerStatisticVersionResult> privateIncre
return pfResult;
}

/**
* Attempts to process an order refund through the original real money payment provider.
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<RefundPurchaseResponse>> RefundPurchaseAsync(final RefundPurchaseRequest request) {
return new FutureTask(new Callable<PlayFabResult<RefundPurchaseResponse>>() {
public PlayFabResult<RefundPurchaseResponse> call() throws Exception {
return privateRefundPurchaseAsync(request);
}
});
}

/**
* Attempts to process an order refund through the original real money payment provider.
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<RefundPurchaseResponse> RefundPurchase(final RefundPurchaseRequest request) {
FutureTask<PlayFabResult<RefundPurchaseResponse>> task = new FutureTask(new Callable<PlayFabResult<RefundPurchaseResponse>>() {
public PlayFabResult<RefundPurchaseResponse> call() throws Exception {
return privateRefundPurchaseAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Attempts to process an order refund through the original real money payment provider.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<RefundPurchaseResponse> privateRefundPurchaseAsync(final RefundPurchaseRequest request) throws Exception {
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/RefundPurchase", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<RefundPurchaseResponse>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<RefundPurchaseResponse> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<RefundPurchaseResponse>>(){}.getType());
RefundPurchaseResponse result = resultData.data;

PlayFabResult<RefundPurchaseResponse> pfResult = new PlayFabResult<RefundPurchaseResponse>();
pfResult.Result = result;
return pfResult;
}

/**
* Completely removes all statistics for the specified user, for the current game
*/
Expand Down Expand Up @@ -1292,6 +1350,64 @@ private static PlayFabResult<ResetUserStatisticsResult> privateResetUserStatisti
return pfResult;
}

/**
* Attempts to resolve a dispute with the original order's payment provider.
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<ResolvePurchaseDisputeResponse>> ResolvePurchaseDisputeAsync(final ResolvePurchaseDisputeRequest request) {
return new FutureTask(new Callable<PlayFabResult<ResolvePurchaseDisputeResponse>>() {
public PlayFabResult<ResolvePurchaseDisputeResponse> call() throws Exception {
return privateResolvePurchaseDisputeAsync(request);
}
});
}

/**
* Attempts to resolve a dispute with the original order's payment provider.
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<ResolvePurchaseDisputeResponse> ResolvePurchaseDispute(final ResolvePurchaseDisputeRequest request) {
FutureTask<PlayFabResult<ResolvePurchaseDisputeResponse>> task = new FutureTask(new Callable<PlayFabResult<ResolvePurchaseDisputeResponse>>() {
public PlayFabResult<ResolvePurchaseDisputeResponse> call() throws Exception {
return privateResolvePurchaseDisputeAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Attempts to resolve a dispute with the original order's payment provider.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<ResolvePurchaseDisputeResponse> privateResolvePurchaseDisputeAsync(final ResolvePurchaseDisputeRequest request) throws Exception {
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/ResolvePurchaseDispute", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<ResolvePurchaseDisputeResponse>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<ResolvePurchaseDisputeResponse> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<ResolvePurchaseDisputeResponse>>(){}.getType());
ResolvePurchaseDisputeResponse result = resultData.data;

PlayFabResult<ResolvePurchaseDisputeResponse> pfResult = new PlayFabResult<ResolvePurchaseDisputeResponse>();
pfResult.Result = result;
return pfResult;
}

/**
* Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval.
*/
Expand Down
58 changes: 58 additions & 0 deletions PlayFabSDK/src/com/playfab/PlayFabAdminModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,30 @@ public static class RandomResultTableListing {

}

public static class RefundPurchaseRequest {
/**
* Unique PlayFab assigned ID of the user on whom the operation will be performed.
*/
public String PlayFabId;
/**
* Unique order ID for the purchase in question.
*/
public String OrderId;
/**
* Reason for refund. In the case of Facebook this must match one of their refund or dispute resolution enums (See: https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds)
*/
public String Reason;

}

public static class RefundPurchaseResponse {
/**
* The order's updated purchase status.
*/
public String PurchaseStatus;

}

public static enum Region {
USCentral,
USEast,
Expand Down Expand Up @@ -1991,6 +2015,40 @@ public static class ResetUserStatisticsResult {

}

public static enum ResolutionOutcome {
Revoke,
Reinstate,
Manual
}

public static class ResolvePurchaseDisputeRequest {
/**
* Unique PlayFab assigned ID of the user on whom the operation will be performed.
*/
public String PlayFabId;
/**
* Unique order ID for the purchase in question.
*/
public String OrderId;
/**
* Reason for refund. In the case of Facebook this must match one of their refund or dispute resolution enums (See: https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds)
*/
public String Reason;
/**
* Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and Manual. Manual will cause no change to the order state.
*/
public ResolutionOutcome Outcome;

}

public static class ResolvePurchaseDisputeResponse {
/**
* The order's updated purchase status.
*/
public String PurchaseStatus;

}

public static class ResultTableNode {
/**
* Whether this entry in the table is an item or a link to another table
Expand Down
48 changes: 48 additions & 0 deletions PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ public static class AuthUserResponse {

}

public static class DeregisterGameRequest {
/**
* Unique identifier for the Game Server Instance that is being deregistered.
*/
public String LobbyId;

}

public static class DeregisterGameResponse {

}

/**
* A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData.
*/
Expand Down Expand Up @@ -139,6 +151,42 @@ public static enum Region {
Australia
}

public static class RegisterGameRequest {
/**
* IP address of the Game Server Instance.
*/
public String ServerHost;
/**
* Port number for communication with the Game Server Instance.
*/
public String ServerPort;
/**
* Unique identifier of the build running on the Game Server Instance.
*/
public String Build;
/**
* Unique identifier of the build running on the Game Server Instance.
*/
public Region Region;
/**
* Unique identifier of the build running on the Game Server Instance.
*/
public String GameMode;
/**
* Tags for the Game Server Instance
*/
public Map<String,String> Tags;

}

public static class RegisterGameResponse {
/**
* Unique identifier generated for the Game Server Instance that is registered.
*/
public String LobbyId;

}

public static class StartGameRequest {
/**
* Unique identifier of the previously uploaded build executable which is to be started.
Expand Down
Loading

0 comments on commit 1a34464

Please sign in to comment.