示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            config.Environment(ConfigEnvironment);
            var clientId = (ConfigEnvironment == PayPalConfiguration.EnvironmentProduction)
                                                                ? ProductionConfigClientId
                                                                : SandboxConfigClientId;

            config.ClientId(clientId);

            //The following are only used in PayPalFuturePaymentActivity.
            config.MerchantName("Hipster Store");
            config.MerchantPrivacyPolicyUri(Android.Net.Uri.Parse("https://www.example.com/privacy"));
            config.MerchantUserAgreementUri(Android.Net.Uri.Parse("https://www.example.com/legal"));

            var intent = new Intent(this, typeof(PayPalService));

            intent.PutExtra(PayPalService.ExtraPaypalConfiguration, config);
            StartService(intent);

            var btnBuyIt                 = FindViewById <Button>(Resource.Id.buyItBtn);
            var btnFuturePayment         = FindViewById <Button>(Resource.Id.futurePaymentBtn);
            var btnFuturePaymentPurchase = FindViewById <Button>(Resource.Id.futurePaymentPurchaseBtn);

            btnBuyIt.Click                 += OnBuyPressed;
            btnFuturePayment.Click         += OnFuturePaymentPressed;
            btnFuturePaymentPurchase.Click += OnFuturePaymentPurchasePressed;
        }
示例#2
0
        public object GetConfiguration()
        {
            var settings = Mvx.Resolve <IAppSettings>().Data;
            var localize = Mvx.Resolve <ILocalization>();

            var baseUri = settings.ServiceUrl.Replace("api/", string.Empty);

            var configuration = new PayPalConfiguration();

            configuration.AcceptCreditCards(false);
            configuration.LanguageOrLocale(localize.CurrentLanguage);
            configuration.MerchantName(settings.TaxiHail.ApplicationName);
            configuration.MerchantPrivacyPolicyUri(Android.Net.Uri.Parse(string.Format("{0}/company/privacy", baseUri)));
            configuration.MerchantUserAgreementUri(Android.Net.Uri.Parse(string.Format("{0}/company/termsandconditions", baseUri)));
            configuration.Environment(_environment);
            configuration.ClientId(_clientId);

            return(configuration);
        }