Skip to content

feat: add offers merchant event payload - #88

Open
AbhishekChorotiya wants to merge 1 commit into
mainfrom
feat/offers-event
Open

feat: add offers merchant event payload#88
AbhishekChorotiya wants to merge 1 commit into
mainfrom
feat/offers-event

Conversation

@AbhishekChorotiya

@AbhishekChorotiya AbhishekChorotiya commented Aug 19, 2026

Copy link
Copy Markdown

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Documentation
  • CI/CD

Description

Adds an offersEvent type and offersEventToJson serializer to sdk-utils/events/PaymentEventData.res, mirroring the existing surchargeEvent pattern:

  • eligibleOffer record: offerQuoteId, offerAmount, currency, code, title, description.
  • offersEvent record: {offers: array<eligibleOffer>}.
  • buildOffersEvent(~offers=[]) and offersEventToJson, emitting {"offers": [...]}.
  • New Offers variant added to the shared events enum in PaymentEventTypes.res (string form "OFFERS").

Additive only — no changes to existing event types/serializers.

How did you test it?

  • Verified via the consuming web-repo change (see linked PR) that offersEventToJson produces {"offers": [...]} for a single auto-applied offer, matching the expected appliedOffersInfo merchant event payload.

Impact on Mobile and Web Repositories

  • I tested the submodule changes in the mobile repository.
  • I tested the submodule changes in the web repository.
  • I updated the corresponding documentation in both repositories, if applicable.
  • I confirmed the changes do not introduce regressions in either repository.

This is additive-only (new type + new enum variant), so it does not affect existing mobile-repository consumers.

Fixes #87

Companion PR in hyperswitch-web: juspay/hyperswitch-web#1729

Checklist

  • I reviewed submitted code thoroughly.
  • I ensured the changes are compatible with both mobile and web repositories.
  • I communicated potential breaking changes, if any, to the relevant teams.

Adds an eligibleOffer/offersEvent type and offersEventToJson serializer
to PaymentEventData.res, following the existing surchargeEvent pattern,
plus a new Offers variant in the shared events enum. Used by
hyperswitch-web to emit an offersInfo merchant event for auto-applied
card eligibility offers.

Fixes #87

@aritro2002 aritro2002 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.

LGTM, I will update the enums in my pr.

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.

Add offers merchant event payload type

2 participants