Open sylvain101010 opened 3 years ago
Customer {
PaymentMethod *PaymentMethod
}
service:
AddPaymentMethod
ChangeDefaultPaymentMethod -> remove
FindPaymentMethodsForUser -> FindPaymentMethodForUser
FindPaymentMethodsForGroup -> FindPaymentMethodForGroup
AddPaymentMethod:
customerPaymentMethodsCount, err := service.billingRepo.GetPaymentMethodsCountForCustomer(ctx, tx, customer.ID)
if err != nil {
tx.Rollback()
return
}
if customerPaymentMethodsCount != 0 {
tx.Rollback()
err = errors.InvalidArgument("Please remove your payment method before adding a new one")
return
}
Comment on fait pour delete une payment method?
What would you like to be changed
Change from allowing a customer to have multiple payment methods, to only one.
A customer will have either 1 payment method, on nonce, but not multiple, with one being the default one ...
Why is this needed
Because it's really unwanted complexity