YoYoGames / GMEXT-EpicOnlineServices

Repository for GameMaker's Epic Online Services Extension
Other
11 stars 2 forks source link

[FEATURE REQUEST] Ecommerce module support (DLC functions) #13

Open EpiphanySamCarey opened 1 week ago

EpiphanySamCarey commented 1 week ago

It would be great if support for the Ecommerce library could be added, specifically to check for owned/installed DLC.

DiasFranciscoA commented 1 week ago

[internal] This is the reference for the ECommerce Module

https://dev.epicgames.com/docs/api-ref/interfaces/ecom

jzavala-YYG commented 1 week ago

Little update: I already succeed the first check out flow.

image
jzavala-YYG commented 1 day ago

void EpicGames_Ecom_QueryOwnership(user,CatalogItemIds,catalogNamespace);

Parameters @param {string} user The Epic Account ID of the local user whose ownership to query @param {array} CatalogItemIds The array of Catalog Item IDs to check for ownership @param {string} catalogNamespace Optional product namespace, if not the one specified during initialization

Query the ownership status for a given list of catalog item IDs defined with Epic Online Services. This data will be cached for a limited time and retrieved again from the backend when necessary Depending on the number of catalog item ids passed, the SDK splits the query into smaller batch requests to the backend and aggregates the result. Note If one of the request batches fails, no data is cached and the entire query is marked as failed.

ASYNC CALLBACK

type "EpicGames_Ecom_QueryOwnership"
identifier The asynchronous listener ID
status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors 
status_message Text representation of the status code 
account_id The Epic Account ID of the local user whose ownership was queried

void EpicGames_Ecom_QueryOwnershipBySandboxIds();

Parameters

@param {string} user The Epic Account ID of the local user whose ownership to query. @param {array} SandboxIds The array of Sandbox IDs to check for ownership.

Query the ownership status of all catalog item IDs under the given list of Sandbox IDs defined with Epic Online Services. This data will be cached for a limited time and retrieved again from the backend when necessary.

ASYNC CALLBACK type "EpicGames_Ecom_QueryOwnershipBySandboxIds" identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the local user whose ownership was queried


void EpicGames_Ecom_QueryOwnershipToken();

@param {string} user The Epic Account ID of the local user whose ownership token you want to query @param {array} CatalogItemIds The array of Catalog Item IDs to check for ownership, matching in number to the CatalogItemIdCount

Query the ownership status for a given list of catalog item IDs defined with Epic Online Services. The data is return via the callback in the form of a signed JWT that should be verified by an external backend server using a public key for authenticity.

ASYNC CALLBACK type "EpicGames_Ecom_QueryOwnershipToken" identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the local user whose ownership token was queried ownership_token @param {String} Ownership token containing details about the catalog items queried


void EpicGames_Ecom_QueryEntitlements();

@param {string} user The Epic Account ID of the local user whose Entitlements you want to retrieve @param {array} EntitlementNames An array of Entitlement Names that you want to check @param {bool} bIncludeRedeemed If true, Entitlements that have been redeemed will be included in the results

Query the entitlement information defined with Epic Online Services. A set of entitlement names can be provided to filter the set of entitlements associated with the account. This data will be cached for a limited time and retrieved again from the backend when necessary. Depending on the number of entitlements passed, the SDK splits the query into smaller batch requests to the backend and aggregates the result. Note If one of the request batches fails, no data is cached and the entire query is marked as failed. Use EpicGames_Ecom_CopyEntitlementByIndex, EpicGames_Ecom_CopyEntitlementByNameAndIndex, and EpicGames_Ecom_CopyEntitlementById to get the entitlement details. Use EpicGames_Ecom_GetEntitlementsByNameCount to retrieve the number of entitlements with a specific entitlement name.

ASYNC CALLBACK type "EpicGames_Ecom_QueryEntitlements identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the local user whose entitlement was queried


void EpicGames_Ecom_QueryEntitlementToken();

@param {string} user The Epic Account ID of the local user whose Entitlements you want to retrieve @param {array} EntitlementNames An array of Entitlement Names that you want to check

Query the entitlement verification status defined with Epic Online Services. An optional set of entitlement names can be provided to filter the set of entitlements associated with the account. The data is return via the callback in the form of a signed JWT that should be verified by an external backend server using a public key for authenticity.

ASYNC CALLBACK type "EpicGames_Ecom_QueryEntitlementToken identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the local user whose entitlement was queried entitlement_token @param {String} Entitlements token containing details about the catalog items queried


