Stripe checkout #104411

Merged
Anna Sirota merged 61 commits from stripe into main 2024-06-17 18:08:41 +02:00
Showing only changes of commit 504344a0e8 - Show all commits

View File

@ -115,11 +115,10 @@ class JoinView(LoginRequiredMixin, FormView):
logger_args = [self.customer.pk, gateway] logger_args = [self.customer.pk, gateway]
logger.debug('Creating a new subscription for customer pk=%s, %s', *logger_args) logger.debug('Creating a new subscription for customer pk=%s, %s', *logger_args)
collection_method = self.plan_variation.collection_method collection_method = self.plan_variation.collection_method
supported = set(gateway.provider.supported_collection_methods) if collection_method not in gateway.provider.supported_collection_methods:
if collection_method not in supported:
# FIXME(anna): this breaks plan selector because collection method # FIXME(anna): this breaks plan selector because collection method
# might not match the one selected by the customer. # might not match the one selected by the customer.
collection_method = supported.pop() collection_method = next(iter(gateway.provider.supported_collection_methods))
with transaction.atomic(): with transaction.atomic():
subscription.plan = self.plan_variation.plan subscription.plan = self.plan_variation.plan