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; }
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); } } }