void EpicGames_Ecom_QueryOffers();

@param {string} user The Epic Account ID of the local user whose offer to query @param {string} OverrideCatalogNamespace If not provided then the SandboxId is used as the catalog namespace

Query for a list of catalog offers defined with Epic Online Services. This data will be cached for a limited time and retrieved again from the backend when necessary.

ASYNC CALLBACK type "EpicGames_Ecom_QueryOffers identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the local user whose offer was queried; needed for localization of Catalog Item (Item) description text and pricing information


void EpicGames_Ecom_Checkout();

@param {string} user The Epic Account ID of the local user who is making the purchase @param {array} Entries An array of EOS_Ecom_CheckoutEntry elements, each containing the details of a single offer @param {string} OverrideCatalogNamespace The catalog namespace will be the current Sandbox ID (in EOS_Platform_Options) unless overridden by this field

Initiates the purchase flow for a set of offers. The callback is triggered after the purchase flow. On success, the set of entitlements that were unlocked will be cached. On success, a Transaction ID will be returned. The Transaction ID can be used to obtain an EpicGames_Ecom_HTransaction handle. The handle can then be used to retrieve the entitlements rewarded by the purchase.

ASYNC CALLBACK type "EpicGames_Ecom_Checkout identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the user who initiated the purchase transaction_id @param {String} The transaction ID which can be used to obtain an EOS_Ecom_HTransaction using EOS_Ecom_CopyTransactionById. */ offer_ids {array} Array of offer ids


void EpicGames_Ecom_RedeemEntitlements();

@param {string} user The Epic Account ID of the user who is redeeming Entitlements @param {array} EntitlementIds The array of Entitlements to redeem

Requests that the provided entitlement be marked redeemed. This will cause that entitlement to no longer be returned from QueryEntitlements unless the include redeemed request flag is set true.

ASYNC CALLBACK type "EpicGames_Ecom_RedeemEntitlements identifier The asynchronous listener ID status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors The EOS_EResult code for the operation. EOS_Success indicates that the operation succeeded; other codes indicate errors. status_message Text representation of the status code account_id The Epic Account ID of the user who has redeemed entitlements redeemed_entitlement_ids_count The number of redeemed Entitlements


int EpicGames_Ecom_GetLastRedeemedEntitlementsCount();

@param {string} user The Epic Account ID of the local user for who to retrieve the last redeemed entitlements count @returns {real}

Fetch the number of entitlements that were redeemed during the last EpicGames_Ecom_RedeemEntitlements call. @param Options structure containing the Epic Account ID @return the number of the redeemed entitlements.


String EpicGames_Ecom_CopyLastRedeemedEntitlementByIndex();

@param {string} user The Epic Account ID of the local user whose last redeemed entitlement id is being copied @param {real} RedeemedEntitlementIndex Index of the last redeemed entitlement id to retrieve from the cache @returns {string}

Fetches a redeemed entitlement id from a given index. Only entitlements that were redeemed during the last EpicGames_Ecom_RedeemEntitlements call can be copied.


int EpicGames_Ecom_GetEntitlementsCount();

@param {string} user The Epic Account ID of the local user for which to retrieve the entitlement count @returns {real}

Fetch the number of entitlements that are cached for a given local user. @return the number of entitlements found.


int EpicGames_Ecom_GetEntitlementsByNameCount();

@param {string} user The Epic Account ID of the local user for which to retrieve the entitlement count @param {string} entitlementName Name of the entitlement to count in the cache @returns {real}

Fetch the number of entitlements with the given Entitlement Name that are cached for a given local user. @return the number of entitlements found.


Entitlement

status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors
status_message Text representation of the status code

if success Redeemed If true then the catalog has this entitlement marked as redeemed CatalogItemId ID of the item associated with the offer which granted this entitlement EndTimestamp If not -1 then this is a POSIX timestamp that this entitlement will end EntitlementId ID of the entitlement owned by an account EntitlementName Name of the entitlement ServerIndex If queried using pagination then ServerIndex represents the index of the entitlement as it * exists on the server. If not queried using pagination then ServerIndex will be -1.


Struct(Entitlement) EpicGames_Ecom_CopyEntitlementByIndex();

@param {string} user The Epic Account ID of the local user whose entitlement is being copied @param {real} index Index of the entitlement to retrieve from the cache @returns {struct}

Fetches an entitlement from a given index.


