//AABB - [2020-06-22 11:41:46]
#ifndef _IAP_H_
#define _IAP_H_

#include "common.h"

enum EAndroidIAPState {
  EAIAP_NONE,
  EAIAP_PRODUCTREQUEST,
  EAIAP_PRODUCTREQUEST_FAILED,
  EAIAP_PRODUCTREQUEST_SUCCESS,
  EAIAP_PURCHASE,
  EAIAP_PURCHASE_SUCCESS,
  EAIAP_PURCHASE_FAILED,
  EAIAP_CONSUME,
  EAIAP_CONSUME_FAILED,
  EAIAP_CONSUME_SUCCESS
};

enum EIAPValidationResult {
  EIAPValidationResult_0,
  EIAPValidationResult_1,
  EIAPValidationResult_2,
  EIAPValidationResult_3,
  EIAPValidationResult_4,
  EIAPValidationResult_5,
};

struct idp_product_info {
  char name_0[16];
  int field_10;
  int field_14;
  int field_18;
  int field_1C;
  int field_20;
  wchar_t wbuf_24[16];
};

typedef void (*fn_IAP_Fun)(EIAPValidationResult, int);

int IAP_BuyProduct(EIAPValidationResult a1, fn_IAP_Fun fn, bool b);  //002740F8
int IAP_CacheProductLocalPrices();                                   //00274218
bool IAP_CheckAndConsume(char *);                                    //002741A8
const char *IAP_GetIncompletePurchase();                             //00274088
int IAP_GetMaxProducts();                                            //00273F70
int IAP_GetProductCount();                                           //00273F64
int IAP_GetProductIndex(char *);                                     //00273F34
idp_product_info *IAP_GetProductInfo(int index);                     //00273F20
bool IAP_GetProductPurchased(char *a1);                              //00274034
bool IAP_GetProductPurchased(int a1);                                //00273C00
int IAP_GetStatus();                                                 //00273C68
const char *IAP_GetStatusString();                                   //00273C18
void IAP_Init(char const *, int);                                    //00273CE0
int IAP_PurchaseProduct(int);                                        //00273BA8
void IAP_RefreshPurchases();                                         //00274178
void IAP_SetStatus(EAndroidIAPState es);                             //00273C94
int IAP_SkuEnabled(int);                                             //00273F7C
void IAP_Start();                                                     //00274148
void IAP_StoreProductLocalisedPrice(int index);                      //00273B20
void IAP_Update();                                                   //00274238

#endif  //_IAP_H_