Example #1
0
        public void setAmount(int amount)
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "setAmount", "(I)V");

            AndroidJNI.CallVoidMethod(jthiz, jmethod, CxxJavaObject.createJavaParam(amount));
            CxxJavaObject.callJavaEnd();
        }
Example #2
0
        public void setOrderNo(string orderNo)
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "setOrderNo", "(Ljava/lang/String;)V");

            AndroidJNI.CallVoidMethod(jthiz, jmethod, CxxJavaObject.createJavaParam(orderNo));
            CxxJavaObject.callJavaEnd();
        }
Example #3
0
        public int getPayCode()
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "getPayCode", "()I");
            int    jret    = AndroidJNI.CallIntMethod(jthiz, jmethod, CxxJavaObject.createJavaParam((object)null));

            CxxJavaObject.callJavaEnd();
            return(jret);
        }
Example #4
0
        public void setSubject(string subject)
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "setSubject", "(Ljava/lang/String;)V");
            IntPtr jvalue  = AndroidJNI.NewStringUTF(subject);

            AndroidJNI.CallVoidMethod(jthiz, jmethod, CxxJavaObject.createJavaParam(jvalue));
            CxxJavaObject.callJavaEnd();
        }
Example #5
0
        public void setBody(string body, IntPtr lRef)
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = lRef;
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "setBody", "(Ljava/lang/String;)V");
            IntPtr jvalue  = AndroidJNI.NewStringUTF(body);

            AndroidJNI.CallVoidMethod(jthiz, jmethod, CxxJavaObject.createJavaParam(jvalue));
            CxxJavaObject.callJavaEnd();
        }
Example #6
0
        public string getSubject()
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "getSubject", "()Ljava/lang/String;");
            IntPtr jvalue  = AndroidJNI.CallObjectMethod(jthiz, jmethod, CxxJavaObject.createJavaParam((object)null));
            string ret     = AndroidJNI.GetStringUTFChars(jvalue);

            CxxJavaObject.callJavaEnd();
            return(ret);
        }
Example #7
0
        public String getPayChannelMessage()
        {
            CxxJavaObject.callJavaStart();
            IntPtr jthiz   = getLocalJavaObject();
            IntPtr jclazz  = CxxJavaObject.getJavaClass(jthiz);
            IntPtr jmethod = CxxJavaObject.getJavaMethodID(jclazz, "getPayChannelMessage", "()Ljava/lang/String;");
            IntPtr jret    = AndroidJNI.CallObjectMethod(jthiz, jmethod, CxxJavaObject.createJavaParam((object)null));
            string ret     = null;

            if (IntPtr.Zero != jret)
            {
                ret = AndroidJNI.GetStringUTFChars(jret);
            }
            CxxJavaObject.callJavaEnd();
            return(ret);
        }
        private void payInner(AndroidOrder order, AndroidOnPayListener callback)
        {
            CxxJavaObject.callJavaStart();
            IntPtr jApi          = getLocalJavaObject();
            IntPtr jApiClazz     = CxxJavaObject.getJavaClass(jApi);
            IntPtr jApiPayMethod = CxxJavaObject.getJavaMethodID(jApiClazz, "pay",
                                                                 "(Lcom/mob/paysdk/Order;Lcom/mob/paysdk/OnPayListener;)V");

            IntPtr jorder = order.getLocalJavaObject();

            AndroidOnPayListener cxx = callback;
            IntPtr jListener         = cxx.getLocalJavaObject();
            IntPtr gRef = cxx.getJavaObject();

            GCNativeKeeper.getInstance().keep(gRef, cxx);

            AndroidJNI.CallVoidMethod(jApi, jApiPayMethod, CxxJavaObject.createJavaParam(jorder, jListener));
            CxxJavaObject.callJavaEnd();
        }