Convert C# to Java need help!

Hi,

I am trying to convert this to Java but can’t figure out how.
I tried posting it on unity answer instead but it wouldn’t let me.

Any help would be appreciated. Thank you.

			Store.requestProductPurchase( "test.consumable.1", ( receipt, error ) =>
			{
				// we will either have a receipt or an error
				if( receipt != null )
					log( "purchase completed with receipt: " + receipt );
				else if( error != null )
					log( "error purchasing product: " + error );
			});

I don’t use Unityscript much, but you’re looking at an anonymous function.
Try something like —

Store.requestProductPurchase("test.consumable.1", function(receipt:type, error:type)
{
    if(receipt != null)
        log("purchase completed with receipt: "+receipt);
    else if(error != null)
        log("error purchasing product: "+error);
} );

You’ll probably need to add the types to receipt and error in the function parameters…

It’s working, thank you very much.