Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…2978) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…5.1.1 (#2976) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…2981) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…rs table (#2974) * fix(skus): Add indexes for externalID and radomSubscriptionId in orders table * Update CurrentMigrationVersion to 73
…activate order (#2990) * refactor: add support for stipe payment intent succeeded webhook and activate order * test: add parse test for stripe payment intent notification * refactor: rename is perpetual license to is one off payment * refactor: remove extra new line
|
[puLL-Merge] - brave-intl/bat-go@2995 DescriptionThis PR introduces support for Stripe one-off payments (perpetual licenses) in the SKU service, alongside CI/infrastructure improvements and dependency updates. Core feature: When a Stripe Other changes:
Possible Issues
Security Hotspots
ChangesChanges
sequenceDiagram
participant Stripe
participant WebhookHandler
participant Service
participant OrderRepo
participant PayHistRepo
Stripe->>WebhookHandler: payment_intent.succeeded event
WebhookHandler->>Service: processStripeNotificationTx(ntf)
Service->>Service: parseStripeNotification(event)
Service->>Service: ntf.shouldActivatePL() → true
Service->>Service: ntf.orderID() → extract from metadata
Service->>OrderRepo: getOrderFullTx(orderID)
OrderRepo-->>Service: order (with items)
Service->>Service: order.IsOneOffPayment() → check SKU variant
alt Not one-off payment
Service-->>WebhookHandler: ErrOrderNotOneOffPayment
end
Service->>Service: ntf.paymentID() → payment intent ID
Service->>Service: ntf.paidAt() → created timestamp
Service->>Service: expt = paidAt + 100 years
Service->>Service: activateStripePL(order, paymentID, paidAt, expt)
Service->>OrderRepo: SetStatus(orderID, "paid")
Service->>OrderRepo: SetExpiresAt(orderID, expt)
Service->>PayHistRepo: Insert(orderID, paidAt)
Service->>OrderRepo: AppendMetadata("paymentProcessor", "stripe")
Service->>OrderRepo: AppendMetadata("stripePaymentId", paymentID)
Service-->>WebhookHandler: success
|
Sneagan
left a comment
There was a problem hiding this comment.
Components reviewed previously.
WIP