• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Question about AppStore SYS_GET_TRANSACTIONS_PAGE behavior in S2S Cloud Code

Scheduled Pinned Locked Moved Unsolved General
2 Posts 2 Posters 12 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by
    #1

    Hi brainCloud team,

    We are implementing an internal monthly revenue settlement tool and need to retrieve App Store IAP transactions for a specific month.

    We observed different behavior depending on how the Cloud Code script is executed.

    Environment

    • App: dev
    • Cloud Code script: S2S callable
    • Service: appStore
    • Operation: SYS_GET_TRANSACTIONS_PAGE

    Case 1: S2S script/RUN without a player session

    Our backend calls the Cloud Code script through S2S script/RUN.

    Inside the script, we tried:

    var appStoreProxy = bridge.getAppStoreServiceProxy();
    var response = appStoreProxy.sysGetTransactionsPage({
      pagination: { rowsPerPage: 50, pageNumber: 1 },
      searchCriteria: {
        type: "itunes",
        pending: false,
        createdAt: { "$gte": monthStart, "$lt": monthEnd }
      },
      sortCriteria: { createdAt: -1 }
    });
    

    This failed with:

    Processing exception: Unrecognized request: service=appStore, operation=SYS_GET_TRANSACTIONS_PAGE.
    

    Case 2: Same script from the brainCloud console after Quick Auth

    When we ran the same Cloud Code script from the brainCloud web console, after Quick Auth created a player session, the request succeeded.

    Case 3: S2S script/RUN, but the script creates a player session explicitly

    We changed the script to create a session from a known dedicated service profileId:

    var userSession = bridge.getSessionForProfile(sessionProfileId);
    var response = bridge.callAPIForSession(userSession, "appStore", "SYS_GET_TRANSACTIONS_PAGE", {
      context: {
        pagination: { rowsPerPage: 50, pageNumber: 1 },
        searchCriteria: {
          type: "itunes",
          pending: false,
          createdAt: { "$gte": monthStart, "$lt": monthEnd }
        },
        sortCriteria: { createdAt: -1 }
      }
    });
    

    This succeeded.

    Questions

    1. Is SYS_GET_TRANSACTIONS_PAGE expected to require a player session, even when called from S2S Cloud Code?
    2. Is there an official or recommended way to retrieve app-wide IAP transactions for a monthly settlement report without using an arbitrary player profile session?
    3. If a player session is required, is it safe to use a dedicated internal/service profileId and omit profileId from searchCriteria to retrieve app-wide transactions?
    4. Is the Unrecognized request error expected in this case, or should this be reported as a bug, permission issue, or app configuration issue?

    Thanks.

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote last edited by
    #2

    Hmm - we'll look into it. Definitely looks like it isn't hooked up to the S2S proxy properly.

    Thanks for reporting this.

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users