internal static void OnCheckout(IntPtr address) { OnCheckoutCallback callback = null; CheckoutCallbackInfo callbackInfo = null; if (Helper.TryGetAndRemoveCallback <OnCheckoutCallback, CheckoutCallbackInfoInternal, CheckoutCallbackInfo>(address, out callback, out callbackInfo)) { callback(callbackInfo); } }
/// <summary> /// Initiates the purchase flow for a set of offers. The callback is triggered after the purchase flow. /// On success, the set of entitlements that were unlocked will be cached. /// On success, a Transaction Id will be returned. The Transaction Id can be used to obtain a /// <see cref="Transaction" /> handle. The handle can then be used to retrieve the entitlements rewarded by the purchase. /// <seealso cref="Transaction.Release" /> /// <seealso cref="Achievements" /> /// </summary> /// <param name="options">structure containing filter criteria</param> /// <param name="clientData">arbitrary data that is passed back to you in the CompletionDelegate</param> /// <param name="completionDelegate">a callback that is fired when the async operation completes, either successfully or in error</param> public void Checkout(CheckoutOptions options, object clientData, OnCheckoutCallback completionDelegate) { var optionsInternal = Helper.CopyProperties <CheckoutOptionsInternal>(options); var completionDelegateInternal = new OnCheckoutCallbackInternal(OnCheckout); var clientDataAddress = IntPtr.Zero; Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); EOS_Ecom_Checkout(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsInternal); }