예제 #1
0
        // ----------------------------------------------------------------------------------
        private void Paddle_RecoveryErrorEvent(object sender, LicensingRecoveryErrorEventArgs e)
        {
            debug_print(e.ToString());

            CJsonResult jResult = new CJsonResult {
                errCodeI = PADErrorUnableToRecoverLicense,
                errStr   = e.Message
            };

            ScTask.get().set_result(CreateJsonResult(jResult));
        }
예제 #2
0
        private void Paddle_RecoveryCompleteEvent(object sender, LicensingRecoveryCompleteEventArgs e)
        {
            debug_print(e.ToString());
            debug_print(e.Message);

            CJsonResult jResult = new CJsonResult {
                successB = true,
                resultI  = 1
            };

            ScTask.get().set_result(CreateJsonResult(jResult));
        }
예제 #3
0
        private void Paddle_CheckoutWindowClosed()
        {
            ScTask task = ScTask.get();

            //	task may be NULL at this point
            //	if the checkout already completed or errored
            if (task != null)
            {
                CJsonResult jResult = new CJsonResult {
                    resultI = Convert.ToInt32(CheckoutState.Abandoned)
                };

                task.set_result(CreateJsonResult(jResult));
            }
        }
예제 #4
0
        private void Paddle_LicensingCompleteEvent(object sender, LicensingCompleteEventArgs e)
        {
            ScTask task = ScTask.get();

            debug_print(e.ToString());

            //	may be NULL during auto-activate
            if (task != null)
            {
                CJsonResult jResult = new CJsonResult {
                    successB = true,
                    resultI  = Convert.ToInt32(ActivationState.Activated)
                };

                task.set_result(CreateJsonResult(jResult));
            }
        }
예제 #5
0
        private void Paddle_LicensingErrorEvent(object sender, LicensingErrorEventArgs e)
        {
            ScTask task = ScTask.get();

            debug_print(e.ToString());

            //	may be NULL during auto-activate
            if (task != null)
            {
                CJsonResult jResult = new CJsonResult {
                    resultI  = Convert.ToInt32(ActivationState.Failed),
                    errCodeI = PADErrorLicenseActivationFailed,
                    errStr   = "Licensing failed"
                };

                task.set_result(CreateJsonResult(jResult));
            }
        }
예제 #6
0
        private void Paddle_CheckoutErrorEvent(object sender, TransactionErrorEventArgs e)
        {
            ScTask task = ScTask.get();

            debug_print(e.ToString());

            //	task may be NULL at this point
            //	if the checkout already completed
            if (task != null)
            {
                CJsonResult jResult = new CJsonResult {
                    resultI = Convert.ToInt32(CheckoutState.Failed),
                    // ?? errCodeI	= PADErrorLicenseActivationFailed,
                    errStr = e.Error
                };

                task.set_result(CreateJsonResult(jResult));
            }
        }
예제 #7
0
        private void Paddle_CheckoutCompleteEvent(object sender, TransactionCompleteEventArgs e)
        {
            ScTask task = ScTask.get();

            debug_print(e.ToString());

            Debug.Assert(task != null, "ScTask should not be NULL");
            if (task != null)
            {
                string purchResponseJsonStr = JsonConvert.SerializeObject(e.ProcessStatus, Formatting.Indented);

                CJsonResult jResult = new CJsonResult {
                    successB     = true,
                    resultI      = Convert.ToInt32(CheckoutState.Purchased),
                    responseJson = purchResponseJsonStr
                };

                task.set_result(CreateJsonResult(jResult));
            }
        }