Struct(Entitlement) EpicGames_Ecom_CopyEntitlementByNameAndIndex();

@param {string} user The Epic Account ID of the local user whose entitlement is being copied @param {string} EntitlementName Name of the entitlement to retrieve from the cache @param {real} Index Index of the entitlement within the named set to retrieve from the cache. @returns {struct}

Fetches a single entitlement with a given Entitlement Name. The Index is used to access individual entitlements among those with the same Entitlement Name. The Index can be a value from 0 to one less than the result from EpicGames_Ecom_GetEntitlementsByNameCount.


Struct(Entitlement) EpicGames_Ecom_CopyEntitlementById();

@param {string} user The Epic Account ID of the local user whose entitlement is being copied @param {string} EntitlementName ID of the entitlement to retrieve from the cache @returns {struct}

Fetches the entitlement with the given ID.


int EpicGames_Ecom_GetOfferCount(const EpicGames_Ecom_GetOfferCountOptions* Options);

@param {string} user The Epic Account ID of the local user whose offers are being accessed @returns {real}

Fetch the number of offers that are cached for a given local user. @return the number of offers found.


CatalogOffer

status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors
status_message Text representation of the status code

if success

bAvailableForPurchase True if the user can purchase this offer.
CatalogNamespace Product namespace in which this offer exists
CurrencyCode The Currency Code for this offer
CurrentPrice64 The current price including discounts of this offer as a 64-bit number.
DecimalPoint The decimal point for the provided price.  For example, DecimalPoint '2' and CurrentPrice64 '12345' would be '123.45'.
DescriptionText Localized UTF-8 description of this offer
DiscountPercentage A value from 0 to 100 define the percentage of the OrignalPrice that the CurrentPrice represents
EffectiveDateTimestamp Timestamp indicating the effective date of the offer. Can be ignored if set to -1.
Id The ID of this offer
LongDescriptionText Localized UTF-8 long description of this offer
OriginalPrice64 The original price of this offer as a 64-bit number
PriceResult      * If this value is EOS_Success then OriginalPrice, CurrentPrice, and DiscountPercentage contain valid data.* Otherwise this value represents the error that occurred on the price query.
PurchaseLimit The maximum number of times that the offer can be purchased.* A negative value implies there is no limit.
ReleaseDateTimestamp Timestamp indicating when the time when the offer was released. Can be ignored if set to -1.
ServerIndex * The index of this offer as it exists on the server. * This is useful for understanding pagination data.
TitleText Localized UTF-8 title of this offer

Struct(CatalogOffer) EpicGames_Ecom_CopyOfferByIndex();

@param {string} user The Epic Account ID of the local user whose offer is being copied @param {real} OfferIndex The index of the offer to get. @returns {struct}

Fetches an offer from a given index. The pricing and text are localized to the provided account.


Struct(CatalogOffer) EpicGames_Ecom_CopyOfferById();

@param {string} user The Epic Account ID of the local user whose offer is being copied @param {string} OfferId The ID of the offer to get. @returns {struct}

Fetches an offer with a given ID. The pricing and text are localized to the provided account.


int EpicGames_Ecom_GetOfferItemCount();

@param {string} user The Epic Account ID of the local user who made the initial request for the Catalog Offer through EOS_Ecom_QueryOffers @param {string} OfferId An ID that corresponds to a cached Catalog Offer (retrieved by EOS_Ecom_CopyOfferByIndex) @returns {real}

Fetch the number of items that are associated with a given cached offer for a local user.

@return the number of items found.


