Skip to content

feat: add onCouponCodeChange callback and supportsCouponCode/couponCode config to ApplePay (COSDK-473)#1094

Merged
descorp merged 6 commits into
developfrom
feat/applepay-coupon
May 13, 2026
Merged

feat: add onCouponCodeChange callback and supportsCouponCode/couponCode config to ApplePay (COSDK-473)#1094
descorp merged 6 commits into
developfrom
feat/applepay-coupon

Conversation

@descorp
Copy link
Copy Markdown
Contributor

@descorp descorp commented May 11, 2026

Adds coupon code support to ApplePay (iOS 15+). Merchants can enable the coupon code field via supportsCouponCode, pre-fill it with couponCode, and react to changes via onCouponCodeChange. Auto-resolves with empty update if no callback configured.

Ticket: COSDK-473
Chain: 3/3 — targets feat/applepay-shipping (PR #1093).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Apple Pay coupon codes on iOS 15 and above. It includes updates to the configuration parser, event listeners, and native delegate methods to handle coupon code changes. Feedback includes a correction for a type mismatch in the event listener where an object is passed instead of a string, and a recommendation to improve state management for summary items and shipping methods to prevent data loss during updates.

Comment thread src/components/utils/startEventListeners.ts Outdated
Comment thread ios/Components/ApplePay/ApplePayModule+Delegates.swift
@descorp descorp force-pushed the feat/applepay-shipping branch from 0c8ce7c to 2dba812 Compare May 11, 2026 12:02
@descorp descorp force-pushed the feat/applepay-coupon branch from fd8685e to 7d27e98 Compare May 11, 2026 14:40
@descorp descorp force-pushed the feat/applepay-shipping branch 3 times, most recently from 2cbbdb9 to 710c329 Compare May 13, 2026 11:32
Base automatically changed from feat/applepay-shipping to develop May 13, 2026 12:33
@descorp descorp force-pushed the feat/applepay-coupon branch from d629845 to 497b93a Compare May 13, 2026 12:50
erenbesel
erenbesel previously approved these changes May 13, 2026
Robert-SD
Robert-SD previously approved these changes May 13, 2026
@descorp
Copy link
Copy Markdown
Contributor Author

descorp commented May 13, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Apple Pay coupon codes, including the necessary configuration updates, native module extensions for iOS, and event handling logic. I have identified two important improvements: the ApplePayError type definition needs to be updated to include 'couponCode' to prevent TypeScript errors, and the currentShippingMethods property should be updated during the coupon code update process to ensure consistency across the payment flow.

Comment thread src/core/configurations/ApplePayConfiguration.ts
Comment thread ios/Components/ApplePay/ApplePayModule+Delegates.swift
@descorp descorp dismissed stale reviews from Robert-SD and erenbesel via 82ae4bb May 13, 2026 13:09
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
55.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@descorp descorp merged commit 5321fe8 into develop May 13, 2026
10 of 11 checks passed
@descorp descorp deleted the feat/applepay-coupon branch May 13, 2026 13:38
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.

4 participants