Skip to content

feat(payment): permite pular o trial no createStripeSubscription - #1099

Merged
AldemirLucas merged 1 commit into
mainfrom
feat/checkout-coupon-campaign
Sep 25, 2026
Merged

AldemirLucas merged 1 commit into
mainfrom
feat/checkout-coupon-campaign

Conversation

@AldemirLucas

@AldemirLucas AldemirLucas commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Issue da feature

Summary

  • Adiciona o argumento opcional skipTrial (default false) em createStripeSubscription.
  • Com skipTrial: true, a mutation não cria o SetupIntent de 7 dias: abre uma assinatura paga na hora (trial_end: now) e aplica o cupom, se houver.
  • Sem o flag, o fluxo continua o mesmo (trial de chatbot/BD Pro quando a conta é elegível).

Serve o checkout de campanha do website (?checkout=…&coupon=…), que precisa cobrar o 1º mês/ano com desconto em vez de empilhar trial + cupom.

Test plan

  • Conta nova, skipTrial omitido ou false: chatbot elegível ainda cai no trial (SetupIntent / 7 dias).
  • skipTrial: true + cupom válido: Stripe cria assinatura ativa, sem trial, cupom na 1ª fatura, clientSecret de PaymentIntent (não seti_).
  • skipTrial: true sem cupom: assinatura paga sem trial, preço cheio.
  • Conta que já tem chatbot/BD Pro ativo: segue recusando nova assinatura do mesmo tipo.
  • Checkout normal do site (sem link de campanha) não envia skipTrial e não muda de comportamento.

This update introduces a new optional argument, skip_trial, to the StripeSubscribeMutation. When set to true, it bypasses the trial period for subscriptions, allowing for immediate access to the service. The mutation logic has been adjusted accordingly to handle this new parameter.
@AldemirLucas
AldemirLucas requested a review from Winzen September 21, 2026 14:48
@github-actions github-actions Bot added the prod Indica que o Pull Request está com a branch de destino (base) apontando para main label Sep 21, 2026

@Winzen Winzen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@mergify

mergify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@AldemirLucas
AldemirLucas merged commit d3ec619 into main Sep 25, 2026
9 checks passed
github-actions Bot added a commit that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prod Indica que o Pull Request está com a branch de destino (base) apontando para main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants