Skip to content

Stripe Integration for Claim Management

Stripe is used to manage the payment from member to solve overpayment issues. More info about 🇧🇪 Overpayments 👉 https://www.notion.so/Overpayments-Belgium-bcab8ca75af24f10b1624a8742e12541 ⧉

Sequence diagram

sequenceDiagram
    participant Alan Mobile
    participant Alan Backend
    participant Stripe API

    Note over Alan Mobile,Alan Backend: User clicks on "Pay per credit card"
    Alan Mobile->>Alan Backend: POST /users/<user_id>/create_overpayment_payment_intent
    activate Alan Backend
    Note over Alan Backend,Stripe API: Create a customer if needed
    Alan Backend->>Stripe API: stripe.Customer.create
    Note over Alan Backend,Stripe API: Create a PaymentIntent and an EphemeralKey
    Alan Backend->>Stripe API: stripe.PaymentIntent.create
    Alan Backend->>Stripe API: stripe.EphemeralKey.create
    Alan Backend-->>Alan Mobile: CustomerId, PaymentIntent, EphemeralKey

    Note over Alan Mobile,Stripe API: User fills credit card info
    Alan Mobile ->> Stripe API: common-mobile/payment/StripePayment/openPaymentSheet
    Stripe API-->>Alan Mobile: onSuccess callback

    Note over Alan Backend,Stripe API: Stripe handles the payment
    Stripe API->>Alan Backend: POST /services/stripe-claims
    Alan Backend->>Alan Backend: Create a UserCareActSettlement
    Alan Backend-->>Stripe API: 200 OK

    deactivate Alan Backend
Hold "Alt" / "Option" to enable pan & zoom