Ejemplo n.º 1
0
        public ActionResult RegisterPayment(RegisterPaymentRequest request)
        {
            if (request.amount > 0)
            {
                NativeSql.Exec("j2me_registePayment", new { session = request.session, rootingId = request.rootingId, amount = request.amount, });
            }

            RegisterPaymentResponse response = new RegisterPaymentResponse()
            {
                ok = true, message = "",
            };

            return(Json(response));
        }
Ejemplo n.º 2
0
        private async void RegisterPayment(String payMode)
        {
            String paymentRequest = payMode.Equals(PaymentMode.SUBSCRIPTION.ToString()) ? GetSubscriptionRequest() : GetRegisterPaymentBody();

            //call register payment API
            RegisterPaymentResponse response = await APIService.getInstance().MakePostRequest <RegisterPaymentResponse>(APIService.endPoint, paymentRequest);

            if (response != null && response.paymentId != null)
            {
                //store locally the payment ID
                _paymentId            = response.paymentId;
                _hostedPaymentPageUrl = response.hostedPaymentPageUrl;
                //start SDK
                MiASDK.Instance.StartSDK(this, new MiAPaymentInfo(response.paymentId, response.hostedPaymentPageUrl, APIService.returnURL, APIService.cancelURL));
            }
            else
            {
                //something went wrong
                Toast.MakeText(this, "Cannot create payment id", ToastLength.Short).Show();
            }
        }