Ejemplo n.º 1
0
        /// <summary>
        /// Displays the in-app purchase dialog for published in-app contract
        /// </summary>
        /// <param name="inAppContractAddress">In-app purchase contract address</param>
        /// <param name="inAppService">In-App service</param>
        public InAppPurchaseDialog(string inAppContractAddress, IInAppService inAppService)
        {
            _contractAddressChecker = new ContractAddressChecker();
            if (!_contractAddressChecker.CheckAddress(inAppContractAddress))
            {
                throw new ArgumentException("In-App contract address is not valid", nameof(inAppContractAddress));
            }

            _inAppAddress = inAppContractAddress;
            _inAppService = inAppService ?? throw new ArgumentNullException(nameof(inAppService));

            _canvasBuilder = new QrCodeCanvasBuilder();
            _appSettings   = new AppSettingsInterop();

            //component init
            this.InitializeComponent();
            Loaded += InAppPurchaseDialog_Loaded;
        }
Ejemplo n.º 2
0
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            //Create service builder instance with specified ethereum network.
            //Use Main Net for your products and rinkeby or ropsten for test purposes.
            var inAppServiceBuilder = new InAppSeviceBuilder(EthereumNetwork.Rinkeby);

            _inAppService = inAppServiceBuilder.Build();


            //we have some test user addresses with active subscriptions and some consumables bought
            //use this settings to see how in-app purchase dialog behaves with active subscription.
            //rinkeby test user: "******"
            //ropsten test user: "******"

            var settings = new AppSettingsInterop();

            settings.SaveUserWalletAddress("");
            //settings.SaveUserWalletAddress("0x3d082697579c08ed9da629ad19c736a9b26b64e6");
        }