Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(boleto): Introduce Boleto as a valid Stripe Payment Method #3111

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

julienbourdeau
Copy link
Contributor

@julienbourdeau julienbourdeau commented Jan 27, 2025

Context

We're adding support for Boleto payment method through Stripe 🇧🇷

Description

Boleto requires 2 step. First the payment is initiated on Stripe and the customer receive a barcode to go pay IRL.

This PR has very little change because most of it already works and is already tested 😅 but it requires a fair amount of manual QA.

To test the integration, you can use different email address as described in Stripe docs. By default, boleto payment are completed after 3 minutes.

TODO

  • Add boleto to PaymentProviderCustomers::StripeCustomer::PAYMENT_METHODS
    • GQL: boleto is a valid payment method for a customer
    • API: boleto is a valid payment method for a customer
  • When Lago creates a invoice and tries to collect it via stripe
    • Boleto is a valid payment method
    • A Lago payment.requires_action webhook is sent
    • Once the invoice is paid, Stripe sends payment_intent.succeded webhook and the invoice is marked as paid
  • When using a stripe payment URL to pay an invoice
  • When setting up payment method (POST /customers/:id/checkout_url)
    • Boleto is a valid payment method
    • No webhook is sent for next_action because there is no payment at this stage, just setup
  • When creating a PaymentRequest (POST /payment_requests)
    • If Boleto is setup, we try to collect payment with Boleto
    • A Lago payment.requires_action webhook is sent
    • No PaymentRequestMailer email is sent

Screenshots

Create new customer, without payment method, create invoice and use invoice payment_url to pay

CleanShot 2025-01-29 at 13 46 15@2x
CleanShot 2025-01-29 at 13 46 39@2x
CleanShot 2025-01-29 at 13 46 59@2x
CleanShot 2025-01-29 at 13 47 37@2x
CleanShot 2025-01-29 at 13 47 47@2x
CleanShot 2025-01-29 at 13 51 05@2x
CleanShot 2025-01-29 at 13 54 52@2x

Create new customer and set up payment method

CleanShot 2025-01-29 at 13 10 14@2x
CleanShot 2025-01-29 at 13 10 33@2x
CleanShot 2025-01-29 at 13 11 01@2x
CleanShot 2025-01-29 at 13 11 47@2x
CleanShot 2025-01-29 at 13 14 24@2x

Invoice collection with Boleto set up

CleanShot 2025-01-29 at 13 35 32@2x
CleanShot 2025-01-29 at 13 35 59@2x
CleanShot 2025-01-29 at 13 38 58@2x
CleanShot 2025-01-29 at 13 39 59@2x

@julienbourdeau julienbourdeau self-assigned this Jan 27, 2025
@julienbourdeau julienbourdeau marked this pull request as ready for review January 29, 2025 12:55
app/models/clickhouse/events_enriched.rb Outdated Show resolved Hide resolved
@julienbourdeau julienbourdeau merged commit 04c838f into main Jan 31, 2025
6 checks passed
@julienbourdeau julienbourdeau deleted the feat/boleto branch January 31, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants