Skip to content

Add automatic reload type to iOS - #58

Open
ana-maksimovskikh wants to merge 8 commits into
mainfrom
ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed
Open

Add automatic reload type to iOS#58
ana-maksimovskikh wants to merge 8 commits into
mainfrom
ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed

Conversation

@ana-maksimovskikh

@ana-maksimovskikh ana-maksimovskikh commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

https://linear.app/evervault/issue/CARD-1055/e-apple-pay-ios-advanced-request-types-decision-needed

Tested manually on both simulator and actual device. Also checked behaviour for unsupported iOS versions.
All seems to work ✨

Docs update: https://github.com/evervault/docs/pull/836

Screenshot 2026-08-19 at 11 05 55 Screenshot 2026-08-23 at 17 29 38

@ana-maksimovskikh
ana-maksimovskikh force-pushed the ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed branch from e79aaa2 to be4671d Compare August 17, 2026 13:19
@ana-maksimovskikh
ana-maksimovskikh marked this pull request as ready for review August 18, 2026 09:41
@ana-maksimovskikh
ana-maksimovskikh requested a review from a team as a code owner August 18, 2026 09:41
@ana-maksimovskikh
ana-maksimovskikh force-pushed the ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed branch from be4671d to 5c54d72 Compare August 18, 2026 15:36

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!

@ana-maksimovskikh
ana-maksimovskikh force-pushed the ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed branch from 8651d0e to 2702de9 Compare August 20, 2026 12:35
@ana-maksimovskikh
ana-maksimovskikh changed the base branch from main to ana/apple-pay-fix-recurring-payment-summary-fallback August 20, 2026 15:39
@ana-maksimovskikh
ana-maksimovskikh force-pushed the ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed branch from 2702de9 to cf5e728 Compare August 20, 2026 16:09
Base automatically changed from ana/apple-pay-fix-recurring-payment-summary-fallback to main August 23, 2026 11:35
ana-maksimovskikh and others added 6 commits August 23, 2026 12:45
Introduces AutomaticReloadPaymentTransaction, keeping automaticReloadBilling
as a plain SummaryItem (reconstructed into the real PKAutomaticReloadPaymentSummaryItem
where it's actually needed) so the model itself stays iOS-15-safe.
Wires the new transaction type into buildPaymentRequest and getPaymentSummaryItems.
.automaticReload is gated to iOS 16+ and can't be named directly in switches that
compile at the package's iOS 15 minimum, so those branches fall through a default
case; ApplePayTransactionType's initializer now throws EvervaultError.UnsupportedVersionError
instead of trapping when it's reached on an unsupported OS.
buildPaymentRequest reconstructs a PKAutomaticReloadPaymentSummaryItem and
appends it to paymentSummaryItems, but getPaymentSummaryItems's
.automaticReload branch only mapped the plain paymentSummaryItems, never
reconstructing/appending the reload item. PassKit calls this fallback to
rebuild the summary list after shipping, payment-method, or coupon-code
changes, so the reload line (and its total) would silently disappear from
the sheet on any of those triggers.

Factored the reconstruction into a shared buildAutomaticReloadBillingItem
helper used by both call sites, so they can't drift apart again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AutomaticReloadPaymentTransaction exposed shippingMethods and set it on
the request in buildPaymentRequest, but getShippingMethods in
EvervaultPayment+SwiftUI.swift didn't know about it and returned [] for
.automaticReload - so any shipping methods a merchant configured would
vanish as soon as the buyer selected or changed a shipping address.

Same bug, same fix as #57 (RecurringPaymentTransaction): rather than
wiring the second file up to match, remove shippingMethods from the model
entirely. Matches the web SDK's stance (CARD-875), which hard-rejects
shipping methods on anything but a one-off payment transaction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ana-maksimovskikh
ana-maksimovskikh force-pushed the ana/card-1055-e-apple-pay-ios-advanced-request-types-decision-needed branch from cf5e728 to 3089c77 Compare August 23, 2026 11:46
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