Unverified Commit c3d3cc69 authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Add subscription validation APIs and runtime functions. (#847)

parent 55a95913
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]

### Added
- Add subscription validation APIs and runtime functions for Google and Apple.

## [3.12.0] - 2022-05-22
### Added
+487 −437

File changed.

Preview size limit exceeded, changes collapsed.

+343 −1

File changed.

Preview size limit exceeded, changes collapsed.

+29 −0
Original line number Diff line number Diff line
@@ -330,6 +330,11 @@ service Nakama {
    option (google.api.http).get = "/v2/user";
  }

  // Get subscription by product id.
  rpc GetSubscription (api.GetSubscriptionRequest) returns (api.ValidatedSubscription) {
    option (google.api.http).get = "/v2/iap/subscription/{product_id}";
  }

  // A healthcheck which load balancers can use to check the service.
  rpc Healthcheck (google.protobuf.Empty) returns (google.protobuf.Empty) {
    option (google.api.http).get = "/healthcheck";
@@ -493,6 +498,14 @@ service Nakama {
    };
  }

  // List user's subscriptions.
  rpc ListSubscriptions (api.ListSubscriptionsRequest) returns (api.SubscriptionList) {
    option (google.api.http) = {
      post: "/v2/iap/subscription",
      body: "*"
    };
  }

  // List current or upcoming tournaments.
  rpc ListTournaments (api.ListTournamentsRequest) returns (api.TournamentList) {
    option (google.api.http).get = "/v2/tournament";
@@ -651,6 +664,14 @@ service Nakama {
    };
  }

  // Validate Apple Subscription Receipt
  rpc ValidateSubscriptionApple (api.ValidateSubscriptionAppleRequest) returns (api.ValidateSubscriptionResponse) {
    option (google.api.http) = {
      post: "/v2/iap/subscription/apple",
      body: "*"
    };
  }

  // Validate Google IAP Receipt
  rpc ValidatePurchaseGoogle (api.ValidatePurchaseGoogleRequest) returns (api.ValidatePurchaseResponse) {
    option (google.api.http) = {
@@ -659,6 +680,14 @@ service Nakama {
    };
  }

  // Validate Google Subscription Receipt
  rpc ValidateSubscriptionGoogle (api.ValidateSubscriptionGoogleRequest) returns (api.ValidateSubscriptionResponse) {
    option (google.api.http) = {
      post: "/v2/iap/subscription/google",
      body: "*"
    };
  }

  // Validate Huawei IAP Receipt
  rpc ValidatePurchaseHuawei (api.ValidatePurchaseHuaweiRequest) returns (api.ValidatePurchaseResponse) {
    option (google.api.http) = {
+337 −77

File changed.

Preview size limit exceeded, changes collapsed.

Loading