Skip to content

Commit 63319f3

Browse files
committed
Added productId to the properties of a purchase/item
1 parent 4de7626 commit 63319f3

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

engine/src/java/com/runrev/android/billing/amazon/AmazonBillingProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ public void onActivityResult (int requestCode, int resultCode, Intent data)
199199
boolean addPurchaseReceiptToLocalInventory(Receipt receipt)
200200
{
201201
boolean success = true;
202+
if (success)
203+
success = setPurchaseProperty(receipt.getSku(), "productId", receipt.getSku());
202204
if (success)
203205
success = setPurchaseProperty(receipt.getSku(), "itemType", receipt.getItemType().toString());
204206

engine/src/java/com/runrev/android/billing/google/GoogleBillingProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ public String getPurchaseList()
334334
boolean addPurchaseToLocalInventory(Purchase purchase)
335335
{
336336
boolean success = true;
337+
if (success)
338+
success = setPurchaseProperty(purchase.getSku(), "productId", purchase.getSku());
337339
if (success)
338340
success = setPurchaseProperty(purchase.getSku(), "itemType", purchase.getItemType());
339341

@@ -359,6 +361,8 @@ boolean addPurchaseToLocalInventory(Purchase purchase)
359361
boolean loadKnownItemToLocalInventory(SkuDetails skuDetails)
360362
{
361363
boolean success = true;
364+
if (success)
365+
success = setPurchaseProperty(skuDetails.getSku(), "productId", skuDetails.getSku());
362366
if (success)
363367
success = setPurchaseProperty(skuDetails.getSku(), "itemType", skuDetails.getType());
364368

engine/src/java/com/runrev/android/billing/samsung/SamsungBillingProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ boolean loadBaseToLocalInventory(BaseVO baseVO)
110110
boolean success = true;
111111
//Log.d(TAG, "Base Item id is : " + baseVO.getItemId());
112112
//Log.d(TAG, "Base Item name is : " + baseVO.getItemName());
113-
113+
if (success)
114+
{
115+
success = setPurchaseProperty(baseVO.getItemId(), "productId", baseVO.getItemId());
116+
//Log.d(TAG, "Base productId loaded successfully");
117+
}
114118
if (success)
115119
{
116120
success = setPurchaseProperty(baseVO.getItemId(), "title", baseVO.getItemName());

engine/src/mblandroidstore.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ void MCStoreProductRequestResponseEvent::Dispatch()
807807
const char *t_subscriptionDurationUnit = nil;
808808
const char *t_subscriptionDurationMultiplier= nil;
809809

810-
t_product_id = m_product_id;
810+
//t_product_id = m_product_id;
811+
t_product_id = MCStoreGetPurchaseProperty(m_product_id, "productId");
811812
t_description = MCStoreGetPurchaseProperty(m_product_id, "description");
812813
t_title = MCStoreGetPurchaseProperty(m_product_id, "title");
813814
t_itemType = MCStoreGetPurchaseProperty(m_product_id, "itemType");
@@ -825,6 +826,12 @@ void MCStoreProductRequestResponseEvent::Dispatch()
825826
t_response = new MCVariableValue();
826827

827828
MCVariableValue *t_element = nil;
829+
830+
if (t_product_id != nil)
831+
{
832+
t_response->lookup_element(ep, "productId", t_element);
833+
t_element->assign_string(MCString(t_product_id));
834+
}
828835

829836
if (t_price != nil)
830837
{

0 commit comments

Comments
 (0)