Open
Conversation
Contributor
🚫 Missing Linked IssueHi 👋 This pull request does not appear to be linked to any open issue yet. Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically. ✔️ How to fix this
Once linked, this check will pass automatically on your next push or when you re-run the workflow. Thanks for helping maintainers! 🙌 |
05b5f65 to
4589399
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR implements subscription-based events for the Web SDK, allowing merchants to receive real-time updates about payment form status changes and other payment-related events.
Key Changes:
SubscriptionEventTypes.res) to support form status changes, payment method selection, validation states, and moreSubscriptionEventHooks.resto manage event subscription lifecycle and handle event dispatching to merchant callbacksSupported Event Names:
FORM_STATUS- Notifies when payment form completeness changes (COMPLETE/INCOMPLETE)PAYMENT_METHOD_STATUS- Emitted when payment method status changesPAYMENT_METHOD_INFO_CARD- Card payment method information updates (card number, expiry, CVV)PAYMENT_METHOD_INFO_BILLING_ADDRESS- Billing address field changesConfiguration:
Merchants can configure which events to receive using the
subscriptionEventsoption inpaymentElementOptions:Backward Compatibility:
The implementation maintains full backward compatibility. If
subscriptionEventsoption is not passed in the payment element options, all events are emitted by default to existing integrations. WhensubscriptionEventsarray is explicitly provided, only the specified events are dispatched, giving merchants fine-grained control over event handling.Architecture:
onChangecallback on PaymentElementeventNameandpayloadfieldssubscriptionEventsundefined → all events emitted;subscriptionEventsdefined → only listed events emittedHow did you test it?
Tested manually using the following React component integration:
Test Scenarios:
Checklist
npm run re:build