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

ApplePayContext handles shipping #1561

Merged
merged 4 commits into from
May 1, 2020
Merged

Conversation

yuki-stripe
Copy link
Collaborator

Summary

STPApplePayContext automatically attaches shipping details to PaymentIntent upon confirmation, and also passes the raw PKPayment back to the user if they want to collect shipping details themselves.

Motivation

https://jira.corp.stripe.com/browse/IOS-1668

Testing

  • STPApplePayContextFunctionalTest - tests shipping details are attached to the PI for automatic confirmation, and that PKPayment is passed.
  • STPApplePayContextTest - tests converting from a PKPayment to STPPaymentIntentShippingDetailsParams.

addressParams.postalCode = address.postalCode;

NSPersonNameComponentsFormatter *formatter = [NSPersonNameComponentsFormatter new];
formatter.style = NSPersonNameComponentsFormatterStyleLong;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This produces a name like "Dr. Jonathan Maple Appleseed Esq." vs. ...StyleDefault which produces a name like "Jonathan Appleseed".

@yuki-stripe yuki-stripe changed the base branch from yuki/payment-intent-shipping to master April 28, 2020 23:31
@yuki-stripe yuki-stripe force-pushed the yuki/applepaycontext-shipping branch from e0d5748 to 3a6b986 Compare April 28, 2020 23:40
@@ -90,7 +90,7 @@ - (void)pay {

#pragma mark - STPApplePayContextDelegate

- (void)applePayContext:(STPApplePayContext *)context didCreatePaymentMethod:(__unused STPPaymentMethod *)paymentMethod completion:(STPIntentClientSecretCompletionBlock)completion {
- (void)applePayContext:(STPApplePayContext *)context didCreatePaymentMethod:(__unused STPPaymentMethod *)paymentMethod paymentInformation:(__unused PKPayment *)paymentInformation completion:(STPIntentClientSecretCompletionBlock)completion {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would appreciate scrutiny on this API change!

@@ -61,6 +66,8 @@ didSelectShippingMethod:(PKShippingMethod *)shippingMethod
/**
Called when the user has selected a new shipping address. You should inspect the
address and must invoke the completion block with an updated array of PKPaymentSummaryItem objects.

@note This does not contain full contact information - you can only receive that after the user authorizes payment, in the paymentInformation passed to `applePayContext:didCreatePaymentMethod:paymentInformation:completion:`
Copy link
Contributor

Choose a reason for hiding this comment

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

the distinction here isn't really clear to me. Could we enumerate what is available vs what isn't available here in a little more detail?

Stripe/PublicHeaders/STPApplePayContext.h Outdated Show resolved Hide resolved
@yuki-stripe yuki-stripe merged commit 8315842 into master May 1, 2020
@yuki-stripe yuki-stripe deleted the yuki/applepaycontext-shipping branch May 1, 2020 17:07
kgaidis-stripe added a commit that referenced this pull request Dec 2, 2022
Financial Connections: started client-side-tinting Consent and Data Access View icons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants