protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_polling);

            mCompositeSubscription    = new CompositeDisposable();
            mCardInputWidget          = FindViewById <CardInputWidget>(Resource.Id.card_widget_three_d);
            mErrorDialogHandler       = new ErrorDialogHandler(SupportFragmentManager);
            mProgressDialogController = new ProgressDialogController(SupportFragmentManager);
            mPollingDialogController  = new PollingDialogController(this);
            mStripe = new Stripe(this);

            Button threeDSecureButton = FindViewById <Button>(Resource.Id.btn_three_d_secure);

            threeDSecureButton.Click += (s, e) =>
            {
                BeginSequence(false);
            };
            Button threeDSyncButton = FindViewById <Button>(Resource.Id.btn_three_d_secure_sync);

            threeDSyncButton.Click += (s, e) =>
            {
                BeginSequence(true);
            };

            RecyclerView recyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view);

            RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(this);
            recyclerView.HasFixedSize = true;
            recyclerView.SetLayoutManager(linearLayoutManager);
            mPollingAdapter = new PollingAdapter();
            recyclerView.SetAdapter(mPollingAdapter);
        }
Exemple #2
0
 public void Detach()
 {
     if (mCompositeSubscription != null)
     {
         mCompositeSubscription.Clear();
     }
     mCardInputWidget = null;
 }
Exemple #3
0
 /**
  * Unregister the {@link BroadcastReceiver}.
  */
 public void Detach()
 {
     if (mTokenBroadcastReceiver != null)
     {
         LocalBroadcastManager.GetInstance(mActivity)
         .UnregisterReceiver(mTokenBroadcastReceiver);
         mTokenBroadcastReceiver = null;
         mActivity = null;
     }
     mCardInputWidget = null;
 }
Exemple #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.layout_card_input_widget);

            mCardInputWidget = FindViewById <CardInputWidget>(Resource.Id.card_input_widget);
            buttonVerify     = FindViewById <Button>(Resource.Id.buttonVerify);

            buttonVerify.Click += ButtonVerify_Click;

            return;
        }
Exemple #5
0
        public DependencyHandler(
            AppCompatActivity activity,
            CardInputWidget cardInputWidget,
            ListView outputListView)
        {
            mCardInputWidget = cardInputWidget;
            mContext         = activity.BaseContext;

            mProgresDialogController =
                new ProgressDialogController(activity.SupportFragmentManager);

            mListViewController = new ListViewController(outputListView);

            mErrorDialogHandler = new ErrorDialogHandler(activity.SupportFragmentManager);
        }
Exemple #6
0
        public AsyncTaskTokenController(
            Button button,
            CardInputWidget cardInputWidget,
            Context context,
            ErrorDialogHandler errorDialogHandler,
            ListViewController outputListController,
            ProgressDialogController progressDialogController,
            string publishableKey)
        {
            mCardInputWidget          = cardInputWidget;
            mContext                  = context;
            mErrorDialogHandler       = errorDialogHandler;
            mPublishableKey           = publishableKey;
            mProgressDialogController = progressDialogController;
            mOutputListController     = outputListController;

            button.Click += (s, e) =>
            {
                SaveCard();
            };
        }
Exemple #7
0
        public IntentServiceTokenController(
            AppCompatActivity appCompatActivity,
            Button button,
            CardInputWidget cardInputWidget,
            ErrorDialogHandler errorDialogHandler,
            ListViewController outputListController,
            ProgressDialogController progressDialogController,
            string publishableKey)
        {
            mActivity                 = appCompatActivity;
            mCardInputWidget          = cardInputWidget;
            mErrorDialogHandler       = errorDialogHandler;
            mOutputListViewController = outputListController;
            mProgressDialogController = progressDialogController;
            mPublishableKey           = publishableKey;

            button.Click += (s, e) =>
            {
                SaveCard();
            };
            RegisterBroadcastReceiver();
        }
Exemple #8
0
 public RxTokenController(
     Button button,
     CardInputWidget cardInputWidget,
     Context context,
     ErrorDialogHandler errorDialogHandler,
     ListViewController outputListController,
     ProgressDialogController progressDialogController,
     string publishableKey)
 {
     mCardInputWidget          = cardInputWidget;
     mContext                  = context;
     mErrorDialogHandler       = errorDialogHandler;
     mOutputListController     = outputListController;
     mProgressDialogController = progressDialogController;
     mPublishableKey           = publishableKey;
     mCompositeSubscription    = new CompositeDisposable();
     //
     mCompositeSubscription.Add(Disposable.Create(() =>
     {
         SaveCard();
     }));
 }
Exemple #9
0
 public void Detach()
 {
     mCardInputWidget = null;
 }