private PaymentDataRequest CreatePaymentDataRequest() { try { var list = new List <Integer> { (Integer)WalletConstants.CardNetworkAmex, (Integer)WalletConstants.CardNetworkDiscover, (Integer)WalletConstants.CardNetworkVisa, (Integer)WalletConstants.CardNetworkMastercard }; var currencyCode = ListUtils.SettingsSiteList?.StripeCurrency ?? "USD"; PaymentDataRequest.Builder request = PaymentDataRequest.NewBuilder() .SetTransactionInfo(TransactionInfo.NewBuilder() .SetTotalPriceStatus(WalletConstants.TotalPriceStatusFinal) .SetTotalPrice(Price) .SetCurrencyCode(currencyCode) .Build()) .AddAllowedPaymentMethod(WalletConstants.PaymentMethodCard) .AddAllowedPaymentMethod(WalletConstants.PaymentMethodTokenizedCard) .SetCardRequirements(CardRequirements.NewBuilder() .AddAllowedCardNetworks(list) .Build()); request.SetPaymentMethodTokenizationParameters(CreateTokenizationParameters()); return(request.Build()); } catch (Exception e) { Console.WriteLine(e); return(null); } }
/// <summary> /// Not yet implemented /// </summary> /// <returns></returns> public override string ToString() { return($"{this.GetType().Name}: {CardName}\n----------------------\n{CardRequirements.ShowRequirements()}"); }