예제 #1
0
        public static async Task ConfirmCurrentWithCardAsync(PaymentMethod paymentMethod, bool coverStripeFee)
        {
            if (!(Current is null))
            {
                await Current.Doc.UpdateAsync(new
                {
                    UserConfirmed         = true,
                    PaymentMethodUID      = paymentMethod.UID,
                    PaymentMethodLastFour = paymentMethod.LastFourDigits,
                    PaymentMethodType     = nameof(PaymentMethodType.Card),
                    CoverStripeFee        = coverStripeFee
                });

                CurrentConfirmed?.Invoke();
            }
        }
예제 #2
0
        public static async Task ConfirmCurrentWithOneTimeTokenAsync(string token, PaymentMethodType paymentMethodType, bool coverStripeFee)
        {
            if (paymentMethodType == PaymentMethodType.Card)
            {
                throw new ArgumentException("Must be Apple or Google Pay", nameof(paymentMethodType));
            }
            if (!(Current is null))
            {
                await Current.Doc.UpdateAsync(new
                {
                    UserConfirmed             = true,
                    PaymentMethodType         = paymentMethodType.ToString(),
                    PaymentMethodOneTimeToken = token,
                    CoverStripeFee            = coverStripeFee
                });

                CurrentConfirmed?.Invoke();
            }
        }