Skip to content

fix: dispatch payment submitted event for google pay and apple pay in dc - #281

Merged
jakubjasinsky merged 4 commits into
masterfrom
jakub-wallet-payment-submitted-event
Oct 13, 2026
Merged

jakubjasinsky merged 4 commits into
masterfrom
jakub-wallet-payment-submitted-event

Conversation

@jakubjasinsky

Copy link
Copy Markdown
Collaborator

Summary

Dynamic Checkout never fired processout_dynamic_checkout_payment_submitted for Google Pay or Apple Pay, so merchants listening for it (e.g. CAT) couldn't tell a wallet payment was in progress. Every other payment method already fires it.

Changes

  • Google Pay: fire the event when the user approves in the Google Pay sheet, before tokenizing. Dismissing the sheet doesn't fire it.
  • Apple Pay: fire the event when the user authorizes in the Apple Pay sheet (onpaymentauthorizedPostprocess), just before the existing apple_pay_authorized_post_process event.
  • Payload matches the existing wallet success/error/pending events (payment_method_name: google_pay / apple_pay, display name from the invoice).
  • Added wallet-events.test.ts and extended the test loader with the wallet clients. The new tests fail on master and pass with this fix.

Additional Context

  • Apple Pay fires on authorization rather than after tokenization. This matches card's "submitted → tokenize" order and avoids firing after the Apple sheet has already shown success.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:51
@datadog-processout

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

Check version bumped | Check version bumped

View in Datadog · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e14bbcd | Docs | View more details | Give us feedback!

@datadog-eu-processout

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

Check version bumped | Check version bumped — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e14bbcd | Docs | View more details | Give us feedback!

Copilot AI 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.

🟢 Approval recommended

The wallet event behavior is correctly implemented and covered by focused tests.

0 open findings

What changed in this PR

Adds payment-submitted events for Dynamic Checkout wallet payments.

Changes:

  • Dispatches submitted events for approved Google Pay and Apple Pay payments.
  • Adds wallet event payload and ordering tests.
  • Extends the test namespace loader with wallet clients.
File Description
src/​dynamic-checkout/​clients/​google-pay.ts Dispatches the event before tokenization.
src/​dynamic-checkout/​clients/​apple-pay.ts Dispatches the event upon authorization.
test/​dynamic-checkout/​wallet-events.test.ts Tests wallet event behavior and payloads.
test/​support/​loadNamespace.ts Loads wallet clients in tests.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jakubjasinsky
jakubjasinsky merged commit 338b607 into master Oct 13, 2026
5 checks passed
@jakubjasinsky
jakubjasinsky deleted the jakub-wallet-payment-submitted-event branch October 13, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants