mirror of
https://github.com/defold/extension-iap
synced 2025-06-27 10:27:46 +02:00
Merge pull request #55 from defold/fix-json-migration-issue
Push nil as last argument if there is no error
This commit is contained in:
commit
f97a7ee6b6
@ -308,6 +308,7 @@ static void HandleProductResult(const IAPCommand* cmd)
|
|||||||
if (cmd->m_ResponseCode == BILLING_RESPONSE_RESULT_OK) {
|
if (cmd->m_ResponseCode == BILLING_RESPONSE_RESULT_OK) {
|
||||||
const char* json = (const char*)cmd->m_Data;
|
const char* json = (const char*)cmd->m_Data;
|
||||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||||
|
lua_pushnil(L);
|
||||||
} else {
|
} else {
|
||||||
dmLogError("IAP error %d", cmd->m_ResponseCode);
|
dmLogError("IAP error %d", cmd->m_ResponseCode);
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
@ -343,6 +344,7 @@ static void HandlePurchaseResult(const IAPCommand* cmd)
|
|||||||
if (cmd->m_Data != 0) {
|
if (cmd->m_Data != 0) {
|
||||||
const char* json = (const char*)cmd->m_Data;
|
const char* json = (const char*)cmd->m_Data;
|
||||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||||
|
lua_pushnil(L);
|
||||||
} else {
|
} else {
|
||||||
dmLogError("IAP error, purchase response was null");
|
dmLogError("IAP error, purchase response was null");
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
@ -47,6 +47,7 @@ static void IAPList_Callback(void* luacallback, const char* result_json)
|
|||||||
if(result_json != 0)
|
if(result_json != 0)
|
||||||
{
|
{
|
||||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||||
|
lua_pushnil(L);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -97,6 +98,7 @@ static void IAPListener_Callback(void* luacallback, const char* result_json, int
|
|||||||
|
|
||||||
if (result_json) {
|
if (result_json) {
|
||||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||||
|
lua_pushnil(L);
|
||||||
} else {
|
} else {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
switch(error_code)
|
switch(error_code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user