Esempio n. 1
0
        public void TokenPayment(JudoDotNetXamarin.TokenPaymentViewModel payment, JudoDotNetXamarin.JudoSuccessCallback success, JudoDotNetXamarin.JudoFailureCallback failure, Activity context)
        {
            Intent i = new Intent(context, typeof(UIMethods));

            i.PutExtra(JudoSDKManager.REQUEST_CODE, ACTION_TOKEN_PAYMENT.ToString());
            i.PutExtra(JudoSDKManager.JUDO_PAYMENT_REF, payment.PaymentReference);
            i.PutExtra(JudoSDKManager.JUDO_CONSUMER, JsonConvert.SerializeObject(new Consumer()
            {
                YourConsumerReference = payment.ConsumerReference,
                ConsumerToken         = payment.ConsumerToken
            }));
            i.PutExtra(JudoSDKManager.JUDO_AMOUNT, payment.Amount.ToString());
            i.PutExtra(JudoSDKManager.JUDO_ID, (String.IsNullOrWhiteSpace(payment.JudoID) ? JudoConfiguration.Instance.JudoId : payment.JudoID));
            i.PutExtra(JudoSDKManager.JUDO_CURRENCY, payment.Currency);
            i.PutExtra(JudoSDKManager.JUDO_CARD_DETAILS, JsonConvert.SerializeObject(new CardToken()
            {
                CardLastFour  = payment.LastFour,
                CardType      = payment.CardType,
                Token         = payment.Token,
                ConsumerToken = payment.ConsumerToken
            }));
            _judoSuccessCallback = new Lazy <JudoSuccessCallback> (() => success);
            _judoFailureCallback = new Lazy <JudoFailureCallback> (() => failure);

            context.StartActivityForResult(i, ACTION_TOKEN_PAYMENT);
        }
Esempio n. 2
0
        public void PreAuth(JudoDotNetXamarin.PaymentViewModel preAuthorisation, JudoDotNetXamarin.JudoSuccessCallback success, JudoDotNetXamarin.JudoFailureCallback failure, Activity context)
        {
            Intent i = new Intent(context, typeof(UIMethods));

            i.PutExtra(JudoSDKManager.REQUEST_CODE, ACTION_PREAUTH.ToString());
            i.PutExtra(JudoSDKManager.JUDO_PAYMENT_REF, preAuthorisation.PaymentReference);
            i.PutExtra(JudoSDKManager.JUDO_CONSUMER, JsonConvert.SerializeObject(new Consumer()
            {
                YourConsumerReference = preAuthorisation.ConsumerReference
            }));
            i.PutExtra(JudoSDKManager.JUDO_AMOUNT, preAuthorisation.Amount.ToString());
            i.PutExtra(JudoSDKManager.JUDO_ID, (String.IsNullOrWhiteSpace(preAuthorisation.JudoID) ? JudoConfiguration.Instance.JudoId : preAuthorisation.JudoID));
            i.PutExtra(JudoSDKManager.JUDO_CURRENCY, preAuthorisation.Currency);
            _judoSuccessCallback = new Lazy <JudoSuccessCallback> (() => success);
            _judoFailureCallback = new Lazy <JudoFailureCallback> (() => failure);

            context.StartActivityForResult(i, ACTION_PREAUTH);
        }