CatalogItem { status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors status_message Text representation of the status code

if success

/*YYStructAddBool(&Struct, "bAvailableForPurchase", data->ApiVersion);*/
CatalogNamespace Product namespace in which this item exists
DescriptionText Localized UTF-8 description of this item
DeveloperText Localized UTF-8 developer of this item
EntitlementEndTimestamp If not -1 then this is the POSIX timestamp that the entitlement will end
EntitlementName The entitlement name associated with this item
Id The ID of this item
ItemType The type of item as defined in the catalog TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
LongDescriptionText Localized UTF-8 long description of this item
TechnicalDetailsText Localized UTF-8 technical details of this item 
TitleText Localized UTF-8 title of this item

Struct(CatalogItem) EpicGames_Ecom_CopyOfferItemByIndex();

@param {string} user The Epic Account ID of the local user whose item is being copied @param {string} OfferId The ID of the offer to get the items for. @param {real} ItemIndex The index of the item to get @returns {struct}

Fetches an item from a given index.


Struct(CatalogItem) EpicGames_Ecom_CopyItemById();

@param {string} user The Epic Account ID of the local user whose item is being copied @param {string} ItemId The ID of the item to get. @returns {struct}

Fetches an item with a given ID.


int EpicGames_Ecom_GetOfferImageInfoCount();

@param {string} user The Epic Account ID of the local user whose offer image is being accessed. @param {string} OfferId The ID of the offer to get the images for. @returns {real}

Fetch the number of images that are associated with a given cached offer for a local user.

@return the number of images found.


KeyImageInfo status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors status_message Text representation of the status code

if success

Height The expected height in pixels of the image
Width The expected width in pixels of the image
Type Describes the usage of the image (ex home_thumbnail)
Url The URL of the image

Struct(KeyImageInfo) EpicGames_Ecom_CopyOfferImageInfoByIndex();

@param {string} user The Epic Account ID of the local user whose offer image is being copied. @param {string} OfferId The ID of the offer to get the images for. @param {real} ImageInfoIndex The index of the image to get. @returns {struct}

Fetches an image from a given index.


int EpicGames_Ecom_GetItemImageInfoCount();

@param {string} user The Epic Account ID of the local user whose item image is being accessed @param {string} ItemId The ID of the item to get the images for. @returns {real}

Fetch the number of images that are associated with a given cached item for a local user.

@return the number of images found.


Struct(KeyImageInfo) EpicGames_Ecom_CopyItemImageInfoByIndex();

@param {string} user The Epic Account ID of the local user whose item image is being copied @param {string} ItemId The ID of the item to get the images for. double ImageInfoIndex The index of the image to get. @returns {struct}

Fetches an image from a given index.


int EpicGames_Ecom_GetItemReleaseCount();

@param {string} user The Epic Account ID of the local user whose item release is being accessed @param {string} ItemId The ID of the item to get the releases for. @returns {real}

Fetch the number of releases that are associated with a given cached item for a local user.

@return the number of releases found.


CatalogRelease

status The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors
status_message Text representation of the status code

if success

CompatibleAppIds An array of compatible APP IDs
CompatiblePlatforms An list of compatible Platforms 
ReleaseNote Release note for compatible versions

Struct(CatalogRelease) EpicGames_Ecom_CopyItemReleaseByIndex();

@param {string} user The Epic Account ID of the local user whose item release is being copied @param {string} ItemId The ID of the item to get the releases for. @param {real} ReleaseIndex The index of the release to get. @returns {struct}

Fetches a release from a given index.


int EpicGames_Ecom_GetTransactionCount();

@param {string} user The Epic Account ID of the local user whose transaction count to get @returns {real}

Fetch the number of transactions that are cached for a given local user. @return the number of transactions found.


{string} EpicGames_Ecom_Transaction_GetTransactionIdByIndexTransaction

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {real} user The index of the transaction to get @returns {string}

The Ecom Transaction Interface exposes getters for accessing information about a completed transaction. All Ecom Transaction Interface calls take a handle of type EOS_Ecom_HTransaction as the first parameter.


//////////NO SENSE {string} EpicGames_Ecom_Transaction_GetTransactionIdByIdTransaction

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {string} TransactionId The ID of the transaction to get @returns {string}

The Ecom Transaction Interface exposes getters for accessing information about a completed transaction. All Ecom Transaction Interface calls take a handle of type EOS_Ecom_HTransaction as the first parameter.


{real} EpicGames_Ecom_Transaction_GetEntitlementsCountByIndexTransaction

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {real} user The index of the transaction to get @returns {real}

Fetch the number of entitlements that are part of this transaction.


{real} EpicGames_Ecom_Transaction_GetEntitlementsCountByIdTransaction

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {string} TransactionId The ID of the transaction to get @returns {real}

Fetch the number of entitlements that are part of this transaction.


{Entitlement} EpicGames_Ecom_Transaction_CopyEntitlementByIndexByIndexTransaction()

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {real} user The index of the transaction to get @param {real} EntitlementIndex The index of the entitlement to get @returns {struct}

Fetches an entitlement from a given index.


{Entitlement} EpicGames_Ecom_Transaction_CopyEntitlementByIndexByIdTransaction()

Parameters @param {string} user The Epic Account ID of the local user who is associated with the transaction @param {string} TransactionId The ID of the transaction to get @param {real} EntitlementIndex The index of the entitlement to get @returns {struct}

Fetches an entitlement from a given index.