Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: add support for apple pay line items to payment sheet #1020

Merged
merged 15 commits into from
Jul 8, 2022

Conversation

charliecruzan-stripe
Copy link
Collaborator

@charliecruzan-stripe charliecruzan-stripe commented Jun 28, 2022

Summary

Adds in support for apple pay line items to payment sheet, and also expands the possible options for apple pay line items to include those introduced in iOS 15

This does include a couple small breaking changes (small meaning easily migrate-able):

  • ApplePay.CartSummaryItem: renamed type to isPending. type is a very general field name and doesn't provide a good description of what it's doing. Migration guide included in CHANGELOG. We run the risk of Apple adding another PKPaymentSummaryItemType, but I think that's unlikely (since they seem to be instead transitioning to wholly different item types such as PKDeferredPaymentSummaryItem)
  • ApplePay.CartSummaryItem: added a new required paymentType field. In all existing code, merchants should set this to paymentType: 'Immediate' (since we only had support for Immediate up until this PR).

Motivation

closes #964

context: https://paper.dropbox.com/doc/2022-06-01-PaymentSheet-Apple-Pay-Line-Items-Mobile-API-Review--Bj2jImE0_eYxuR0dPw5B__jyAg-kqjRdFlgqiAxQvKUiBFH3

Testing

Added unit tests for all ApplePayUtils functionality

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

Copy link

@ramont-stripe ramont-stripe left a comment

Choose a reason for hiding this comment

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

looks good!

ios/StripeSdk.swift Outdated Show resolved Hide resolved
@charliecruzan-stripe charliecruzan-stripe force-pushed the charliecruzan-applypaylineitemsrefactor branch from 3d77c79 to c02a9ab Compare July 8, 2022 19:42
@charliecruzan-stripe charliecruzan-stripe merged commit 2c0183e into master Jul 8, 2022
@charliecruzan-stripe charliecruzan-stripe deleted the charliecruzan-applypaylineitemsrefactor branch July 8, 2022 21:52
@ScreamZ
Copy link

ScreamZ commented Aug 8, 2022

Any. way to support EURO currency ? @charliecruzan-stripe

@jgalianoz
Copy link

jgalianoz commented Sep 9, 2022

One question, what is the isPending parameter for? @charliecruzan-stripe

@charliecruzan-stripe
Copy link
Collaborator Author

That sets the PKPaymentSummaryItemType to pending if true, or final if false

@ScreamZ
Copy link

ScreamZ commented Sep 12, 2022

@charliecruzan-stripe No idea for my question about euro currency ?

@charliecruzan-stripe
Copy link
Collaborator Author

@ScreamZ are you looking to set the currency to euro in payment sheet, or directly in presentApplePay?

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.

PaymentSheet and subscription
4 participants