跳到主要内容

Client MidasGlobal API Reference

Games published by Tencent can use the payment service provided by Midas to implement the purchase of items or currency in PGOS. Games from other publishing channels can achieve similar functionality through the Third-party Platform Purchase capability provided by PGOS.

API List

APIDescription
GetMidasGlobalAddonInfoRetrieve the necessary information from the Midas Global addon.
SetMidasGlobalMetaDataSet the meta data for using the Midas service in PGOS. Please make sure to call the GetMidasGlobalAddonInfo interface to retrieve the necessary parameters before calling this interface, .
GetMidasGlobalMetaDataThis interface will return Midas meta data that set with SetMidasGlobalMetaData interface by game.
CreateMidasGlobalOrderCreate a Midas order for purchasing real-money items. FATAL: Please note that paying for orders obtained through this interface will increase the Midas payment assets for the specific role ID of the player. So, please ensure that you have set and retrieved the correct role ID through the SetMidasGlobalMetaData interface before calling this interface, .
GetMidasGlobalBalanceDetailUnlike the GetBalance interface provided by the Economy module, this interface provides full information about Midas Token balance of the player.

API Details

GetMidasGlobalAddonInfo

Retrieve the necessary information from the Midas Global addon.

/**
* Retrieve the necessary information from the Midas Global addon.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMidasGlobalAddonInfo(
PgosDataCallback<GetMidasGlobalAddonInfoResult> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<GetMidasGlobalAddonInfoResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMidasGlobalMetaData

Set the meta data for using the Midas service in PGOS. Please make sure to call the GetMidasGlobalAddonInfo interface to retrieve the necessary parameters before calling this interface, .

/**
* Set the meta data for using the Midas service in PGOS.
* Please make sure to call the GetMidasGlobalAddonInfo interface to retrieve the necessary parameters before calling this interface, .
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMidasGlobalMetaData(
const SetMidasGlobalMetaDataParams& params,
PgosDataCallback<SetMidasGlobalMetaDataResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst SetMidasGlobalMetaDataParams&
result_callbackPgosDataCallback<SetMidasGlobalMetaDataResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMidasGlobalMetaData

This interface will return Midas meta data that set with SetMidasGlobalMetaData interface by game.

/**
* This interface will return Midas meta data that set with `SetMidasGlobalMetaData` interface by game.
*
* @return
*/
MidasGlobalMetaData GetMidasGlobalMetaData();

Parameters:

(No parameters)

Return: MidasGlobalMetaData

CreateMidasGlobalOrder

Create a Midas order for purchasing real-money items. FATAL: Please note that paying for orders obtained through this interface will increase the Midas payment assets for the specific role ID of the player. So, please ensure that you have set and retrieved the correct role ID through the SetMidasGlobalMetaData interface before calling this interface, .

/**
* Create a Midas order for purchasing real-money items.
* FATAL: Please note that paying for orders obtained through this interface will increase the Midas payment assets for the specific role ID of the player.
* So, please ensure that you have set and retrieved the correct role ID through the `SetMidasGlobalMetaData` interface before calling this interface, .
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void CreateMidasGlobalOrder(
const CreateMidasGlobalOrderParams& params,
PgosDataCallback<CreateMidasGlobalOrderResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst CreateMidasGlobalOrderParams&
result_callbackPgosDataCallback<CreateMidasGlobalOrderResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMidasGlobalBalanceDetail

Unlike the GetBalance interface provided by the Economy module, this interface provides full information about Midas Token balance of the player.

/**
* Unlike the GetBalance interface provided by the Economy module, this interface provides full information about Midas Token balance of the player.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMidasGlobalBalanceDetail(
const GetMidasGlobalBalanceDetailParams& params,
PgosDataCallback<GetMidasGlobalBalanceDetailResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetMidasGlobalBalanceDetailParams&
result_callbackPgosDataCallback<GetMidasGlobalBalanceDetailResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void