Ejemplo n.º 1
0
        private static StripeCustomer ImportCustomer(StripeOnboardingContext db, StripeJsonCustomer customerDetails)
        {
            var customer = new StripeCustomer
            {
                CustomerId       = customerDetails.NewCustomerId,
                ExternalPersonId = customerDetails.OldCustomerId,
                Imported         = false,
            };


            db.StripeCustomers.Add(customer);
            return(customer);
        }
Ejemplo n.º 2
0
        private static void ImportAccounts(StripeJsonCustomer customerDetails, StripeCustomer customer)
        {
            if (customerDetails.BanksMap != null)
            {
                foreach (var bankDetails in customerDetails.BanksMap)
                {
                    ImportAccount(bankDetails.Key, bankDetails.Value, customer);
                }
            }

            if (customerDetails.CardsMap != null)
            {
                foreach (var cardDetails in customerDetails.CardsMap)
                {
                    ImportAccount(cardDetails.Key, cardDetails.Value, customer);
                }
            }
        }