There’s a class scoped Boolean declared for the purchasing return(?)
private Boolean return_complete = true;
This is then used in the ProcessPurchase() method
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
test_product = args.purchasedProduct;
if (return_complete)
{
MyDebug(string.Format("ProcessPurchase: Complete. Product:" + args.purchasedProduct.definition.id + " - " + test_product.transactionID.ToString()));
return PurchaseProcessingResult.Complete;
}
else
{
MyDebug(string.Format("ProcessPurchase: Pending. Product:" + args.purchasedProduct.definition.id + " - " + test_product.transactionID.ToString()));
return PurchaseProcessingResult.Pending;
}
}
However, it is never false. The ToggleComplete() method is never called.
The summary for this interface method says
///
/// A purchase succeeded.
///
/// The PurchaseEventArgs for the purchase event.
/// The result of the successful purchase
So, the return_complete isn’t needed?
Is there a point of it? If so, when should this bool be toggled ?
Or is it left over old code?
Can this ever be Pending?
LE-Peter:
There’s a class scoped Boolean declared for the purchasing return(?)
private Boolean return_complete = true;
This is then used in the ProcessPurchase() method
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
test_product = args.purchasedProduct;
if (return_complete)
{
MyDebug(string.Format("ProcessPurchase: Complete. Product:" + args.purchasedProduct.definition.id + " - " + test_product.transactionID.ToString()));
return PurchaseProcessingResult.Complete;
}
else
{
MyDebug(string.Format("ProcessPurchase: Pending. Product:" + args.purchasedProduct.definition.id + " - " + test_product.transactionID.ToString()));
return PurchaseProcessingResult.Pending;
}
}
However, it is never false. The ToggleComplete() method is never called.
The summary for this interface method says
So, the return_complete isn’t needed?
Is there a point of it? If so, when should this bool be toggled ?
Or is it left over old code?
Can this ever be Pending?
Correct, left over old code! You can remove it if you want. It allows you to test Pending transactions at runtime if you want.